Hi all I'm working on trying to model a non-linear system (described by a second order differential eqn) into a discrete IIR filter. I guess I'm trying to follow the impulse invariance IIR filter design method. In the laplace domain, the transfer function looks like this H(s) = a^2/(s+a)^2 I tried looking up laplace transform tables to find the time domain form for this and the closest pair I could find was H(s) = 1/(s+a)^2 -> h(t) = t*e^(-at) and the corresponding Z transform for h(t) as H(z) = T*z*e^(-aT) / (z - e^(-aT))^2 My question is, can I assume my extra term a^2 in my numerator will transfer to the z domain as a constant multiplier in the numerator? I haven't done z or laplace transforms since school...so I'd appreciate some help with this math. Cheers Bhaskar

# inverse laplace transform

Started by ●December 21, 2005

Reply by ●December 21, 20052005-12-21

Bhaskar Thiagarajan wrote:> I'm working on trying to model a non-linear system (described by a second > order differential eqn) into a discrete IIR filter. I guess I'm trying to > follow the impulse invariance IIR filter design method. > > In the laplace domain, the transfer function looks like this > H(s) = a^2/(s+a)^2 > > I tried looking up laplace transform tables to find the time domain form for > this and the closest pair I could find was > H(s) = 1/(s+a)^2 -> h(t) = t*e^(-at) > > and the corresponding Z transform for h(t) as > H(z) = T*z*e^(-aT) / (z - e^(-aT))^2 > > My question is, can I assume my extra term a^2 in my numerator will transfer > to the z domain as a constant multiplier in the numerator?Yes. Both Laplace and Z transform are linear.

Reply by ●December 21, 20052005-12-21

Bhaskar Thiagarajan wrote:> Hi all > > I'm working on trying to model a non-linear system (described by a second > order differential eqn) into a discrete IIR filter.Whoa! Stop right there! The Laplace transform (and the z transform) only work with linear systems. You simply cannot do a Laplace transform of a nonlinear system: it doesn't work. You can dink with Volterra series and all that fun stuff, but then you're not really doing a Laplace any more. Now, you _can_ get past the Linearity Nazi by claiming that you're _approximating_ your nonlinear system with a linear one, and taking the Laplace transform of that. I'll allow you through, but only if you tell me you've checked to make sure that your approximation is accurate enough for your expected inputs.> I guess I'm trying to > follow the impulse invariance IIR filter design method.(sniping about nonexistance of impulse response of nonlinear systems ommited (sorta))> > In the laplace domain, the transfer function looks like this > H(s) = a^2/(s+a)^2 > > I tried looking up laplace transform tables to find the time domain form for > this and the closest pair I could find was > H(s) = 1/(s+a)^2 -> h(t) = t*e^(-at)That's correct.> > and the corresponding Z transform for h(t) as > H(z) = T*z*e^(-aT) / (z - e^(-aT))^2Looks good from here.> > My question is, can I assume my extra term a^2 in my numerator will transfer > to the z domain as a constant multiplier in the numerator?Yes. Both the z transform and the Laplace transform are linear operations, so superposition holds.> I haven't done z > or laplace transforms since school...so I'd appreciate some help with this > math. >The impulse-invariance method is not usually a good way to do this, because you have this funny problem with scaling with the sampling rate. Impulse-invariance makes sense in the high-falutin' world of mathematics, but it only translates if you treat the discrete-time stuff as a true chain of impulses that get run through a reconstruction filter, etc. The first reconstruction filter that your real-world signal passes through is a DAC, which acts like a zero-order hold, which (if you treat your DAC inputs as impulses) has a DC gain that varies with sampling rate. For control systems design there is an exact transformation from the point of view of the software. It goes from the input to the DAC to the output of the ADC, and it recognizes that the "impulse response" of the DAC is a unit pulse that is as wide as the sampling rate. To calculate it you find the step response of your system: a^2 1 1 a H_s(s) = ---------- = - - ----- - --------- , s(s + a)^2 a s + a (s + a)^2 convert it to the time domain h_s(t) = 1 - e^-at - a t e^-at , find the z transform of that at a sample interval of T_s: z (1 - d - d * a*T_s)z - (1 - d - a*T_s)d H_s(z) = ----- --------------------------------------- z - 1 (z - d)^2 where d = e^-aT_s. Finally, multiply H_s(z) with the inverse of the z transform of the step function to get the z domain transfer function: (1 - d - d * a*T_s)z - (1 - d - a*T_s)d H_s(z) = --------------------------------------- . (z - d)^2 Now that was simple and direct, wasn't it? Unfortunately this is only exact for things that are sitting inside the sampled-time domain -- for things outside the sampled time domain its just an approximation. If you're trying to make a discrete-time thingie replicate the behavior of a continuous-time thingie then you're probably better off using something like the Tustin approximation and tweaking things after the fact to get the response right. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com

