PSD calculation using FFT -

조회 수: 13 (최근 30일)
Sergio Roa
Sergio Roa 2018년 8월 3일
편집: David Goodmanson 2018년 8월 3일
Hi! I am using the FFT for calculating a PSD using the code provided by MATLAB in Power Spectral Density Estimates Using FFT. The important par of the code is:
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/length(x):Fs/2;
I want to understand the fourth line, especially the factor (1/(Fs*N)). I am trying to compare with some definitions in vibrations books (Rao,S & Silva, Clarence) and I am not able to find the relation.
psdx = (1/(Fs*N)) * abs(xdft).^2;
Thank you!
  댓글 수: 1
dpb
dpb 2018년 8월 3일
Don't know why the factor Fs is in the denominator there...see amplitude-estimation-and-zero-padding

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

답변 (1개)

David Goodmanson
David Goodmanson 2018년 8월 3일
편집: David Goodmanson 2018년 8월 3일
Hi Sergio,
For a time domain signal x(t) and an N-point fft, y = fft(x)/N gives the correct scaling in the frequency domain as you probably know. In this case the spectrum is squared, which brings in two factors of 1/N. Then, since the result is the density energy/Hz, you need to divide by the frequency grid spacing delta_f as well. The overall factor is 1/(N^2 delta_f), but delta_f = Fs/N which leads to the result shown.

카테고리

Help CenterFile Exchange에서 Parametric Spectral Estimation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by