- KVRian
- 1391 posts since 13 Oct, 2003, from Prague, Czech Republic

I'm new to Laplace Transforms and ZDF so I'm asking here a few pointers if it can be done something along the following lines:

1. Place poles and zeroes on the S-plane.

2. Integrate the time domain from 0 to "t" by dividing the S-domain transfer function by "s".

3. Do Inverse Laplace Transform.

Now if I understand correctly, you're left with infinite impulse response integral (from 0 to t) of the filter you just described on S-plane? Let's call this h(t).

Then what?

Also do I need to use Heaviside step function somewhere?

...or am I doing it all wrong? (I probably am)

1. Place poles and zeroes on the S-plane.

2. Integrate the time domain from 0 to "t" by dividing the S-domain transfer function by "s".

3. Do Inverse Laplace Transform.

Now if I understand correctly, you're left with infinite impulse response integral (from 0 to t) of the filter you just described on S-plane? Let's call this h(t).

Then what?

Also do I need to use Heaviside step function somewhere?

...or am I doing it all wrong? (I probably am)

- KVRian
- 994 posts since 9 Jan, 2006

If you have the continuous time transfer function you can derive a structure and digital zdf implementation directly from thatKraku wrote:I'm new to Laplace Transforms and ZDF so I'm asking here a few pointers if it can be done something along the following lines:

1. Place poles and zeroes on the S-plane.

2. Integrate the time domain from 0 to "t" by dividing the S-domain transfer function by "s".

3. Do Inverse Laplace Transform.

Now if I understand correctly, you're left with infinite impulse response integral (from 0 to t) of the filter you just described on S-plane? Let's call this h(t).

Then what?

Also do I need to use Heaviside step function somewhere?

...or am I doing it all wrong? (I probably am)

Edit: getting some more info together

- KVRAF
- 4795 posts since 11 Feb, 2006, from Helsinki, Finland

The normal way to do bilinear transform (BLT) is to replace every "s" in the analog transfer function with the BLT differentiator 2*(z-1)/(z+1), or equivalently replace every "1/s" with the BLT integrator (ie. 1/2*(z+1)/(z-1)).

The real "meat" of the so called ZDF or TPT (for topology preserving transform) is that you can do the BLT also by replacing every analog integrator by the BLT integrator (well, strictly speaking you want something that implements the trapezoidal rule, but DF1 or TDF2 BLT integrators are equivalent) in the actual analog implementation topology, meaning that by starting from a set of continuous time differential equations you can then convert these into a set of discrete time equations that you can finally solve (using any of the usual methods to solve a set of equations) to implement the system, preserving some (hopefully most) of it's properties beyond just the LTI characteristics that a transfer function would describe.

In other words, compared to regular BLT, the ZDF approach goes a step further, by integrating the analog system directly using the trapezoidal rule, which for the LTI case is equivalent to regular BLT, but somewhat more general... and you don't need to do any Laplace transform at all.

The real "meat" of the so called ZDF or TPT (for topology preserving transform) is that you can do the BLT also by replacing every analog integrator by the BLT integrator (well, strictly speaking you want something that implements the trapezoidal rule, but DF1 or TDF2 BLT integrators are equivalent) in the actual analog implementation topology, meaning that by starting from a set of continuous time differential equations you can then convert these into a set of discrete time equations that you can finally solve (using any of the usual methods to solve a set of equations) to implement the system, preserving some (hopefully most) of it's properties beyond just the LTI characteristics that a transfer function would describe.

In other words, compared to regular BLT, the ZDF approach goes a step further, by integrating the analog system directly using the trapezoidal rule, which for the LTI case is equivalent to regular BLT, but somewhat more general... and you don't need to do any Laplace transform at all.

<- plugins | forum

- KVRian
- 994 posts since 9 Jan, 2006

Here's a canonical form for continuous time systems:

As mystran said, replace the integrators with DF1 or DF2 bilinear, aka trapezoidal, integrators (I think in the Art of VA Filter Design transposed DF2 is chosen). The a and b coefficients are simply the multiples of powers of s in descending order. Feedback taken from the denominator, feedforward from the numerator. Then just have to keep in mind the feedback paths are instantaneous, so the implicit equations will need rearranging so the output isn't defined in terms of itself.

As mystran said, replace the integrators with DF1 or DF2 bilinear, aka trapezoidal, integrators (I think in the Art of VA Filter Design transposed DF2 is chosen). The a and b coefficients are simply the multiples of powers of s in descending order. Feedback taken from the denominator, feedforward from the numerator. Then just have to keep in mind the feedback paths are instantaneous, so the implicit equations will need rearranging so the output isn't defined in terms of itself.

- KVRAF
- 4795 posts since 11 Feb, 2006, from Helsinki, Finland

matt42 wrote:Here's a canonical form for continuous time systems:

Right, except typically you don't really implement an analog filter this way (other than the second order case anyway; when using normalized coefficients and controlling the actual cutoff by scaling the integrator inputs you get the familiar SVF) and the point of the whole ZDF-thing is to transform the implementation rather than the response.

