how to plot these figures

2 次查看(过去 30 天)
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