| Filter Design Toolbox | ![]() |
Normalize quantized filter coefficients
Syntax
Description
h = normalize(Hq)
accounts for quantized filter coefficient overflow by normalizing the quantized filter coefficients in the quantized filter Hq. The new quantized filter h contains the normalized coefficients. All quantized filter coefficients for h stored in the QuantizedCoefficients property value are modified to have magnitude less than or equal to one. The result also modifies the ReferenceCoefficients property value for h accordingly. normalize also modifies the ScaleValues property value for h from that of Hq, so that input data to each section of h are scaled to compensate for the normalized filter coefficients. The scaling factors used in normalize are powers of two. There may be a different scaling factor for each section of the quantized filter. You can apply normalize to direct form IIR and FIR filters only. To apply normalize to a quantized filter, its property Hq.FilterStructure must be one of the following strings:
Examples
Create a direct form II transposed quantized filter and use normalize to account for overflow.
% Create a low pass reference filter in the Signal Proc. Toolbox. [b,a] = ellip(5,2,40,0.4); % Create the quantized filter from the reference. hq = qfilt('df2t',{b,a}); Warning: 5 overflows in coefficients.
You are warned that some of the coefficients have overflowed. To account for this overflow, use normalize to modify the ReferenceCoefficients, QuantizedCoefficients, and ScaleValues property values for Hq.
hq = normalize(hq) hq = Quantized Direct form II transposed filter Numerator QuantizedCoefficients{1} ReferenceCoefficients{1} (1) 0.365295410156250 0.365289835338219130 (2) 0.395721435546875 0.395708380608267300 (3) 0.724884033203125 0.724891008581378560 (4) 0.724884033203125 0.724891008581378120 (5) 0.395721435546875 0.395708380608267240 (6) 0.365295410156250 0.365289835338218350 Denominator QuantizedCoefficients{2} ReferenceCoefficients{2} (1) 0.250000000000000 0.250000000000000000 (2) -0.541015625000000 -0.541012429707579350 (3) 0.790557861328125 0.790542752251058410 (4) -0.668945312500000 -0.668930473694134720 (5) 0.365966796875000 0.365965902328318770 (6) -0.103698730468750 -0.103697674644671510 FilterStructure = df2t ScaleValues = [0.03125 1] NumberOfSections = 1 StatesPerSection = [5] CoefficientFormat = quantizer('fixed', 'round', 'saturate', [16 15]) InputFormat = quantizer('fixed', 'floor', 'saturate', [16 15]) OutputFormat = quantizer('fixed', 'floor', 'saturate', [16 15]) MultiplicandFormat = quantizer('fixed', 'floor', 'saturate', [16 15]) ProductFormat = quantizer('fixed', 'floor', 'saturate', [32 30]) SumFormat = quantizer('fixed', 'floor', 'saturate', [32 30])
Notice that none of the coefficients overflow, and that the ScaleValues property value has changed.
| noperations | noverflows | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |