# Why is level of power spectrum dependent on FFT resolution?

I created a sinusoidal wave in some noise, and plotted the power spectrum of the signal using two periodogram estimates (welch procedure). One estimate is 'high resolution' - i.e. it uses a longer window than the corresponding 'low resolution' estimate. The result and code used to generate it are shown below. For reference: the y-axis will have units of |signal|^2 and the x-axis are just FFT samples.

My question is: From the plot, it would appear that there is overall more power content in the low resolution (red) plot, although this is obviously not the case, the input signal is the same in both cases. This poses some questions about how we compare signals, it seems it is critical to use the same parameter values (like window lengths) when comparing the energy content of different signals.

For reference, I do understand that the length of the window in the welch estimate will determine the resolution of my spectrum, and that the number of FFT points used will determine the smoothness of my output, which has nothing to do with resolution.

Fs = 1000;
t = 0:1/Fs:1-1/Fs;
x = cos(2*pi*100*t)+randn(size(t));

nWindow1 = 100;
noverlap1 = 0*nWindow1;
nfft1 = 1000;
[pxx1, f1] = pwelch(x,hann(nWindow1), noverlap1, nfft1, Fs, 'centered', 'power');

nWindow2 = 1000;
noverlap2 = 0*nWindow2;
nfft2 = 1000;
[pxx2, f2] = pwelch(x,hann(nWindow2), noverlap2, nfft2, Fs, 'centered', 'power');

figure
hold on
plot(f1, 10*log10(pxx1),'r')
plot(f2, 10*log10(pxx2),'b')
legend('Low Resolution Estimate', 'High Resolution Estimate')

• One word - leakage. – jojek Aug 23 '14 at 19:16
• I understand that there is leakage, but if some of the spectral content 'leaks' to other frequency components, shouldn't the overall level balance out? Or is this interpretation correct: The 2 blue spike are ever so slightly above the red, I guess because the scale is in dB this small difference is enough to raise the entire range of the spectrum several dB above? – Dipole Aug 23 '14 at 19:24
• Different (shorter) length of segment implies less resolution and wider main lobe in frequency domain. You see how red peaks are wide? You can think of how much noise is being gathered. When it comes to averaging of segments in Welch's method, white noise should be washed out. On the contrary, like I said - resolution is very poor. – jojek Aug 23 '14 at 19:51

The observed phenomenon is simply due to the fact that when you set window length to 100 it is as if you were doing fft with 100 samples instead of 1000. So Nw=100 similar to NFFT = 100.

And why does FFT size affect results (level of noise VS level of tone)? Good question

Two types of spectral densities:

1) PWELCH-like PSD: "PSDW"

• A tone grows in dB as FFT size increases. As in a true PSD the tone is a Dirac's delta for NFFT->inf. Larger NFFT means smaller dF, and larger A, in such a way that A * dF = constant
• A unit power noise stays at 0dB.

This is really a [Watt/Hz] spectral density and total power given by:

totalPower = trapz(F,PSDW) = trapz(fs * F,PSDW/fs) = sum(PSDW)/NFFT

2) OSCILLOSCOPE-like PSD: "PSDO", PSDO = PSDW/NFFT

• A tone remains the same dB as FFT size increases
• A unit power noise becomes less dBs as NFFT increases.

This is a [Watt/Hz/NFFT] measure, with power:

totalPower = NFFT * trapz(F,PSDO) = NFFT*trapz(fs * F,PSDO/fs) = sum(PSDO)