Example of how to use the FilterDesign stuff? (dsp module)

dsp_module

#1

I’ve started to have a go at using the dsp module, but I’m having a lot of trouble. I want to use a high order low pass filter, preferably a butterworth. I’ve been following the example project here: https://github.com/WeAreROLI/JUCE/tree/master/examples/DSP%20module%20plugin%20demo/Source

I’m finding this example slightly confusing itself, I’m not familiar with the ‘ProcessorDuplicator’ or the ‘ProcessContextReplacing’ stuff. I declared my filter as done in that example, but it seems it’s initialized expecting a “dsp::IIR::Coefficients”, e.g. in the example it’s initialized like:

lowPassFilter (dsp::IIR::Coefficients::makeFirstOrderLowPass (48000.0, 20000.f))

However, I suppose I want to use designIIRLowpassHighOrderButterworthMethod() from here. Problem is, this returns an array of IIR::Coefficients rather than a single one, I’ve no idea how I’m supposed to use this to initialize my filter.

Any example usage of setting my filter to be of these FilterDesign types would be very useful. Also why is only low pass filter designs available?

Cheers.


#2

If it returns a list of coefficients then it’s meant to be used as a cascading filter. This means you need to create several IIRFilters in series for each Coefficient element in the array.


#3

Ah right, I was hoping there would be a generalized class that implements this stuff internally.