[linux-audio-dev] *fast* FIR filter engine for audio

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: [linux-audio-dev] *fast* FIR filter engine for audio
From: Anders Torger (torger_AT_ludd.luth.se)
Date: Sun Jun 11 2000 - 23:28:36 EEST


At last I have stopped being lazy and finalised my FIR engine to something that
works. It is available under the GPL at www.ludd.luth.se/~torger/filter.html

The software also contains a WFIR engine, Warped Finitie Impulse Response.

It requires IA32 or compatible since it uses MMX instructions and ordinary x86
assembler.

Performance example: On a dual Pentium II 266 MHz with two channels 16 bit @
44.1 kHz input and 24 bit output 3000 taps is the approximate limit for
real-time operation (2 clock cycles per tap). It should be enough for room
correction applications which I designed the FIR engine for, however I have not
coded a FIR filter designer suitable for that yet. For now the included WFIR
designer with the warp factor set to 0 can be used to create minimum-phase
filters that modifies the power response.

The filter cannot be overflowed, nor is there any rounding done (apart from
cutting down the output sample to 24 bit). With these properties I'd say that
my FIR filter is by far the fastest ever on the IA32 architecture, or am I
wrong?

Unfortunately the performance is not tap-linear, the processor time needed is
exponential up to about 4000 taps, where it starts to be linear again on my
P2 processor. I guess it is a cache problem, the internal state of the filter
gets quite large. 4000 taps needs twice the time compared to 3000, on the other
hand a 1000 tap filter is 5 times faster than a 3000 tap filter. This suggests
that a dual processor system with half the clock speed is faster than a
uniprocessor system due to the extra cache, I have not tested that though.

This FIR engine does integer math, and is designed to work alone, and not in
series with other filters. It has an ALSA-interface, and can thus with a good
digital sound card be fully digitally connected to a HiFi system. I use a
Digi96 card and pass digital output from my Hifi CD-player through the filter
and back digitally to an external Hifi DAC. The total delay is around 200 ms
while still allowing stable performance without interruptions. 200 ms may be
high for certain studio monitoring applications, but works well in ordinary
playback applications (that is 200 ms from pressing the play button on the CD
remote until the sound starts streaming out of the speakers).

It scales over multiple processors, assuming you have at least one channel per
processor. The largest limitation of the filter is that input samples are
limited to 16 bit, due to the use of MMX instructions.

-- 
/Anders Torger

"Lascia la spina, cogli la rosa"


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Mon Jun 12 2000 - 00:47:43 EEST