MOTDSP566 Blockset

 

     Search     Help Desk 
MOTDSP566 FIR Interpolation  Contents   See Also

Purpose

Upsample and filter an input signal.

Library

Motdsp566lib

Description

The MOTDSP566 FIR Interpolation block resamples the input at an integer rate L times faster than the input sample rate, where L is specified by the Interpolation factor parameter. This process consists of two steps:

The MOTDSP566 FIR Interpolation block implements the upsampling and FIR filtering steps together using a polyphase filter structure, which is more efficient than straightforward upsample-then-filter algorithms.

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

The Frame-based inputs parameter allows you to choose between sample-based and frame-based operation.

Sample-Based Operation

When the check box is not selected (default), the block assumes that the input is a 1-by-N sample vector or M-by-N sample matrix. Each of the N vector elements (or M*N matrix elements) is treated as an independent channel, and the block interpolates each channel over time.

Frame-Based Operation

When the Frame-based inputs check box is selected, the block assumes that the input is an M-by-N frame matrix. Each of the N frames in the matrix contains M 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 interpolates each channel independently over time. Frame-based operation provides substantial increases in throughput rates, at the expense of greater model latency.

In frame-based operation, the Framing parameter determines how the block adjusts the rate at the output. There are two available options:

Latency

Zero Latency.    The FIR Interpolation block has zero tasking latency for all single-rate operations. The block is single-rate for the particular combinations of sampling mode and parameter settings shown in the table below.

Sampling Mode Parameter Settings
Sample-based Interpolation factor parameter, L, is 1.
Frame-based Interpolation factor parameter, L, is 1, or
Framing parameter is Maintain input frame rate.

Note that in sample-based mode, single-rate operation occurs only in the trivial case of factor-of-1 interpolation.

The block also has zero latency for sample-based multirate operations in Simulink's single-tasking mode. Zero tasking latency means that the block propagates the first filtered input (received at t=0) as the first input sample, followed by L-1 interpolated values, the second filtered input sample, and so on.

Nonzero Latency.    The FIR Interpolation block is multirate for all settings other than those in the above table. The amount of latency for multirate operation depends on Simulink's tasking mode and the block's sampling mode, as shown in the table below.

Multirate... Sample-Based Latency Frame-Based Latency
Single-tasking None One frame (Mi samples)
Multitasking One sample One frame (Mi samples)

In cases of one-sample latency, a zero initial condition appears as the first output sample in each channel, followed immediately by the first filtered input sample, L-1 interpolated values, and so on.

In cases of one-frame latency, the first Mi output rows contain zeros, where Mi is the input frame size. The first filtered input sample (first filtered row of the input matrix) appears in the output as sample Mi+1, followed by L-1 interpolated values, the second filtered input sample, and so on. See the example below for an illustration of this case.

See "Excess Algorithmic Delay (Tasking Latency)" in Chapter 2 and "The Simulation Parameters Dialog Box" in Chapter 4 of Using Simulink for more information about block rates and Simulink's tasking modes.

Example

Construct the frame-based model shown below.

Adjust the block parameters as follows.

This model is multirate because there are at least two distinct sample rates, as shown by the two Probe blocks. To run this model in Simulink's multitasking mode, select Fixed-step and discrete from the Type controls in the Solver panel of the Simulation Parameters dialog box, and select MultiTasking from the Mode parameter. Also set the Stop time to 30.

Run the model and look at the output, yout. The first few samples of each channel are shown below.

Since we ran this frame-based multirate model in multitasking mode, the first four (Mi) output rows are zero. The first filtered input matrix row appears in the output as sample 5 (i.e., sample Mi+1). Every second row is an interpolated value.

The filter coefficient vector generated by fir1(3,0.25) is

or, equivalently,

Dialog Box

Command File
Command File used by Motorola DSP566xx simulator core.
DSP Processor Type
Select the DSP Processor to be used.
FIR filter coefficients
The FIR filter coefficients, in descending powers of z.
Interpolation factor
The integer factor, L, by which to increase the sample rate of the input sequence.
Frame-based inputs
Selects frame-based operation.
Number of channels
For frame-based operation, the number of columns (channels) in the input matrix, N.
Framing
For frame-based operation, the method by which to implement the interpolation: increase the output frame rate, or increase the output frame size.
Simulation Time to enter Interactive Mode (secs):
Simulation time to step into the assembly code by launching the assembly language debugger. This parameter must be a scalar greater than or equal to zero. This parameter will be ignored if not using Interactive Mode.

See Also

MOTDSP566 FIR Decimation FIR decimation


[ Previous | Help Desk | Next ]