| Filter Design Toolbox | ![]() |
Set all data format property values for quantized filters and quantized FFTs
Syntax
Description
When Hq is a floating-point quantized filter, setbits(Hq,format) sets all data format properties for the quantized filter Hq to the values specified by format. In this case, format is a two-element vector of integers whose entries are described as follows:
format sets the word length in bits.
format sets the exponent length in bits.
When Hq is a fixed-point quantized filter, setbits(Hq,format) sets the properties CoefficientFormat, InputFormat, and OutputFormat to the value specified by format, whereas the property values SumFormat and ProductFormat are specified by 2*format. In this case, format is a two-element vector of integers whose entries are described as follows:
format sets the word length in bits.
format sets the fraction length (the number of bits after the radix point).
Note
When 2*format exceeds the maximum values for the SumFormat and ProductFormat properties, their maximum values are used instead.
|
setbits(F,fmt) sets all data format property values for quantized FFT F.
When F is a fixed-point quantized FFT, fmt = [w, f] where w is the word length and f is the fraction length. The twiddle, input, and output formats are set to [w, f]. The sum and product formats are set to [2w, 2f].
When F is a floating-point quantized FFT, fmt = [w, e] where w is the word length and e is the exponent length. All formats are set to [w, e].
If the specified formats exceed the maximum allowed, they are set to the maximum.
Examples
Create a quantized filter with default data format property values. Set the CoefficientFormat, InputFormat, and OutputFormat property values for a 24-bit word length, and a 23-bit fraction length, while setting the SumFormat and ProductFormat property values to a 48-bit word length and a 46-bit fraction length.
Hq = qfilt; setbits(Hq,[24 23]) get(Hq) Quantized Direct form II transposed filter Numerator QuantizedCoefficients{1} ReferenceCoefficients{1} + (1) 0.9999998807907105 1.000000000000000000 (2) 0.5000000000000000 0.500000000000000000 Denominator QuantizedCoefficients{2} ReferenceCoefficients{2} + (1) 0.9999998807907105 1.000000000000000000 (2) 0.7000000476837158 0.699999999999999960 (3) 0.8899999856948853 0.890000000000000010 FilterStructure = df2t ScaleValues = [1] NumberOfSections = 1 StatesPerSection = [2] CoefficientFormat = quantizer('fixed', 'round', 'saturate', [24 23]) InputFormat = quantizer('fixed', 'floor', 'saturate', [24 23]) OutputFormat = quantizer('fixed', 'floor', 'saturate', [24 23]) MultiplicandFormat = quantizer('fixed', 'floor', 'saturate', [24 23]) ProductFormat = quantizer('fixed', 'floor', 'saturate', [48 46]) SumFormat = quantizer('fixed', 'floor', 'saturate', [48 46])
| set | sos | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |