Paint a signal in time, watch the spectrum update live. Mask frequencies and the reconstruction redraws instantly. Hover the spectrum to see the pure sinusoid each bin represents.
Left-drag to draw · right-drag (or shift-drag) erases to zero · hold ⌥/Alt to add to the existing signal
DC on the left, Nyquist on the right · hover any bar to see the sinusoid basis at that frequency
Left-drag kills · right-drag (or shift) restores · resets reflect in the spectrum and reconstruction below
The signal you get back from the masked spectrum · compare with the original
Signal pad. A discrete real-valued sequence x[n] of length N = 256. Index n is time (or position along a 1-D line). Amplitude on the y-axis is in [-1, +1] (and gets clipped to that range visually but values keep their sign).
Magnitude spectrum. |X[k]| for k = 0..N/2. Bin k corresponds to frequency k/N cycles per sample. k = 0 is DC (the mean); k = N/2 is the Nyquist frequency (alternating ±1). For a real signal the negative-frequency half is the complex conjugate of the positive half, so we just show k = 0..N/2.
Hover to inspect. Hovering bin k draws (in purple) the pure cosine basis function cos(2π k n / N) scaled by the magnitude. This is exactly what that bin contributes to the reconstruction. The phase of X[k] decides whether it's a cos, a sin, or somewhere in between.
Mask. Painting on the spectrum sets the corresponding X[k] (both magnitude and phase) to zero. This is the same operation as setting frequencies to zero in an image-processing low-pass / band-pass filter — only here in 1-D.
Reconstruction. Inverse FFT of the masked spectrum. RMS error is computed against the original. Try: drawing a sharp square wave then low-passing it — you see Gibbs ringing. Or drawing a constant + low sinusoid, then notching DC — the constant disappears.
Things to try:
square, then ↓ low-pass — watch Gibbs ringing appear.noise, then ↑ high-pass — only the bumpy high frequencies survive.two tones, then mask one of the two peaks — the other tone alone reconstructs.δ impulse — the spectrum is flat (every frequency contributes equally to a spike).step — the spectrum has the 1/k envelope of a step's Fourier series.