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.
fft(n)
byk
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/… $\endgroup$