Main Content

dsp.MIMOFIRFilter

Filter input signals through multipath MIMO FIR filter

Since R2024b

Description

The dsp.MIMOFIRFilter models a multipath multiple-input multiple-output (MIMO) system to filter a streaming input signal. The object performs filtering in the time domain, where the filtering operation involves a convolution between the input channel and the FIR filter on the specific path. You can specify the coefficients of multiple filters directly using the Numerator property or through the num input port.

Using the NumPaths property, you can specify the number of paths between each input and output channel pair. Each path contains a single time-domain FIR filter. The object adds the filtered outputs from each path. Additionally, depending on the setting of the SumFilteredOutputs property, the object adds or concatenates these filtered output contributions. For more information, see Modeling MIMO System with Multiple Propagation Paths.

The number of channels in the output signal depends on the number of filters, number of paths between each input and output channel pair, and the number of input channels. For more details, see the output argument description.

The dsp.FrequencyDomainFIRFilter object also supports modeling MIMO and multipath systems. The dsp.FrequencyDomainFIRFilter object implements filtering in the frequency domain. Typically, time-domain filtering is efficient for smaller impulse responses and frequency domain filtering is efficient for longer impulse responses

To filter the input signal using a multipath MIMO FIR filter:

  1. Create the dsp.MIMOFIRFilter object and set its properties.

  2. Call the object with arguments, as if it were a function.

To learn more about how System objects work, see What Are System Objects?

Creation

Description

mimoFilter = dsp.MIMOFIRFilter creates a MIMO FIR filter System object™ with two filters and a single path between each input and output channel pair. For multichannel inputs, the object adds the filtered output contributions from all input channels before sending them as outputs. For more information, see Modeling MIMO System with Multiple Propagation Paths.

mimoFilter = dsp.MIMOFIRFilter(num) creates a MIMO FIR filter object with the Numerator property set to num.

example

mimoFilter = dsp.MIMOFIRFilter(Name=Value) sets properties of the MIMO FIR filter object by using one or more name-value pair arguments. You can use this syntax with any of the previous input argument combinations.

Example: dsp.MIMOFIRFilter(NumPaths=2)

example

Properties

expand all

Unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. Objects lock when you call them, and the release function unlocks them.

If a property is tunable, you can change its value at any time.

For more information on changing property values, see System Design in MATLAB Using System Objects.

Source of the FIR filter coefficients, specified as one of these:

  • "Property" –– Specify the filter coefficients through the Numerator property.

  • "Input port" –– Specify the filter coefficients as an input when you call the object.

Time-domain FIR filter coefficients, specified as a row vector (single filter) or a matrix (multiple filters) of size F-by-NumLen, where F is the number of filters and NumLen is the filter length. If F is greater than 1, then its value must be a multiple of the product of the number of input channels (columns) T and the number of paths P you specify through the NumPaths property. The multiplication factor determines the number of output channels R and equals F/(T × P).

The coefficient values can change during simulation but the size of the numerator must remain constant.

Tunable: Yes

Dependencies

To enable this property, set NumeratorSource to "Property".

Data Types: single | double
Complex Number Support: Yes

Number of propagation paths P between each input and output channel pair, specified as a positive integer. Each path is represented by a unique filter. When you specify the number of paths to be greater than 1, the filter models multipath propagation. The object sums up filtered output contributions from all paths between each input and output channel pair.

For an example, see Filter Input Signal Through Multiple Propagation Paths.

Dependencies

To enable this property, the number of filters F must be greater than 1.

Data Types: single | double

Option to sum filtered output contributions from all input channels, specified as:

  • true –– The object adds the filtered output from each input channel to generate an L-by-R output matrix, where L is the input frame size (number of input rows) and R is the number of output channels. R equals F/(T x P), where F is the number of filters, T is the number of input channels, and P is the value that you specify in the NumPaths property.

  • false –– The object does not sum filtered output contributions from all input channels. The output is an L-by-R-by-T array.

For more information on how the object computes the output based on the value of the SumFilteredOutputs property, see Modeling MIMO System with Multiple Propagation Paths.

Dependencies

To enable this property, the number of filters F must be greater than 1.

Data Types: logical

Usage

Description

output = mimoFilter(input) filters the streaming input signal using the multipath MIMO FIR filter. The object filters each channel of the input signal independently over time in the time domain.

Input Arguments

expand all

Data input, specified as a matrix of size L-by-T. This object 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 (columns) must remain constant.

Data Types: single | double
Complex Number Support: Yes

Time-domain FIR filter coefficients, specified as a row vector or a matrix input when you pass data to the object algorithm. For more information on the filter coefficients, see the Numerator property description.

If the numerator input is a row vector, the number of data input channels must be 1.

Dependencies

To enable this property, set NumeratorSource to "Input port".

Data Types: single | double
Complex Number Support: Yes

Output Arguments

expand all

Filtered output, returned as a vector, matrix, or a 3-D array.

When the number of filters F is greater than 1 and you set SumFilteredOutputs to:

  • true –– The object adds the filtered output from each input channel to generate an L-by-R output matrix, where L is the input frame size (number of input rows) and R is the number of output channels. R equals F/(T x P), where F is the number of filters, T is the number of input channels, and P is the value that you specify in the NumPaths property.

  • false –– The object does not sum filtered output contributions from all input channels. The output is an L-by-R-by-T array. output(:,j,k) refers to the output from the kth input channel for the jth output channel. For example, output(:,3,2) indicates output on the third output channel from the second input channel.

