How can I plot this signal?

5 views (last 30 days)
Niloufar
Niloufar on 2 Nov 2022
Answered: KALYAN ACHARJYA on 2 Nov 2022
I want to plot a magnitude and phase of a signal which the x coordinate is logf and y coordinate once is 20*log(abs(Av)) and once is 20*log(angle(Av)).here is my code but it doesn't plot anything.what is the ploblem?
close all;clear;clc;
gm = 0.04;
RL = 10000;
CL = 10^(-9);
f = logspace(-1,2);
Av = (-gm*RL)/(1 + RL*CL*f*1i);
%magnitude
subplot(2,1,1);
loglog(f,(abs(Av))^20);
title('magnitude');
grid on;
%phase
subplot(2,1,2);
loglog(f,(angle(Av))^20);
title('phase');

Accepted Answer

Alan Stevens
Alan Stevens on 2 Nov 2022
Like this?
gm = 0.04;
RL = 10000;
CL = 10^(-9);
f = logspace(-1,2);
Av = (-gm*RL)./(1 + RL*CL*f*1i);
%magnitude
subplot(2,1,1);
loglog(f,(abs(Av)).^20); % Notice the dot .^
title('magnitude');
grid on;
%phase
subplot(2,1,2);
loglog(f,(angle(Av)).^20);
title('phase');
grid

More Answers (1)

KALYAN ACHARJYA
KALYAN ACHARJYA on 2 Nov 2022
gm = 0.04;
RL = 10000;
CL = 10^(-9);
f = logspace(-1,2);
Av = (-gm*RL)./(1 + RL*CL*f*1i);
%magnitude
subplot(2,1,1);
loglog(f,(abs(Av)).^20);
title('magnitude');
grid on;
%phase
subplot(2,1,2);
loglog(f,(angle(Av)).^20);
title('phase');

Categories

Find more on 2-D and 3-D Plots 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!