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.

getRateChangeFactors

Get overall interpolation and decimation factors

Syntax

[L,M] = getRateChangeFactors(rateConverter)

Description

example

[L,M] = getRateChangeFactors(rateConverter) returns the overall interpolation factor, L, and the overall decimation factor, M, corresponding to the rateConverter. The rate converter object can be a dsp.FarrowRateConverter System object™ or a dsp.SampleRateConverter System object. The rate change factors computed take into account the OutputRateTolerance property. The overall decimation factor affects the allowable frame size of the input to the object. The row length of the input vector or matrix must be an integer multiple of M.

This function supports C and C++ code generation.

Examples

collapse all

Create a default dsp.FarrowRateConverter object that converts a signal from 44.1 kHz to 48 kHz.

frc = dsp.FarrowRateConverter
frc = 
  dsp.FarrowRateConverter with properties:

   Main
        InputSampleRate: 44100
       OutputSampleRate: 48000
    OutputRateTolerance: 0
          Specification: 'Polynomial order'
        PolynomialOrder: 3

  Show all properties

Return the overall interpolation (L) and decimation (M) factors of the filter object.

[L,M] = getRateChangeFactors(frc)
L = 160
M = 147

Create src, a multistage sample rate converter with default properties. src combines three filter stages to convert from 192 kHz to 44.1 kHz. Determine its overall interpolation and decimation factors.

src = dsp.SampleRateConverter;
[L,M] = getRateChangeFactors(src)
L = 147
M = 640

Input Arguments

collapse all

Polynomial sample rate conversion filter, specified as a dsp.FarrowRateConverter or a dsp.SampleRateConverter System object.

Output Arguments

collapse all

Overall interpolation factor, returned as a scalar.

Data Types: double

Overall decimation factor, returned as a scalar. The overall decimation factor affects the allowable frame size of the input to the object. The row length of the input vector or matrix must be an integer multiple of M.

Data Types: double

Introduced in R2014b