Fast Modulation of Filter Parameters

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

Post

mystran wrote: Wed May 22, 2019 2:35 am
S0lo wrote: Wed May 22, 2019 1:13 am
Z1202 wrote: Tue May 21, 2019 5:29 pm As mentioned, this works only if resonance is sufficiently high so that the imaginary parts of the poles are away from zero. Particularly see 7.9 and 7.11 of you know which book ;) (dropping the imaginary part is equivalent to averaging with a conjugate filter's output).
Actually it should be possible to construct any resonating 2-pole this way.
On the other hand, serial connection probably doesn't suffer from this ill-conditioning, but doubles (effectively) the filter order and has complex transients.
I have skimmed through 7.11 very briefly to get the top lines. But let me take it from you before I decide to go deep into this or not. Is it possible to design a single CPS (or Complex resonator, or..etc) where we would simply drop the imaginary part and get exactly the desired 2-pole without ill-conditioned problems at any resonance value?
Not really. What we have is essentially a parallel implementation by partial fractional decomposition... but since we know the outputs of the two terms are conjugate for Q>.5 we can just compute one and take the real part and pretend we did a parallel sum.
I should have clarified that my question is really for this case. Where the two poles are conjugates. (The two different real poles case wouldn't work for sure. I'm aware of that). Given that I'm doing a serial connection (cascade) between the two 1-poles. I haven't tried a partial fraction (parallel connection), although I'm currently looking into it.

Given the above, Specifically how do you normalize it to have the desired gain? Say for an LP, you want 0db gain at z=1. Normally we equalize the amplitude response at the desired z (or s) to the gain we want, then solve for the gain coefficient. But this doesn't seam to be really working clear here. As the analytical transfer function is now a 1-pole, instead of the a 2-pole.

I tried both, normalizing for the 1-pole and 2-pole transfer functions. Doesn't seam to be giving the desired 0db gain a z=1 gain. The result is that the lower frequencies get heavily attenuated as soon as the cut-off becomes lower than 9Khz or so. The problem worsens with high resonance. While I have to say that normalizing for the 1-pole has less attenuation. But another problem that arised in this case is that the normalizing coefficient gets populated with a sqrt() function. Pretty unfortunate for the hoped for CPU saving.

The second thing I noticed clearly in a spectrum analyzer is the drop in the order/slope of the filter. Perhaps due to the ill-conditioning that Z1202 was talking about as far as I understand it. It's not apparent in the sound with high cut-off but clear with lower cut-off. Higher resonance does improve this just a little bit but not much. But Off-course this is just a mere eye observation without any quantification from my side. I could be miss-lead.
Last edited by S0lo on Fri May 24, 2019 3:50 am, edited 1 time in total.
www.solostuff.net
Advice is heavy. So don’t send it like a mountain.

Post

On second thought. May be you meant that it has to be done in parallel? I can kind of see why, like aliasing adds the other pair of the conjugate ?

Any way, the transfer function I'm getting with the partial fraction seams to be extremely complex. I could be doing some thing wrong though. Need to check further.
www.solostuff.net
Advice is heavy. So don’t send it like a mountain.

Post

S0lo wrote: Fri May 24, 2019 3:33 am Given the above, Specifically how do you normalize it to have the desired gain? Say for an LP, you want 0db gain at z=1. Normally we equalize the amplitude response at the desired z (or s) to the gain we want, then solve for the gain coefficient b0. But this doesn't seam to be really working clear here. As the analytical transfer function is now a 1-pole, instead of the a 2-pole.
When you treat it as a parallel sum of conjugates, you get a 2nd order transfer function.

Post

mystran wrote: Fri May 24, 2019 3:59 am
S0lo wrote: Fri May 24, 2019 3:33 am Given the above, Specifically how do you normalize it to have the desired gain? Say for an LP, you want 0db gain at z=1. Normally we equalize the amplitude response at the desired z (or s) to the gain we want, then solve for the gain coefficient b0. But this doesn't seam to be really working clear here. As the analytical transfer function is now a 1-pole, instead of the a 2-pole.
When you treat it as a parallel sum of conjugates, you get a 2nd order transfer function.
There is a detailed explanation in 7.9, but the basic idea is that the real part is equal to the average of conjugates.

Post

Z1202 wrote: Fri May 24, 2019 11:17 am There is a detailed explanation in 7.9, but the basic idea is that the real part is equal to the average of conjugates.
Assuming that what you meant is that, after zeroing the imaginary part of a CPS. the resultant transfer function becomes the average of the CPS transfer function and the CPS conjugate transfer function. Using this while keeping 2 zeros of an LP. The result actually is a 2-pole 3-zero LP (Or 3-pole 3-zero with the 3rd-pole at the origin). The response looks like this:

Imaginary_droped.png

Compared to the original 2-pole 2-zero:

Normal.png

From what I can see, there is a clear drop in slope. Investigating further. The 3rd zero created is bound to the real axis and is following the real coordinates of the 2-poles. The zero exhibits it's lowest attenuation when the cut-off is nearer to quarter the sampling rate as it becomes closer to the origin. Higher resonance would overcome it's effect as the poles go further apart from it, but I'm still not sure if that would increase the sonicly perceived (none asymptotic) slope significantly enough.

The filter is apparently stable at fast modulation as long as the cut-off is more than 0Hz.

Obviously there is always the probability of human error from my side.
You do not have the required permissions to view the files attached to this post.
www.solostuff.net
Advice is heavy. So don’t send it like a mountain.

Post

S0lo wrote: Sun May 26, 2019 9:03 pm
Z1202 wrote: Fri May 24, 2019 11:17 am There is a detailed explanation in 7.9, but the basic idea is that the real part is equal to the average of conjugates.
Assuming that what you meant is that, after zeroing the imaginary part of a CPS. the resultant transfer function becomes the average of the CPS transfer function and the CPS conjugate transfer function. Using this while keeping 2 zeros of an LP. The result actually is a 2-pole 3-zero LP (Or 3-pole 3-zero with the 3rd-pole at the origin).
I didn't check your math, but having 1-pole LP (complex or not) with 2 zeros is highly unusual. I mean, highly. Most likely there is a mistake.

Post

Z1202 wrote: Mon May 27, 2019 8:18 am
S0lo wrote: Sun May 26, 2019 9:03 pm
Z1202 wrote: Fri May 24, 2019 11:17 am There is a detailed explanation in 7.9, but the basic idea is that the real part is equal to the average of conjugates.
Assuming that what you meant is that, after zeroing the imaginary part of a CPS. the resultant transfer function becomes the average of the CPS transfer function and the CPS conjugate transfer function. Using this while keeping 2 zeros of an LP. The result actually is a 2-pole 3-zero LP (Or 3-pole 3-zero with the 3rd-pole at the origin).
I didn't check your math, but having 1-pole LP (complex or not) with 2 zeros is highly unusual. I mean, highly. Most likely there is a mistake.
hmmm, well if I don't put any zeros at nyquist it's not going to be an LP. It's just going to be a single peak filter. (I'm talking in the Z-domain)

