Different results using SS and TF forms
Different results using SS and TF forms
(OP)
Many function (such as cheby2) allow us to generate state space (SS) form of a system if we specify 4 arguments, or transfer function form if we specify two arguments.
freqz expects TF as an input, so if I have a SS, I need to convert it first.
I would expect the following two codes to gives similar plots:
But they do not give the same results. The second one gives the expected plot (20 db down at frequency 0.75).
Code and output shown here:
http: //home.com cast.net/~ electricpe te/eng-tip s/FilterQu estion.doc
I think I have overlooked something. What?
freqz expects TF as an input, so if I have a SS, I need to convert it first.
I would expect the following two codes to gives similar plots:
Quote (code1):
[A,B,C,D]=cheby2(9,20,0.75); % 9th order filter, 30 db down at cutoff of 0.75*Fmax
freqz(ss2tf(A,B,C,D))
Quote (code2):
[A,B]=cheby2(9,20,0.75);
freqz(A,B)
But they do not give the same results. The second one gives the expected plot (20 db down at frequency 0.75).
Code and output shown here:
http:
I think I have overlooked something. What?
=====================================
Eng-tips forums: The best place on the web for engineering discussions.





RE: Different results using SS and TF forms
[b,a] = ss2tf(A,B,C,D,iu)
jsolar
RE: Different results using SS and TF forms
This gives the correct result:
[A,B,C,D]=cheby2(9,20,0.75);
[a b] = ss2tf(A,B,C,D)
freqz(a,b)
This does not:
[A,B,C,D]=cheby2(9,20,0.75);
freqz(ss2tf(A,B,C,D))
=============
It appears that ss2tf(A,B,C,D) returns only half the answer. I can only get the full answer using [x,y]=ss2tf(A,B,C,D)
ss2tf(A,B,C,D)
ans =
Columns 1 through 7
0.4657 3.5534 12.5944 27.1445 39.1463 39.1463 27.1445
Columns 8 through 10
12.5944 3.5534 0.4657
ยป [a b]=ss2tf(A,B,C,D)
a =
Columns 1 through 7
0.4657 3.5534 12.5944 27.1445 39.1463 39.1463 27.1445
Columns 8 through 10
12.5944 3.5534 0.4657
b =
Columns 1 through 7
1.0000 6.2604 18.4834 33.5098 40.9165 34.7873 20.5536
Columns 8 through 10
8.1288 1.9519 0.2169
=====================================
Eng-tips forums: The best place on the web for engineering discussions.