Fast Modulation of Filter Parameters

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

Z1202 wrote: Tue May 28, 2019 12:30 pm
S0lo wrote: Mon May 27, 2019 9:09 pmThe 3 wasn't for that one. It was for a 1-pole with 2-zero at nyquist.
You should be able to do with just 1 zero. Your goal 2-pole function should have no more than 2-zeros and (assuming the poles are complex) it should be expressible as an average of two complex 1-poles without any zeros mixed with the input (unfiltered) signal added to that or something like that. Mixing coefficients need to be found out. I'm not sure whether allowing 1-poles to have 1-zero will remove the need to mix in the input signal or not, but you shouldn't have 2 zeros in a 1-pole.

See partial fraction expansion for more detail.
All the zeros at nyquist (weather 1 or 2 or none) are put in serial prior to the pole. So they are just input to the 1-pole in all 3 cases. For example here is the 1-zero case:

Code: Select all

temp=re;
re = b0*(in0 + in1) + R*(x*re - y*im);
im = R*(x*im + y*temp);
out0 = re;
No mixing is done what so ever.

I tried all cases, no-zeros, 1-zero and 2-zero. In all cases, droping the imaginary part after the 1-pole to relief some CPU, causes the resultant slope to be as shown above. Slightly shallower than expected. Nothing is for free.

The reason I needed the transfer function is because I need to normalize it. i.e. find the b0 coefficient.

On paper, In all cases, weather I include the zeros in the transfer function or not, averaging generates an extra real zero that follows the real component of the poles (i.e not fixed to nyquist). If averaging is really what dropping the imaginary part does (which indeed seams correct), then that shallow slope is probably caused by that extra zero attenuating the poles. Thats all I wanted to say. Not trying to be too picky about it.
www.solostuff.net
Advice is heavy. So don’t send it like a mountain.

Post

S0lo wrote: Wed May 29, 2019 12:08 amAll the zeros at nyquist (weather 1 or 2 or none) are put in serial prior to the pole. So they are just input to the 1-pole in all 3 cases.
Normally the zeros would be "automatically" generated by mixing, if you properly tune the mixing coefficients(that is you can place them anywhere you want, but you need to find the mixing coefficients). That's the idea. If you try to "manually" add zeros, you may end up with having "extra" ones.

Post

E.g.

Code: Select all

(z+1)(z-1)         1/2+j       1/2-j
---------- = 1 + --------- + ---------
 z^2-z+1/2       z-(1+j)/2   z-(1-j)/2

Post

Z1202 wrote: Wed May 29, 2019 8:42 am E.g.

Code: Select all

(z+1)(z-1)         1/2+j       1/2-j
---------- = 1 + --------- + ---------
 z^2-z+1/2       z-(1+j)/2   z-(1-j)/2
EDIT: fixed a few thingies bellow

This clarifies allot. So we basically have:

Noname.jpg

I left the second zero out of it in serial. Finding the coefficients cr and ci leads to:

cr=1
ci=-(1/R + x)/y;

Final code works well. And the slope is perfect. However, not much to the CPU saving. Because ci now is an additional complex coefficient that wasn't needed before which involves 2 divisions and 1 addition . The original line that calculated the second pole is:

out0 = re1 + R*(x*out0)

Which involves 2 multiplications and 1 addition. This was supposed to be our saving. Which is now counter acted by ci calculation.

Edit: Actually it even requires more operations since now the imaginary part has to involve an extra multiplication and addition

Code: Select all

im = ci*in0 + R*(x*im + y*temp); 
instead of:

Code: Select all

im = R*(x*im + y*temp); 
However, I have to say that this thing sounds different at fast modulation. Different than both TPT and the CPS in the article!!. And I do like it, it has less gain jumps at high resonance.
You do not have the required permissions to view the files attached to this post.
Last edited by S0lo on Mon Jul 08, 2019 6:32 pm, edited 1 time in total.
www.solostuff.net
Advice is heavy. So don’t send it like a mountain.

Post

