Function File: b = randsrc (n)
Function File: b = randsrc (n, m)
Function File: b = randsrc (n, m, alphabet)
Function File: b = randsrc (n, m, alphabet, seed)

Generate a matrix of random symbols. The size of the matrix is n rows by m columns. By default m is equal to n.

The variable alphabet can be either a row vector or a matrix with two rows. When alphabet is a row vector the symbols returned in b are chosen with equal probability from alphabet. When alphabet has two rows, the second row determines the probability with which each of the symbols is chosen. The sum of the probabilities must equal 1. By default alphabet is [-1 1].

The variable seed allows the random number generator to be seeded with a fixed value. The initial seed will be restored when returning.

Package: communications