Communications Blockset | ![]() ![]() |
Block Parameters
This section discusses the sample time parameter, seed parameter, and signal attribute parameters that are common to many random source blocks, and then discusses each category of random source.
Sample Time Parameter for Random Sources
Each of the random source blocks requires you to set a Sample time parameter in the block mask. If you configure the block to produce a sample-based signal, then this parameter is the time interval between successive updates of the signal. If you configure the block to produce a frame-based matrix signal, then the Sample time parameter is the time interval between successive rows of the frame-based matrix.
If you use a Simulink Signal Inspection block to query the period of a frame-based output from a random source block in the Comm Sources library, then note that the Signal Inspection block reports the period of the entire frame, not the period of each sample in a given channel of the frame. The following equation relates the quantities involved for a single-channel signal.
Tf
notation.
Seed Parameter
The blocks in the Communication Sources library that generate random data require you to set a seed in the block mask. This is the initial seed that the random number generator uses when forming its sequence of numbers. You should make sure that initial seeds in different blocks in a model have different values, so that they generate statistically independent sequences.
Four of the blocks in the Communication Sources library require you to choose their seeds according to the following rule, in order to obtain accurate results:
This rule applies to the following blocks:
To avoid having to remember whether a block that you are using is on this list, you can simply apply the seed rule to all source blocks that have an Initial seed parameter.
You can choose integers that satisfy the seed rule with the randseed
function. Entering randseed
at the MATLAB prompt returns a prime number greater than 30. If you choose a constant seed such as randseed(n)
, where n is some positive integer variable, the block produces the same noise sequence each time you start the simulation. The sequence will be different from that produced with a different constant seed. If you want the noise to be different each time you start the simulation, then you can use a varying seed such as randseed(cputime)
.
Signal Attribute Parameters for Random Sources
In most random source blocks, the output can be a frame-based matrix, a sample-based row or column vector, or a sample-based one-dimensional array. The following table indicates how to set certain block parameters depending on the kind of signal you want to generate.
The Frame-based outputs and Interpret vector parameters as 1-D check boxes are mutually exclusive, because frame-based signals and one-dimensional signals are mutually exclusive. The Samples per frame parameter field is active only if the Frame-based outputs check box is checked.
Example. The model in the following figure illustrates that one random source block can produce various kinds of signals. The annotations in the model indicate how each copy of the block is configured. Notice how each block's configuration affects the type of connector line (single or double) and the signal dimensions that appear above each connector line. In the case of the Rayleigh Noise Generator block, the first two block parameters (Sigma and Initial seed) determine the number of channels in the output; for analogous indicators in other random source blocks, see their individual reference entries.
The particular mask parameters depend on the block. See each block's individual entry in the reference section for details.
![]() | Sequence Generator Examples | Communications Sinks | ![]() |