| Filter Design Toolbox | ![]() |
Quantizing the IIR Filter
You used the filter design tools in FDATool to design an IIR filter with a passband you defined. To demonstrate the effects of quantization on this filter, we can convert the filter to fixed-point arithmetic and quantize its transfer function coefficients. So, to complete the design process, we need to quantize the IIR filter, keeping its performance intact through the quantization process. You use FDATool in quantization mode to accomplish this operation:
Designed(Quantized). If you import a filter into FDATool, Source changes to read Imported.
For now the filter uses the default structure -- Direct form II transposed.
If you select Filter Coefficients from the Analysis menu in FDATool, you can review the coefficients of the reference and quantized filters. When you scroll to the bottom of the display in the analysis area, you see that eight coefficients overflowed during quantization. In the left column of the analysis area, the symbols +,-, and 0 appear to indicate which coefficients overflowed or underflowed, and in which direction (toward ±infinity or toward zero. The following table summarizes the meaning of the symbols.
eps) or -1.0. The following data table shows the filter coefficients.
Numerator QuantizedCoefficients{1} ReferenceCoefficients{1} 0 (1) 0.000000000000000 0.000006805499528066 (2) -0.000030517578125 -0.000037137669916463 (3) 0.000091552734375 0.000087218236138384 (4) -0.000122070312500 -0.000115464066452111 (5) 0.000091552734375 0.000094505093411602 (6) -0.000061035156250 -0.000048910514376539 (7) 0.000030517578125 0.000015426381218102 0 (8) 0.000000000000000 -0.000002610607681069 0 (9) 0.000000000000000 0.000000167701400337 Denominator QuantizedCoefficients{2} ReferenceCoefficients{2} + (1) 0.999969482421875 1.000000000000000000 - (2) -1.000000000000000 -7.532602606298016000 + (3) 0.999969482421875 24.769238091848504000 - (4) -1.000000000000000 -46.426612663362768000 + (5) 0.999969482421875 54.235802381593018000 - (6) -1.000000000000000 -40.420742464796888000 + (7) 0.999969482421875 18.759623438876325000 - (8) -1.000000000000000 -4.954375991471868800 (9) 0.569671630859375 0.569669813719955510 Warning: 8 overflows in coefficients.
Your quantized filter is now unstable (check FDATool for the Current Filter Information). When the reference filter poles and zeros are so close to one another, they can be very sensitive to the effects of quantization. In this case, quantizing the filter moved some of the poles outside the unit circle. If you switch to the Pole/Zero plot by selecting Pole/Zero from the Analysis menu in FDATool, you see the poles and zeros for the quantized filter.
We resolve this problem by converting our filter structure to one that is more robust to quantization effects. For example, we could change from direct form II transposed to a lattice structure, or we could use second-order sections (SOS) to implement our quantized filter. Second-order section form offers a strong option because when we convert to SOSs, we reduce the order of the polynomials that define the filter, and thus reduce the filter sensitivity to quantization.
When you convert to second-order sections (SOS), you have the option of treating the error between the reference filter magnitude response and the quantized filter magnitude response in one of three ways. The Scale option determines which method FDATool uses:
None -- ignore scaling when determining the SOS coefficients
L-2 -- use Euclidean norm when determining the SOS coefficients
L-infininty -- use L
scaling when determining the SOS coefficients
FDATool optimizes the order of the second-order sections according to the scaling option you choose. (The tf2sos function that performs the conversion is called with option 'down' for L-2 and 'up' for L-infinity scaling.)
Our IIR filter does not need to be scaled to meet our needs, so select None from the Scale list and Up from the Direction list.
As you followed this example, you created an arbitrary magnitude IIR filter to match an ideal filter response. Then you quantized the filter and converted it to second-order section form. All of this you accomplished using FDATool, although you could have used the command line to perform the same filter design and quantization operations.
To save the filter you created in FDATool, either select File->Save Session to save the session and your FDATool interface settings, or choose File->Export to export the filter to your MATLAB workspace in transfer function form.
| Designing the IIR Filter | Selected Bibliography | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2008 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |