cost
Implementation cost of the sample rate converter
Syntax
Description
Examples
Computational Cost of Sample Rate Converter
Create src
, a multistage sample rate converter with default values. src
combines three filter stages to convert from 192 kHz to 44.1 kHz. Determine its computational cost: the number of coefficients, the number of states, the number of multiplications per unit sample, and the number of additions per unit sample.
src = dsp.SampleRateConverter; cst = cost(src)
cst = struct with fields:
NumCoefficients: 8631
NumStates: 138
MultiplicationsPerInputSample: 27.6672
AdditionsPerInputSample: 26.6875
Repeat the computation allowing a tolerance of 10% in the output sample rate.
src.OutputRateTolerance = 0.1; ctl = cost(src)
ctl = struct with fields:
NumCoefficients: 44
NumStates: 80
MultiplicationsPerInputSample: 14.2500
AdditionsPerInputSample: 13.5000
Input Arguments
src
— Multistage sample rate converter
SampleRateConverter
System object™
Multistage sample rate converter, specified as a dsp.SampleRateConverter
System object.
Output Arguments
c
— Output structure
structure
Output structure with information about the computational cost of
src
:
Estimated Value | Description |
---|---|
| 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 |
Version History
Introduced in R2014b
See Also
Functions
Objects
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)