dsphdl.FarrowRateConverter
Description
The dsphdl.FarrowRateConverter
System object™ converts the sample rate of a signal by using FIR filters to implement a
polynomial sinc approximation. A Farrow filter is an efficient rate converter when the rate
conversion factor is a ratio of large integer decimation and interpolation factors. Specify
the rate conversion factor by providing the input sample rate and the desired output sample
rate. You can provide the rate conversion factor as a fixed property or as a time-varying
input signal.
You can use this object with the default coefficients for most rate conversions. The
default coefficients are a LaGrange interpolation that matches the
dsp.FarrowRateConverter
System object. Or, you can specify a custom set of coefficients if the default does not meet
your specifications.
The object provides a hardware-friendly interface with input and output control signals. To provide a cycle-accurate simulation of the generated HDL code, the object models architectural latency including pipeline registers and multiplier optimizations.
To filter and resample input data with an HDL-optimized Farrow rate converter:
Create the
dsphdl.FarrowRateConverter
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?
Note
You can also generate HDL code for this hardware-optimized algorithm, without creating a MATLAB® script, by using the DSP HDL IP Designer app. The app provides the same interface and configuration options as the System object.
Creation
Description
creates an
HDL-optimized Farrow filter System object with default properties.rc
= dsphdl.FarrowRateConverter
sets properties using one or more name-value arguments.rc
= dsphdl.FarrowRateConverter(Name=Value
)
For example:
rc = dsphdl.FarrowRateConverter(RateChange=441e3/96e3, ... FilterStructure='Direct form transposed'); [dataOut,validOut,ready] = rc(dataIn,validIn);
Properties
Usage
Syntax
Description
[
filters data to achieve the input to output sample rate ratio, dataOut
,validOut
,ready
]
= rc(dataIn
,validIn
, rate
)rate
.
The object expects the rate
argument only when you set the
RateChangeSource
property to 'Input port'
. For
example:
rc = dsphdl.FarrowRateConverter(RateChangeSource='Input port') ... for k=1:length(dataIn) rate = myGetRate(); %calculate desired rate change [dataOut(k),validOut(k)] = rc(dataIn(k),validIn(k),rate);
Input Arguments
Output Arguments
Object Functions
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)
Algorithms
This System object implements the algorithms described on the Farrow Rate Converter block reference page.