Asymptotic tracing with bode plots
8 views (last 30 days)
Show older comments
Hi, I am trying to use use Bode's asymptotic tracing technique to find an equivalent RC network to synthesize eigen-mode 1 of the characteristic impedance function Zc(w). Im limiting my fitting to four poles and to the frequency range 10^-1Hz to 10^7Hz. Attached is my data files and my code show below.
clear all;
clc;
load ZCmod1.txt;
load omega1g.txt;
load ZCmagorig.txt;
load ZCphaseorig.txt;
load freq.txt;
n=10;
i=1;
j=1;
p(1)=0;
z(1)=0;
x=1;
for i=1:(size(omega1g,1)-1)/n
a=ZCmod1(j);
b=ZCmod1(j+n);
c=ZCmod1(j+n/2);
p(i)=10^(-1*a+c+omega1g(j+n/2));
z(i)=10^(-1*b+c+omega1g(j+n/2));
x(i)=x*p(i)/z(i);
j=j+n;
end
H1=(10^ZCmod1(1))*x;
s = tf('s');
zeros=1;
poles=1;
for i=1:(size(omega1g,1)-1)/n
zeros=zeros*(s+z(i));
poles=poles*(s+p(i));
end
H=H1*zeros/poles;
[num,den]=tfdata(H);
[residues1,poles1,k1] = residue(num{1,1},den{1,1});
[ZCmag,ZCphase] = bode(H,freq*2*pi);
for i=1:size(ZCmag,3)
zc(i)=ZCmag(1,1,i);
phase(i)=ZCphase(1,1,i);
end
zc = zc';
phase = phase';
j=1;
k=1;
xa(j)=freq(1);
ya(j)=10^ZCmod1(1); %to draw the asymptotic lines
for i=1:(size(omega1g,1)-1)/n
j=j+1;
xa(j)=p(i)/(2*pi);
ya(j)=10^ZCmod1(k);
j=j+1;
k=k+n;
xa(j)=z(i)/(2*pi);
ya(j)=10^ZCmod1(k);
end
xa(j+1)=freq(k);
ya(j+1)=10^ZCmod1(k);
semilogx(freq,ZCmag);
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!