Announcing a new package: Filter

Isabel Kaspriskie's icon

I'm excited to announce the arrival of a new package to the Package Manager — Filter.

Filter is a set of MSP and Jitter IIR filter externals for the Butterworth, Chebyshev Type-I/Type-II, elliptic, Legendre, and Bessel filter topologies. The package also includes one-pole filter with two outlets for simultaneous lowpass and highpass outputs as well as a DC blocker.

If you've been following along with the Demystifying Digital Filters tutorial series, this package pairs nicely with Part 3 and Part 4 which discuss the inner workings of these IIR filter objects.

If you're curious about looking into the source code, the package itself is open source and located on GitHub here.

You can download it now from the Package Manager.

srs's icon

This looks great! Is there anything in this package which can implement a transparent 3-band crossover filter?

Similar to what is described in the Crossover Filter Design Video Tutorial but for 3 bands instead of just two..

Isabel Kaspriskie's icon

Bessel filters work well in crossover filter applications. :)

srs's icon

Ah yes - as it clearly states in the image above! : )

Do you know of any example patches that implement a transparent 3-band crossover filter using the Bessel approach (if that is the ideal one) ?

There is a great 2-band version covered in the Crossover Filter Design video tutorial but I can’t find a 3-band example in Max anywhere..

There is this diagram from another thread but the exact filter topologies and orders aren’t clear

via this thread: https://cycling74.com/tutorials/crossover-filter-design-video-tutorial/

Isabel Kaspriskie's icon

I haven't tried them out myself, but there look like some examples in the thread you've linked.

srs's icon

I thought so too, there a lots of suggestions and questions but after trying them out (such as the attached patch of the diagram above), I haven't got to a working version yet as I don't know exactly what filter types to use.

3-band crossover.maxpat
Max Patch

After inverting the phase of the crossover output to test against the original signal, it doesn't seem to be a transparent 3-band split.

It seems like it is possible to create one in Max but I've yet to find a configuration of filters that works..

Roman Thilenius's icon


that picture i posted there is from linkwitz himself and it refers to an (analog) 4-times-cascade of (3db each) butterworth filters.

afaik the "correction allpass" (APF) is made from the same filters.

it only works this way using multiples of 2 - order linkwitz-riley filters (i.e. 4, 8, or 12 times of 3db butterworths.)

generally you can do the same with digital filters and archive an even better result.

whether you prefer flat passband (butterworth) or flat group delay (bessel) is always a matter of application.*)

driving a speaker system is a bit another requirement than doing frequency selective DSP but luckily it also has quite some things in common. :)

*) if you need both at the same time, you have move to another planet.

daddymax's icon

Is it just me, or do these filters crackle as you change the frequency? Also, the MC versions are there but don't work on my computer?

Isabel Kaspriskie's icon

The cutoff frequency is an attribute, so it does not update at signal rate which may be why you're hearing crackles. It is a feature request on the queue to make the cutoff modulatable, but the implementation changes are non-trivial. (As an explanation for why: These objects are essentially a wrapper around the filter implementations from Vinnie Falco's DSPFilters project. To change any parameters, the entire filter needs to be reconstructed, so doing this at signal rate is expensive.)

For MC, the mappings are, for example, filter.mc.butterworth~ rather than mc.filter.butterworth~. This has caused a few people to be caught up, so I will be adding the more expected mc.filter.<topology>~ aliases in the next release.

srs's icon

Thanks Roman. What do you mean when you say that the APF is ‘made from the same filters’ ? It doesn’t seem to be possible to create an allpass butterworth filter using the [filter], [filterdesign] or [biquad] objects in Max.

If I understand correctly, I need to replace each component in that diagram with 4 cascaded 3dB (2nd order) butterworth filters but after doing so and using the standard biquad correction allpass, it still isn’t transparent.

Or does the test method I’m using of inverting the phase and summing with the original not apply here due to the filter delay?

Roman Thilenius's icon


you can either use third party externals or biquad, and as you probably know, in a butterworth the "quality" of the frequency respose goes at the cost of a "terrible" phase respose.

so it seems appropiate to replicate such a l/r speaker system and use an exact copy of the lowpass and highpass cascades from the higher two bands´ frequency splitter as phase correction allpass into into the LF signal path.

i.e. APF 1000 is nothing more than HPF 1000 and LPF 1000 but with the outputs summed together.

if you add a 3rd splitter and make 4 bands, its two filters will go as AP in each of the 2 lower bands, and so on and so forth.

Roman Thilenius's icon

hm, filter.butterworth allows "bandwidth" attribute when not in bandpass mode. :)

Roman Thilenius's icon