| Filter Design Toolbox | ![]() |
Set or display property values for quantized filters, quantizers, and quantized FFTs
Syntax
set(Hq) set(Hq,'prop',value) set(Hq,'prop1',value1, 'prop2',value2,...) s = set(Hq) set(Hq,struct)set(Hq,{'prop1','prop2',...},{value1,value2,...})set(q, PropertyValue1, PropertyValue2, ... ) set(q,a) set(q,pn,pv) set(q,'PropertyName1',PropertyValue1,'PropertyName2', PropertyValue2,...) q.PropertyName = Value set(q) s = set(q) set(F,'PropertyName',PropertyValue) set(F,'PropertyName1',PropertyValue1,'PropertyName2', PropertyValue2,...) set(F,a) set(F,pn,pv) F.PropertyName = Value set(F) s = set(F)
Description
set(Hq)
displays all of the property names and their possible values for a given quantized filter Hq. The display indicates the default values for properties in braces. When the default values for a property cannot be represented by a finite list, set(Hq) does not display the property's default values.
set(Hq,' sets the values for the property 'prop',value)
prop' of a quantized filter Hq. You specify the property name by the string 'prop', and the associated value in value. 'prop' can be any of the properties listed in Table 12-3, Quick Guide to Quantized Filter Properties,. value can be a string, a numerical value, or a cell array containing numerical values. The possible values for each property are described in detail in Quantized Filter Properties Reference.
set(Hq,' lets you set multiple properties in one command.prop1',value1,'prop2',value2,...)
s = set(Hq)
returns all property names and their possible values for a quantized filter Hq. s is a MATLAB structure whose field names are the property names of Hq and whose values are cell arrays of possible property values, except when the possible values for the property cannot be described with a finite list. In this case the values are empty cell arrays.
set(Hq,struct)
sets the properties of the quantized filter Hq according to the values associated with the field names of the MATLAB structure struct. All field names for the structure s must be valid quantized filter properties. See Table 12-3, Quick Guide to Quantized Filter Properties, for a list of all property names.
sets the listed properties specified in the cell array of a vector of strings set(Hq,{'prop1','prop2',...},{value1,value2,...})
{'prop1','prop2',...} to the corresponding values listed in the cell array {value1,value2,...} for quantized filter object Hq. The two cell array input arguments must be the same size, and the values must be valid for the corresponding properties.
set(q, PropertyValue1, PropertyValue2,...) sets the properties of quantizer q. If two property values conflict, the last value in the list is the one that is set.
set(q,a) where a is a structure whose field names are object property names, sets the properties named in each field name with the values contained in the structure.
set(q,pn,pv) sets the named properties specified in the cell array of strings pn to the corresponding values in the cell array pv.
set(q,'PropertyName1',PropertyValue1,'PropertyName2', sets multiple property values with a single statement. Note that you can use property name/property value string pairs, structures, and property name/property value cell array pairs in the same call to
PropertyValue2,...)set.
q.PropertyName = Value uses the dot notation to set property PropertyName to Value.
set(q) displays the possible values for all properties of quantizer q.
s = set(q) returns a structure containing the possible values for the properties of quantizer q.
The states are cleared when you set any value other than WarnIfOverflow.
For a quantizer, these are the possible property values, sorted by property name.
set(F,'PropertyName',PropertyValue) sets the value of the specified property for the quantized FFT F.
set(F,'PropertyName1',PropertyValue1,'PropertyName2',PropertyValue2,...) sets multiple property values with a single statement. Note that you can use property name/property value string pairs, structures, and property name/property value cell array pairs in the same call to set.
set(F,a) where a is a structure whose field names are object property names, sets the properties named in each field name with the values contained in the structure.
set(F,pn,pv) sets the named properties specified in the cell array of strings pn to the corresponding values in the cell array pv for all objects specified in H.
F.PropertyName = Value uses the dot notation to set property PropertyName to Value.
set(F) displays the possible values.
s = set(F) returns a structure with the possible values.
Remarks
Examples
Create a quantized filter and change the values for the ReferenceCoefficients and InputFormat properties.
Hq = qfilt; set(Hq,'ref',{[1 .5] [1 .7 .89]},'inp',[16,14]) Hq Hq = Quantized direct-form II transposed filter Numerator QuantizedCoefficients{1} ReferenceCoefficients{1} + (1) 0.999969482421875 1.000000000000000000 (2) 0.500000000000000 0.500000000000000000 Denominator QuantizedCoefficients{2} ReferenceCoefficients{2} + (1) 0.999969482421875 1.000000000000000000 (2) 0.700012207031250 0.699999999999999960 (3) 0.890014648437500 0.890000000000000010 FilterStructure = df2t ScaleValues = [1] NumberOfSections = 1 StatesPerSection = [2] CoefficientFormat = quantizer('fixed', 'round', 'saturate', [16 15]) InputFormat = quantizer('fixed', 'floor', 'saturate', [16 14]) 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]) Warning: 2 overflows in coefficients.
You can create a structure to assign the same data format property values to a set of filters.
s.InputFor = [16,14]; s.Coefficient = [16,14]; s.SumF = [17,15]; s.Prod = [16,15]; s.output = [24,23];
Now assign those property values to the filter in the previous example.
set(Hq,s) Hq Hq = Quantized Direct-form II transposed filter Numerator QuantizedCoefficients{1} ReferenceCoefficients{1} (1) 1.00000000000000 1.000000000000000000 (2) 0.50000000000000 0.500000000000000000 Denominator QuantizedCoefficients{2} ReferenceCoefficients{2} (1) 1.00000000000000 1.000000000000000000 (2) 0.70001220703125 0.699999999999999960 (3) 0.89001464843750 0.890000000000000010 FilterStructure = df2t ScaleValues = [1] NumberOfSections = 1 StatesPerSection = [2] CoefficientFormat = quantizer('fixed', 'round', 'saturate', [16 14]) InputFormat = quantizer('fixed', 'floor', 'saturate', [16 14]) OutputFormat = quantizer('fixed', 'floor', 'saturate', [24 23]) MultiplicandFormat = quantizer('fixed', 'floor', 'saturate', [16 15]) ProductFormat = quantizer('fixed', 'floor', 'saturate', [16 15]) SumFormat = quantizer('fixed', 'floor', 'saturate', [17 15])
Notice that you do not have to provide complete property names when you create the structure fields.
The next example uses property name/property value pairs to set quantizer properties.
q = quantizer; set(q, 'mode','fixed', ... 'roundmode','ceil', ... 'overflowmode','wrap', ... 'format',[24 22]);
O you might use dot notation to enter the new property values:
With no output arguments and one input argument, set displays the defaults for the quantizer, quantized filter, or quantized FFT.
q = quantizer; set(q) Mode: [double | float | {fixed} | single | ufixed] RoundMode: [ceil | convergent | fix | {floor} | round] OverflowMode: [{saturate} | wrap] Format: [wordlength fractionlength] - In 'fixed', 'ufixed' mode. [wordlength exponentlength] - In 'float' mode. [16 15] = default. Max: Maximum value before quantize. Min: Minimum value before quantize. NOverflows: Number of overflows. NUnderflows: Number of underflows.
With one output argument and one input argument, set returns a structure.
s = Mode: {'double' 'float' 'fixed' 'single' 'ufixed'} RoundMode: {'ceil' 'convergent' 'fix' 'floor' 'round'} OverflowMode: {'saturate' 'wrap'} Format: {} Max: {} Min: {} Overflows: {} NUnderflows: {}
See Also
get, qfilt, setbits, sos2cell, sos
| scalevalues | setbits | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |