FIR to IIR converter
Posted: Sun Feb 23, 2014 8:06 pm
This schematic can approximate IIR filter that has response as close as possible to filter that was used on the test tone.
Test tone can be practically anything (typically an impulse, sine sweep or white noise). You provide the schematic with DRY test tone and WET test tone (one passed through filter you desire to model...in case you have IR then input it here and input impulse to the DRY).
The schematic will preform Least Squares Method to approximate IIR filter coefficients. You can select the order of the filter (higher order, more precise the result, but also the filter will have to be more complex). In the output float array the filters are arranged as [b0,b1,...bn,a1,a2,...a,n] Note that A coefficients are inverse of standard IIR filter coefficients. that is because in standard IIR the an*y(n) is subtracted, but Least squares method assumes they are added.
EDIT: added the stable version of the filter. Old one using trogs float array to mem conversion was crashing.
Test tone can be practically anything (typically an impulse, sine sweep or white noise). You provide the schematic with DRY test tone and WET test tone (one passed through filter you desire to model...in case you have IR then input it here and input impulse to the DRY).
The schematic will preform Least Squares Method to approximate IIR filter coefficients. You can select the order of the filter (higher order, more precise the result, but also the filter will have to be more complex). In the output float array the filters are arranged as [b0,b1,...bn,a1,a2,...a,n] Note that A coefficients are inverse of standard IIR filter coefficients. that is because in standard IIR the an*y(n) is subtracted, but Least squares method assumes they are added.
EDIT: added the stable version of the filter. Old one using trogs float array to mem conversion was crashing.