๐Ÿ“ป Spectral Analysis

Decompose signals into frequency components โ€” FFT, windowing, and the live spectrogram

Time Domain Signal x(t) = ฮฃ Aโ‚™ยทcos(2ฯ€ยทfโ‚™ยทt + ฯ†โ‚™)
Magnitude Spectrum (FFT) |X[k]| โ€” log scale
Spectrogram (STFT) Time โ†’ Frequency heatmap

Presets

Harmonics (up to 6)

FFT Settings

Window:

Live Metrics

โ€”
Fund. (Hz)
โ€”
ฮ”f (Hz)
โ€”
SNR (dB)
โ€”
Parseval err

About Spectral Analysis

The Fast Fourier Transform

The DFT decomposes any discrete signal into N complex sinusoids: X[k] = ฮฃ x[n]ยทe^(โˆ’2ฯ€ijk/N). The Cooley-Tukey radix-2 FFT computes this in O(Nยทlogโ‚‚N) operations instead of O(Nยฒ), making real-time spectrum analysis practical. A 1024-point FFT needs only ~10,000 operations instead of one million.

Windowing & Spectral Leakage

A finite signal segment is implicitly multiplied by a rectangular window, whose sharp edges create spectral leakage โ€” energy from one frequency bleeds into neighbours. The Hann window w[n] = 0.5(1โˆ’cos(2ฯ€n/N)) tapers the edges smoothly, trading frequency resolution for dramatically reduced leakage. Blackman windows suppress leakage further at the cost of wider main lobes.

The Spectrogram (STFT)

The Short-Time Fourier Transform runs an FFT on overlapping windows slid across time: X(m,k) = ฮฃ x[n+mยทhop]ยทw[n]ยทe^(โˆ’2ฯ€ijk/N). The result is displayed as a 2D heatmap (time ร— frequency). There is an inherent resolution trade-off: long windows give fine frequency resolution but blur rapid changes; short windows capture transients but smear frequencies.