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.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Sample rate converter

The `dsp.FIRRateConverter`

System
object™ performs sampling rate conversion by a rational factor on a vector or matrix
input. The FIR rate convertor cascades an interpolator with a decimator. The interpolator
upsamples the input by the upsampling factor, *L*, followed by a lowpass FIR
filter. The FIR filter acts both as an anti-imaging filter and an anti-aliasing filter prior
to decimation. The decimator downsamples the output of upsampling and FIR filtering by the
downsampling factor *M*. You must use upsampling and downsampling factors
that are relatively prime, or coprime. The resulting discrete-time signal has a sampling rate
*L/M* times the original sampling rate.

To perform sampling rate conversion:

Create the

`dsp.FIRRateConverter`

object and set its properties.Call the object with arguments, as if it were a function.

To learn more about how System objects work, see What Are System Objects? (MATLAB).

`firrc = dsp.FIRRateConverter`

`firrc = dsp.FIRRateConverter(L,M,NUM)`

`firrc = dsp.FIRRateConverter(___,Name,Value)`

returns a FIR
sample rate converter, `firrc`

= dsp.FIRRateConverter`firrc`

, that resamples an input signal at a rate
3/2 times the original sampling rate.

returns an FIR sample rate converter, `firrc`

= dsp.FIRRateConverter(L,M,NUM)`firrc`

, with the
`InterpolationFactor`

property set to `L`

, the
`DecimationFactor`

property set to `M`

, and the `Numerator`

property set to `NUM`

.

returns an FIR sample rate converter, with additional properties specified by one or more
`firrc`

= dsp.FIRRateConverter(___,`Name,Value`

)`Name,Value`

pair arguments.

```
firrc =
dsp.FIRRateConverter('FullPrecisionOverride','false')
```

enables the fixed-point
data types to be controlled through the individual fixed-point property
settings.**For versions earlier than R2016b, use the step
function to run the System object algorithm. The arguments to
step are the object you created, followed by
the arguments shown in this section.**

**For example, y = step(obj,x) and y = obj(x) perform equivalent operations.**

`y = firrc(x)`

To use an object function, specify the
System
object as the first input argument. For
example, to release system resources of a System
object named `obj`

, use
this syntax:

release(obj)

This object implements the algorithm, inputs, and outputs described on the FIR Rate Conversion block reference page. The object properties correspond to the block parameters.