Reply by ●December 21, 20052005-12-21

"Tim Wescott" <tim@seemywebsite.com> wrote in message news:wYGdnbPA6obFKjTe4p2dnA@web-ster.com...> Bhaskar Thiagarajan wrote: > > Hi all > > > > I'm working on trying to model a non-linear system (described by asecond> > order differential eqn) into a discrete IIR filter. > > Whoa! Stop right there! > > The Laplace transform (and the z transform) only work with linear > systems. You simply cannot do a Laplace transform of a nonlinear > system: it doesn't work. You can dink with Volterra series and all that > fun stuff, but then you're not really doing a Laplace any more.Hmm...I think I mis-spoke. My instinct tells me that a second order differential equation is non-linear. However, I just looked up the Rick Lyons' book and I see that he calls it a linear system. I'm just going to take his word for it for now and revisit it later.> Now, you _can_ get past the Linearity Nazi by claiming that you're > _approximating_ your nonlinear system with a linear one, and taking the > Laplace transform of that. I'll allow you through, but only if you tell > me you've checked to make sure that your approximation is accurate > enough for your expected inputs. > > > I guess I'm trying to > > follow the impulse invariance IIR filter design method. > > (sniping about nonexistance of impulse response of nonlinear systems > ommited (sorta)) > > > > In the laplace domain, the transfer function looks like this > > H(s) = a^2/(s+a)^2 > > > > I tried looking up laplace transform tables to find the time domain formfor> > this and the closest pair I could find was > > H(s) = 1/(s+a)^2 -> h(t) = t*e^(-at) > > That's correct. > > > > and the corresponding Z transform for h(t) as > > H(z) = T*z*e^(-aT) / (z - e^(-aT))^2 > > Looks good from here. > > > > My question is, can I assume my extra term a^2 in my numerator willtransfer> > to the z domain as a constant multiplier in the numerator? > > Yes. Both the z transform and the Laplace transform are linear > operations, so superposition holds. > > > I haven't done z > > or laplace transforms since school...so I'd appreciate some help withthis> > math. > > > The impulse-invariance method is not usually a good way to do this, > because you have this funny problem with scaling with the sampling rate. > Impulse-invariance makes sense in the high-falutin' world of > mathematics, but it only translates if you treat the discrete-time stuff > as a true chain of impulses that get run through a reconstruction > filter, etc. The first reconstruction filter that your real-world > signal passes through is a DAC, which acts like a zero-order hold, which > (if you treat your DAC inputs as impulses) has a DC gain that varies > with sampling rate. > > For control systems design there is an exact transformation from the > point of view of the software. It goes from the input to the DAC to the > output of the ADC, and it recognizes that the "impulse response" of the > DAC is a unit pulse that is as wide as the sampling rate. To calculate > it you find the step response of your system: > > a^2 1 1 a > H_s(s) = ---------- = - - ----- - --------- , > s(s + a)^2 a s + a (s + a)^2 > > convert it to the time domain > > h_s(t) = 1 - e^-at - a t e^-at , > > find the z transform of that at a sample interval of T_s: > > z (1 - d - d * a*T_s)z - (1 - d - a*T_s)d > H_s(z) = ----- --------------------------------------- > z - 1 (z - d)^2 > > where d = e^-aT_s. > > Finally, multiply H_s(z) with the inverse of the z transform of the step > function to get the z domain transfer function: > > (1 - d - d * a*T_s)z - (1 - d - a*T_s)d > H_s(z) = --------------------------------------- . > (z - d)^2 > > Now that was simple and direct, wasn't it?Yes - very nice. Thanks for helping out Tim. That last equation should've been H(z) and not H_s(z) and I *think* the first equation should've had the first term on the right as 1/s and not 1/a I applied this technique to model my system and so far it mostly makes sense (whereas using the earlier scheme, my step response of the filter was growing exponentially). However, I can't seem to match 'a' (in my case this is the inverse of the critically damped time constant of my system) to it's definition, which is, the step response should reach 0.35 the max value in this duration. After creating my filter, examining the step response shows this time constant to be larger than what I used to get the filter. I couldn't find anything in the z transform tables I have to match what you did to get from h_s(t) to H_s(Z)...but I'll take your word for it.> Tim Wescott > Wescott Design Services > http://www.wescottdesign.com

