Dialog FIR Decimation
Polyphase thinning with FIR filter. The FIR filter coefficients are set in the input field.
blockType: SubSystem
Path in the library:
|
Description
Block Dialog FIR Decimation performs efficient polyphase decimation using an integer sampling rate reduction factor according to the first measurement.
Conceptually, the FIR decimator (as shown in the diagram) consists of a smoothing FIR filter, followed by a decrease in the sampling frequency.
The FIR filter filters the data in each channel of the input signal using a direct-form FIR filter. The subsequent lowering of the sampling frequency reduces the samples of each channel of filtered data, taking each -Counting down and discarding the counts that follow it, where — this is the value of the decimation coefficient, which is set in the Decimation factor parameter. The resulting discrete-time signal has a sampling frequency reduced by times compared to the original one.
The FIR filter coefficients are set in the input field.
Note that the actual block algorithm implements a polyphase structure of a direct-form FIR filter, which is the effective equivalent of the combined system shown in the diagram. For more information, see Algorithms.
Ports
Input
#
IN_1
—
input data
scalar | vector | matrix
Details
Input data for a block specified as a scalar, vector or matrix.
| Data types |
|
| Complex numbers support |
Yes |
Output
#
OUT_1
—
output data after thinning
scalar | vector | matrix
Details
Output data after thinning, returned as a scalar, vector or matrix.
Block behaviour depends on the value of Rate options parameter:
-
Enforce single-rate processing- when this value is selected, the block keeps the input sampling rate and thins the signal, reducing the output frame size by times. -
Allow multirate processing- when this value is selected, the block thins the signal so that the output sample rate is times smaller than the input sample rate. The output frame size is the same as the input frame size.
| Data types |
|
| Complex numbers support |
Yes |
Parameters
Main group
# FIR filter coefficients — coefficients of the low-pass FIR filter
Details
Specify the coefficients of the numerator of the FIR filter transfer function in descending order:
Transfer function The FIR filter is defined as follows:
To work as an effective smoothing filter, the coefficients usually correspond to a low-pass filter with a normalized cutoff frequency of no more than , where — the decimation coefficient.
The block initializes all filter states to zero.
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
Yes |
# Decimation factor — decimation coefficient
Details
Specify the integer coefficient . The block reduces the sampling rate of the input sequence by this factor.
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
Yes |
#
Filter structure —
FIR filter structure
Direct form | Direct form transposed
Details
Specify the structure of the FIR filter: Direct form or `Direct form transposed'.
| Values |
|
| Default value |
|
| Program usage name |
|
| 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 |
|
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
Yes |
#
Rate options —
the method by which the block decimates the input data
Enforce single-rate processing | Allow multirate processing
Details
Specify the method by which the block should thin out the input data. Options to choose from:
-
'Enforce single-rate processing` — when this method is selected, the unit saves the sampling rate of the input signal and decimates the signal, reducing the size of the output frame in once. To select this method, the Input processing parameter must have the value
Columns as channels (frame based).
If the Rate options parameter is set to `Enforce single-rate processing', then the Dialog FIR Decimation block can be used inside trigger subsystems.
-
`Allow multirate processing' — when this method is selected, the unit decimates the signal in such a way that the output sampling rate in times less than the entrance one.
Dependencies
To use this parameter, set the Input processing parameter to Columns as channels (frame based).
| Values |
|
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
Yes |
# Allow arbitrary frame length for fixed-size input signals — allow arbitrary frame size for fixed-size input signals
Details
Specify whether fixed-size input signals (whose size does not change during simulation) can have an arbitrary frame size, that is, the frame size does not have to be a multiple of the decimation factor. The block uses this parameter only for fixed-size input signals and ignores it if the input signal has a variable size.
For fixed-size input signals:
-
If the Allow arbitrary frame length for fixed-size input signals checkbox is selected, then the size of the signal frame does not have to be a multiple of the decimation factor. If the input signal is not a multiple of the decimation factor, then the output is usually a variable-size signal. Therefore, in order to support an arbitrary input size, the block must also support variable-size operations, which can be enabled by checking the Allow arbitrary frame length for fixed-size input signals checkbox.
-
If the Allow arbitrary frame length for fixed-size input signals checkbox is unchecked, the input frame size must be a multiple of the decimation factor.
Dependencies
To use this parameter, set the Input processing parameter to Columns as channels (frame based), and the Rate options parameter to Enforce single-rate processing.
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
Yes |
Additional Info
Polyphase subfilters
The polyphase implementation of the FIR decimator splits the pulse response of the low-pass FIR filter into various sub-filters, where — the coefficient of lowering the sampling rate or decimation. For more information about the polyphase implementation, see Algorithms.
Let indicates the pulse response of the FIR filter. , and — the input signal. Thinning in removing the output signal from the filter is equivalent to a downsampling convolution:
The key to the effectiveness of polyphase filtering is that certain input values are multiplied only by selected pulse response values in a downsampling convolution. For example, if , then the input values are combined only with the filter coefficients , and the input values are — only with filter coefficients . By dividing the filter coefficients into two polyphase sub-filters, unnecessary calculations are not performed in the convolution. The outputs of convolutions with polyphase sub-filters are interleaved and summed to obtain the filter output.
Frame-based processing
If the Input processing parameter is set to Columns as channels (frame based), then the block repeats 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 Rate options parameter to specify how the block will recalculate the input data.:
-
If the Rate options parameter is set to
Enforce single-rate processing, then the input and output data of the block have the same sampling rate. To thin out 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 has an upper boundceil( ), where — the size of the input data frame, and — the decimation coefficient specified in the Decimation factor parameter.
In this mode, if the signal has a fixed size (the frame size does not change during simulation) and the Allow arbitrary frame length for fixed-size input signals checkbox is selected, then the input frame size can be arbitrary and does not have to be a multiple of the decimation factor. If the Allow arbitrary frame length for fixed-size input signals checkbox is not set, then the input frame size must be a multiple of the decimation factor.
This table provides support for an arbitrary input frame size if the Input processing parameter is set to Columns as channels (frame based) and Rate options on Enforce single-rate processing.
| The input signal | The unit supports this signal | Support for arbitrary input frame size | Input size | Output size |
|---|---|---|---|---|
A fixed-size signal |
Yes |
If the Allow arbitrary frame length for fixed-size input signals checkbox is selected |
on |
Upper limit of size |
-
If the Rate options parameter is set to
Allow multirate processing, then the input and output data of the FIR decimator block have the same size. However, the sampling rate of the output data in times lower than the sampling rate of the input data. In this mode, the block examines the input matrix on how independent channels. The block thinns each column of the input signal in time, keeping the frame size constant, while the period of the output frame ( ) in times longer than the period of the input frame ( ).
In this mode, the unit receives only fixed-size signals, and these signals can have an arbitrary frame size.
This table provides support for an arbitrary input frame size if the Input processing parameter is set to Columns as channels (frame based), and for the Rate options parameter , the value Allow multirate processing.
| The input signal | The unit supports this signal | Support for arbitrary input frame size | Input size | Output size |
|---|---|---|---|---|
A fixed-size signal |
Yes |
Always |
on |
on |
A variable-size signal |
No |
Not applicable |
Not applicable |
Not applicable |
Sample-based processing
If the Input processing parameter is set to Elements as channels (sample based), then the block considers the input matrix on how independent channels and thinns each channel in time. The countdown period at the exit ( ) in times longer than the input countdown period ( ), while the sizes of the input and output data remain identical.
In this mode, the unit receives only fixed-size signals, and these signals can have an arbitrary frame size.
This table provides support for an arbitrary input frame size when the Input processing parameter is set to Elements as channels (sample based). The value of the Rate options parameter is automatically set to Allow multirate processing.
| The input signal | The unit supports this signal | Support for arbitrary input frame size | Input size | Output size |
|---|---|---|---|---|
A fixed-size signal |
Yes |
Always |
on |
on |
A variable-size signal |
No |
Not applicable |
Not applicable |
Not applicable |
Delay time
If the block operates in a sample-based processing mode, it always has zero delay. Zero delay means that the block transmits the first filtered input sample received at a given time. , as the first output reference. This first output sample is followed by the filtered input samples. , etc.
Algorithms
Thinning with a FIR filter is effectively implemented using a polyphase structure. For more information about the polyphase structure, see Polyphase subfilters.
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 decimation coefficient, which is set in the parameter settings window.
You can write this equation as:
where , , …, — these are the polyphase components of the FIR filter .
Conceptually, FIR filter decimation consists of a low-pass FIR filter, followed by a sample rate reduction element.
Replace its polyphase representation.
The identity for multidimensional thinning is presented here.
Applying the identity for decimation moves the operation of lowering the sampling rate before the filtering operation. This move allows you to filter the signal at a lower rate.
You can replace the delays and decimation factor at the input with a switching switch.
When the first input sample arrives, the switch feeds it to the branch 0, and the decimator calculates the first output value. As new input counts arrive, the switch moves counterclockwise through the branches. , and down to the branch 0 by feeding one count into each branch. When the switch reaches the branch 0, the decimator outputs the following set of output values. This process continues as long as the data continues to arrive. Every time the switch comes to a branch 0, the decimator outputs . The decimator effectively outputs one count for each the counts that it receives. Thus, the sampling rate at the output of the FIR decimator is .