Any "cookbook" approaches to linear phase EQ?

DSP, Plug-in and Host development discussion.
Fender19
KVRist
232 posts since 30 Aug, 2012

Post Tue Apr 16, 2019 8:24 am

There are many linear phase EQ plugins out there today with all the standard filter curves (low pass, high pass, bell, shelving, etc.). I assumed there were some RBJ-style "cookbook" filter kernels and methods floating around for this but I can't find any such thing.

So, how is it being done? For example, how does one create a "parametric" bell EQ in linear phase that is user-adjustable on the fly?

I can use a simple "RBJ" filter to do that with IIR - how do you do it with LP FIR?

User avatar
Unaspected
KVRist
493 posts since 4 May, 2012

Re: Any "cookbook" approaches to linear phase EQ?

Post Tue Apr 16, 2019 9:05 am

This website and products are wonderful: http://iowahills.com/5FIRFiltersPage.html

JustinJ
KVRer
29 posts since 31 Oct, 2017

Re: Any "cookbook" approaches to linear phase EQ?

Post Mon Apr 22, 2019 9:39 am

If you look at commercial parametric EQs such as Fabfilter's Pro-Q3 you'll find a lot of different filter types supported and one of it's modes is indeed linear phase.

So, either there's a way to convert from IIR filter types to FIR filter types or there's another method being employed. I'm not sure which, but I'd be curious to find out too.

Fender19
KVRist
232 posts since 30 Aug, 2012

Re: Any "cookbook" approaches to linear phase EQ?

Post Mon Apr 22, 2019 7:07 pm

JustinJ wrote:
Mon Apr 22, 2019 9:39 am
If you look at commercial parametric EQs such as Fabfilter's Pro-Q3 you'll find a lot of different filter types supported and one of it's modes is indeed linear phase.

So, either there's a way to convert from IIR filter types to FIR filter types or there's another method being employed. I'm not sure which, but I'd be curious to find out too.
Exactly my question. As far as switching between minimum & linear phase I thought all they were doing was using 1/2 vs. the entire impulse kernel - but that would also change the shape of the filters - so it's not that simple.

It's also hard imagine they are computing forward and reverse FFTs to generate FIR filter impulses or process the signal - especially when the code is "optimized for use on every channel". Nothing that uses FFTs (AFAIK) is lean enough on CPU to use on EVERY channel.

IDK - but I sure would like some clues!

mystran
KVRAF
5253 posts since 12 Feb, 2006 from Helsinki, Finland

Re: Any "cookbook" approaches to linear phase EQ?

Post Mon Apr 22, 2019 11:13 pm

Probably the easiest methods to design FIRs for arbitrary spectrum are IFFT+window and ordinary least-squares.

IFFT gives you a kernel that is exact at the spectrum sampling points, but usually oscillates unacceptably in between. Windowing the result will smooth out the response, getting rid of most of the ripple, but also typically rounding out desirable features. You can also fit for non-uniform spectral samples, if you build a non-uniform DFT matrix and solve using something like LU.

OLS lets you over-specify the spectrum (eg. you probably want something like 8 times as many spectral samples as target taps; basically we want to pretend that target spectrum is "continuous") and finds you the best fit in the "sum of squared errors" sense. Essentially you just use an overdetermined DFT matrix and solve for the pseudo-inverse (eg. using Cholesky). This can still oscillate, but such oscillation tends to be concentrated around sharp features and it typically does a good job with relatively smooth target responses.

Either way, if you want to target a linear-phase version of a given IIR response, just build the target spectrum by evaluating the transfer function at each of the frequencies you need and then zero out the phase (ie. use the magnitude only).
If you'd like Signaldust to return, please ask Katinka Tuisku to resign.

Return to “DSP and Plug-in Development”