# Why does increasing FFT length (narrowing bandwidth) not decrease Noise Power per bin?

I was under the impression that zero-mean white guassian noise had a constant Power Spectral Density which means that smaller bandwidths should decrease the power in that band. I'm getting surprising results for average power in each FFT bin, it's staying the same irrespective of how long I make the FFT. Am I not measuring power correctly?

Here is a reduced for of my MATLAB script (should be Octave-compatible). Please excuse my odd habit of time vectors going up-down and frequency and misc ones going left-right.

%pkg load communications
% ^UNCOMMENT^ if using OCTAVE
close all

Q=8;        % Lowest power of 2 to iterate though in FFT loop
R=12;       % Highest power of 2 to iterate though in FFT loop
N=1;        % Linear PSD of noise
c=0;        % Loop counter

K=2.^(Q:R)  % Loop vector

for k=K
n=sqrt(N).*(randn(k,1)+j.*randn(k,1))./sqrt(2); % complex noise
P=(abs(fft(n)')).^2./k; % Noise Power in frequency domain
c=c+1;
e(c)=mean(P); % Mean power measurement across bins
%v(c)=var(P);
figure
plot(10.*log10(P))
end
e
%v


I feel like I'm missing something fundamental about this. Does FFT binning not truly band-limit signal power because of the way the algorithm works? I'm basically trying to get an output analogous to a spectrum analyzer in that is shows something proportional to true power.

• By code, you have divided your fft(n) by k thus the power does not depend on the length of your vector. Theoretically, the power of sampled white noise (modeled by iid complex Gaussian random variables) does not depend on the bandwidth because it is the projection to an orthonormal basis. Please take a look at this answer (and its comments) dsp.stackexchange.com/questions/8629/… – AlexTP Oct 11 '17 at 14:46
• @AlexTP I did divide the square of the FFT by k but if I didn't then the power would increase as k increased which makes even less sense. According to that equation in the top-rated answer, the variance or power should decrease for narrower bandwidths. (less total area under H(f) because it's the same height but a smaller width window). Should I instead divide by k^2? If so, I don't understand the math behind it. Square magnitude of fft should be energy, therefore dividing it by length should be power. – AnalogEE Oct 11 '17 at 15:10
• The math behind it is the Parseval theorem for DFT en.wikipedia.org/wiki/… What is your question ? The physical signification of the model or how to code ? – AlexTP Oct 11 '17 at 15:22
• I'm trying to emulate the performance of a spectrum analyzer using an FFT. When you decrease resolution bandwidth on an analyzer, the noise power in that band drops proportionally (which is correct because noise has a constant PSD as the answer you linked me explained). I'm not understanding why on earth the isn't doing that based on the code. – AnalogEE Oct 11 '17 at 15:37