Engee documentation

FIR Interpolation

Polyphase interpolation with FIR filter.

fir interpolation

Description

The FIR Interpolation block performs efficient polyphase interpolation using the integer interpolation factor on the first measurement.

Conceptually, interpolation with a finite impulse response filter (FIR filter, FIR) represents frequency upsampling by a factor of followed by the application of a reconstructive FIR filter, which is typically an approximation of an ideal band-limited interpolation filter.

Raising the sampling rate of each channel of the input signal to a higher frequency is done by adding zeros between samples. A FIR filter filters each channel of the transformed data. The resulting sampled signal has a sampling rate of times the original sampling rate.

fir interpolation 1

However, the actual block algorithm implements the polyphase structure of a direct-form FIR filter, the effective equivalent of the combined system shown in the diagram. More details are given in Sect. [Алгоритмы].

The FIR Interpolation block can be used within trigger subsystems if the Rate options parameter is set to Enforce single-rate processing.

Ports

Input

In - input data
scalar | vector | matrix

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

Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64.

Support for complex numbers: Yes.

Num - coefficients of the numerator of the filter transfer function
vector

Port of input of FIR filter numerator coefficients in the form of vector.

The transfer function of the FIR filter is defined as:

To operate as an effective reconstruction filter, the coefficients generally correspond to a low-pass filter with a value of normalised cut-off frequency no greater than the value of the inverse of the interpolation coefficient.

The values of the coefficients are adjustable. That is, their values can be changed during the modelling process, while their properties such as size, data type and complexity remain unchanged.

Dependencies

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

Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64.

Support for complex numbers: Yes.

Output

Out - output data after interpolation
scalar | vector | matrix

Output data after interpolation, returned as a scalar, vector or matrix.

The block behaviour depends on the value of the Rate options parameter:

  • Enforce single-rate processing - when this value is selected, the block keeps the input sampling rate and interpolates the signal, increasing the output frame size by times.

  • Allow multirate processing - when this value is selected, the block interpolates the signal so that the output sampling rate is times the input sampling rate.

Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64.

Support for complex numbers: Yes.

Parameters

Coefficient source - method of coefficient setting
Dialog parameters (by default) | Input port

If the parameter has the value Dialog parameters, the filter coefficients are set in the parameter settings window. If the parameter has the value Input port, the filter coefficients are set through the input port Num.

FIR filter coefficients - coefficients of low-frequency FIR filter
[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] (By default) | vector.

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


To operate as an effective reconstruction filter, the coefficients are usually selected to correspond to a low-pass filter with a value of normalised cut-off frequency no greater than the value of the inverse of the interpolation coefficient.

The block initialises all filter states with zero.

Dependencies

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

Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64.

Support for complex numbers: Yes.

Interpolation factor - interpolation factor
3 (By default) | positive scalar

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

Data types: Int8, Int16, Int32, Int64.

Input processing - type of input signal processing
Columns as channels (frame based) | Elements as channels (sample based)

Specify whether the block performs sample-based or frame-based processing. Options to select:

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

  • Columns as channels (frame based)` - each column of the input signal is treated as an independent channel (frame based processing).

Rate options - the method by which the block interpolates the input data
Enforce single-rate processing (by default) | Allow multirate processing.

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

  • Enforce single-rate processing - when this method is selected, the block retains the sampling rate of the input signal and interpolates the signal, increasing the output frame size by a factor of . To select this method, the Input processing parameter must be set to Columns as channels (frame based).

  • Allow multirate processing - when this method is selected, the block interpolates the signal so that the output sampling rate is times the input sampling rate.

Read More

Frame-based processing

When Input processing is set to Columns as channels (frame based), the unit re-samples each column of the input signal in time. In this mode, the block can perform either single-rate or multirate processing. You can use the Rate options parameter to specify how the block will resample the input data:

  • If the Rate options parameter is set to Enforce single-rate processing, the block’s input and output data have the same sampling rate. To interpolate the output data while preserving the sampling rate of the input data, the block recalculates the data in each column of the input data so that the output data frame size ( ) is times the input data frame size ( ).

  • If Rate options is set to Allow multirate processing, the input and output data of FIR filtered interpolation have the same size. However, the sampling rate of the output data is times higher than the sampling rate of the input data. In this mode, the block treats the input matrix to as independent channels. The block interpolates each column of the input signal in time, keeping the frame size constant ( = ), with the period of the output frame ( ) being times shorter than the period of the input frame ( ).

Sampling-based processing

If Input processing is set to Elements as channels (sample based), the block treats the input matrix to as independent channels and interpolates each channel in time. The output sampling period ( ) is times shorter than the input sampling period ( ), while the input and output data sizes remain identical.

Algorithms

Interpolation with FIR filter is efficiently realised using a polyphase structure.

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

where is the length of the FIR filter.

We can rearrange this equation as follows:

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

We can write this equation in the form:

where , , …​, are the 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

Let us replace with its polyphase representation.

fir interpolation 3

The identity for multivariate interpolation is presented here.

fir interpolation 4

Applying the identity for interpolation moves the zero samples insertion operation after the filtering operation. This move allows the signal to be filtered at a slower rate.

fir interpolation 5

You can replace the zero sample insertion operator, delay block, and adder with a switching switch. The switch starts at the first branch 0 and moves anti-clockwise, each time obtaining 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 filtered interpolation is .

fir interpolation 6

References

  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.