How to shift the pwelch plot
조회 수: 8 (최근 30일)
이전 댓글 표시
Hi,
I am using the pwelch function to plot signal power spectrum density. Similar to the function "fftshift", I want the first half of the spectrum swapped with second half to put the zero-frequency value in the middle. But I dont know how to do it on the pwelch. Can any one give me some suggestions?
Thanks.
댓글 수: 0
답변 (2개)
bym
2011년 11월 21일
pwelch calculates a one sided spectrum by default, therefore, no shifting is required. You can use the option 'twosided' to get the two sided PSD
댓글 수: 0
Wayne King
2011년 11월 21일
If you really want DC to be in the middle, you can do this.
Fs = 1e3;
t = 0:1/Fs:1-1/Fs;
x = cos(2*pi*100*t)+randn(size(t));
plot(psd(spectrum.welch,x,'Fs',Fs,'CenterDC',true));
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Spectral Estimation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!