DSPRelated.com
Forums

Problem of SOS matrix to Transfer Function in IIR Filter Design using Matlab

Started by X.Y. January 4, 2007
Hi, everyone, I have to design a IIR filter using FDATOOL in Matlab.
And I expert it to workspace as SOS Matrix(SOS) and Scale Values(G).
Then I use function [b,a] = sos2tf(SOS,G) to acquire the Transfer
Function. However, it always report error:
>> [b,a]=sos2tf(SOS,G)
??? Error using ==> times Matrix dimensions must agree. Error in ==> sos2tf at 52 b = b.*g; I don't know how to handle this problem, someone help me please. Thanks a lot! P.S. I just want to implement an IIF filter using C program language. So I want to acquire the Transfer Function and then the difference equation. And besides, if there is another way, please tell me. Thanks.
On Fri, 05 Jan 2007 01:58:41 -0000, X.Y. <Xieyu1219@gmail.com> wrote:

> Hi, everyone, I have to design a IIR filter using FDATOOL in Matlab. > And I expert it to workspace as SOS Matrix(SOS) and Scale Values(G). > Then I use function [b,a] =3D sos2tf(SOS,G) to acquire the Transfer > Function. However, it always report error: >>> [b,a]=3Dsos2tf(SOS,G) > ??? Error using =3D=3D> times > Matrix dimensions must agree. > > Error in =3D=3D> sos2tf at 52 > b =3D b.*g; >
G must be a scalar value. -- = Oli
"Oli Charlesworth =D0=B4=B5=C0=A3=BA
"
> On Fri, 05 Jan 2007 01:58:41 -0000, X.Y. <Xieyu1219@gmail.com> wrote: > > > Hi, everyone, I have to design a IIR filter using FDATOOL in Matlab. > > And I expert it to workspace as SOS Matrix(SOS) and Scale Values(G). > > Then I use function [b,a] =3D sos2tf(SOS,G) to acquire the Transfer > > Function. However, it always report error: > >>> [b,a]=3Dsos2tf(SOS,G) > > ??? Error using =3D=3D> times > > Matrix dimensions must agree. > > > > Error in =3D=3D> sos2tf at 52 > > b =3D b.*g; > > > > G must be a scalar value. > > > > -- > Oli
yes=A3=ACG is a scale value and it is given by FDATOOL, I have not changed it.
On Jan 5, 12:48 pm, "X.Y." <Xieyu1...@gmail.com> wrote:
> "Oli Charlesworth =E5=86=99=E9=81=93=EF=BC=9A > " > > On Fri, 05 Jan 2007 01:58:41 -0000, X.Y. <Xieyu1...@gmail.com> wrote: > > > > Hi, everyone, I have to design a IIR filter using FDATOOL in Matlab. > > > And I expert it to workspace as SOS Matrix(SOS) and Scale Values(G). > > > Then I use function [b,a] =3D sos2tf(SOS,G) to acquire the Transfer > > > Function. However, it always report error: > > >>> [b,a]=3Dsos2tf(SOS,G) > > > ??? Error using =3D=3D> times > > > Matrix dimensions must agree. > > > > Error in =3D=3D> sos2tf at 52 > > > b =3D b.*g; > > > G must be a scalar value. > > > Oliyes=EF=BC=8CG is a scale value and it is given by FDATOOL, I have no=
t changed it No, "scalar", as in "not a matrix or vector", i.e. a 1x1 variable. --=20 Oli