When you want to perform the same operations on several independent signals, you can group those signals together as a multichannel signal. For example, if you need to filter each of four independent signals using the same direct-form II transpose filter, you can combine the signals into a multichannel signal, and connect the signal to a single Digital Filter Design block. The block applies the filter to each channel independently.

A sample-based signal with M*N channels is represented by a sequence of M-by-N matrices. Multiple sample-based signals can be combined into a single multichannel sample-based signal using the Concatenate block. In addition, several multichannel sample-based signals can be combined into a single multichannel sample-based signal using the same technique.

You can combine individual sample-based signals into a multichannel
signal by using the Matrix
Concatenate block in the Simulink^{®} Math Operations library:

Open the Matrix Concatenate Example 1 model by typing

at the MATLAB

^{®}command line.Double-click the Signal From Workspace block, and set the

**Signal**parameter to`1:10`

. Click**OK**.Double-click the Signal From Workspace1 block, and set the

**Signal**parameter to`-1:-1:-10`

. Click**OK**.Double-click the Signal From Workspace2 block, and set the

**Signal**parameter to`zeros(10,1)`

. Click**OK**.Double-click the Signal From Workspace3 block, and set the

**Signal**parameter to`5*ones(10,1)`

. Click**OK**.Double-click the Matrix Concatenate block. Set the block parameters as follows, and then click

**OK**:**Number of inputs**=`4`

**Mode**=`Multidimensional array`

**Concatenate dimension**=`1`

Double-click the Reshape block. Set the block parameters as follows, and then click

**OK**:**Output dimensionality**=`Customize`

**Output dimensions**=`[2,2]`

Run the model.

Four independent sample-based signals are combined into a 2-by-2 multichannel matrix signal.

Each 4-by-1 output from the Matrix Concatenate block contains one sample from each of the four input signals at the same instant in time. The Reshape block rearranges the samples into a 2-by-2 matrix. Each element of this matrix is a separate channel.

Note that the Reshape block works columnwise, so that a column vector input is reshaped as shown below.

The 4-by-1 matrix output by the Matrix Concatenate block and the 2-by-2 matrix output by the Reshape block in the above model represent the same four-channel sample-based signal. In some cases, one representation of the signal may be more useful than the other.

At the MATLAB command line, type

`dsp_examples_yout`

.The four-channel, sample-based signal is displayed as a series of matrices in the MATLAB Command Window. Note that the last matrix contains only zeros. This is because every Signal From Workspace block in this model has its

**Form output after final data value by**parameter set to`Setting to Zero`

.

You can combine existing multichannel sample-based signals into larger multichannel signals using the Simulink Matrix Concatenate block:

Open the Matrix Concatenate Example 2 model by typing

at the MATLAB command line.

Double-click the Signal From Workspace block, and set the

**Signal**parameter to`[1:10;-1:-1:-10]'`

. Click**OK**.Double-click the Signal From Workspace1 block, and set the

**Signal**parameter to`[zeros(10,1) 5*ones(10,1)]`

. Click**OK**.Double-click the Matrix Concatenate block. Set the block parameters as follows, and then click

**OK**:**Number of inputs**=`2`

**Mode**=`Multidimensional array`

**Concatenate dimension**=`1`

Run the model.

The model combines both two-channel sample-based signals into a four-channel signal.

Each 2-by-2 output from the Matrix Concatenate block contains both samples from each of the two input signals at the same instant in time. Each element of this matrix is a separate channel.

Was this topic helpful?