Communications Blockset    

Random or Pseudorandom Signals

Random signals are useful for simulating noise, errors, or signal sources. Besides using built-in Simulink blocks such as the Random Number block, you can also use blocks in the Comm Sources library of the Communications Blockset to generate:

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 Probe block to query the period of a frame-based output from a random source block in the Comm Sources library, then note that the Probe block reports the period of the entire frame, not the period of each sample in a given channel of the frame. The equation below relates the quantities involved for a single-channel signal.

where:

Seed Parameter for Random Sources

Each of the random source blocks requires 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. If you choose a constant seed, then 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 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 table below indicates how to set certain block parameters depending on the kind of signal you want to generate.

Signal Attributes
Parameter Settings
Sample-based, one-dimensional

Sample-based row vector

Also, any vector parameters in the block should be rows, not columns.
Sample-based column vector

Also, any vector parameters in the block should be columns, not rows.
Frame-based

Also, set Samples per frame to the number of samples in each output frame, that is, the number of rows in the signal.

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 figure below 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.

Random Bits

The Bernoulli Random Binary Generator and Binary Vector Noise Generator blocks both generate random bits, but differ in the way that you specify the distribution of 1s. As a result, the Bernoulli Random Binary Generator block is suitable for representing sources, while the Binary Vector Noise Generator block is more appropriate for modeling channel errors.

The Bernoulli Random Binary Generator block considers each element of the signal to be an independent Bernoulli random variable. Also, different elements need not be identically distributed.

The Binary Vector Noise Generator block constructs a random binary signal using a two-stage process. First, using information that you provide in the block mask, it determines how many 1s will appear. Then it determines where to place the required number of 1s, so that each possible arrangement has equal probability.

For example, if you set the Binary vector length parameter to 4, set the Probabilities parameter to 1, and uncheck the Frame-based outputs check box, then the block generates binary vectors of length 4, each of which contains exactly one 1. You might use these parameters to perturb a binary code that consists of four-bit codewords. Adding the random vector to your code vector (modulo 2) would introduce exactly one error into each codeword. Alternatively, to perturb each codeword by introducing one error with probability 0.4 and two errors with probability 0.6, set the Probabilities parameter to [0.4, 0.6] instead of 1.

Note that the Probabilities parameter of the Binary Vector Noise Generator block affects only the number of 1s in each vector, not their placement.

Random Integers

The Random-Integer Generator and Poisson Int Generator blocks both generate vectors containing random nonnegative integers. The Random-Integer Generator block uses a uniform distribution on a bounded range that you specify in the block mask. The Poisson Int Generator block uses a Poisson distribution to determine its output. In particular, the output can include any nonnegative integer.

Pseudorandom Symbols

The PN Sequence Generator block generates a sequence of pseudorandom symbols. Such a sequence can be used in a pseudorandom scrambler and descrambler, or in a direct-sequence spread-spectrum system.

Random Real Numbers

You can use one of several blocks to generate random real numbers, depending on what distribution you want to use. The choices are listed in the table below.

Distribution
Block
Gaussian
Gaussian Noise Generator
Rayleigh
Rayleigh Noise Generator
Rician
Rician Noise Generator
Uniform on a bounded interval
Uniform Noise Generator

The particular mask parameters depend on the block. See each block's individual entry in the reference section for details.


 Communications Sources Nonrandom Signals