Higher order & slope filters in Juce Framework

I want to create a -96 dB/octave LowCut filter for juce plugin application. However, the Riley Filter and Ladder Filter have a maximum of -24 dB/octave. How can I achieve -96 dB/octave?

The easy answer is just to chain filters, i.e. three 24 dB/oct filters in series will result in a 96 dB/oct roll-off.

2 Likes

You need to be careful to choose the correct Q values when cascading filters like this: Cascading filters | EarLevel Engineering

2 Likes

You usually don’t want a ladder filter unless you’re programming something like a synthesiser, that is, they’re usually coloured using drive and saturation. The Linkwitz-Riley filter is generally used for cross overs so depending on what you’re doing you might want one of those.

If you’re just wanting a filter that’s relatively steep then a Butterworth filter might do. You can get it by cascading 12dB IIR filters with specific Q settings - I think another responder here gave the Earlevel site link that goes into some detail what those Q settings are and how to calculate them. Just be aware that the steeper the filter is, the more you may get artefacts around the corner frequency.

On the other hand, if you’re wanting to do half-band limiting to get rid of aliasing as part of an oversampling set up then the JUCE oversampling library code manages all that in a reasonable way using polyphase filters.

2 Likes

Really thanks for this beautiful suggestion. I was looking for such a link to help with understanding the essentials and calculations

2 Likes

I want to set the ORDER number to 16th order in the Butterworth filter to achieve -96db/octave CUTOFF, but the ORDER number doesn’t have the slightest effect; there’s not even a 1db difference between order 1 and order 10 (I checked with a spectrum analyzer in Cubase and by ear). Did I use the ORDER incorrectly in this code? Why is it ineffective?


using StereoFilter = juce::dsp::ProcessorDuplicator<juce::dsp::IIR::Filter<float>,
        juce::dsp::IIR::Coefficients<float>>;
    juce::dsp::ProcessorChain<StereoFilter> processChain;
    enum ChainIndex { HPF };


//set filter order and cutoff frequency 
void NewProjectAudioProcessor::setHPF(float frequency, int slope)
{   
    *processChain.get<ChainIndex::HPF>().state =
        *juce::dsp::FilterDesign<float>::designIIRHighpassHighOrderButterworthMethod(
            frequency, spec.sampleRate, 2 * (slope+1))[0];
}

I searched the examples and all the examples I could find use chained dsp::IIRFilters. I wonder if there’s any way to get a higher ordered filter with creating a single instance of dsp::IIRFilter.

Or is the dsp::IIRFilter is fixed at 12db/oct? Sorry for this begginner question but I’ll be very pleased if someone help with understanding this.

Although it’s possible to create a single high-order IIR filter, in practice such filters are not very robust. They are very sensitive to small changes in their coefficients, and such changes are frequently introduced when quantising the coefficients to represent them as doubles/floats. Quantisation error in the coefficients can result in the filter becoming unstable.

Low-order filters such as biquad filters are normally less susceptible to instability due to coefficient quantisation, which is one reason why filter designers will often choose to implement a high-order filter as a series of low-order filters.

2 Likes

Thank you so much. I understand now why it’s preferred to use chained low ordered filters instead using a single one. So it’s possible to get a single high ordered juce::IIRFilter. Is there any juce documentation or any source which you can suggest if I’d like to achieve this in this way? Thanks again