Fourier Transform Visualizer Back
Signal Processing

Fourier Transform Visualizer

Adjust signal type, window function and frequency with sliders to see the time-domain waveform, magnitude spectrum and phase spectrum update in real time. Build deep intuition for FFT fundamentals.

Signal Settings

Harmonic Amplitude (fundamental = 1st)

FFT Settings

Preset

Results
Dominant Frequency
SNR (dB)
Spectral Centroid
THD (%)
FFT AmplitudeSpectrum
FFT PhaseSpectrum

What is a Fourier Transform?

🙋
What exactly is a Fourier Transform? I see it mentioned everywhere in signal processing, but it sounds really abstract.
🎓
Basically, it's a mathematical tool that takes a signal (like a sound wave or vibration) and breaks it down into the pure sine waves that make it up. Think of it like a recipe: the signal in time is the final cake, and the Fourier Transform gives you the list of ingredients—the specific frequencies and their strengths. Try changing the "Signal Type" in the simulator above from a simple sine to a square wave and watch how the spectrum changes.
🙋
Wait, really? So any weird-looking wave is just a sum of simple sine waves? That seems almost too good to be true. What's the catch when we try to measure this in the real world?
🎓
In practice, there's a big catch: we can't measure a signal forever. We only capture a finite "window" of time. If you cut a signal off abruptly, it creates artificial jumps at the edges. In the frequency domain, this "spectral leakage" makes it look like energy has smeared into frequencies that aren't really there. This is why the "Window Function" control in the simulator is so important.
🙋
Oh, so that's what the Hann and Hamming windows are for! But if they reduce leakage, do they have a downside? Should I just always use one?
🎓
Exactly! A window like Hann tapers the signal smoothly to zero at the edges, reducing those artificial jumps and the resulting leakage. The trade-off is a slight loss in frequency resolution—nearby frequencies become harder to distinguish. It's a classic engineering compromise. Play with the simulator: switch between "Rectangular" (no window) and "Hann" and watch how the sharp peaks in the spectrum broaden slightly but the messy leakage between them cleans up.

Physical Model & Key Equations

The core of the Continuous Fourier Transform decomposes a time-domain signal $x(t)$ into its constituent complex exponentials (sine and cosine waves) across all frequencies $f$.

$$X(f) = \int_{-\infty}^{\infty}x(t) e^{-i 2 \pi f t}dt$$

Where $X(f)$ is the complex frequency spectrum (showing magnitude and phase), $x(t)$ is the input signal, $f$ is frequency, and $i$ is the imaginary unit. This equation assumes we know the signal for all time, which is impossible in practice.

In reality, we use the Discrete Fourier Transform (DFT) on a sampled signal of length $N$. Applying a window function $w[n]$ weights the samples before the transform to mitigate spectral leakage.

$$X[k] = \sum_{n=0}^{N-1}x[n] \cdot w[n] \cdot e^{-i 2 \pi k n / N}$$

Here, $x[n]$ are the discrete signal samples, $w[n]$ is the window (e.g., Hann window), and $X[k]$ is the DFT output at frequency bin $k$. The choice of $w[n]$ directly controls the trade-off between spectral leakage and frequency resolution, which you can visualize directly in the simulator.

Real-World Applications

Audio Engineering & Music: Fourier Transforms are the backbone of digital audio. They allow for equalization (boosting or cutting specific frequencies), audio compression (like MP3, which removes inaudible frequencies), and synthesizers that generate complex sounds from simple waves. When a mastering engineer "cleans up" a muddy recording, they are often editing in the frequency domain.

Vibration Analysis & Condition Monitoring: Engineers mount accelerometers on machinery like turbines or motors. By transforming vibration signals over time into the frequency domain, they can identify specific frequencies associated with worn bearings, imbalance, or misalignment, allowing for predictive maintenance before a catastrophic failure.

Medical Imaging (MRI): Magnetic Resonance Imaging doesn't take a direct picture. It measures signals in what is essentially the frequency domain (k-space). The inverse Fourier Transform is then used to reconstruct the detailed cross-sectional images of the body that doctors use for diagnosis.

Communications & Radar: Every modern wireless technology, from WiFi to GPS, relies on processing signals in the frequency domain. It allows multiple users to share the same channel (frequency division multiplexing) and enables radar systems to determine both the distance and speed of an object by analyzing the frequency shift of the reflected signal.

Common Misconceptions and Points to Note

When you start using the FFT, there are a few common pitfalls you might encounter. The first is the "relationship between the sampling frequency and the displayed frequency range". For example, with a sampling frequency of 44.1 kHz, the highest frequency you can theoretically see with the FFT is half of that, 22.05 kHz (the Nyquist frequency). Frequency components above this will appear as incorrect low frequencies due to a phenomenon called aliasing, completely skewing your analysis. In practice, it's a golden rule to always remove high-frequency components with an anti-aliasing filter before measurement.

The second point is that "the values on the spectrum's vertical axis (amplitude) are not absolute values". What this tool displays as the "amplitude spectrum" is the absolute value $|X[k]|$ of the complex spectrum $X[k]$. This includes the influence of the window function and the FFT point count N as a normalization factor. For instance, even if you analyze a sine wave with an amplitude of 1, the displayed peak value will not simply be "1". To know the precise amplitude value, you need to consider the correction factor for the window function you used (e.g., approximately 2x for a Hann window).

The third is the "trade-off between resolution and measurement time". The frequency resolution $\Delta f$ is determined by the sampling frequency $f_s$ divided by the FFT point count $N$ ($\Delta f = f_s / N$). If you want to distinguish finer frequencies (make $\Delta f$ smaller), you need to increase $N$, but that means acquiring data over a longer period. For example, when analyzing the vibration of machinery with fluctuating rotational speed, taking data for too long can cause the frequencies to "smear". If you don't understand this dilemma, you might fail to capture effective data in the field.

How to Use

  1. Set the fundamental frequency using the freq slider (range 1–100 Hz); observe the base waveform update in real-time
  2. Adjust amplitude with the amp slider (0–10 V) to scale signal magnitude without altering frequency content
  3. Add Gaussian noise via the noise slider (0–1.0 standard deviation) to simulate real sensor data degradation
  4. Configure sampling frequency (fs) between 200–20 kHz to control Nyquist limits and aliasing behavior
  5. View the time-domain waveform on the left panel and frequency-domain magnitude spectrum on the right panel simultaneously

Worked Example

Configure a 50 Hz sine wave (power utility frequency) with 5 V amplitude, 0.5 kHz sampling rate, and 0.1 V noise. The FFT reveals a dominant peak at 50 Hz with magnitude ~2.5 V, plus harmonic content at 100, 150, and 200 Hz from nonlinearity. Adding 0.3 V noise spreads energy across the spectrum, reducing SNR from 34 dB to 18 dB. Lowering fs to 200 Hz causes aliasing—the 50 Hz component folds to 150 Hz due to Nyquist violation.

Practical Notes

  1. Set fs ≥ 2× highest frequency of interest; for vibration analysis on rotating machinery (5 kHz bearing defects), use fs ≥ 10 kHz minimum
  2. Window functions (Hann, Blackman) reduce spectral leakage when signal length is not an integer multiple of the period
  3. Noise levels above 0.5 V obscure weak harmonics; use in conjunction with band-pass filtering for SNR improvement
  4. For structural health monitoring, compare FFT signatures before/after with tolerance bands ±3% of baseline peaks