Bugzilla – Bug 3387
Convolve short FIR filters in firmware
Last modified: 2006-06-05 17:13:52 UTC
Feature request: implement processing of Finite Impulse Response (FIR) filters in the Squeezebox firmware, to enable arbitrary EQ. I have a server-side transcode plugin (hooked into slimserver-convert.conf) for EQ and room correction. For long filters (i.e. room correction) this is great. For short or frequently-changed filters (i.e. EQ) this is almost unusable. The server-side transcoder processes the stream, which is then buffered on the Squeezebox; any changes initiated by the user (via plugin) area only heard after many seconds, due to SB's buffering. Suggestion for a good way to fix this, and to generally enable a wide range of filter extensions: - Implement convolution in the firmware, for short FIR filters (say, 128 tap). Convolution = FFT, multiply by FFT of the filter, then IFFT; with overlap-and-save for linear stream processing. FFT already exists in firmware, and short filters shouldn't break the CPU budget. (You would need floating point math for the convolution; 32-bit is OK). This all takes effect after any decodes (ie. on raw data). - Have a bank of four filters. #1: processes left in, to left out. #2: right in - right out. #3: left in - right out. #4: right in - left out. This enables cross-channel cancellation (stereo image width enhancement, etc) as well as per-channel equalization and other filtering. - Have a client function callable by the server to install a 128 * 32-bit filter to each bank. - Have another client function callable by the server to bypass all filters. Then, e.g., my plugin displays a set of bar input controls, one for each of 9 frequency bands; on change, it recalculates the EQ filter (which is reasonably quick), and sends the filter up to Squeezebox.
Bah. My assumptions were off; 128-tap FIR filters aren't nearly long enough for decent control of bass (approximately, you need samplerate/freq, so ~750 taps for control at 60Hz; round up to 2^10). I'm not sure the SB hardware is enough for this. (For a reference point, see http://pcfarina.eng.unipr.it/Public/Papers/188-Mohonk2003.pdf) Another small complication: distinct filters are needed for each samplerate.
Subject: Re: Convolve short FIR filters in firmware Unfortunately, SB2/3 doesn't have enough power left over even for the 128 tap filters. Sorry.