For more information on how the object computes the output, see Modeling MIMO System with Multiple Propagation Paths.

The output has the same data type and complexity as the input signal.

Data Types: single | double
Complex Number Support: Yes

Object Functions

To use an object function, specify the System object as the first input argument. For example, to release system resources of a System object named obj, use this syntax:

release(obj)

expand all

visualizeVisualize frequency response of individual filter stages or sum of filter paths between input and output channels
stepRun System object algorithm
releaseRelease resources and allow changes to System object property values and input characteristics
resetReset internal states of System object

Examples

collapse all

Design six bandpass FIR filters with varying center frequencies. The bandwidth for each filter is 0.1. The MIMO system models three input channels, two output channels, and one path between each input channel-output channel pair.

bw = 0.1;
Fs   = 8000;
num = [% Input Channel 1, Output Channel 1
    designBandpassFIR(CenterFrequency=0.5,bandwidth=bw);...
    % Input Channel 1, Output Channel 2
    designBandpassFIR(CenterFrequency=0.55,bandwidth=bw);...
    % Input Channel 2, Output Channel 1
    designBandpassFIR(CenterFrequency=0.6,bandwidth=bw);...
    % Input Channel 2, Output Channel 2
    designBandpassFIR(CenterFrequency=0.65,bandwidth=bw);...
    % Input Channel 3, Output Channel 1
    designBandpassFIR(CenterFrequency=0.7,bandwidth=bw);...
    % Input Channel 3, Output Channel 2
    designBandpassFIR(CenterFrequency=0.75,bandwidth=bw)];

Initialize the dsp.MIMOFIRFilter object with the array of filters. Set NumPaths to 1. The SumFilteredOutputs property is true by default.

mimoFilt = dsp.MIMOFIRFilter(num,NumPaths=1);

The input contains two sinusoidal signals each with a frame length of 256. The first sinusoidal signal contains tones at 100 Hz, 200 Hz, and at 300 Hz. The second sinusoidal signal contains tones at 2 kHz, 2.5 kHz, and at 3 kHz.

frameLen = 256;
 sin_Hz = dsp.SineWave(Frequency=[100 200 300],SampleRate=Fs,...
     SamplesPerFrame=frameLen);
 sin_KHz = dsp.SineWave(Frequency=[2e3 2.5e3 3e3],SampleRate=Fs,...
     SamplesPerFrame=frameLen);

Initialize a spectrumAnalyzer object to view the spectrum of the input and the filtered output.

 specScope = spectrumAnalyzer(SampleRate=Fs,PlotAsTwoSidedSpectrum=false, ...
     ChannelNames={'Input Channel 1',...
     'Input Channel 2',...
     'Input Channel 3',...
     'Output Channel 1',...
     'Output Channel 2'},...
     ShowLegend=true);

Stream in 1e4 frames of the noisy input sinusoidal signal. The input noise is white Gaussian with a mean of 0 and a variance of 0.01. Pass the signal through the designed MIMO FIR filter array. Since there are six filters, three input channels, and one path between each input channel-output channel pair, the number of output channels of the system is given by 6(3×1)=2. Visualize the spectrum of the input and output signals in the spectrum analyzer.

 for idx = 1:1e4
     x = sin_Hz()+sin_KHz()+0.01*randn(frameLen,3);
     y = mimoFilt(x);
     specScope([x,y]);
 end

Filter an input signal through three distinct paths between the input and the output by specifying three filters to model the frequency responses across each path.

Design multiple lowpass FIR filters with varying fractional delays. The filter order for each filter is 400 and the sampling rate is 8000 Hz.

order = 400;
Fs = 8000;
num = [designFracDelayFIR(0.1,order); % Path 1
    designFracDelayFIR(0.2,order); % Path 2
    designFracDelayFIR(0.3,order); % Path 3
    ];

Initialize the dsp.MIMOFIRFilter object with the array of filters. Set the number of propagation paths to 3. The object models a single-input single-output (SISO) system. The SumFilteredOutputs property is true by default.

mimoFilt = dsp.MIMOFIRFilter(Numerator=num, ...
    NumPaths=3)
mimoFilt = 
  dsp.MIMOFIRFilter with properties:

       NumeratorSource: 'Property'
             Numerator: [3x400 double]
              NumPaths: 3
    SumFilteredOutputs: true

The input contains two sinusoidal signals each with a frame length of 1024. The first sinusoidal signal contains a tone at 200 Hz. The second sinusoidal signal contains a tone at 4 kHz.

frameLen = 1024;
sin_200Hz = dsp.SineWave(Frequency=200,SampleRate=Fs, ...
    SamplesPerFrame=frameLen);
sin_4KHz = dsp.SineWave(Frequency=4e3,SampleRate=Fs, ...
    SamplesPerFrame=frameLen);

Initialize a spectrumAnalyzer object to view the spectrum of the input and the filtered output.

specScope = spectrumAnalyzer(SampleRate=Fs,PlotAsTwoSidedSpectrum=false, ...
    ChannelNames={'Input','Output'},ShowLegend=true);

Stream in 1e3 frames of the noisy input sinusoidal signal. The input noise is white Gaussian with a mean of 0 and a variance of 0.01. Pass the signal through the designed filter. Visualize the spectrum of the input and output signals in spectrum analyzer.

for idx = 1:1e3
    x = sin_200Hz()+sin_4KHz()+0.01*randn(frameLen,1);
    y = mimoFilt(x);
    specScope([x,y])
end

Algorithms

expand all

Extended Capabilities

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

Version History

Introduced in R2024b