mystran wrote: Mon May 27, 2019 8:53 pm In the beginning, Mother Earth created the man and she saw that the man was lost in his filter design. So she created the state variable filter for the man to use, such that the man wouldn't have to be lost anymore. But man was stubborn and wanted to use digital filters on his digital computer. So she created the trapezoidal integrator, such that man could use a digital state variable filter with his digital computer. And man was happy with this digital state variable filter using the trapezoidal integrator and everything was good, until suddenly Mother Earth died due to catastrophic ecosystem collapse that man had caused covering every nook and cranny in plastic and by releasing excessive carbon dioxide into the atmosphere in order to generate electricity to mine blockchain-hashes with his digital computer ... but like ... fnord.
Signaldust, any chance you could assist with a new version of your convolution plugin - 32 bit and 64 bit, which did not have the restrictions of high and low pass filters (or these could be turned off)...?

Post

kodebode2 wrote: Tue Jun 11, 2019 4:04 pm Signaldust, any chance you could assist with a new version of your convolution plugin - 32 bit and 64 bit, which did not have the restrictions of high and low pass filters (or these could be turned off)...?
Offtopic... but yeah, there is some chance I might revisit the topic of convolution one day, but don't hold your breath, because it's almost certainly not going to happen within the next three years.

Post

mystran wrote: Tue Jun 11, 2019 6:51 pm
kodebode2 wrote: Tue Jun 11, 2019 4:04 pm Signaldust, any chance you could assist with a new version of your convolution plugin - 32 bit and 64 bit, which did not have the restrictions of high and low pass filters (or these could be turned off)...?
Offtopic... but yeah, there is some chance I might revisit the topic of convolution one day, but don't hold your breath, because it's almost certainly not going to happen within the next three years.
I only saw this now after many months. I am honored by your response, I will wait for as long as it takes, assuming I am still alive.. your work is valuable to many of us, and it would be a pleasure to look forward to a copy of your unfiltered convolution plugin, at such a time in the future as you are ready for this.

Post

I read Solo's paper:

http://www.solostuff.net/wp-content/upl ... v1.1.1.pdf

But I don't understand why BIBO-stability is enough to guarantee stability under modulation. It sounds like it guarantees that the filter does not "explode to infinity", but how does it say anything about whether changing the parameters could produce clicks or small pops?

Or in other words, how does BIBO-stability tell us anything about, whether the filters at different cut-offs are even the same filter shape?

---

Actually, maybe it doesn't:

https://www.zhdk.ch/file/live/48/48904a ... tion_2.pdf

So the filter shapes can surely be different at different cut-off frequencies. However, what guarantees that the changes are smooth?

Or do we, for example, study in addition that the filter is a continuous function? In other words, then it must be continuous between parameter values?

Post

soundmodel wrote: Fri May 17, 2024 5:40 pm But I don't understand why BIBO-stability is enough to guarantee stability under modulation. It sounds like it guarantees that the filter does not "explode to infinity", but how does it say anything about whether changing the parameters could produce clicks or small pops?
As far as I can tell it doesn't automatically mean that there is no clicks and pops, but it means that modulation cannot cause transients such that the "energy" stored in the filter increases, at least not in a way where we could keep "pumping" more and more energy into the transients and violate the BIBO stability that way. As it turns out, this sort of "pumping more energy by modulation" is one of the typical instability symptoms in less well behaved filters.

It doesn't so much guarantee "no clicks or pops" but rather just forbids the most common reason.
Or in other words, how does BIBO-stability tell us anything about, whether the filters at different cut-offs are even the same filter shape?
It does not.
So the filter shapes can surely be different at different cut-off frequencies. However, what guarantees that the changes are smooth?
You can do this on purpose too if you want, it's orthogonal to the question of stability.

Post

Then how do we get no clicks and pops?

Cross-fade between filters? Some other tricks?

Post

soundmodel wrote: Fri May 17, 2024 7:07 pm Then how do we get no clicks and pops?

Cross-fade between filters? Some other tricks?
BIBO stability only insures that the filter is not divergent. Meaning you wont get a numerical overflow. ie. the output and memory variables will not go to ∞ or -∞

