how to plot these figures

4 views (last 30 days)
Nate Duong
Nate Duong on 10 Jan 2017
Commented: Star Strider on 10 Jan 2017
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)

Accepted Answer

Star Strider
Star Strider on 10 Jan 2017
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 Comments
Nate Duong
Nate Duong on 10 Jan 2017
@ 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 on 10 Jan 2017
As always, my pleasure.

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!