Upsample, filter, and downsample input signal and generates optimized HDL code
DSP System Toolbox HDL Support / Filtering
The FIR Rate Conversion HDL Optimized block 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 block implements a polyphase architecture to avoid unnecessary arithmetic operations and high intermediate sample rates.
The block upsamples the input signal by an integer factor of L, applies it to a FIR filter, and downsamples the input signal by an integer factor of M.
You can use the input and output control ports for pacing the flow of samples. In the default configuration, the block uses validIn and validOut control signals. For additional flow control, you can enable a ready output signal and a request input signal.
The ready output port indicates that the block can accept a new input
data sample on the next time step. When L ≥ M, you can
use the ready signal to achieve continuous output data samples. If you
apply a new input sample after each time the block returns ready signal
as 1
, the block returns a data output sample with the
validOut signal set to 1
on every time step.
When you disable the ready port, you can apply a valid data sample
only every ceil(L/M)
time steps. For example, if:
L/M = 4/5, then you can apply a new input sample on every time step.
L/M = 3/2, then you can apply a new input sample on every other time step.
When you enable the request input port, the block returns the next
output sample when therequest signal is 1
and a valid
output sample is available. When you disable the request port, the block
returns output samples when they are available. When no new data is available, block sets the
validOut signal to 0
.
You can connect the request input port to the ready output port of a downstream block.