Engee documentation

FIR Interpolation

Polyphase interpolation with FIR filter.

blockType: FIRInterpolation

Path in the library:

/Signal Operations/Filters/MultirateFilters/FIR Interpolation

Description

Block FIR Interpolation performs efficient polyphase interpolation using an integer interpolation coefficient according to the first measurement.

Conceptually, interpolation with a finite impulse response filter (FIR filter) represents an increase in frequency in once, followed by the use of a reconstructive FIR filter, which is usually an approximation of an ideal interpolation filter with a limited frequency band.

Increasing the sampling rate of each channel of the input signal to a higher one is performed by adding there are no zeros between the samples. Next, the FIR filter filters each channel of the transformed data. The resulting discrete signal has a sampling frequency in times the original sampling rate.

fir interpolation 1

However, the real block algorithm implements a polyphase structure of a direct-form FIR filter, an effective equivalent of the combined system shown in the diagram. For more information, see Algorithms.

Block FIR Interpolation it can be used inside trigger subsystems if for the parameter Rate options the value is set Enforce single-rate processing.

Ports

Output

# OUT_1 — output after interpolation
scalar | vector | the matrix

Details

The output after interpolation, returned as a scalar, vector, or matrix.

The block behavior depends on the parameter value Rate options:

  • Enforce single-rate processing — when this value is selected, the unit saves the input sampling rate and interpolates the signal, increasing the size of the output frame in once.

  • Allow multirate processing — when this value is selected, the unit interpolates the signal in such a way that the output sampling rate in times the input sampling rate.

Data types

Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64

Complex numbers support

Yes

Input

# IN_1 — input data
scalar | vector | the matrix

Details

Input data for the block, specified as a vector or matrix.

Data types

Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64

Complex numbers support

Yes

# Num — coefficients of the numerator of the filter transfer function
vector

Details

The input port of the coefficients of the FIR filter numerator in the form of a vector.

Transfer function The FIR filter is set as

To work as an effective reconstruction filter, the coefficients usually correspond to a low-pass filter with a value of the normalized cutoff frequency no greater than the value of the inverse value of the interpolation coefficient.

The coefficient values are configurable. That is, their values can change during the modeling process, while their properties, such as size, data type and complexity, remain unchanged.

Dependencies

To use this port, set the parameter Coefficient source value Input port.

Data types

Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64

Complex numbers support

Yes

Parameters

Main

# Coefficient source — the method of setting coefficients
Dialog parameters | Input port

Details

If the parameter is set to Dialog parameters, then the filter coefficients are set in the parameter settings window. If the parameter is set to Input port, then the filter coefficients are set via the input port Num.

Values

Dialog parameters | Input port

Default value

Dialog parameters

Program usage name

CoefficientSource

Tunable

No

Evaluatable

No

# FIR filter coefficients — coefficients of the low-pass FIR filter
String

Details

Specify the coefficients of the numerator of the FIR filter transfer function :

To work as an effective reconstruction filter, the coefficients are usually selected so as to correspond to a low-pass filter with a normalized cutoff frequency value no greater than the value of the inverse of the interpolation coefficient.

The block initializes all filter states to zero.

Dependencies

To use this parameter, set for the parameter Coefficient source meaning Dialog parameters.

Default value

[0; -0.000129061486199961; -0.000228040316280948; 0; 0.000554613738572437; 0.000802607430267054; 0; -0.00152912350278902; -0.00203638780675590; 0; 0.00342230705979440; 0.00433928347039265; 0; -0.00673109372352446; -0.00825637814441869; 0; 0.0121125402586868; 0.0145130044012328; 0; -0.0204721583515830; -0.0241392529239787; 0; 0.0332125142618354; 0.0388230898504630; 0; -0.0529640018790903; -0.0619837024555044; 0; 0.0860610417481775; 0.102712774109103; 0; -0.154048515452570; -0.197567026018057; 0; 0.408837525145054; 0.824655115145336; 1; 0.824655115145336; 0.408837525145054; 0; -0.197567026018057; -0.154048515452570; 0; 0.102712774109103; 0.0860610417481775; 0; -0.0619837024555044; -0.0529640018790903; 0; 0.0388230898504630; 0.0332125142618354; 0; -0.0241392529239787; -0.0204721583515830; 0; 0.0145130044012328; 0.0121125402586868; 0; -0.00825637814441869; -0.00673109372352446; 0; 0.00433928347039265; 0.00342230705979440; 0; -0.00203638780675590; -0.00152912350278902; 0; 0.000802607430267054; 0.000554613738572437; 0; -0.000228040316280948; -0.000129061486199961]

Program usage name

FilterCoefficients

Tunable

No

Evaluatable

Yes

# Interpolation factor — the interpolation coefficient
Real number

Details

Specify the integer coefficient . The block increases the sampling rate of the input sequence according to this factor.

Default value

3

Program usage name

InterpolationFactor

Tunable

No

Evaluatable

Yes

# Input processing — input signal processing type
Columns as channels (frame based) | Elements as channels (sample based)

Details

Specify whether the block performs processing based on a reference or frame. Options to choose from:

  • Elements as channels (sample based) — each element of the input signal is considered as an independent channel (sample-based processing).

  • Columns as channels (frame based) — Each column of the input signal is considered as an independent channel (frame-based processing).

For more information, see Signal processing by frames and counts.

Values

Columns as channels (frame based) | Elements as channels (sample based)

Default value

Columns as channels (frame based)

Program usage name

InputProcessing

Tunable

No

Evaluatable

No

# Rate options — the method by which the block interpolates the input data
Allow multirate processing | Enforce single-rate processing

