## Steepest-slope 2nd-order resonant filter?

Started by 7 years ago●6 replies●latest reply 7 years ago●592 viewsHi there

I'm trying to reverse engineer a nice resonant filter that INA-GRM released commercially as a VST plug-in back in the '90s. According to their documentation (if it's to be believed), the filter is just a second-order bandpass (or peaking EQ?), but with an extremely steep slope.

So I'm looking for a filter design that has a slope of at least 48dB per octave — and I don't mind if it's FIR or IIR. I also don't mind about ringing, ripple, or phase problems. The impulse response should be an exponentially decaying cosine wave.

I've tried the biquad filter from the RBJ cookbook, but the rolloff doesn't seem to be steep enough, and lets through too much of the lower frequencies.

Any thoughts?

Thanks, Michael

Hi Michael,

something is not clear in your request. The order of a filter is directly to its slope (and vice versa). A second order filter is -12dB/octave, no more, no less.

If you play with RBJ EQ and you want to achieve higher slopes, you have to cascade them accordingly. Since a biquad is -12dB/oct, you need to cascade four of them to reach the expected -48dB/octave

Now, I see two possible interpretations of the "extremely steep slope" of the VST plugin (apart the pure commercial "bla-bla").

First possible explanation: they have used a very high Q in their filter (since it's a bandpass), which gives a very steep slope around the resonance frequency. There would be possibly saturation issues, but since I don't know these plugins, I can't tell

Second possible explanation: they have used a Chebyschev approach, which led to highest possible slope. But even with a Cheby polynomial, you can't achieve -48dB/oct with a second order filter. Moreover, this would lead to a lot of ripple, which I don't see compatible with audio EQ applications.

So I would recommend first to sort the different parameters from this filter (is it a 2nd, a 4th or a 8th order filter?) This would then be easier to see which path you have to follow for this reverse engineering

Benoit

How about just measuring it to see what's going on?:

https://ccrma.stanford.edu/realsimple/imp_meas/

I agree that a "second-order bandpass with an extremely steep slope" can only refer to the locally steep slope near the resonance frequency ("high Q"), or the locally steep slope caused a nearby zero. There is no way to get more than -12 dB-per-octave asymptotic roll-off in a second order filter of any kind.

What everyone else is saying -- the best you'll get out of a 2nd-order lowpass, away from the peak, is 12dB/octave. The best you'l get out of a 2nd-order bandpass is 6dB/octave (because each pole gives slope on each side). Close to resonance you can get a slope that's as near infinite as you're willing to go, by increasing the Q of the filter, but that's just a local phenomenon.

You don't say whether you need a bandpass, lowpass, or what, but for 48dB/octave over more than a few octaves you need 6 poles in play -- so a 6-pole lowpass filter, or a 12-pole bandpass (assuming a symmetric response). Not worrying about ringing, ripple or phase makes the filter design task easier, but if you want a *perfect* damped cosine wave decay, then the task gets harder -- in general, each pole of an IIR filter will contribute its own decaying sinusoid, with it's own frequency and decay rate. This may not add up (literally) to what you want.

Michael,

If it helps and to simply amplify what others have said:

*The maximum possible slope of any band edge of a filter response is inversely related to the length of the impulse (or unit sample) response. *

Any nitpicking variations on this assertion will be slight. So, if it's a FIR filter then you have a rather direct notion of what the filter might be like - and, in the case you've specified, it would have coefficients that match the "decaying cosine wave". With that many apparent samples in the impulse response, the order of the filter will be quite large.

Building a filter with passband ripple doesn't really improve the fundamental slope limit here.

When you say "ringing", it generally implies time domain response ("ripple" has already been mentioned) which is directly related to the impulse response and is generally what results from a step input. So that's easy to calculate with a simple convolution.

I'm also a bit concerned about the specification of *cosine* in the impulse response. This implies the response at zero time but I think you would probably mean you want it to be "positive in the center of the impulse response (if FIR)" and decaying in both directions from the peak. Then you would have a narrow bandpass filter response with a symmetrical (time offset) impulse response.

I'm a little late to the discussion, but you could try this out in ASN Filter script, and see the results for yourself (the real time updates help greatly), and modify the code to include more filters. Here's the code to get you started:

// This example is a programmable Peaking or Bell filter based

// on an all-pass filter configuration.

// Peaking filters are typically found in audio applications

// as a method of performing magnitude equalisation.

//

// The variable K, 0.1<=K<=3 is used to specify gain/sign of peak.

//

// Copyright Advanced Solutions Nederland 2015

// Revision: 1.00, 18 November 2015

ClearH1; // clear primary filter from cascade

interface BW = {0,2,0.1,0.5}; // filter bandwidth

interface fc = {0, fs/2,fs/100,fs/4}; // peak/notch centre frequency

interface K = {0,3,0.1,0.5}; // gain/sign

Main()

k1=-cos(2*pi*fc/fs);

k2=(1-tan(BW/2))/(1+tan(BW/2));

Pz = {1,k1*(1+k2),k2}; // define denominator coefficients

Qz = {k2,k1*(1+k2),1}; // define numerator coefficients

Num = (Pz*(1+K) + Qz*(1-K))/2;

Den = Pz;

Gain = 1;

****

Good luck! -Sanjeev.

Thanks everyone for your help. In the end, a standard biquad BPF using the RBJ cookbook worked. For some reason that eludes me, I wasn't getting the right degree of resonance out of it for ages, and then I tweaked something and suddenly it worked. Darned if I know what I did to fix it.

In any case, I am now happily emulating the GRM Reson with a simple biquad, which, happily, can be hardware accelerated as Apple includes a hardware-optimized biquad routine in its Accelerate framework.