power spectral density of fft
조회 수: 1 (최근 30일)
이전 댓글 표시
hello guys, i have a piece of code that gets the fft of a part of the signal and i am now trying to get the PSD.
Fs = 44100; cj = sqrt(-1); %T=.6; dt = 1/Fs; left=test(:,1); right=test(:,2); time = 45; interval =.636; w_range = time*Fs: (time+interval)*Fs-1; I = left(w_range); Q = right(w_range); n = interval * Fs; f = -Fs/2:Fs/n:Fs/2-Fs/n;
s = I+cj.*Q;
% Smooth the signal ss = smooth(s,201);
sf = (fftshift(fft(ss(1:n)))); %FFT of signal
figure(1) plot(f,((20*log10((abs(sf))./max(abs(sf))))))
so now i was wondering from my understanding in order to get the PSD i just need to raise sf to the power of two or is there more things i need to perform?
Thanks in advance
댓글 수: 0
채택된 답변
Daniel kiracofe
2014년 7월 28일
well, in some sense, you can never really "get" the PSD of anything. you can only estimate it. And yes, the fft magnitude squared is an estimator of the PSD. This is referred to as the periodogram. However, it is not a very good estimator. A better estimator would be to use the pwelch() function. I some tutorial on PSD here http://www.mechanicalvibration.com/Introduction_power_spectral.html that may help you.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Parametric Spectral Estimation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!