plotting power Vs frequency graph

9 ビュー (過去 30 日間)
shirin
shirin 2021 年 2 月 1 日
コメント済み: Star Strider 2021 年 2 月 1 日
Hi all,
I have loaded some data from the oscilloscope and I need to plot power vs frequency graph for my data. I usually use pwelch to plot the frequency response but it seems for this data it wont give me good frequency respose. anyone can help please.
Fs=10e9. L=1000000

採用された回答

Star Strider
Star Strider 2021 年 2 月 1 日
I am not certain what the probme is with pwelch. It appears to give the correct result when I plot it.
Alternatively, try this:
s = readmatrix('Sumof3MIMOsDATASET1afterDACFs10G200K512eros.csv');
Fs=10e9;
L=numel(s);
t = linspace(0, L, L)/Fs;
Ts = 1/Fs;
Fn = Fs/2;
t = linspace(0, L, L)*Ts;
ms = mean(s);
FTs = fft(s)/L;
Fv = linspace(0, 1, fix(L/2)+1)*Fn;
Iv = 1:numel(Fv);
figure
plot(t, s)
grid
xlabel('Time (s)')
ylabel('Amplitude (Units)')
figure
semilogy(Fv, abs(FTs(Iv))*2)
grid
xlabel('Frequency (Hz)')
ylabel('Amplitude (Units)')
figure
plot(Fv, mag2db(abs(FTs(Iv))*2))
grid
xlabel('Frequency (Hz)')
ylabel('Power (Units^2)')
.
  2 件のコメント
shirin
shirin 2021 年 2 月 1 日
Thanks!
Star Strider
Star Strider 2021 年 2 月 1 日
As always, my pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePulse and Transition Metrics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by