About this zero-delay feedback again (sorry)

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

Urs wrote:
Caco wrote:
Urs wrote:
Caco wrote:Another fun property of all this is that the more you oversample then the fewer iterations you need to do so oversampling ends up being really cheap :)
Unless your prediction comes up with a correct initial guess most of the time :-)
Cool, at the moment I average around four iterations at most filter settings but the iterations creeps up quite a bit at extreme resonance and cutoffs though.
Yes, high resonance becomes a cpu killer.

But take an example: In a synthesizer you actually know what's going into the filter (oscillator waveforms, white noise etc.). And once the filter goes into selfoscillation you also know what's happening. So you can take these cases into account when preparing your initial guess.

;) Urs
I hadn't thought of it that way. So far I have been using the filter in effects rather than in a synth so I cannot predict what the input looks like in advance. I suppose when I am in self-oscillation I can start to build up a good idea of what the output should look like to help shape my initial guess better :)

Post

Yeah, that's one of the reasons why we haven't done any audio inputs yet... it may fry cpus even more :lol:

Post

Urs wrote:Hmmm... in contrast to my earlier beliefs, I'd say that a basic LPF doesn't have a feedback. It has a state.
Hi Urs!

I'd rather argue that point and say that a basic 1-pole LPF does have a negative feedback around an integrator. I wonder what makes you say otherwise?

Regards,
{Z}

Post

Z1202 wrote:
Urs wrote:Hmmm... in contrast to my earlier beliefs, I'd say that a basic LPF doesn't have a feedback. It has a state.
Hi Urs!

I'd rather argue that point and say that a basic 1-pole LPF does have a negative feedback around an integrator. I wonder what makes you say otherwise?
Yes, but that's just one way to conceptualize it. As long as the one-pole filter has no non-linearities, you can assume it's free of that feedback and use most standard formulas without loss of quality.

Then again, everything that has a "z" in the denominator of it's transfer-function has 'feedback' in one way or the other. Doesn't always mean that we have to model it that way!

Cheers,
- Clemens

Post

cheppner wrote:
Z1202 wrote:
Urs wrote:Hmmm... in contrast to my earlier beliefs, I'd say that a basic LPF doesn't have a feedback. It has a state.
Hi Urs!

I'd rather argue that point and say that a basic 1-pole LPF does have a negative feedback around an integrator. I wonder what makes you say otherwise?
Yes, but that's just one way to conceptualize it. As long as the one-pole filter has no non-linearities, you can assume it's free of that feedback and use most standard formulas without loss of quality.

Then again, everything that has a "z" in the denominator of it's transfer-function has 'feedback' in one way or the other. Doesn't always mean that we have to model it that way!

Cheers,
- Clemens
This is not fully correct. You get a somewhat different time-varying behavior if you don't preserve the analog topology. In some cases it gets critical.

Post

Z1202 wrote:
cheppner wrote:Yes, but that's just one way to conceptualize it. As long as the one-pole filter has no non-linearities, you can assume it's free of that feedback and use most standard formulas without loss of quality.
This is not fully correct. You get a somewhat different time-varying behavior if you don't preserve the analog topology. In some cases it gets critical.
Can you give an example where this is visible in the linear case?

Cheers,
- Clemens

Post

cheppner wrote:
Z1202 wrote:
cheppner wrote:Yes, but that's just one way to conceptualize it. As long as the one-pole filter has no non-linearities, you can assume it's free of that feedback and use most standard formulas without loss of quality.
This is not fully correct. You get a somewhat different time-varying behavior if you don't preserve the analog topology. In some cases it gets critical.
Can you give an example where this is visible in the linear case?

Cheers,
- Clemens
I didn't perform this experiment myself. Rather I got feedback from another guy, where he replaced a DF implementation of a 1-pole with a TPT one and got much better results. I'd suggest you simply run a DF and a TPT version in parallel and apply audio-rate modulation to the cutoff. I guess pretty much independently of the modulation signal you'll get different outputs from both filters. On an intuitive level, the output of a TPT filter is picked up from an integrator, so, thinking in continuous-time terms, there can't be any discontinuities in the output signal, no matter what the modulation signal is. This doesn't hold for DF.

