Contents

scaleopts

Options for scaling SOS filter

Syntax

opts = scaleopts(hd)
opts = scaleopts(hs)
opts = scaleopts(hs,Name,Value)

Description

opts = scaleopts(hd) uses the current settings in the dfilt filter hd to create an options object opts that contains specified scaling options for second-order section scaling. You can pass opts as an input to scale to apply scaling settings to a second-order filter.

opts = scaleopts(hs) creates an options object based on the current settings of the filter System object™ hs.

opts = scaleopts(hs,Name,Value) creates an options object with additional options specified by one or more Name,Value pair arguments.

Input Arguments

expand all

hd

Discrete-time dfilt.df1sos, dfilt.df2tsos, dfilt.df2sos, or dfilt.df1tsosfilter object.

hs

dsp.BiquadFilter filter System object.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

'Arithmetic' — Value types:‘double' | 'single' | 'fixed'

For filter System object inputs only, specify the arithmetic used during analysis. When you specify 'double' or 'single', the function performs double- or single-precision analysis. When you specify 'fixed' , the arithmetic changes depending on the setting of the CoefficientDataType property and whether the System object is locked or unlocked.

 Details for Fixed-Point Arithmetic

When you do not specify the arithmetic, the function uses double-precision arithmetic if the filter System object is in an unlocked state. If the System object is locked, the function performs analysis based on the locked input data type.

Output Arguments

opts

Scaling object. The following table lists the properties of opts.

Parameter

Default

Description and Valid Value

MaxNumerator

2

Maximum allowed value for numerator coefficients.

MaxScaleValue

No default value

Maximum allowed scale values. The filter applies the MaxScaleValue limit only when you set ScaleValueConstraint to a value other than unit. Setting MaxScaleValue to a numerical value automatically changes the ScaleValueConstraint setting to none.

NumeratorConstraint

none

Specifies whether and how to constrain numerator coefficient values. Options are none, normalize, po2, and unit.

OverflowMode

wrap

Sets the way the filter handles arithmetic overflow situations during scaling. Choose one ofwrap or saturate or satall.

ScaleValueConstraint

unit

Specify whether to constrain the filter scale values, and how to constrain them. Valid options are none, po2, and unit.

Examples

From a filter hd, you can create an options scaling object that contains the scaling options settings you require.

[b,a]=ellip(10,.5,20,0.5);
[s,g]=tf2sos(b,a);
hd=dfilt.df1sos(s,g)
opts=scaleopts(hd)
 
opts =
 
            MaxNumerator: 2
     NumeratorConstraint: 'none'
            OverflowMode: 'wrap'
    ScaleValueConstraint: 'unit'
           MaxScaleValue: 'Not used'
Was this topic helpful?