Signal Processing and FFT Simulator
Explore sampled signals, frequency content, and filtering through linked time-domain and frequency-domain visualizations.
Generate, sample, and filter a signal
Build a sine, cosine, square, sawtooth, triangle, or noise-corrupted waveform, choose the sample rate and record length, then look at the same signal in the time domain and as a single-sided DFT magnitude spectrum. Apply a filter and compare before and after.
- Time-domain plot with real axes and, when the sample rate is low enough to see them, individual sample markers.
- Frequency spectrum with the peak frequency called out, the Nyquist limit marked, and the filter corner frequency drawn on the plot.
- Low-pass, high-pass, and band-pass filtering with adjustable cut-off and order.
- RMS, peak amplitude, and dominant frequency reported for both the original and the filtered signal.
Equations used
The spectrum is a discrete Fourier transform with single-sided magnitude scaling:
- X[k] = Σ x[n]·e^(−j2πkn/N)
- Nyquist frequency: f_Nyquist = fs / 2
- Frequency resolution: Δf = fs / N
- First-order low-pass response: H(s) = 1 / (1 + s/ω_c)
Frequently asked questions
- What is the Nyquist frequency?
- The Nyquist frequency is half the sample rate, and it is the highest frequency a sampled signal can represent unambiguously. Sampling at 200 Hz gives a Nyquist frequency of 100 Hz. Any content above it is not lost quietly — it folds back into the spectrum as a lower frequency, which is aliasing.
- What is aliasing and how do you avoid it?
- Aliasing is a frequency above the Nyquist limit appearing in the sampled data disguised as a lower frequency, and it cannot be undone after sampling. Avoid it by sampling at more than twice the highest frequency in the signal, and by applying an analogue anti-aliasing low-pass filter before the converter so out-of-band content never reaches it.
- What does an FFT actually show?
- It decomposes the signal into the sinusoids that make it up, and the magnitude spectrum shows how much of each frequency is present. A pure 5 Hz sine gives a single spike at 5 Hz; a square wave gives a spike at its fundamental plus a decaying series of odd harmonics; broadband noise spreads energy across the whole spectrum.
- What is the cut-off frequency of a filter?
- The cut-off, or corner, frequency is where the filter's output power has fallen to half its passband value — a drop of 3 dB, or a factor of about 0.707 in amplitude. It marks the transition between the passband and the stopband rather than a hard edge; a first-order filter rolls off at 20 dB per decade beyond it.