Author Topic: Filter implimentation  (Read 1138 times)

Offline wmpptw

  • Newbie
  • *
  • Posts: 1
  • Matlab Forum
    • View Profile
Filter implimentation
« on: February 01, 2010, 03:41:00 PM »
Hi,
 
this is the first time I've used this forum so I not quite sure what to expect, but here goes.
 
I first tried to design a bandpass chebyshev (I) filter in matlab, with a sampling frequency of 100Hz and a bandpass of 0.06 to 0.12 Hz. Unfortunately over about order 3 the filter becomes unstable. The help files suggested instead of using the transfer function, to use the zero pole fucntion instead as this would be better. This worked! Code written below:
n = 5; r = 0.1;
Wn = ([0.06 0.12]/Fn); ftype =
'bandpass';
[z,p,k] = cheby1(n,r,Wn, ftype);
[sos] = zp2sos(z,p,k);
h1 = dfilt.df2sos(sos);
 
My question is this: when I try to implement the filter on my signal using the filtfilt function in matlab, so as to stop any zero phase distortion, matlab gives an error of 'not enough input arguments. I assume its expecting b,a coefficients from the transfer function. But this  filter would be unstable in the transfer function!?
 
I wondered if anyone could help? How do I use the h1 output on my signal?
 
Thanks
 
Paul Williams

Matlab and SimuLink Development Forum

Filter implimentation
« on: February 01, 2010, 03:41:00 PM »