| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Signal Processing Blockset |
| Contents | Index |
| Learn more about Signal Processing Blockset |
| On this page… |
|---|
Splitting Multichannel Sample-Based Signals into Individual Signals Splitting Multichannel Sample-Based Signals into Several Multichannel Signals |
Multichannel signals, represented by matrices in the Simulink environment, are frequently used in signal processing models for efficiency and compactness. Though most of the signal processing blocks can process multichannel signals, you may need to access just one channel or a particular range of samples in a multichannel signal. You can access individual channels of the multichannel signal by using the blocks in the Indexing library. This library includes the Selector, Submatrix, Variable Selector, Multiport Selector, and Submatrix blocks.
You can split a multichannel sample-based signal into single-channel sample-based signals using the Multiport Selector block. This block allows you to select specific rows and/or columns and propagate the selection to a chosen output port. In this example, a three-channel sample-based signal is deconstructed into three independent sample-based signals:
Open the Multiport Selector Example 1 model by typing doc_splitmltichsbsigsind at the MATLAB command line.

Double-click the Signal From Workspace block, and set the block parameters as follows:
Signal = randn(3,1,10)
Sample time = 1
Samples per frame = 1
Based on these parameters, the Signal From Workspace block outputs a three-channel, sample-based signal with a sample period of 1 second.
Save these parameters and close the dialog box by clicking OK.
Double-click the Multiport Selector block. Set the block parameters as follows, and then click OK:
Select = Rows
Indices to output = {1,2,3}
Based on these parameters, the Multiport Selector block extracts the rows of the input. The Indices to output parameter setting specifies that row 1 of the input should be reproduced at output 1, row 2 of the input should be reproduced at output 2, and row 3 of the input should be reproduced at output 3.
At the MATLAB command line, type dsp_examples_yout.
The following is a portion of what is displayed at the MATLAB command line. Because the input signal is random, your output might be different than the output show here.
dsp_examples_yout(:,:,1) = -0.1199 dsp_examples_yout(:,:,2) = -0.5955 dsp_examples_yout(:,:,3) = -0.0793
This sample-based signal is the first row of the input to the Multiport Selector block. You can view the other two input rows by typing dsp_examples_yout1 and dsp_examples_yout2, respectively.
You have now successfully created three, single-channel sample-based signals from a multichannel sample-based signal using a Multiport Selector block.
Multichannel signals, represented by matrices in the Simulink environment, are frequently used in signal processing models for efficiency and compactness. Though most of the signal processing blocks can process multichannel signals, you may need to access just one channel or a particular range of samples in a multichannel signal. You can access individual channels of the multichannel signal by using the blocks in the Indexing library. This library includes the Selector, Submatrix, Variable Selector, Multiport Selector, and Submatrix blocks.
You can split a multichannel sample-based signal into other multichannel sample-based signals using the Submatrix block. The Submatrix block is the most versatile of the blocks in the Indexing library because it allows arbitrary channel selections. Therefore, you can extract a portion of a multichannel sample-based signal. In this example, you extract a six-channel, sample-based signal from a 35-channel, sample-based signal (5-by-7 matrix):
Open the Submatrix Example model by typing doc_splitmltichsbsigsev at the MATLAB command line.

Double-click the Constant block, and set the block parameters as follows:
Constant value = rand(5,7)
Interpret vector parameters as 1–D = Clear this check box
Sampling mode = Sample based
Sample Time = 1
Based on these parameters, the Constant block outputs a constant-valued, sample-based signal.
Save these parameters and close the dialog box by clicking OK.
Double-click the Submatrix block. Set the block parameters as follows, and then click OK:
Row span = Range of rows
Starting row = Index
Starting row index = 3
Ending row = Last
Column span = Range of columns
Starting column = Offset from last
Starting column offset = 1
Ending column = Last
Based on these parameters, the Submatrix block outputs rows three to five, the last row of the input signal. It also outputs the second to last column and the last column of the input signal.
The model should now look similar to the following figure.

Notice that the output of the Submatrix block is equivalent to the matrix created by rows three through five and columns six through seven of the input matrix.
You have now successfully created a six-channel, sample-based signal from a 35-channel sample-based signal using a Submatrix block.
![]() | Creating Multichannel Frame-Based Signals | Deconstructing Multichannel Frame-Based Signals | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |