"High-End Audio" IIR filters

XCore Project reviews, ideas, videos and proposals.
User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

"High-End Audio" IIR filters

Post by lilltroll »

Version: 0.3
Status: Alpha
License: BSD
Download: /files/project_builds/IIRsos96.zip

INTRODUCTION:

The standard fixed Point IIR filter on XMOS uses a 64 bit signed MAC and 32 bit internal states.

Today there exist DAC's that achieves > 130 dB DNR (Dynamic Noise Ratio), but a filter with 32 bit internal states will not achieve such SNR/DNR for many filter-coef's, instead the filter will often suffer from limit cycles

(A caotic behavior, where oscillating cycles will be superinposed to the filtered data)
An example :

fs=96 kHz

2:nd order butterworth HP filter @ 65 Hz that serves as the first SOS link in a 4:th order L-R filter, used as a crossover between the front and the subwoofer.

Inserting a linear chirp to the standard filter implementation will result in a limit cycle at the output with an amplitude near 4096, e.g. 2* 2^12 = 13 bits of limit cycles, thus reducing the DNR with 13 bits.

If the input signal is 24 bits, you would only have 11 bits DNR left at the output!
METHOD:

This asm implementation uses a 96 bit 2-complement MAC and 64 bits are then stored in the internal filterstates.
RESULT:

The output of this implemetation (for the same example as above) shows an error (compared to a reference calculation done with long double float) of +-0.5 e.g. only quantization noise.
DISCUSSION:

Compared to using double floats, this filter runs much much faster!
The reference asm code is for readabillity and understanding, it works but it's slower.
Images:


Probably not the most confused programmer anymore on the XCORE forum.
User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Post by lilltroll »

Starting timer
Stopping timer
Total time is 2774 us
Filter runs at 1476kHz
IN, OUT
0, 0
575243, 573515
2300970, 2290608
5177175, 5144382
9203827, 9127937
...
Probably not the most confused programmer anymore on the XCORE forum.
User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Post by lilltroll »

Filling the channel buffer with samples increases the speed to
1856kHz
Probably not the most confused programmer anymore on the XCORE forum.
User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Post by lilltroll »

Starting timer
Stopping timer
Total time is 437 us
Filter runs at 2339kHz
IN, OUT
0, 0
2300970, 2294059
...
Probably not the most confused programmer anymore on the XCORE forum.