You probably could also try analyse this the other way round, applying a TPT conversion from discrete time to continuous time to the DF filters. I guess the inverse BLT will correspond to approximating z^-1 by an allpass, although I'm not sure. Then, particularly, you can check whether there are any cutoff-dependent gain factors directly connected to the output (without an integrator in between).

A simplest possible example demonstrating the importance of topology in the linear time-varying cases is probably a serial connection of a gain and an integrator. Depending on the order of connection, you obviously get different results when modulating the gain.

In theoretical terms, the standard analog-to-digital conversion techniques are developed for LTI filters. Nonlinear filters are obviously not LTI, but neither are linear filters in the time-varying case. Thus, a transfer function only gives you information about an LTI system's behavior. In linear time-varying cases you rather need to compare their state-space representations.

Regards,
{Z}

Post

Z1202 wrote:
cheppner wrote:
Z1202 wrote:
Urs wrote:Hmmm... in contrast to my earlier beliefs, I'd say that a basic LPF doesn't have a feedback. It has a state.
Hi Urs!

I'd rather argue that point and say that a basic 1-pole LPF does have a negative feedback around an integrator. I wonder what makes you say otherwise?
Yes, but that's just one way to conceptualize it. As long as the one-pole filter has no non-linearities, you can assume it's free of that feedback and use most standard formulas without loss of quality.

Then again, everything that has a "z" in the denominator of it's transfer-function has 'feedback' in one way or the other. Doesn't always mean that we have to model it that way!

Cheers,
- Clemens
This is not fully correct. You get a somewhat different time-varying behavior if you don't preserve the analog topology. In some cases it gets critical.
Okay, I still believe your explanation is not generally correct for the reasons mentioned. However, a 1-pole TPT lowpass (using a transposed DF2 integrator) seems to be fully equivalent (toplogiically!) to a 1-pole transposed DF2 lowpass. I don't think it holds for any other filter types, including HP1, though.

Regards,
{Z}

Post

Hi Z1202,

yes I wasn't sure about these things after your comment and I did some analysis of simple RC-lowpass filters.

It came out that if you choose the capacitor to be time variable and set the node equation to

Code: Select all

V = integrate( I/capacitance )
it does result in an equation where the multiplication needs to be _before_ the integrator (which intuitively makes sense). Nevertheless, you can make a simple formula out of that in the linear case even for a bilinear integrator.

Didn't have the time right now to write that up but maybe later I will.

Cheers,
- Clemens

Post

cheppner wrote:It came out that if you choose the capacitor to be time variable
You mean "state variable", right? What else would you choose as a state variable??? Capacitor is the only thing in there which has a state and that state is the capacitor charge, which in case of constant capacitance is equivalent to capacitor voltage being the state.
it does result in an equation where the multiplication needs to be _before_ the integrator (which intuitively makes sense).
Of course, because the result is smoother then than otherwise :)
Nevertheless, you can make a simple formula out of that in the linear case even for a bilinear integrator.
Not sure what you're referring to here.

Regards,
{Z}

Post

Z1202 wrote:
cheppner wrote:It came out that if you choose the capacitor to be time variable
You mean "state variable", right? What else would you choose as a state variable???
Of course you need a state variable inside the integrator. What I was referring to was the actual RC-circuit:

Code: Select all

in ---- R ------ out
           |
           = C
           |
------------------ (gnd)
If you vary the capacitance of the capacitor to adjust the cutoff frequency, you get a filter where the multiplication must be before the integrator. (edit: wrong:) If you would vary the resistance instead, you would have the non-smooth filter you've described with the multiplication afterwards.

This is not a circuit that would be used for a VCF. I just picket it for simplicity. Active filters with opamps etc. are an open question to me.

