Complex EQ using Convolution?
-
- KVRist
- Topic Starter
- 134 posts since 13 Apr, 2016
I have a fairly complex EQ that I want to apply to the audio path in my plugin, and by complex, I mean about 15 specific peak and shelving filters. I've been thinking about applying that EQ with convolution, similar to cabinet simulation but obviously without the reverb component. I'm wondering if this is reasonable.
Here's my theoretical workflow:
- Create the desired EQ in Logic using several copies of it's Channel EQ in series, which is mostly shelving and peak filters.
- Send a sine sweep through the EQ and record the result.
- Deconvolve the EQ'd sine sweep using Voxengo's Deconvolve to produce an impulse response.
- Use that IR with a convolution algorithm to filter my audio stream.
Does that make sense? Are there any problems with this workflow?
Here's my theoretical workflow:
- Create the desired EQ in Logic using several copies of it's Channel EQ in series, which is mostly shelving and peak filters.
- Send a sine sweep through the EQ and record the result.
- Deconvolve the EQ'd sine sweep using Voxengo's Deconvolve to produce an impulse response.
- Use that IR with a convolution algorithm to filter my audio stream.
Does that make sense? Are there any problems with this workflow?
-
- KVRian
- 1273 posts since 9 Jan, 2006
In digital there's little need to sine sweep then deconvolve. You can simply feed an impulse, a sample of 1.0 amplitude followed by zeroes. The output of the filter is the impulse response. Depending on the required resolution you can choose the length of the impulse to feed into your system.joshb wrote:I have a fairly complex EQ that I want to apply to the audio path in my plugin, and by complex, I mean about 15 specific peak and shelving filters. I've been thinking about applying that EQ with convolution, similar to cabinet simulation but obviously without the reverb component. I'm wondering if this is reasonable.
Here's my theoretical workflow:
- Create the desired EQ in Logic using several copies of it's Channel EQ in series, which is mostly shelving and peak filters.
- Send a sine sweep through the EQ and record the result.
- Deconvolve the EQ'd sine sweep using Voxengo's Deconvolve to produce an impulse response.
- Use that IR with a convolution algorithm to filter my audio stream.
Does that make sense? Are there any problems with this workflow?
Processing of parametric EQs is not too heavy on the CPU, generally. You might find it less taxing CPU wise just to use regular EQ and copy the settings rather than use convolution. Plus there are other drawbacks to convolution.
-
- KVRist
- Topic Starter
- 134 posts since 13 Apr, 2016
Doh...of course. Thank you.You can simply feed an impulse, a sample of 1.0 amplitude followed by zeroes. The output of the filter is the impulse response.
I was wondering about that. Can you be more specific? I'm guessing that bass response is affected most by the length of the IR (assuming EQ only). So if the sampleRate is 48k, would that mean that an IR of 48k samples would suffice?Depending on the required resolution you can choose the length of the impulse to feed into your system.
That's what I'm trying to figure out...at what number of IIR filters would be more efficient than using convolution.Processing of parametric EQs is not too heavy on the CPU, generally. You might find it less taxing CPU wise just to use regular EQ and copy the settings rather than use convolution. Plus there are other drawbacks to convolution.
Such as?Plus there are other drawbacks to convolution
Thank you.
-
- KVRian
- 1379 posts since 26 Apr, 2004 from UK
For once, convolution, even via FFT, is slower than IIR. Then the sharper the spectrum, the longer the impulse has to be. Don't forget that you are trying to match poles with an infinite number of roots. It's... not that easy.
-
- KVRAF
- 2256 posts since 29 May, 2012
One drawback would be to find out an algorithm that yields a minimum phase FIR impulse response to be used with convolution. I haven't yet seen one that has made immediate sense to me. I have seen papers like this https://www.researchgate.net/publicatio ... l_Cepstrum and there was some sample code in a minBLEP sample I had found in the net, but nothing easily understandable. I would be more concerned about this than the amount of cpu cycles that convolution would waste.
~stratum~
-
- KVRian
- 1273 posts since 9 Jan, 2006
No, in order for perfect convolution your impulse response needs to be as long as the impulse response of the filter you are sampling. Which could be anything from relatively short to infinitly long. In an EQ filter I'd guess most impulse responses would decay towards the noise floor. This could take thousands of samples, maybe. Chaining EQ filters will likely increase the overall IR length. You're right that bass resolution suffers the most as we shorten the IR. I also noticed, looking at cabinet impulse responses, that shortening the IR tended to smooth the spectrum. I'd guess you'd need to make a judgement call. Weighing up factors like CPU efficiency, latency and audible differences in sound quality to arrive at a suitable length.joshb wrote:I was wondering about that. Can you be more specific? I'm guessing that bass response is affected most by the length of the IR (assuming EQ only). So if the sampleRate is 48k, would that mean that an IR of 48k samples would suffice?
A lot would depend on your actual implementations and how efficient you get them. You'd need to profile to get a solid figure.joshb wrote:That's what I'm trying to figure out...at what number of IIR filters would be more efficient than using convolution.
Other draw backs are that brute force convolution becomes extremely taxing on the CPU once the IR gets large. You can increase efficiency with FFT convolution at the cost of added latency. The latency can be reduced (all the way to zero if required) with partitioned convolution at the cost of algorithmic complexity and issues around multi threading as well as increased CPU load.joshb wrote:Such as?Plus there are other drawbacks to convolution
Thank you.
I don't think this is an issue if we are sampling minimum phase equipment as in the OPs question.stratum wrote:One drawback would be to find out an algorithm that yields a minimum phase FIR impulse response to be used with convolution.
-
- KVRAF
- 2256 posts since 29 May, 2012
It's not. Should it be? could be a question though. Before seeking this I used to assume that linear phase is good enough for all purposes, but it turns out it is not: http://www.fabfilter.com/help/pro-q/usi ... essingmodeI don't think this is an issue if we are sampling minimum phase equipment as in the OPs question.
~stratum~
-
- KVRian
- 1273 posts since 9 Jan, 2006
I don't think so. Not in the context of sampling a minimum phase EQ anyway.stratum wrote:It's not. Should it be?I don't think this is an issue if we are sampling minimum phase equipment as in the OPs question.
We could decide that transforming FIR kernels between minimum, maximum, mixed and or linear phase could be cool, but we'd be straying pretty far off topic.
-
- KVRAF
- 2256 posts since 29 May, 2012
Ok, I see it's not because he intends to sample another EQ which does not have the delay problem.I don't think so. Not in the context of sampling a minimum phase EQ anyway.
~stratum~