why my dB plot doesn't seem right?

조회 수: 3 (최근 30일)
Xiaolong wu
Xiaolong wu 2020년 11월 23일
댓글: Mathieu NOE 2020년 11월 24일
Dear, I have a very simple signal, now I want to plot it. It seems all make sense when I plot it use linear scale. But I got very strange plot when I plot in log scale. code below:
%% test data
fs = 1000;
t = 0:1/fs:5-1/fs;
x = cos(2*pi*50*t)+cos(2*pi*100*t);
%plot(t,x)
%plotChannelSpectral(x);
[psd,f] = pwelch(x,500,200,500,1000);
plot(f,(psd)); % this one makes sense
figure;
plot(f,10*log10(psd)); %this just doesn't make sense
Should it be strght line?
And I don't know when should I use log scale and when should I use linear. For this instance, linear is very good, but log is not.
Thanks in advance.
  댓글 수: 5
Xiaolong wu
Xiaolong wu 2020년 11월 24일
Thanks, I will try the bode plot definitely.
How am I supose to accept the answer, I remember there is a accept answer button?
Mathieu NOE
Mathieu NOE 2020년 11월 24일
Make sure you are logged in.
If the question has already been closed you will see "Accepted Answer by ____" to the right of your profile picture where the question is asked. If not, then look next to the profile picture of the answerer(s). To the right of each person's answer, in green, you should see a box that says "Accept this answer." Push that button

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

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