SBAA378B November   2019  – December 2023 PCM3140-Q1 , PCM5140-Q1 , PCM6140-Q1 , TLV320ADC3140 , TLV320ADC5140 , TLV320ADC6140

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. Introduction
  5. Infinite Impulse Response Filters
    1. 2.1 Digital Biquad Filter
  6. TLV320ADCx140/PCMx140-Q1 Digital Biquad Filters
    1. 3.1 Filter Design Using PurePath™ Console
      1. 3.1.1 Example Generating Programmable Biquad Coefficients Using PurePath Console
    2. 3.2 How to Generate N0, N1, N2, D1, and D2 Coefficients with a Digital Filter Design Package
    3. 3.3 Avoid Overflow Conditions
    4. 3.4 Digital Biquad FiIter Allocation to Output Channel
    5. 3.5 Programmable Coefficient Registers for Digital Biquad Filters 1–6
    6. 3.6 Programmable Coefficient Registers for Digital Biquad Filters 7–12
  7. How to Program the Digital Biquad Filters on TLV320ADCx140/PCMx140-Q1
  8. Typical Audio Applications for Biquad Filtering
    1. 5.1 Parametric Equalizers
  9. Crossover Networks
  10. Voice Boost
  11. Bass Boost
  12. Removing 50 Hz–60 Hz Hum With Notch Filters
  13. 10Revision History
  14. 11Digital Filter Design Techniques
    1. 11.1 Analog Filters

How to Generate N0, N1, N2, D1, and D2 Coefficients with a Digital Filter Design Package

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 1 kHz of a system running at 48 kHz. 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] by dividing:
    • GUID-62DED953-6AE8-4887-9AE4-A14B8EEC744C-low.gif
    • GUID-84F4A72C-B994-420F-8DFB-6EB9A1B9E820-low.gif
    • GUID-D992E139-F831-4DB6-A902-F8F02237DD6E-low.gif
    • GUID-DF813C56-FE28-48A2-8449-D40A7A0916E8-low.gif
    • GUID-DD51B9A6-6961-4325-8B3D-A6DB297CE558-low.gif
  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.