How to correctly plot the PSD of segments of a signal?

조회 수: 10 (최근 30일)
MAWE
MAWE 2022년 9월 16일
답변: Chunru 2022년 9월 16일
I have a signal r of length S samples of baseband bandwidth W Hz. This represents the received signal in a communication system. The sampling rate is fs and carrier frequency is fc. I want to monitor the two-sided power spectral density (PSD) of r in segements each of length U samples, where I prefer to calculate the PSD from fft directly instead of a built in function, but having an additional appraoch using a built-in function may be helpful. The way I do it now for the first segment for example is like so
r1 = r(1:U);
[psd,f]=pwelch(r1);
plot(f, 10*log10(psd));
From the documentaion it seems that I used pwelch incorrectly or not the way I wanted it, because the above syntax returns the normalized frequency as x-axis.
The one I think I need is the following
[pxx,f] = pwelch(x,window,noverlap,f,fs)
But I am not sure what I should use for windows, nooverlap, and f. I also want to calculate a similar result using fft directly on the segments. I do it as so
psd1 = abs(fft(r1)).^2/(fs*S);
where I know I need to normalize the power of the fft of the segment, but not sure how exactly.
How can I use these both methods (or any other built-in method other than pwelch) correctly in MATLAB?

답변 (1개)

Chunru
Chunru 2022년 9월 16일
% r1 = r(1:U);
U = 8192;
r1 = randn(U, 1) + 1i*randn(U,1); % complex baseband signal
fs = 10000;
fc = 2000;
nfft = 1024;
[pxx,f] = pwelch(r1,nfft, nfft*3/4, 1024, fs);
% win, overlap, nfft, fs
plot(f, 10*log10(pxx));
xline(fc)

카테고리

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

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by