User`s guide

3 Working with Signals
3-8
Note In the recommended dspstartup settings, SingleTask rate transition
is set to Error in the Diagnostics pane in the Simulation Parameters dialog
box. Thus, in the
dspstartup configurations, cross-rate operations will
generate errors even though the solver is in fixed-step single-tasking mode.
Example: Cross-Rate Operations. Consider the model below, which sums two
signals having different sample periods. The fast signal (T
s
=1) has sample
times 1, 2, 3, ..., and the slow signal (T
s
=2) has sample times 1, 3, 5, ....
This example will generate an error under the
dspstartup settings, as
explained in the previous Note.
The output,
yout, is a matrix containing the fast signal (T
s
=1) in the first
column, the slow signal (T
s
=2) in the second column, and the sum of the two in
the third column.
yout =
1 1 2
2 1 3
3 2 5
4 2 6
5 3 8
6 3 9
7 4 11
8 4 12
9 5 14
10 5 15
As expected, the slow signal (second column) changes once every two seconds,
half as often as the fast signal. Nevertheless, it has a defined value at every
T
s
= 2
T
s
= 1