Also NOT DF2!! Only Direct Form I and Transposed Direct Form II (ie. TDF2) are equivalent to trapezoidal rule in the time-varying case.

---

ps. There are a total of 4 different "direct form" filters:

DF1 and TDF2 are essentially equivalent, where TDF2 essentially just merges the delays of DF1. These are safe and one should usually use TDF2 because it's arguably ideal.

Similarly the TDF1 and DF2 filters are essentially equivalent, where again DF2 merges the delays, but these do not correctly implement the trapezoidal rule in time-varying cases.

<- plugins | forum

- KVRian
- 994 posts since 9 Jan, 2006

Thanks for the clarification on the DF2. Yes, I suppose a lot of people want to model specific circuits, or even more generally topologies. But if, say, you want a linear filter for an EQ, or something, then this method is simple and you get better time varying dehaviour than with BLT. Also the OP is talking about placement of poles in the s plane, which makes me think they dont have a specific topology in mind

- KVRAF
- 4795 posts since 11 Feb, 2006, from Helsinki, Finland

matt42 wrote:Thanks for the clarification on the DF2. Yes, I suppose a lot of people want to model specific circuits, or even more generally topologies. But if, say, you want a linear filter for an EQ, or something, then this method is simple and you get better time varying dehaviour than with BLT. Also the OP is talking about placement of poles in the s plane, which makes me think they dont have a specific topology in mind

Right. The key to good time-varying behavior is to put the feed-forward component of the integrator before the feedback component. If I'm not mistaken, Vadim's book (or some draft of it) might originally have used DF1. However, TDF2 is equivalent and the current versions of The Art of VA Filter Design even have a picture of the TDF2 integrator on the "cover" (ie. the first page of the PDF).

As for transfer functions: Yes, you can do it without a specific topology, but this is the traditional BLT then. By substituting in the transfer function, you get a transfer function that you can then implement using any of the various direct form filters (or something else, like ladder-lattice or whatever floats your boat). In this case the transform is only LTI though and you get none of the usual perceived "ZDF" benefits.

<- plugins | forum

- KVRian
- 994 posts since 9 Jan, 2006

Perhaps this is where we misunderstand each other? I'm suggesting a generalised topology so you can design from the s-plane directly and arrive at a zdf filter.mystran wrote:As for transfer functions: Yes, you can do it without a specific topology, but this is the traditional BLT then.

- KVRian
- 1331 posts since 26 Apr, 2004, from UK

I don't think you can use the ZDF in that case. You don't start with the analog form where you can implement the TPT integrator/nodal equivalence. If you have a s-space function, then use the BLT.

- KVRian
- 994 posts since 9 Jan, 2006

I humbly disagree. If I have a transfer function and I want to both have BLT equivalent response and nice modulation behavior what do I do? I don't see how it's against the rules to work from a generalized structure such as the one in the image I posted.Miles1981 wrote:I don't think you can use the ZDF in that case. You don't start with the analog form where you can implement the TPT integrator/nodal equivalence. If you have a s-space function, then use the BLT.

On a practical note all that's generally needed is to derive one and two pole structures and chain them. Once you have the transfer functions you just lift the coefficients and slap them in the digital structures. It's quite a trivial process.

- KVRian
- 913 posts since 11 Apr, 2002

