Forums

Re: laplace tranform convert to code

Started by Tim Wescott July 21, 2006
tim w wrote:
> Hello all, > > I need some guidance in programming a laplace transfer function into > computer language -- pseudocode for now. > > The transfer function is a second order function: > > To^2*s^2 + zeta1*To*s + 1 > ------------------------- > To^2*s^2 + zeta2*To*s + 1 > > From what i've read the above transfer function is a bandstop filter, Zeta1 > and Zeta2 are adjustable paramaters. A demand signal is conditioned by the > function. > > What are the steps I need to take to convert to software? Should I convert > to z? Or??? > > Any web site or recomended book?? > > by the way, i've never programmed from transfer functions so I am new at > this. > > thanks
This is a perfect question for the comp.dsp group; I am taking the liberty of cross-posting it there. Yes, if you want this to actually execute in the digital domain you'll need to convert to the z domain one way or another, then write software to the resulting transfer function. If you must start from the s domain and go to the z domain then your best bet is to use Tustin's approximation ("bilinear transform") after prewarping the poles. When I can I prefer to start with the requirements for the filter and just design the whole darn thing in the z domain -- this is particularly important (albeit frustrating) for a notch filter where you want to make sure the gain above the notch is the same as the gain below. "Understanding Digital Signal Processing" by Rick Lyons will get you a long way down the road. It includes approximating Laplace-domain filters in the z domain, but skimming through the table of contents and flipping through the book I don't see anything that looks like a promise of code (Rick?). My book, "Applied Control Theory for Embedded Systems" gives you the tools you need to go from a z-domain transfer function to code, but it'll be pretty light in getting from the s-domain to the z-domain -- I take refuge in claims of finite page counts and finite time. I hope this helps. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Posting from Google? See http://cfaj.freeshell.org/google/ "Applied Control Theory for Embedded Systems" came out in April. See details at http://www.wescottdesign.com/actfes/actfes.html