How to convert output of pwelch() into amplitude response in MATLAB

2026-04-26

Stack Overflow: View Question

Tags: matlab, signal-processing, fft

Score: 1 | Views: 44

The asker has a pure sinusoid with amplitude 1 and wants to recover that amplitude from the output of MATLAB's pwelch(). They take the square root of the power spectral density (PSD), but get 0.605 instead of the expected 1.0. This is a deceptively simple question that touches on several DSP fundamentals that trip up even experienced engineers.

Why the naive approach fails: There are multiple scaling factors baked into pwelch() output that all conspire against a simple sqrt-and-done recovery:

The correct approach: For a one-sided PSD estimate Pxx from pwelch() with frequency resolution df, the amplitude of a sinusoidal component at a spectral peak is:

amplitude = sqrt(2 * Pxx_peak * df)

The factor of 2 inside the sqrt corrects for sinusoidal power (A²/2). The multiplication by df converts PSD to power spectrum. Alternatively, call pwelch with the 'power' option (MATLAB R2013a+) to get the power spectrum directly, then simply take sqrt(2 * Pxx_peak).

Gotchas to watch for: Spectral leakage will spread energy across adjacent bins, so the peak bin alone may underestimate amplitude. For precise recovery, sum over the main lobe of the leaked peak. Also, the 0.605 value the asker reports is suspiciously close to 1/sqrt(2) × sqrt(sum(hamming²)/N), suggesting they're hitting the window energy correction issue directly. Finally, the overlap parameter (default 50% in MATLAB) affects the equivalent degrees of freedom but not the expected amplitude—though it's a common source of confusion.

The challenge: Recovering signal amplitude from a PSD estimate requires correctly unwinding at least four distinct normalization factors (density-to-spectrum, window energy, one-sided doubling, and sinusoidal power), and confusing any one of them produces plausible but wrong results.

All newsletters