locosoundman wrote on Mon, 05 December 2005 22:14 |
Hello all:
Thanks for your reply - I do have Octave, which is like MATLAB. But my difficulty is getting the translation from analog to digital right.
I am working on a second order low-pass Butterworth filter. I guess my question is, what do I need to do make the coefficients in the s-domain, which I know how to use to figure out capacitor values, translate into the z-transform function of my IIR?
Maybe it is better said:
If I have 1 / (s^2 + 1.414s + 1) as my transfer function, how will it look within the z-transform: H(z) = a0z + a1z^-1... / 1+ b1z^-1+ b2z^-2
the carrots showing exponents.
Again, I don't have a great math background so it is probably something really simple that I am just not seeing. If anyone could just shed some light on the rigt path to go down...
Best, Rob
|
The short answer is - get some good DSP book.
The specific answer is: You need to perform a transformation from the s domain to the z domain. There is more then one way to do that. In your case (and most cases) you need to take your trandsfer function, and do the bilinear transformation as follows:
Start with
T(s)=1 / (s^2 + 1.414s + 1)
Next you need to figure the 3dB cuttoff frequency, say we call it wp. This fp is the cutoff in the analog domain (wp=2*pi*fp)
Next you need to prewarp the frequency as follows:
Wp=tan(wp*T/2). Pay attention to W (capital) an w (small)
Next you need to substitute Wp for wp as follows:
T(s)=1/ [(s/Wp)^2 +1.414*(s/Wp)+1]
Next substitute s=K*(z-1)/(z+1) for each and every s
That yields a transfer function of z, namely T(z)
Just set K=1 or 2/T
Juggle it around to a form:
T(Z)= (n1+n2*Z^-1+n2*Z^-2)/(1+d1*z^-1+d2*z^-2)
The numerator yields the feedback, the denominator yield the forward coefficients...
But, if you really want to learn, you need a DSP book...
Regards
Dan Lavry
www.lavryengineering.com