DSPRelated.com
Forums

Biquad filtering with Fs/Fo > 200

Started by dgen...@engmail.uwaterloo.ca October 29, 2007
I'm designing a parametric equalizer using a spartan 3e starter board and a TI PCM codec I wired to it, running at 48kHz. I decided to use the biquad IIR filter core from opencores.org which accepts 5 16bit normalized coefficients. I'm using http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt as a guide for calculating coefficients. (this is not platform specific and applicable for dsp chips too)

If I want to have a LP filter at, say 200Hz, I get coefficients that saturate to about 1 LSB. This seems like way too much aliasing or quantization or whatever you call it. One solution I'm considering is to downsample to increase my Fo/Fs and get more descriptive coefficients. I assume I would use averages or something when downsampling to avoid aliasing. I would still run my higher filters (2kHz, etc) at full sample rate. Is this a reasonable solution or will it suffer quality problems downsampling low bands? Is there another type of digital filter more suitable for say subwoofer crossover type of applications?
D Gens-

> I'm designing a parametric equalizer using a spartan 3e starter board and
> a TI PCM codec I wired to it, running at
> 48kHz. I decided to use the biquad IIR filter core from opencores.org
> which accepts 5 16bit normalized coefficients.
> I'm using http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt as a guide
> for calculating coefficients. (this is not
> platform specific and applicable for dsp chips too)
>
> If I want to have a LP filter at, say 200Hz, I get coefficients that saturate
> to about 1 LSB. This seems like way too
> much aliasing or quantization or whatever you call it. One solution I'm
> considering is to downsample to increase my
> Fo/Fs and get more descriptive coefficients. I assume I would use averages
> or something when downsampling to avoid
> aliasing. I would still run my higher filters (2kHz, etc) at full sample
> rate. Is this a reasonable solution or will
> it suffer quality problems downsampling low bands? Is there another type of
> digital filter more suitable for say subwoofer crossover type of applications?

FPGA is a poor solution for high quality audio/acoustic applications, with one reason being what you're discovering
the hard way: difficulty in implementing longer precision. For effective IIR filters frequencies lower than Fs/Fc
ratios of about 250, many more bits than 16 are needed. For a recent 16-bit TI DSP project we used 64-bit precision
for the core biquad calculation sections. We implemented this in asm language, used instruction cache, dual MAC, etc
and the result was fairly fast.

An FPGA solution would be slower for each IIR filter, due to sequential sections, but would overall be faster
depending on how many parametric filters were implemented in parallel. But, the main points in the real world are a)
how long to get it working, and b) how can the code be maintained and supported over the long-term? DSP = days, FPGA
= weeks. C + small asm lang, easy to document between engineers. Complex Verilog to run multiprecision calculations,
not easy.

-Jeff
Two suggestions--

For a biquad implementation, you can consider doing the sections which
challenge 16 bit precision in double precision. Most DSP chips offer
this feature. It is commonly used when frequency gets small relative to
the sampling rate, or when the rate of gain change with respect to
frequency is large.

2nd suggestion
There is a second order filter algorithm used by audio engineers which
realizes parametrics in which sensitivity to coefficients and other
concerns are eased and low frequency performance is superior. Another
advantage of this realization is that the user parameters (Fo, Q, and
level of boost or cut) are mapped to the DSP EQ with virtual
independence of each other so look up tables are smaller. The technique
uses a second order allpass filter embedded in a matrix of forward paths
where the allpass outputs are added and subtracted. Look for these
references or key words--
textbook by Mitra (most current one)
Gray and Markel All Pass Lattice
journal article by Regalia and Mitra
AES preprint paper by Dana Massie
papers by Dutilleux (AES Journal 1989) and Maher

Good luck!

Christopher Moore

d...@engmail.uwaterloo.ca wrote:
> I'm designing a parametric equalizer using a spartan 3e starter board
> and a TI PCM codec I wired to it, running at 48kHz. I decided to use the
> biquad IIR filter core from opencores.org which accepts 5 16bit
> normalized coefficients. I'm using
> http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt
> as a guide for
> calculating coefficients. (this is not platform specific and applicable
> for dsp chips too)
>
> If I want to have a LP filter at, say 200Hz, I get coefficients that
> saturate to about 1 LSB. This seems like way too much aliasing or
> quantization or whatever you call it. One solution I'm considering is to
> downsample to increase my Fo/Fs and get more descriptive coefficients. I
> assume I would use averages or something when downsampling to avoid
> aliasing. I would still run my higher filters (2kHz, etc) at full sample
> rate. Is this a reasonable solution or will it suffer quality problems
> downsampling low bands? Is there another type of digital filter more
> suitable for say subwoofer crossover type of applications?
>
>
> 11:02 AM

--
-----------------------------------
Seven Woods Audio, Inc. Christopher Moore
Concepts, Products, Circuits for Audio Analog/Digital
m...@SevenWoodsAudio.com
http://www.SevenWoodsAudio.com
Options:

1. Increase your number of bits
2. Decrease your sampling rate
3. Downsample

Apply 1 in any case. Apply 2 prefereably than 3, only in case you can not apply 2 go for 3.

Cheers.

Jaime Andr Aranguren Cardona
j...@ieee.org
j...@computer.org

----- Original Message ----
From: "d...@engmail.uwaterloo.ca"
To: a...
Sent: Friday, October 26, 2007 9:02:55 AM
Subject: [audiodsp] Biquad filtering with Fs/Fo > 200

I'm designing a parametric equalizer using a spartan 3e starter board and a TI PCM codec I wired to it, running at 48kHz. I decided to use the biquad IIR filter core from opencores.org which accepts 5 16bit normalized coefficients. I'm using http://www.musicdsp .org/files/ Audio-EQ- Cookbook. txt as a guide for calculating coefficients. (this is not platform specific and applicable for dsp chips too)

If I want to have a LP filter at, say 200Hz, I get coefficients that saturate to about 1 LSB. This seems like way too much aliasing or quantization or whatever you call it. One solution I'm considering is to downsample to increase my Fo/Fs and get more descriptive coefficients. I assume I would use averages or something when downsampling to avoid aliasing. I would still run my higher filters (2kHz, etc) at full sample rate. Is this a reasonable solution or will it suffer quality problems downsampling low bands? Is there another type of digital filter more suitable for say subwoofer crossover type of applications?

__________________________________________________