Details

Specify the method by which the block should interpolate the input data. Options to choose from:

  • Enforce single-rate processing — when choosing this method, the unit saves the sampling rate of the input signal and interpolates the signal, increasing the size of the output frame in once. To select this method, the parameter Input processing must have a value Columns as channels (frame based).

  • Allow multirate processing — when selecting this method, the unit interpolates the signal in such a way that the output sampling rate in times higher than the input sampling rate.

Values

Allow multirate processing | Enforce single-rate processing

Default value

Enforce single-rate processing

Program usage name

RateOptionsFrameBased

Tunable

No

Evaluatable

No

# Output buffer initial conditions — initial conditions

Details

This parameter appears only if the block is configured for multi-speed processing, i.e. for the parameter Rate options the value is set Allow multirate processing in this case, there is a delay in data transmission in the block. The amount of delay during multi-speed, multitasking depends on the value of the parameter. Input processing.

Input processing Delay

Elements as channels (sample based)

selections

Columns as channels (frame based)

frames ( samples per frame)

When the block shows a delay, the initial conditions are zero by default. Alternatively, you can use the parameter Output buffer initial conditions to specify a matrix of initial conditions containing one value for each channel, or a scalar initial condition that the block applies to all channels. The block divides the initial conditions Output buffer initial conditions on Interpolation factor and outputs scaled initial conditions until the first filtered input sample is available.

The initial conditions are stored in the output data type and scaling.

Additional information about the delay in the block FIR Interpolation It is given in the Delay time section.

Dependencies

To use this parameter, set for the parameter Rate options meaning Allow multirate processing.

Default value

0

Program usage name

OutputBufferIC

Tunable

No

Evaluatable

Yes

Additional Info

Frame-based processing

Details

If for the parameter Input processing the value is set Columns as channels (frame based), then the block resamples each column of the input signal in time. In this mode, the unit can perform both single-speed and multi-speed processing. You can use the parameter Rate options to specify how the block will recalculate the input data:

  • If for the parameter Rate options the value is set Enforce single-rate processing, then the input and output data of the block have the same sampling rate. To interpolate the output data while maintaining the sampling rate of the input data, the block recalculates the data in each input data column so that the size of the output data frame was in times larger than the input data frame size: .

  • If for the parameter Rate options the value is set Allow multirate processing, then the input and output data of the FIR filter interpolation have the same size. However, the sampling rate of the output data in times higher than the sampling rate of the input data. In this mode, the block examines the input matrix on how independent channels. The block interpolates each column of the input signal over time, keeping the frame size constant ( ), while the period of the output frame ( ) in times shorter than the period of the input frame ( ).

Sample-based processing

Details

If for the parameter Input processing the value is set Elements as channels (sample based), then the block considers the input matrix on how independent channels and interpolates each channel in time. The sample period at the output in times shorter than the sample period at the input: at the same time, the sizes of the input and output data remain identical.

Delay time

Details

If for the parameter Input processing the value is set Columns as channels (frame based), and for the parameter Rate optionsEnforce single-rate processing, then the block FIR Interpolation it always has zero latency. Zero delay means that the block transmits the first filtered input sample received at a given time. , as the first output sample. The first output sample is then followed by the interpolated values, the second filtered input sample, and so on.

The only time when the block FIR Interpolation demonstrates the delay, this is if for the parameter Rate options the value is set Allow multirate processing. The amount of delay during multi-speed, multitasking depends on the value of the parameter. Input processing.

Input processing Delay

Elements as channels (sample based)

selections

Columns as channels (frame based)

frames ( samples per frame)

When the block shows a delay, the initial conditions are zero by default. Alternatively, you can use the parameter Output buffer initial conditions to specify a matrix of initial conditions containing one value for each channel, or a scalar initial condition that the block applies to all channels. The block divides the initial conditions Output buffer initial conditions on Interpolation factor and outputs scaled initial conditions until the first filtered input sample is available.

When the block is in sample-based processing mode, it outputs scaled initial conditions at the beginning of each channel, followed immediately by the first filtered input sample, then interpolated values, and so on.

When the block is in frame-based processing mode and uses an initial default value of zero, the first the output lines contain zeros, where — the size of the input frame. The first filtered input sample (the first filtered row of the input matrix) appears in the output as selection. Then follows the interpolated values, the second filtered input sample, and so on.

Algorithms

The FIR filter interpolation is effectively implemented using a polyphase structure.

To derive the polyphase structure, we begin by defining the transfer function of the FIR filter.:

where — this is the length of the FIR filter.

You can rearrange this equation as follows:

where — this is the number of polyphase components, and its value is equal to the interpolation coefficient, which is set in the parameter settings window.

You can write this equation as

where — polyphase components of the FIR filter .

Conceptually, FIR filter interpolation consists of an interpolation coefficient followed by a low-pass FIR filter .

fir interpolation 1

Replace its polyphase representation.

fir interpolation 3

The identity for multidimensional interpolation is presented here.

fir interpolation 4

Applying the identity for interpolation moves the operation of inserting zero samples after the filtering operation. This move allows you to filter the signal at a lower rate.

fir interpolation 5

You can replace the zero sample insertion operator, the delay block, and the adder with a switching switch. The switch starts at the first branch 0 and moves counterclockwise, each time getting one sample from each branch. The interpolator effectively outputs samples for each input sample received. Thus, the sampling rate at the output of the FIR filter interpolation is .

fir interpolation 6

Literature

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

  2. Orfanidis, Sophocles J. Introduction to Signal Processing. Upper Saddle River, NJ: Prentice-Hall, 1996.