DSPRelated.com

Periodogram

Category: Spectral

A periodogram is an estimate of the power spectral density (PSD) of a signal, commonly computed by squaring the magnitude of the signal's discrete Fourier transform (DFT) and normalizing by the number of samples, though the exact scaling depends on the normalization convention, window correction, and whether a one-sided or two-sided spectrum is used. It is a very direct nonparametric spectral estimation method and forms the basis for more refined techniques such as Welch's method and multitaper estimation.

In practice

In embedded signal processing, the periodogram appears whenever you compute an FFT on a block of samples and then look at the properly scaled squared magnitudes of the output bins. On a microcontroller running a vibration monitor, motor current analyzer, or acoustic detector, this is typically the first step toward identifying dominant frequency components. The raw periodogram is straightforward to implement: take N samples, apply a window function, run an FFT, and compute |X[k]|² / N (or a variant scaled to your normalization convention).

A persistent pitfall is treating the raw periodogram as a stable or low-variance estimate. For a single block of data, each bin's estimate has high variance, and this variance does not decrease as N grows for a single record, even though increasing N does improve frequency resolution. This is why Welch's method - averaging multiple overlapping periodograms - is preferred in practice when an estimate of average spectral content is needed rather than a snapshot.

Windowing is critical and often mishandled. Applying no window (the implicit rectangular window) introduces spectral leakage that can bury low-amplitude tones near high-amplitude ones. Common windows for embedded use include Hann, Hamming, and Blackman-Harris, each trading frequency resolution for sidelobe suppression. The blog post "Accurate Measurement of a Sinusoid's Peak Amplitude Based on FFT Data" covers how the window choice affects amplitude readings from FFT bins, which directly applies when interpreting periodogram peaks.

On resource-constrained targets, the periodogram's memory and compute cost is dominated by the FFT. A 1024-point complex FFT on a Cortex-M4F with CMSIS-DSP can complete in the low hundreds of microseconds depending on clock rate, compiler settings, and configuration, which is feasible for many real-time applications. On smaller 8-bit cores without hardware multiply, the same computation may be impractical without fixed-point shortcuts or a reduced transform size. Always budget for the windowing multiply pass and the magnitude-squared computation in addition to the FFT itself.

Discussed on DSPRelated

Frequently asked

What is the difference between a periodogram and a power spectrum?
The terms are closely related but not identical. The true power spectral density is a theoretical property of a stationary random process. A periodogram is a specific statistical estimate of that density derived from a finite data record using the DFT. The blog post "The Power Spectrum" on EmbeddedRelated covers this distinction in detail. In everyday usage the terms are often used interchangeably, but in signal processing literature the periodogram refers specifically to the squared-magnitude DFT estimator.
Why is the raw periodogram called a 'poor' spectral estimator?
Because it is inconsistent: its variance does not decrease as you add more samples to a single record. Each DFT bin's estimate behaves roughly like a chi-squared random variable with two degrees of freedom, meaning the standard deviation equals the mean regardless of N. Averaging multiple periodogram records (Welch's method) reduces variance proportionally to the number of averages, at the cost of frequency resolution if the total data length is fixed.
Do I need to apply a window function before computing a periodogram?
Not strictly, but in practice you almost always should. Omitting the window is equivalent to using a rectangular window, which has high sidelobes (about -13 dB). For signals with tones of very different amplitudes - common in vibration or audio work - a strong tone's leakage can completely obscure a weaker nearby tone. Hann or Hamming windows are reasonable general-purpose choices; Blackman-Harris offers better sidelobe suppression at the cost of a wider main lobe.
How do I convert periodogram output to engineering units like g²/Hz or V²/Hz?
Start with |X[k]|² / N to get a power estimate per bin. To convert to a density (per Hz), divide by the effective noise bandwidth of your window (in Hz), which equals the window's normalized noise bandwidth times the bin spacing fs/N. Scaling also depends on whether your FFT uses a one-sided or two-sided spectrum. For real-valued signals, the one-sided PSD folds the negative-frequency bins onto the positive side, so you multiply non-DC, non-Nyquist bins by two. Keep your window correction factor and fs consistent throughout.
What is the relationship between the periodogram and the DFT of the autocorrelation?
By the Wiener-Khinchin theorem, the power spectral density equals the Fourier transform of the autocorrelation sequence. The periodogram is the DFT analog of this: computing |X[k]|² / N is mathematically equivalent to taking the DFT of the sample autocorrelation of the windowed data. This connection is useful conceptually but in practice the direct FFT-then-square approach is more computationally efficient than explicitly computing the autocorrelation first.

Differentiators vs similar concepts

The periodogram is often confused with Welch's method and the spectrogram. Welch's method is an averaged periodogram: it divides the data into overlapping segments, computes a periodogram for each, and averages the results to reduce variance. The spectrogram is a time-varying periodogram: it computes short-time periodograms at successive time offsets and displays them as a 2D time-frequency image, trading frequency resolution for temporal resolution. The periodogram itself is a single-snapshot, single-record estimate with no temporal averaging.