coeffs

Coefficients for filters

Syntax

s = coeffs(ha)
s = coeffs(hd)
s = coeffs(hm)
s = coeffs(hs)
s = coeffs(hs,Name,Value)

Description

s = coeffs(ha) returns a structure containing the coefficients of the adaptive filter ha.

s = coeffs(hd) returns a structure containing the coefficients of the discrete-time filter hd.

s = coeffs(hm) returns a structure containing the coefficients of the multirate filter hm.

s = coeffs(hs) returns filter coefficients for the filter System object™ hs.

s = coeffs(hs,Name,Value) returns filter coefficients for the filter System object hs with additional options specified by one or more Name,Value pair arguments.

Input Arguments

expand all

ha

Adaptive adaptfilt filter object.

hd

Discrete-time dfilt filter object.

hm

Multirate mfilt filter object. CIC-based filters do not have coefficients, so the function does not support CIC filter structures such as mfilt.cicdecim.

hs

Filter System object.

The following Filter System objects are supported by this analysis function:

Filter System objects
dsp.FIRFilter
dsp.FIRInterpolator
dsp.CICInterpolator
dsp.FIRDecimator
dsp.CICDecimator
dsp.FIRRateConverter
dsp.BiquadFilter
dsp.IIRFilter
dsp.AllpoleFilter
dsp.AllpassFilter
dsp.CoupledAllpassFilter

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' — The types of values:‘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

s

Structure with a single field, Numerator, containing filter coefficients. For adaptive filters, s contains the instantaneous frequency response available at the time you use the function.

Examples

coeffs works the same way for all filters. This example uses a multirate filter hm to demonstrate the function.

hm=mfilt.firdecim(3);
s=coeffs(hm);
stem(s.Numerator)

The filter coefficients may be extracted by typing s.Numerator at the command prompt.

Was this topic helpful?