Is there any difference between convolution engines for IIR and FIR filters?
And is there a difference in sound quality using either convolution engine?
A convolution engine performs convolution the discrete version of which is:
$$y[n] = \sum_{k=0}^{|h|-1}x[n-k] \cdot h[k]$$
Where:
- $n$ denotes discrete time
- $|\cdot|$ denotes length of sequence (so $|h|$ means, the length of the impulse response).
- $y$ is the output
- $x$ is the input
- $h$ is impulse response
Notice here that this formula is giving you $y[n]$. This means that to calculate one time instance for the output you need to take into account $|h|-1$ time instances in the past of the signal ($x[n-k]$ for $k=0$ is the present value).
Both Finite Impulse Response (FIR) and Infinite Impulse Response (IIR) filters can theoretically be expressed via convolution.
But, in the case of IIR filters, $|h|=\infty$. Therefore, to produce a given $y[n]$, you would have to wait forever. What is really done in practice given an IIR filter is to truncate its impulse response when this has decayed sufficiently. The alternative (still in the case of IIR filters) is to implement them in one of the standard forms. In that case, you are implementing a recursive difference equation that produces one $y[n]$ as a combination of a finite set of past values of both its input and output. As a side note, the fact that the filter now has feedback from its output back to its input is what makes it IIR as there are now conditions by which numbers can circulate forever in that loop without necessarily decaying to zero.
Therefore:
When referring to a "...convolution engine" we are talking about FIR filters.
Because of the fact that you would have to truncate the IIR impulse response to express it via convolution, yes the result can be different.
I could not find much info about the convolution engine within Equalizer APO. I‘m just interested in best audio quality.
Equalizer APO can do both types of filters (look into filters/
) plus special implementations for some standard filters. For example, if you look into filters/IIRFilter.cpp
and specifically the function IIRFilter::process()
, you will see exactly the two iterations that apply coefficients to an input buffer, an output buffer and finally produce an output value. And if you look into filters/ConvolutionFilter.cpp
you will notice that it performs convolution via FFT (faster) and libHybridConv
(see libHybridConv/libHybridConv.c
, hcProcessSingle()
).
In conclusion: "Best audio quality..." depends on the workload of your machine. A sufficiently long IIR filter would not sound too different than an FIR one. And at the same time, long filters take more time to calculate. This is further worsened if you want to apply the filter in more than one channels (and I am not talking multiple speakers here, just going stereo means applying one convolution per channel. You should also take into account the comments about the sound quality being subjective here :) ).
However, you might be able to take the results of your room's impulse response, prioritise which "problems" you want to correct and then use a simple graphic equaliser to correct those problems in particular.
You can run a simple graphic EQ, whether in Equalizer APO or any other VST host and then re-route your audio source to be going first through the VST filter and then to the output.
Hope this helps.