Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Frequency-Domain FIR Filter

Filter input signal in the frequency domain

  • Library:
  • DSP System Toolbox / Filtering / Filter Implementations

Description

The Frequency-Domain FIR Filter block implements frequency-domain, fast Fourier transform (FFT)-based filtering to filter a streaming input signal. In the time domain, the filtering operation involves a convolution between the input and the impulse response of the finite impulse response (FIR) filter. In the frequency domain, the filtering operation involves the multiplication of the Fourier transform of the input and the Fourier transform of the impulse response. The frequency-domain filtering becomes more efficient than time-domain filtering as the impulse response grows longer. This block uses the overlap-save and overlap-add methods to perform the frequency-domain filtering. For filters with a long impulse response length, the latency inherent to these two methods can be significant. To mitigate this latency, the Frequency-Domain FIR Filter block partitions the impulse response into shorter blocks and implements the overlap-save and overlap-add methods on these shorter blocks. To partition the impulse response, select the Partition numerator to reduce latency check box. For more details on these two methods and on reducing latency through impulse response partitioning, see Algorithms.

Ports

Input

expand all

Data input, specified as a vector or matrix. This block supports variable-size input signals. That is, you can change the input frame size (number of rows) even after calling the algorithm. However, the number of channels (number of columns) must remain constant.

Example: randn(164,4)

Data Types: single | double
Complex Number Support: Yes

Output Arguments

expand all

Filtered output, returned as a vector or matrix. The size, data type, and complexity of the output match those of the input.

This port is unnamed until you select the Output filter latency parameter and click Apply.

Data Types: single | double
Complex Number Support: Yes

Filter latency, returned as a scalar. This latency is inherent to overlap-add and overlap-save methods and does not include the group delay of the filter. This port appears only when you select the Output filter latency check box.

This port is unnamed until you select the Output filter latency check box and click Apply.

Data Types: uint32

Parameters

expand all

Filtering method in the frequency domain, specified as either Overlap-save or Overlap-add. For more details on these two methods, see Algorithms

FIR filter coefficients, specified as a row vector.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
Complex Number Support: Yes

Flag to partition the numerator to reduce latency, specified as one of the following:

  • 'off' –– The filter uses the traditional overlap-save or overlap-add method. The latency in this case is FFT length – NumLen + 1. NumLen is the length of the numerator vector you specify in the Filter coefficients parameter.

  • 'on' –– In this mode, the block partitions the numerator into segments of length specified by the Numerator partition length parameter. The filter performs overlap-save or overlap-add on each partition, and combines the partial results to form the overall output. The latency is now reduced to the partition length.

Partition length of the numerator, specified as a positive integer less than or equal to the length of the numerator.

Example: 40

Example: 60

Dependencies

This parameter applies only when you select the Partition numerator to reduce latency check box.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

When you select this check box, the FFT length equals twice the numerator length. When you clear this check box, you specify the FFT length through the FFT length parameter.

The FFT length you specify must be greater than or equal to the length of the numerator vector you specify in the Filter coefficients parameter.

Example: 64

Example: 50

Dependencies

This parameter applies when you clear the Inherit FFT length from numerator length check box.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

When you select this check box and click Apply, the block outputs the filter latency through the latency port.

Opens the Filter Visualization Tool (FVTool) and displays the magnitude/phase response of the FIR filter. The response is based on the block dialog parameters. Changes made to these parameters update FVTool.

To update the magnitude response while FVTool is running, modify the block dialog parameters and click Apply.

  • Code generation — Simulate model using generated C code. The first time you run a simulation, Simulink® generates C code for the block. The C code is reused for subsequent simulations, as long as the model does not change. This option requires additional startup time but provides faster simulation speed than Interpreted execution.

  • Interpreted execution — Simulate model using the MATLAB®  interpreter. This option shortens startup time but has slower simulation speed than Code generation.

Algorithms

expand all

Overlap-save and overlap-add are the two frequency-domain FFT-based filtering methods this algorithm uses.

References

[1] Stockham, T. G., Jr. "High Speed Convolution and Correlation." Proceedings of the 1966 Spring Joint Computer Conference, AFIPS, Vol 28, 1966, pp. 229–233.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Introduced in R2017b

Was this topic helpful?