Any way, analytically speaking. Averaging two conjugate pole transfer functions (without zeros) still does generate a real zero. The numerator becomes (1-R*x*z^-1) where R*x is the real component of the poles (R is the radius/resonance, x=cos(w)). This part was done by a symbolic solver so there is little chance of a mistake.
www.solostuff.net
Advice is heavy. So don’t send it like a mountain.

Post

S0lo wrote: Mon May 27, 2019 3:41 pmhmmm, well if I don't put any zeros at nyquist it's not going to be an LP. It's just going to be a single peak filter. (I'm talking in the Z-domain)

Any way, analytically speaking. Averaging two conjugate pole transfer functions (without zeros) still does generate a real zero. The numerator becomes (1-R*x*z^-1) where R*x is the real component of the poles (R is the radius/resonance, x=cos(w)). This part was done by a symbolic solver so there is little chance of a mistake.
You can have 1 zero in your CPS, e.g. the one at Nyquist. When you add them up, you can get 2 zeros, but not 3 zeros.

Post

Z1202 wrote: Mon May 27, 2019 4:10 pm
S0lo wrote: Mon May 27, 2019 3:41 pmhmmm, well if I don't put any zeros at nyquist it's not going to be an LP. It's just going to be a single peak filter. (I'm talking in the Z-domain)

Any way, analytically speaking. Averaging two conjugate pole transfer functions (without zeros) still does generate a real zero. The numerator becomes (1-R*x*z^-1) where R*x is the real component of the poles (R is the radius/resonance, x=cos(w)). This part was done by a symbolic solver so there is little chance of a mistake.
You can have 1 zero in your CPS, e.g. the one at Nyquist. When you add them up, you can get 2 zeros, but not 3 zeros.
Here is what I'm doing along with the solvers derivation. A CPS with no zeros (or 1-zero at the origin if you like):

https://www.symbolab.com/solver/step-by ... D%5Cright)

I suspect that I miss-understood what you meant by "average"

Edit: by the way, that denominator can be simplified further knowing that x^2+y^2=1
www.solostuff.net
Advice is heavy. So don’t send it like a mountain.

Post

S0lo wrote: Mon May 27, 2019 7:38 pmHere is what I'm doing along with the solvers derivation. A CPS with no zeros (or 1-zero at the origin if you like):

https://www.symbolab.com/solver/step-by ... D%5Cright)
Yes, and? Your solution has 2 zeros, which is completely fine. But not 3.

Post

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.

Post

Z1202 wrote: Mon May 27, 2019 8:50 pm
S0lo wrote: Mon May 27, 2019 7:38 pmHere is what I'm doing along with the solvers derivation. A CPS with no zeros (or 1-zero at the origin if you like):

https://www.symbolab.com/solver/step-by ... D%5Cright)
Yes, and? Your solution has 2 zeros, which is completely fine. But not 3.
The 3 wasn't for that one. It was for a 1-pole with 2-zero at nyquist.
Last edited by S0lo on Tue May 28, 2019 11:15 am, edited 1 time in total.
www.solostuff.net
Advice is heavy. So don’t send it like a mountain.

Post

Z1202 wrote: Mon May 27, 2019 8:50 pm
S0lo wrote: Mon May 27, 2019 7:38 pmHere is what I'm doing along with the solvers derivation. A CPS with no zeros (or 1-zero at the origin if you like):

https://www.symbolab.com/solver/step-by ... D%5Cright)
Yes, and? Your solution has 2 zeros, which is completely fine. But not 3.
The 1st zero here is at the origin. which practically means it doesn't exist. The 2nd zero has been generated because of the averaging. If aliasing behaves this way. I have no problem with it :)
www.solostuff.net
Advice is heavy. So don’t send it like a mountain.

Post

Z1202 wrote: Mon May 27, 2019 8:50 pm
S0lo wrote: Mon May 27, 2019 7:38 pmHere is what I'm doing along with the solvers derivation. A CPS with no zeros (or 1-zero at the origin if you like):

https://www.symbolab.com/solver/step-by ... D%5Cright)
Yes, and? Your solution has 2 zeros, which is completely fine. But not 3.
To clarify, here is the same thing with only 1-zero in the result:

https://www.symbolab.com/solver/step-by ... D%5Cright)
www.solostuff.net
Advice is heavy. So don’t send it like a mountain.

Post

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.

Post Reply

Return to “DSP and Plugin Development”