@mystran: why do you think that different BLT integrators are not equivalent? Except for potentially different precision losses, the integrators, being fully LTI, are not distinguishable from the outside. IIRC it was karrikuh who first noticed this. The main reason to use DF2/TDF2 is to have one state variable per integrator rather than two, while TDF2 is preferred because it has a more natural state (something like a half-delayed output IIRC) and can accommodate embedded saturation more easily (although the latter is more a hack than a model of what's really going on in analog circuits). A more critical aspect (which is also non-LTI) is whether you place the cutoff gain before or after the integrator, but that can be considered independent of a particular integration structure.

As for using the canonical continuous-time structure, same as in discrete time, I don't think it's a good idea for orders higher than 2 due to potential precision problems, although I didn't really verify that. As mentioned in this thread, if you don't have a specific topology in mind, it's probably best to decompose into a series of 2- and 1-poles and implement those using standard continuous time structures. You can see e.g section 5.6 of VAFilterDesign for more detail.

The question "how do I implement a particular analog transfer function, while preserving its modulation behavior" is somewhat flawed, because a transfer function doesn't encode a specific modulation behavior. The latter is encoded in the topology, which is not being specified there. Although, if we are talking only about cutoff modulation, then, if I'm not mistaken, all topologies are equivalent, since in continuous time cutoff modulation is equivalent to the compression and/or stretching of the time axis. So pratically speaking, to get a nicely modulatable ZDF filter from an analog transfer function, you have first to choose a nice analog topology (like a series of SVFs) and then apply TPT.

Edit: actually even with cutoff modulation there is some freedom in putting the cutoff gains before or after the integrator, resulting in different time-varying behavior.

As for using the canonical continuous-time structure, same as in discrete time, I don't think it's a good idea for orders higher than 2 due to potential precision problems, although I didn't really verify that. As mentioned in this thread, if you don't have a specific topology in mind, it's probably best to decompose into a series of 2- and 1-poles and implement those using standard continuous time structures. You can see e.g section 5.6 of VAFilterDesign for more detail.

The question "how do I implement a particular analog transfer function, while preserving its modulation behavior" is somewhat flawed, because a transfer function doesn't encode a specific modulation behavior. The latter is encoded in the topology, which is not being specified there. Although, if we are talking only about cutoff modulation, then, if I'm not mistaken, all topologies are equivalent, since in continuous time cutoff modulation is equivalent to the compression and/or stretching of the time axis. So pratically speaking, to get a nicely modulatable ZDF filter from an analog transfer function, you have first to choose a nice analog topology (like a series of SVFs) and then apply TPT.

Edit: actually even with cutoff modulation there is some freedom in putting the cutoff gains before or after the integrator, resulting in different time-varying behavior.

- KVRAF
- 4795 posts since 11 Feb, 2006, from Helsinki, Finland

Z1202 wrote:@mystran: why do you think that different BLT integrators are not equivalent? Except for potentially different precision losses, the integrators, being fully LTI, are not distinguishable from the outside.

Of course they are equivalent in the LTI case. However, as soon as you any time-varying or non-linear stuff going, the DF1/TDF2 forms are also equivalent to trapezoidal integration where as the DF2/TDF1 are not.

edit: Specifically, in DF2/TDF1 the feedforward part is after the feedback part, which means that in time-varying case the second feedforward coefficient (b1) will change one sample too early (if all coefficients are calculated at the same time). However, simply delaying the coefficient is insufficient, because the internal gain of the state variable is also dependent on the feedforward coefficients (as calculated in the "future") which means that the internal gain needs to be scaled as the coefficients change (with the complication that the b0 and (delayed) b1 coefficients need different scaling in the time-varying case). While it can be made to work, it's just pointless. Use TDF2.

<- plugins | forum

- KVRAF
- 4795 posts since 11 Feb, 2006, from Helsinki, Finland

Z1202 wrote:Although, if we are talking only about cutoff modulation, then, if I'm not mistaken, all topologies are equivalent, since in continuous time cutoff modulation is equivalent to the compression and/or stretching of the time axis.

Only if you always do the "stretching" by scaling the integrator input (which arguably is the natural thing to do). Otherwise you get pretty much the same problem as with DF2/TDF1 integrators, where the internal gain is cutoff dependent, which then leads to transient problems on modulation.

edit: oh I just realised you're suggesting to keep the actual integrator fully LTI and then treat the cutoff explicitly as part of the circuit.. sure that'd also work I guess, though I'm not entirely sure what the advantage would be (and the internal gain at resonance will still be variable, although I suppose it doesn't matter if you aren't planning to mess with the state)

Last edited by mystran on Sun Mar 19, 2017 1:23 am, edited 1 time in total.

<- plugins | forum

- KVRian
- 913 posts since 11 Apr, 2002

Looking e.g. at Fig.3.9 (DF2 integrator) of VAFilterDesign, which specific part of the integrator contains the coefficients b0 and b1 you mentioned?mystran wrote:Z1202 wrote:@mystran: why do you think that different BLT integrators are not equivalent? Except for potentially different precision losses, the integrators, being fully LTI, are not distinguishable from the outside.

Of course they are equivalent in the LTI case. However, as soon as you any time-varying or non-linear stuff going, the DF1/TDF2 forms are also equivalent to trapezoidal integration where as the DF2/TDF1 are not.

edit: Specifically, in DF2/TDF1 the feedforward part is after the feedback part, which means that in time-varying case the second feedforward coefficient (b1) will change one sample too early (if all coefficients are calculated at the same time). However, simply delaying the coefficient is insufficient, because the internal gain of the state variable is also dependent on the feedforward coefficients (as calculated in the "future") which means that the internal gain needs to be scaled as the coefficients change (with the complication that the b0 and (delayed) b1 coefficients need different scaling in the time-varying case). While it can be made to work, it's just pointless. Use TDF2.

Edit: or equivalently, since you were talking of TDF1, looking at Fig.3.8 and swapping the FIR and IIR parts.

- KVRAF
- 4795 posts since 11 Feb, 2006, from Helsinki, Finland

Z1202 wrote:Looking e.g. at Fig.3.9 (DF2 integrator) of VAFilterDesign, which specific part of the integrator contains the coefficients b0 and b1 you mentioned?

Edit: or equivalently, since you were talking of TDF1, looking at Fig.3.8 and swapping the FIR and IIR parts.

See my edit above. That said, if the feed-forward part goes first, one can use the full BLT with pre-warping and all directly on the integrators, which makes it a rather more fool-proof approach (and you can easily mess with the state too, make the integrator non-linear, whatever).

<- plugins | forum