Signal Processing

FFT Visualizer

Paste CSV samples and inspect frequency bins, magnitudes, phases, and the dominant component.

Samples

8

Peak Bin

2

Peak Frequency

2000.0 Hz

0 Hz
0.000
1000 Hz
0.000
2000 Hz
4.000
3000 Hz
0.000
4000 Hz
0.000

Frequency-Domain Analysis with FFT and DFT Bins

Time-domain samples show how a signal changes from one instant to the next. Frequency-domain analysis shows how much of the signal is made from different sinusoidal components. Engineers use this view to detect tones, harmonics, switching noise, vibration modes, aliasing, modulation sidebands, and measurement artifacts. The fast Fourier transform, or FFT, is an efficient algorithm for computing the discrete Fourier transform. This tool uses direct DFT math for small pasted sample sets so the bin calculations remain transparent, while presenting the same kind of magnitude spectrum an FFT produces.

The DFT assumes a finite block of N samples and compares that block to complex sinusoids whose frequencies fit an integer number of cycles in the window. Bin k corresponds to k times the sample rate divided by N. If the sample rate is 8000 Hz and the block length is 8 samples, bin 1 represents 1000 Hz, bin 2 represents 2000 Hz, and bin 4 represents the Nyquist frequency at 4000 Hz. Each bin has a real part, imaginary part, magnitude, and phase.

Manual Calculation Steps

Begin with a sequence of samples x of n. Choose a bin k. For every sample index n, multiply the sample by a rotating complex reference whose angle is negative two pi times k times n divided by the total sample count. Sum all of those products. The real part comes from cosine terms, and the imaginary part comes from sine terms. The magnitude is the square root of real squared plus imaginary squared. The phase is the arctangent of the imaginary part divided by the real part.

If the signal contains exactly one sinusoid that lands on a DFT bin, that bin will have a large magnitude and neighboring bins will be small. If the sinusoid falls between bins, energy spreads across many bins. This effect is spectral leakage. A window function can reduce leakage by tapering the ends of the sample block, but it also changes amplitude scaling and widens the main lobe. For accurate measurements, the sample rate, block length, window, amplitude correction, and frequency resolution must be considered together.

Frequency resolution is sample rate divided by sample count. Doubling the sample count halves the bin spacing. That does not magically create new information, but it can separate tones that were previously grouped into the same bin spacing. Zero padding can create a smoother-looking plotted spectrum, but it interpolates the DFT rather than improving the underlying resolution. The actual ability to distinguish nearby frequencies comes from observing a longer time interval.

Sampling and Aliasing

The sample rate controls the highest representable frequency. For real-valued samples, frequencies above half the sample rate fold back into the visible range. This folding is aliasing. If a sensor samples at 10 kHz, a 7 kHz input can appear as a 3 kHz component unless an analog anti-alias filter removes it before sampling. Digital signal processing cannot reliably separate a true low-frequency tone from an aliased high-frequency tone after sampling has already occurred.

Real signals produce mirrored positive and negative frequency components, so most engineering plots show bins from zero to Nyquist. DC appears at bin zero and represents the average value of the sampled block. A strong DC offset can dominate the plot and hide smaller AC components, so it is common to subtract the mean before analyzing vibration, audio, or ripple measurements. For power electronics and clocks, harmonics at integer multiples of a fundamental frequency are often more important than the fundamental itself.

Engineering Applications

FFT-style analysis is used in spectrum analyzers, motor diagnostics, audio equalizers, software-defined radios, oscilloscopes, accelerometer analysis, power rail validation, and communication receivers. A microcontroller can use a small FFT to detect a tone. An FPGA can stream samples through a pipelined FFT core. A lab engineer can paste captured data into a quick tool to check whether a noise peak lines up with a switching converter, oscillator, fan, or digital bus.

Use this visualizer for short educational traces and sanity checks. Confirm the sample rate first, then inspect the bin spacing and peak frequency. If the result looks unexpected, check for DC offset, insufficient sample length, clipping, non-integer cycles, and aliasing. The spectrum is not only a plot; it is a set of assumptions about sampling, periodic extension, and finite observation time. Understanding those assumptions turns an FFT from a black-box graph into a measurement instrument.

Student Checkpoints

FFT Visualizer is not just a standalone widget; its article sections cover Manual Calculation Steps, Sampling and Aliasing, Engineering Applications. For FFT, the core inputs are sample rate, sample count, windowing, and bin spacing, and the relevant representation is timing, sampling, packet, encoding, waveform, or channel assumptions represented by sample rate, sample count, windowing, and bin spacing. Read the FFT calculation only after those inputs and assumptions are named.

Start the practice work for FFT with a small hand-check: For FFT, use a sine wave whose frequency lands exactly on a bin, then move it halfway between bins to observe leakage. Then isolate one input from sample rate, sample count, windowing, and bin spacing and change only that value. If the FFT answer shifts unexpectedly, the likely source is forgetting that bin spacing, sample rate, window choice, and record length shape the spectrum before any peak is interpreted.

For FFT, the useful written answer includes the units, timing or encoding convention, one worked example, and the way sample rate, sample count, windowing, and bin spacing affect the measured or decoded value. If a lab result or homework solution disagrees with FFT Visualizer, compare those FFT notes before changing numbers at random.