SLAAEH6 September   2024 TAA5212 , TAA5412-Q1 , TAC5111 , TAC5111-Q1 , TAC5112 , TAC5211 , TAC5212 , TAC5212-Q1 , TAC5311-Q1 , TAC5312-Q1 , TAC5411-Q1 , TAC5412-Q1 , TAD5112 , TAD5112-Q1 , TAD5212 , TAD5212-Q1

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2Infinite Impulse Response Filters
    1. 2.1 Digital Biquad Filter
  6. 3TAC5x1x and TAC5x1x-Q1 Digital Biquad Filters
    1. 3.1 Filter Design using PurePath™ Console
      1. 3.1.1 Example of Programming Biquad Filters Using PurePath™ Console
    2. 3.2 Generating Coefficients N0, N1, N2, D1, D2 using a Digital Filter Design Package
    3. 3.3 Avoiding Overflow Conditions
    4. 3.4 Biquad Filter Allocation on Recording Channel
    5. 3.5 Biquad Filter Allocation on Playback Channel
    6. 3.6 Biquad Filter Programming Example on the TAC5x1x
  7. 4Typical Audio Applications of Biquad Filters
    1. 4.1 Parametric Equalizers
    2. 4.2 Crossover Networks
    3. 4.3 Voice Boost
    4. 4.4 Bass Boost
    5. 4.5 Removing 50Hz–60Hz Hum With Notch Filters
  8. 5Summary
  9. 6References

Generating Coefficients N0, N1, N2, D1, D2 using a Digital Filter Design Package

By default (reset state), the biquad filters are configured as all-pass filters. In this condition, the filter coefficients (as mentioned in Equation 3) have the following values:

  1. N0 = 231 (b0= 1)
  2. N1, N2, D1, D2 = 0 (b1, b2, a1, a2 = 0)

When using a Digital Filter Design Package, such as MATLAB®, to generate an IIR biquad coefficients follow these steps:

  1. Compute the coefficients [b0, b1, b2, a0, a1, a2] with a filter design function, such as the MATLAB butter function to design a Butterworth filter with cutoff at 1kHz of a system running at 48kHz. Note that MATLAB coefficients are normalized with a0 = 1.
    [b, a] = butter( 2, 1000 / (48000/2) ) 
  2. Convert these coefficients to [N0, N1, N2, D1, D2] as shown in the following:
    • N0 = b0
    • N1 = b1 / 2
    • N2 = b2
    • D1 = -a1 / 2
    • D2 = -a2
  3. Convert the coefficients to Q31 by multiplying by 231 .
  4. Round to nearest integer and convert to a 32-bit two's complement hexadecimal format:
    • For positive integers, convert to hexadecimal format
    • For negative integers, take the absolute value of the coefficient, convert it to binary, negate it, add one, and convert to hex. For example, to represent -135 in 32-bit two's complement hexadecimal format:
      • Absolute value of -135 is 0000 0000 0000 0000 0000 0000 1000 0111 in binary (or 0x00000087 in hex).
      • Negating the binary results in 1111 1111 1111 1111 1111 1111 0111 1000 in binary (or 0xFFFFFF78 in hex).
      • Adding one to the same gives 1111 1111 1111 1111 1111 1111 0111 1001 in binary (or 0xFFFFFF79 in hex). Hence, the 32-bit, 32-bit two's complement hexadecimal representation of -135 is 0xFFFFFF79.