This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.


Estimate cost for implementing filter System objects


c = cost(sysobj)
c = cost(sysobj,Name,Value)


c = cost(sysobj) returns a cost estimate c for the filter System object™ sysobj.

c = cost(sysobj,Name,Value) returns a cost estimate c for the filter System object sysobj with additional options specified by one or more Name,Value pair arguments.

Input Arguments

collapse all


Filter System object.

All filter system objects support analysis methods. For more information on analysis methods, see Analysis Methods for Filter System Objects. For a list of analysis methods supported by a particular filter System object, for example dsp.FIRHalfbandDecimator, enter dsp.FIRHalfbandDecimator.helpFilterAnalysis at the MATLAB® Command prompt.

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.

collapse all

Specify the arithmetic used during analysis. The analysis tool assumes a double precision filter when the arithmetic input is not specified and the filter System object is in an unlocked state. 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 for non-CIC structures, 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. CIC structures only support fixed-point arithmetic.

Output Arguments


Cost estimate, c contains the following fields:

Estimated Value



Number of filter coefficients (excluding coefficients with values 0, 1 or -1)


Number of filter states


Number of multiplication operations performed for each input sample


Number of addition operations performed for each input sample


collapse all

This example shows how to compute the cost of implementing an FIR Filter created using dsp.FIRFilter object.

Fs = 8000; Fcutoff = 2000;
firFilt = dsp.FIRFilter('Numerator', fir1(130,Fcutoff/(Fs/2)));
ans = 

  struct with fields:

                  NumCoefficients: 131
                        NumStates: 130
    MultiplicationsPerInputSample: 131
          AdditionsPerInputSample: 130

See Also


Introduced in R2011a

Was this topic helpful?