why psd result estimated by fft is related to frequency resolution?

조회 수: 5(최근 30일)
Here is the code from MATLAB help center.(https://www.mathworks.com/help/signal/ug/power-spectral-density-estimates-using-fft.html)
I only change one parameter T(total time) in the code, when i change T from 1,10,100 to 1000, the final result also change about 10 db/hz. But i don't understand why and how to explain that. will the frequency resolution Fs/n influence the final result?
thanks for your answer! really appreciate it !
rng default
Fs = 1000;
t = 0:1/Fs:T-1/Fs;
x = cos(2*pi*100*t) + randn(size(t));
N = length(x);
xdft = fft(x);
xdft = xdft(1:N/2+1);
psdx = (1/(Fs*N)) * abs(xdft).^2;
psdx(2:end-1) = 2*psdx(2:end-1);
freq = 0:Fs/N:Fs/2;
grid on
title('Periodogram Using FFT')
xlabel('Frequency (Hz)')
ylabel('Power/Frequency (dB/Hz)')


Raunak Gupta
Raunak Gupta 2020년 10월 2일
The power spectral density estimate shown in each T=1,10,100,1000 is correct as it shows a peak around 100 Hz which exactly represent the frequency present in the signal. Since you are changing T, the length of signal x is changing, and the random noise is getting added which is of different size (If we have different T).
If I see the difference between two values of T it is more towards the –50 to –40 dB side which is very small amplitude value for any signal. This is mainly coming due to small noise variations. If you remove the noise term [randn(size(t))] you will not see any difference between T=1 or T=100.
Also note that we ignore Power/Frequency which is very low (in range of –60 to 70dB/Hz or even lower).
Hope this clarifies!
  댓글 수: 2
Raunak Gupta
Raunak Gupta 2020년 10월 5일
I agree the peak value is changing exactly as you say, that is because the length of signal is changing and since it is periodic signal, power spectral density is scaled up with respect to number of points.
You may refer to the blogs related to fft which nicely mentions the logic behind it.

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by