solution

solution solution

maecourses.ucsd.edu
from maecourses.ucsd.edu More from this publisher
20.07.2013 Views

ω = 100 . For low frequency ( ω ω 10 ), it’s a straight line with a slope of 0 at p p phase equals 0. For high frequency ( ω 10ω p ), it’s a straight line with a slope of 0 at phase equals − π . Then for frequencies between them ( ω 10 < ω < 10ω ), the p p straight line (reference to log10 ω ) achieves the − π phase change, as shown (dotted line). Then, get the phase asymptote by applying composition rules: dashed line plus dotted line, as shown (solid line). phase factor phase factor Code: 2 0 -2 -4 10 0 2 1 0 -1 -2 10 0 10 1 10 1 clear all omg = 1:1:10000; asym_z = 20*log10(omg/500); % get the magnitude asymptote from zero figure(2),subplot(2,1,1),semilogx(omg,asym_z,'--'),hold on xlabel('\omega'),ylabel('gain factor') asym_z_ph = pi/2*ones(size(omg)); % get the phase asymptote from zero figure(3),subplot(2,1,1),semilogx(omg,asym_z_ph,'--'),hold on xlabel('\omega'),ylabel('phase factor') omg_p = 100; omg1 = 1:1:omg_p; 10 2 ω 10 2 ω 10 3 10 3 10 4 10 4

omg2 = omg_p+1:1:10000; ym = zeros(size(omg)); % get the magnitude asymptote from the pole for low frequency ym_1 = ones(size(omg1)); % get the magnitude asymptote from the pole for high frequency ym_2 = omg2/omg_p; ym(1:length(omg1)) = ym_1; ym(length(omg1)+1:end)= ym_2; asym_p = -40*log10(ym); figure(2),subplot(2,1,1),semilogx(omg,asym_p,':'),hold off omg3 = 1:1:omg_p/10; omg4 = omg_p/10+1:1:omg_p*10; omg5 = omg_p*10+1:1:10000; yp = zeros(size(omg)); yp_1 = zeros(size(omg3)); yp_2 = -1*pi/2*(log10(omg4)-log10(omg_p/10)); % a -pi/2 phase change from omg_p/10 to omg_p*10 yp_3 = -1*pi*ones(size(omg5)); yp(1:length(omg3)) = yp_1; yp(length(omg3)+1:length(omg3)+length(omg4))= yp_2; yp(length(omg3)+length(omg4)+1:end)= yp_3; asym_p_ph = yp; figure(3),subplot(2,1,1),semilogx(omg,asym_p_ph,':'),hold off asym_m = asym_z+asym_p; % composition for magnitude asymptote figure(2),subplot(2,1,2),semilogx(omg,asym_m), xlabel('\omega'),ylabel('gain factor') asym_ph = asym_z_ph+asym_p_ph; figure(3),subplot(2,1,2),semilogx(omg,asym_ph), % composition for phase asymptote xlabel('\omega'),ylabel('phase factor')

omg2 = omg_p+1:1:10000;<br />

ym = zeros(size(omg)); % get the magnitude asymptote from the pole for low frequency<br />

ym_1 = ones(size(omg1)); % get the magnitude asymptote from the pole for high frequency<br />

ym_2 = omg2/omg_p;<br />

ym(1:length(omg1)) = ym_1;<br />

ym(length(omg1)+1:end)= ym_2;<br />

asym_p = -40*log10(ym);<br />

figure(2),subplot(2,1,1),semilogx(omg,asym_p,':'),hold off<br />

omg3 = 1:1:omg_p/10;<br />

omg4 = omg_p/10+1:1:omg_p*10;<br />

omg5 = omg_p*10+1:1:10000;<br />

yp = zeros(size(omg));<br />

yp_1 = zeros(size(omg3));<br />

yp_2 = -1*pi/2*(log10(omg4)-log10(omg_p/10));<br />

% a -pi/2 phase change from omg_p/10 to omg_p*10<br />

yp_3 = -1*pi*ones(size(omg5));<br />

yp(1:length(omg3)) = yp_1;<br />

yp(length(omg3)+1:length(omg3)+length(omg4))= yp_2;<br />

yp(length(omg3)+length(omg4)+1:end)= yp_3;<br />

asym_p_ph = yp;<br />

figure(3),subplot(2,1,1),semilogx(omg,asym_p_ph,':'),hold off<br />

asym_m = asym_z+asym_p; % composition for magnitude asymptote<br />

figure(2),subplot(2,1,2),semilogx(omg,asym_m),<br />

xlabel('\omega'),ylabel('gain factor')<br />

asym_ph = asym_z_ph+asym_p_ph;<br />

figure(3),subplot(2,1,2),semilogx(omg,asym_ph), % composition for phase asymptote<br />

xlabel('\omega'),ylabel('phase factor')

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!