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.

Multistage sample rate converter

The `SampleRateConverter`

System
object™ converts the sample rate of an incoming signal.

To convert the sample rate of a signal:

Create the

`dsp.SampleRateConverter`

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).

`src = dsp.SampleRateConverter`

`src = dsp.SampleRateConverter(Name,Value)`

creates a
multistage FIR sample rate converter System
object, `src`

= dsp.SampleRateConverter`src`

, that converts the sample rate of each channel of
an input signal.

returns a multistage FIR sample rate converter System
object, `src`

= dsp.SampleRateConverter(`Name,Value`

)`src`

, with properties and options specified by one or
more `Name,Value`

pair arguments.

**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 = src(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)

The general multistage sample rate converter performs a multistage decimation, a single-stage sample rate conversion, and a multistage interpolation, in that order. Actual designs include at most two of those steps.

The procedure determines automatically the optimal number of decimation or interpolation stages. In special cases, the decimation or the interpolation can be performed in a single stage.

The algorithm always attempts to start by reducing the sample rate. This decreases the amount of computation required. The decimation step is designed so that no intermediate sample rate goes below the bandwidth of interest. This ensures that no information is filtered out.

Each individual stage uses halfband or Nyquist filters to minimize the number of nonzero coefficients.

Transition-band aliasing is allowed because it decreases the implementation cost. The signal within the bandwidth of interest is kept alias free up to the value specified by the

`StopbandAttenuation`

property.

`cost`

|`freqz`

|`getActualOutputRate`

|`getFilters`

|`getRateChangeFactors`

|`info`

|`visualizeFilterStages`