edit: This part is not correct... Simply a mistakt in my maths:
What I found interesting is that varying the resistance does not give the smooth solution - which posts the question if there are some VCF circuits with that non-smooth behaviour ;)

Cheers,
- Clemens
Last edited by cheppner on Tue May 01, 2012 8:29 am, edited 1 time in total.

Post

I'm not convinced that it makes any difference what the exactly topology of one-poles (leaky or not) happens to be, or even what transform you use for s-to-z.

As far as I can see, the only thing that's really relevant is that you maintain your state independent of cutoff (ie you can take the state only, and treat it as a "voltage" without knowing what the cutoff happens to be).

edit (since I guess the above might not have been entirely clear):

basically, in the time-invariant case it doesn't matter whether values are scaled during this sample or the next (or equivalently before or after storing the state variables) as long as the result is the same; the scalar multipliers are constant so one can combine and re-order them as desired, typically to minimize the work-load.. but in the time-variant case this is no longer safe because the scalars are no longer scalars

For example, one can modify DF2 to be safe for time-variance (and assuming BLT low-pass just to have one less coeff), starting with the usual (input x, output y, state s):

s[n] = x[n] - a*s[n-1]
y[n] = b * (s[n] + s[n-1])

Modify by making the state independent of cutoff (ie get rid of b in the zeroes):

s[n] = b*x[n] - a*s[n-1]
y[n] = s[n] + s[n-1]

The LTI response is the same, but since we scale on input, the gain of the state-variable doesn't depend on cutoff anymore; if we have the signal s[n], we can construct y[n] without knowing what the coefficients were. I'm proposing that this is the only condition that one needs to have a "nice" time-variant behavior [edit2: of a single one-pole section at least].

Post

that is how you build a vcf, actually.

this whole issue is the difference between a*x + b*x vs. x(a + b).
Free plug-ins for Windows, MacOS and Linux. Xhip Synthesizer v8.0 and Xhip Effects Bundle v6.7.
The coder's credo: We believe our work is neither clever nor difficult; it is done because we thought it would be easy.
Work less; get more done.

Post

Btw:

out = buf + f * in
buf = out + f * in

transformed "delay-less" (as per neotec, just simplified):

tmp = (in - buf) / (1 + f)
out = buf + f * tmp
buf = out + f * tmp

it turns out the last line can be rewritten simply as:

buf += 2*f * ( in - out )

Sorry if someone mentioned that already...
... could be useful for some things ...

Post

mystran wrote:basically, in the time-invariant case it doesn't matter whether values are scaled during this sample or the next (or equivalently before or after storing the state variables) as long as the result is the same; the scalar multipliers are constant so one can combine and re-order them as desired, typically to minimize the work-load.. but in the time-variant case this is no longer safe because the scalars are no longer scalars
Yes!
For example, one can modify DF2 to be safe for time-variance (and assuming BLT low-pass just to have one less coeff), starting with the usual (input x, output y, state s):

s[n] = x[n] - a*s[n-1]
y[n] = b * (s[n] + s[n-1])

Modify by making the state independent of cutoff (ie get rid of b in the zeroes):

s[n] = b*x[n] - a*s[n-1]
y[n] = s[n] + s[n-1]
Yes, but this is kind of do-it-wrong-first and then repair the integrator. The question really should be, in my opinion, how did we get to the formular of the wrong integrator at first and how can we avoid that?

My proposal is: Via analog circuit transformation WITHOUT assuming that the control-signal was time-independent at all!
I'm proposing that this is the only condition that one needs to have a "nice" time-variant behavior [edit2: of a single one-pole section at least].
Yeah, but what if your filter circuit doesn't sound like it? I mean, we might get a nice AM-like effect with audio-rate modulations if we use the 'dirty' implementation. Or we can get a mixture by multiplying with sqrt(b) before and after!

Cheers
- Clemens

Post Reply

Return to “DSP and Plugin Development”