dsphdl.FIRRateConverter
Upsample, filter, and downsample input signal
Description
The dsphdl.FIRRateConverter
System object™ upsamples, filters, and downsamples input signals. It is optimized for HDL code
generation and operates on one sample of each channel at a time. The object implements an
efficient polyphase architecture to avoid unnecessary arithmetic operations and high
intermediate sample rates.
The object upsamples by an integer factor of L, applies an FIR filter, and downsamples by an integer factor of M.
To resample and filter input data:
Create the
dsphdl.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?
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
Syntax
Description
returns a
System object, HDLFIRRC
= dsphdl.FIRRateConverterHDLFIRRC
, that resamples each channel of the input.
The object upsamples by an integer factor of L, applies an FIR filter,
and downsamples by an integer factor of M. The default
L/M is 3/2.
sets the HDLFIRRC
= dsphdl.FIRRateConverter(L
,M
,num
)InterpolationFactor
property to L
, the
DecimationFactor
property to M
, and the
Numerator
property to num
.
sets properties using one or more name-value arguments. For
example:HDLFIRRC
= dsphdl.FIRRateConverter(___,Name=Value
)
HDLFIRRC = dsphdl.FIRRateConverter(L,M,Num,ReadyPort=true);
Properties
Usage
Syntax
Description
[
resamples dataOut
,validOut
]
= HDLFIRRC(dataIn
,validIn
)dataIn
according to the InterpolationFactor
(L) and DecimationFactor
(M) properties. To avoid dropped samples
when using this syntax, apply new valid input samples, with validIn
set to true
, only every ceil(L/M)
calls to the
object. The object sets validOut
to true
when
dataOut
is a new valid sample.
[
resamples the input data and returns dataOut
,validOut
,ready
]
= HDLFIRRC(dataIn
,validIn
)ready
to indicate whether the
object can accept a new sample on the next call.
This syntax applies when you set the ReadyPort
property to true
. For example:
HDLFIRRC = dsphdl.FIRRateConverter(...,ReadyPort=true); ... [dataOut,validOut,ready] = rateConverter(dataIn,validIn);
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)