DSP Blockset
  Go to block:
    Search    Help Desk 
FIR Rate Conversion    See Also

Upsample, filter, and downsample an input signal.

Library

Multirate Filters, in Filtering

Description

The FIR Rate Conversion block resamples the input to a period K/L times the input sample period, where K is specified by the Decimation factor parameter and L is specified by the Interpolation factor parameter. The resampling process consists of the following steps:

K and L must be relatively prime integers; that is, the ratio K/L cannot be reducible. The FIR Rate Conversion block implements the three steps together using a polyphase filter structure, which is more efficient than straightforward upsample-filter-decimate algorithms. The output of the interpolator is the first filter phase, while the output of the decimator is the last filter phase. When both K and L are greater than 1, the output is the last decimation phase from the first interpolation phase.

The filter specified by the FIR filter coefficients vector should be a lowpass FIR with a normalized cutoff frequency no greater than min(1/L,1/K). The coefficients in the vector are ordered in descending powers of z.

Frame-Based Operation

This block always operates in frame-based mode, and expects an Mi-by-N frame matrix input. Each of the N frames in the matrix contains Mi sequential time samples from an independent signal. The illustration below shows a 6-by-4 matrix input:

The Number of channels parameter specifies the number of independent channels (columns, N) in the matrix, and the block resamples each channel independently over time. Frame-based operation provides substantial increases in throughput rates, at the expense of greater model latency.

The Interpolation factor, L, and Decimation factor, K, must satisfy the relation

for an integer output frame size Mo. The simplest way to satisfy this requirement is to let the Decimation factor equal the input frame size, Mi. The output frame size, Mo, is then equal to the Interpolation factor. This change in the frame size, from Mi to Mo, produces the desired rate conversion while leaving the output frame period the same as the input (Tfo=Tfi).

Diagnostics

An error is generated if the relation between K and L shown above is not satisfied.

A warning is generated if L and K are not relatively prime; that is, if the ratio L/K can be reduced to a ratio of smaller integers.

The block scales the ratio to be relatively prime, and continues the simulation.

Note
If you expect to generate code for the FIR Rate Conversion block using the Real-Time Workshop, you should ensure that inputs are contiguous in memory. See the Contiguous Copy block for more information.

Dialog Box

FIR filter coefficients
The FIR filter coefficients, in descending powers of z.
Decimation factor
The integer factor, K, by which to downsample the signal after filtering.
Interpolation factor
The integer factor, L, by which to upsample the signal before filtering.
Number of channels
The number of columns (channels) in the input matrix, N.

References

Fliege, N. J. Multirate Digital Signal Processing: Multirate Systems, Filter Banks, Wavelets. West Sussex, England: John Wiley & Sons, 1994.

See Also

Downsample
FIR Decimation
FIR Interpolation
Upsample
upfirdn (Signal Processing Toolbox)


[ Previous | Help Desk | Next ]