I'm not sure what you mean by "clicks and pops". But I assume you mean, "undesirable temporary/transient high output" ?. BIBO stability doesn't insure that doesn't happen.

Actually its likely that if "clicks and pops" happen during fast modulation, then they will probably be happening constantly all the time way faster than you can spot them by your ears as pops and clicks. But rather a violent character in filter sound.
Last edited by S0lo on Sat May 18, 2024 2:09 am, edited 1 time in total.
www.solostuff.net
Advice is heavy. So don’t send it like a mountain.

Post

I talked about having clicks and pops when switching at any speed to another frequency, because the new filter is not guaranteed to be of the same shape as the earlier. Thus it may have different pass- and stop-band characteristics, i.e. it will leak other parts. Compare this to suddenly changing a crossfader in two samples.

E.g. this paper discusses this, but it's certainly newer than what filters may already have implemented something similar:

SUPPRESSION OF TRANSIENTS IN TIME-VARYING RECURSIVE FILTERS FOR AUDIO SIGNALS

Vesa Välimäki and Timo I. Laakso
http://users.spa.aalto.fi/vpv/publicati ... 8-trel.pdf

Post

The fundamental problem is that "clicks and pops" is really quite difficult to precisely formulate mathematically and that's what you need to actually prove that there's no "clicks and pops" in a given filter.

Practically speaking, we do know that normalized ladders and many filters based on trapezoidal integration are "safe" and it is relatively straight-forward to show why this is intuitively so: in some sense it is because the "state" in these filters is meaningful without dependence on the instantaneous set of coefficients, typically for two-poles this would mean having the two state variables in quadrature with no cutoff dependent scaling. Perhaps this is too strict, perhaps it is sufficient for the state-trajectory to remain continuous, but the point is that "clean" filters can be constructed.

However, in order to prove that such filters are "clean" we would need to formally define what "clean" (or "free of clicks and pops") means mathematically... and that proves to be a problem much more difficult than constructing clean filters in the first place.

ps. It doesn't exactly help with the problem (of finding a condition to prove) that in discrete-time "continuity" is never truly a thing, because depending on your view point (ie. pre- vs. post-reconstruction) either nothing or everything is continuous in some sense. For trapezoidal filters you could prove the analog prototype remains continuous under modulation and then rely on the fact that trapezoidal rule is a consistent A-stable method... but that's still a bit hand-wavy and doesn't really help with filters not based on integration.

Post

mystran wrote: Fri May 17, 2024 8:55 pm Practically speaking, we do know that normalized ladders and many filters based on trapezoidal integration are "safe" and it is relatively straight-forward to show why this is intuitively so: in some sense it is because the "state" in these filters is meaningful without dependence on the instantaneous set of coefficients, typically for two-poles this would mean having the two state variables in quadrature with no cutoff dependent scaling. Perhaps this is too strict, perhaps it is sufficient for the state-trajectory to remain continuous, but the point is that "clean" filters can be constructed.
Can you clarify this?

So e.g. based on https://www.musicdsp.org/en/latest/Filt ... -code.html ?

But this sounded the same as having the output y[n] be a continuous, bounded function. Because that means that its new values will always be near the previous ones and they will never be Inf/-Inf. But this is in fact trivial, because at computation y[n] is only constants, but maybe one needs to also verify that the functions in it are continuous and bdd over their domains.

Yes, this is the sufficient criterion? If the components of y[n] are continuous and bounded, then y[n] cannot produce values that would "jump" (i.e. be clicks or suchs).
Last edited by soundmodel on Sat May 18, 2024 9:08 am, edited 4 times in total.

Post

mystran wrote: Fri May 17, 2024 8:55 pm The fundamental problem is that "clicks and pops" is really quite difficult to precisely formulate mathematically and that's what you need to actually prove that there's no "clicks and pops" in a given filter.
A filter will pop, if the filter cannot be swept at full audio-rate (per sample basis ideally) so that the next filter shape has all its magnitude values within a certain distance from the earlier filter shape? I.e. that the filters always sweep near to each other. If the distance is small enough, then there should be no more audible click than what a change in a normal sample value has.

Post Reply

Return to “DSP and Plugin Development”