DSP Blockset | ![]() ![]() |
Example: Exporting a Frame-Based Signal. In the model below, the To Workspace block exports a three-channel frame-based signal with the following data:
To create the model, define the following variables at the MATLAB command line.
A = [1:100;-1:-1:-100]'; % 100-by-2 matrix
B = 5*ones(100,1); % 100-by-1 column vector
Matrix A
represents a two-channel signal with 100 samples, and matrix B
represents a one-channel signal with 100 samples.
Specify the following parameter values in the Signal From Workspace block:
[A B]
1
4
The Sample time setting of 1
and Samples per frame setting of 4
yield a frame-based output with sample period of 1 second and frame period of 4 seconds.
Specify the following parameter values in the To Workspace block:
yout
inf
1
-1
Run the model, and look at output yout
. The first 10 samples (rows) are shown.
yout = 1 -1 5 2 -2 5 3 -3 5 4 -4 5 5 -5 5 6 -6 5 7 -7 5 8 -8 5 9 -9 5 10 -10 5
The following two sections may also be of interest:
![]() | Exporting a Frame-Based Signal Using the To Workspace Block | Exporting and Playing WAV Files | ![]() |