Reply by ●December 21, 20052005-12-21

"Bhaskar Thiagarajan" <bhaskart@deja.com> wrote in message news:43a9f98a$0$15781$14726298@news.sunsite.dk...> "Tim Wescott" <tim@seemywebsite.com> wrote in message > news:wYGdnbPA6obFKjTe4p2dnA@web-ster.com... > > Bhaskar Thiagarajan wrote:<thread details snipped>> I couldn't find anything in the z transform tables I have to match whatyou> did to get from h_s(t) to H_s(Z)...but I'll take your word for it.Never mind this Tim...just needed to work through the algebra (twice). Hopefully you didn't jump from one line to the other in your head...I had a friend who could do that and I wasn't sure if I should admire him or hate him :-) Cheers Bhaskar

Reply by ●December 21, 20052005-12-21

Bhaskar Thiagarajan wrote:> "Tim Wescott" <tim@seemywebsite.com> wrote in message > news:wYGdnbPA6obFKjTe4p2dnA@web-ster.com... > >>Bhaskar Thiagarajan wrote: >> >>>Hi all >>> >>>I'm working on trying to model a non-linear system (described by a > > second > >>>order differential eqn) into a discrete IIR filter. >> >>Whoa! Stop right there! >> >>The Laplace transform (and the z transform) only work with linear >>systems. You simply cannot do a Laplace transform of a nonlinear >>system: it doesn't work. You can dink with Volterra series and all that >>fun stuff, but then you're not really doing a Laplace any more. > > > Hmm...I think I mis-spoke. My instinct tells me that a second order > differential equation is non-linear. However, I just looked up the Rick > Lyons' book and I see that he calls it a linear system. I'm just going to > take his word for it for now and revisit it later. > > >>Now, you _can_ get past the Linearity Nazi by claiming that you're >>_approximating_ your nonlinear system with a linear one, and taking the >>Laplace transform of that. I'll allow you through, but only if you tell >>me you've checked to make sure that your approximation is accurate >>enough for your expected inputs. >> >> >>>I guess I'm trying to >>>follow the impulse invariance IIR filter design method. >> >>(sniping about nonexistance of impulse response of nonlinear systems >>ommited (sorta)) >> >>>In the laplace domain, the transfer function looks like this >>>H(s) = a^2/(s+a)^2 >>> >>>I tried looking up laplace transform tables to find the time domain form > > for > >>>this and the closest pair I could find was >>>H(s) = 1/(s+a)^2 -> h(t) = t*e^(-at) >> >>That's correct. >> >>>and the corresponding Z transform for h(t) as >>>H(z) = T*z*e^(-aT) / (z - e^(-aT))^2 >> >>Looks good from here. >> >>>My question is, can I assume my extra term a^2 in my numerator will > > transfer > >>>to the z domain as a constant multiplier in the numerator? >> >>Yes. Both the z transform and the Laplace transform are linear >>operations, so superposition holds. >> >> >>>I haven't done z >>>or laplace transforms since school...so I'd appreciate some help with > > this > >>>math. >>> >> >>The impulse-invariance method is not usually a good way to do this, >>because you have this funny problem with scaling with the sampling rate. >> Impulse-invariance makes sense in the high-falutin' world of >>mathematics, but it only translates if you treat the discrete-time stuff >>as a true chain of impulses that get run through a reconstruction >>filter, etc. The first reconstruction filter that your real-world >>signal passes through is a DAC, which acts like a zero-order hold, which >>(if you treat your DAC inputs as impulses) has a DC gain that varies >>with sampling rate. >> >>For control systems design there is an exact transformation from the >>point of view of the software. It goes from the input to the DAC to the >>output of the ADC, and it recognizes that the "impulse response" of the >>DAC is a unit pulse that is as wide as the sampling rate. To calculate >>it you find the step response of your system: >> >> a^2 1 1 a >>H_s(s) = ---------- = - - ----- - --------- , >> s(s + a)^2 a s + a (s + a)^2 >> >>convert it to the time domain >> >>h_s(t) = 1 - e^-at - a t e^-at , >> >>find the z transform of that at a sample interval of T_s: >> >> z (1 - d - d * a*T_s)z - (1 - d - a*T_s)d >>H_s(z) = ----- --------------------------------------- >> z - 1 (z - d)^2 >> >>where d = e^-aT_s. >> >>Finally, multiply H_s(z) with the inverse of the z transform of the step >>function to get the z domain transfer function: >> >> (1 - d - d * a*T_s)z - (1 - d - a*T_s)d >>H_s(z) = --------------------------------------- . >> (z - d)^2 >> >>Now that was simple and direct, wasn't it? > > > > Yes - very nice. Thanks for helping out Tim. That last equation should've > been H(z) and not H_s(z) and I *think* the first equation should've had the > first term on the right as 1/s and not 1/aYes, those were typos and you're right.> > I applied this technique to model my system and so far it mostly makes sense > (whereas using the earlier scheme, my step response of the filter was > growing exponentially). > However, I can't seem to match 'a' (in my case this is the inverse of the > critically damped time constant of my system) to it's definition, which is, > the step response should reach 0.35 the max value in this duration. After > creating my filter, examining the step response shows this time constant to > be larger than what I used to get the filter. > > I couldn't find anything in the z transform tables I have to match what you > did to get from h_s(t) to H_s(Z)...but I'll take your word for it. >Good -- 'cause I took MathCad's word for it. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com

Reply by ●December 21, 20052005-12-21

Bhaskar Thiagarajan wrote:> "Bhaskar Thiagarajan" <bhaskart@deja.com> wrote in message > news:43a9f98a$0$15781$14726298@news.sunsite.dk... > >>"Tim Wescott" <tim@seemywebsite.com> wrote in message >>news:wYGdnbPA6obFKjTe4p2dnA@web-ster.com... >> >>>Bhaskar Thiagarajan wrote: > > > <thread details snipped> > >>I couldn't find anything in the z transform tables I have to match what > > you > >>did to get from h_s(t) to H_s(Z)...but I'll take your word for it. > > > Never mind this Tim...just needed to work through the algebra (twice). > Hopefully you didn't jump from one line to the other in your head...I had a > friend who could do that and I wasn't sure if I should admire him or hate > him :-) >I long ago stopped doing this kind of stuff in my head or anywhere else related to my brain. I use MathCad, because I have to try the algebra _more_ than twice to be sure. In this case I got the H_s(z) in a form that I could work with, adjusted my math until MathCan indicated it was equal to the mess it came up with, and called it good. SciLab (www.scilab.org) will also do this for free, but only numerically and it's not as user friendly. MatLab will do it for $3K, plus another $3K for the control systems toolbox, and also not symbolically. For some reason I use MathCad and SciLab... -- Tim Wescott Wescott Design Services http://www.wescottdesign.com

Reply by ●December 21, 20052005-12-21

Bhaskar Thiagarajan wrote:> "Tim Wescott" <tim@seemywebsite.com> wrote in message > news:wYGdnbPA6obFKjTe4p2dnA@web-ster.com... > >>Bhaskar Thiagarajan wrote: >> >>>Hi all >>> >>>I'm working on trying to model a non-linear system (described by a > > second > >>>order differential eqn) into a discrete IIR filter. >> >>Whoa! Stop right there! >> >>The Laplace transform (and the z transform) only work with linear >>systems. You simply cannot do a Laplace transform of a nonlinear >>system: it doesn't work. You can dink with Volterra series and all that >>fun stuff, but then you're not really doing a Laplace any more. > > > Hmm...I think I mis-spoke. My instinct tells me that a second order > differential equation is non-linear. However, I just looked up the Rick > Lyons' book and I see that he calls it a linear system. I'm just going to > take his word for it for now and revisit it later. >You can have an any-order (up to infinite) differential equation that is linear. The order of the diff. eq and it's linearity are orthogonal properties. You may want to do a bit of digging and remind yourself of the properties of linearity and time-invariance (they are two different properties). The Laplace transform only works on systems that are linear and time invariant. The z transform only works on systems that are linear and who's time variance is cyclical at the reference rate. If you're clever and determined you can use Fourier analysis on some systems that are time varying, like systems with sampling and superheterodyne radio receivers. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com

Reply by ●December 22, 20052005-12-22

"Tim Wescott" <tim@seemywebsite.com> wrote in message news:wYGdnbPA6obFKjTe4p2dnA@web-ster.com...> Bhaskar Thiagarajan wrote: > > Hi all > > > > I'm working on trying to model a non-linear system (described by asecond> > order differential eqn) into a discrete IIR filter. > > Whoa! Stop right there! > > The Laplace transform (and the z transform) only work with linear > systems. You simply cannot do a Laplace transform of a nonlinear > system: it doesn't work. You can dink with Volterra series and all that > fun stuff, but then you're not really doing a Laplace any more. >You can get special dispensation from the Pope. HH