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. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Estimate cost for implementing filter System objects


c = cost(sysobj)
c = cost(sysobj,'Arithmetic',arithType)



c = cost(sysobj) returns a structure, c, whose fields contain information about the computational cost of implementing the filter System object™, sysobj.

c = cost(sysobj,'Arithmetic',arithType) returns a cost estimate c for the filter System object sysobj in the arithmetic specified by arithType.


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

Input Arguments

collapse all

Specify the arithmetic used during analysis. When the arithmetic input is not specified and the filter System object is unlocked, the analysis tool assumes a double-precision filter. The 'Arithmetic' property set to 'Fixed' applies only to filter System objects with fixed-point properties.

Output Arguments

collapse all

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

Introduced in R2011a