how to plot these figures

조회 수: 4 (최근 30일)
Nate Duong
Nate Duong 2017년 1월 10일
댓글: Star Strider 2017년 1월 10일
Dear group,
I am new with matlab and trying to plot these figure out as the file request.
I tried but could not get the same plot as the file has.
I hope anyone can help. Here is the code which i am working on.
Thank you.
fc = 553e6;
w = 0:2*pi*fc*1e-2:100*2*pi*fc;
pau = 0.33;
tau = 0.2e-9; % in nano second
% beta_square = zeros(1,length(w));
beta_square = 1 + 2*pau*cos(w*tau) + pau^2;
theta = atan(-pau*sin(w*tau)/(1+pau*cos(w*tau)));
figure,plot(w,beta_square)
figure,plot(w,theta)

채택된 답변

Star Strider
Star Strider 2017년 1월 10일
This will get you part of the way. You need to figure out the reason your code does not reproduce the published plots. This aspect of communications engineering is not in an area of my expertise, so I cannot help you with those details.
The (Slightly Changed) Code:
fc = 553e6;
w = 0:2*pi*fc*1e-2:100*2*pi*fc;
pau = 0.33;
tau = [0.2 0.5 1.0 2.0]*1e-9; % in nano second
[W,Tau] = meshgrid(w, tau);
% beta_square = zeros(1,length(w));
beta_square = @(w,tau) 1 + 2*pau*cos(w.*tau) + pau^2;
theta = @(w,tau) atand(-pau*sin(w.*tau)./(1+pau*cos(w.*tau)));
figure,plot(w,10*log10(beta_square(W,Tau)))
set(gca, 'XLim',[4 6]*1E+10)
figure,plot(w,theta(W,Tau))
set(gca, 'XLim',[4 6]*1E+10)
Note that ‘beta_square’ is in units of decibels, so I added that (assuming that it represents a power, if it represents an amplitude instead, 10*log10() becomes 20*log10()). The phase is in degrees, so I also changed atan to atand.
The code works. You may have to review the paper the equations and published figures come from to determine the reason your code is not reproducing those figures.
  댓글 수: 2
Nate Duong
Nate Duong 2017년 1월 10일
@ Star Strider: you are right these things for communication engineering, don't worry, I just need plots. You really answered my question. Thank you very much, Star Strider.
Star Strider
Star Strider 2017년 1월 10일
As always, my pleasure.

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by