how to plot psd versus frequency

조회 수: 4 (최근 30일)
vincent lin
vincent lin 2020년 1월 17일
답변: Hiro Yoshino 2020년 1월 17일
I have file with format t, I, Q
#% Time (s) I Channel (V) Q Channel (V)
xx=[+0.0000000000E+00 +1.3265187530E-02 -1.5107325599E-02
+2.0345052083E-09 +7.4751380907E-03 -2.0936643962E-02
+4.0690104167E-09 -1.7931125163E-03 -2.2093545044E-02
+6.1035156250E-09 -1.1648589721E-02 -1.7382003350E-02];
xx=(xx(:,2).'+j*xx(:,3).');
Sampling frequency is 1/2.0345052083E-09. how can I plot the spectrum versus frequency?
[pxx, w] = periodogram(xx);
plot(w,10*log10(pxx));
gives me strange plot, with middle empty and two sides have spectrum. Also how to get the integrated band power from frequency freq_a to freq_b?

답변 (1개)

Hiro Yoshino
Hiro Yoshino 2020년 1월 17일
[pxx, w] = periodogram(xx);
gives you the PSD (pxx) and the normalized frequency (w).
If you are falimiar with the theory, you can convert it into the frequency of your expectation as follows:
is the formula. N is the number of samples.
If not, the best bet is
[pxx, w] = periodogram(xx, fs);
where fs is the sampling frequency and w is the converted frequency.
Also, you should look into how PSD is calculated and it would help you understand how the PSD data are sorted.
You cannot expect something you find in your text book to appear.
If you do not have time to learn it, then you can just copy the way it is used:

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by