Communications Blockset    

Sequence Generator Examples

This section presents two example models that illustrate the blocks in the Sequence Generator library.

Example: Pseudorandom Sequences

This example describes the autocorrelation properties of the pseudorandom sequences generated by the following three blocks:

If you are reading this in the MATLAB Help Browser, click here to open the model.

The model displays the output sequences of the three blocks in a scope. All three blocks have the same Generator polynomial parameter,
[1 0 0 0 0 1 1], whose digits are the coefficients of the polynomial x6 + x + 1. Since this polynomial has degree 6, the output sequence has period 26 - 1 = 63.

When you run the model, the scope displays two periods of data for each the three signals:

The model also sends the output sequences to the MATLAB workspace as the vectors pn, gold, and kas. You can verify the autocorrelation properties of the output of the PN Sequence Generator by entering the following code at the MATLAB prompt:

The code calculates the cyclic autocorrelation of the PN sequence, by taking the inner product of one period of the sequence with each of its 63 cyclic rotations, and stores the results in a vector, corrvec, of length 63. The code then sorts the entries of corrvec and finds the unique autocorrelation values. The result is

The first entry of the vector corrvec is 63, while all other values are -1, as you can verify by entering corrvec at the MATLAB prompt. This means that 63 occurs only by taking the inner product of the sequence pn with an unrotated copy of itself. All other inner products have the value -1.

You can analyze the output sequences of the Gold Sequence Generator block and the Kasami Sequence Generator block similarly by changing the first line of the preceding code to

and

respectively.

For the Gold and Kasami sequences, the autocorrelation takes on three values. For example, the three values for the Gold sequence are

The three values for the Kasami sequence are

Of the three types of sequences, the PN sequences are best suited for synchronization because the autocorrelation takes on just two values. However, the Gold and Kasami sequences provide a larger number of sequences with good cross-correlation properties than do the PN sequences.

Also note that the peak value of corrvals for the Kasami sequence is less than the peak value for the Gold sequence. In fact, the small set of Kasami sequences satisfy the lower bounds for correlation values, and for this reason they are also referred to as optimal sequences.

Example: Orthogonal Sequences

This example demonstrates the orthogonality of pairs of sequences generated using different Code index parameters, for each of the following three blocks:

If you are reading this in the MATLAB Help Browser, click here to open the model.

The model displays the output sequences of the three blocks in a scope. All three blocks output sequences of period 64, corresponding to their Code length parameters. When you run the model, the scope displays two periods of data for each sequence.

The following code runs the model twice, the first time with the Code index parameter of 60 for all three blocks, and the second time with a Code index of 30. The code then calculates, for each of the three blocks, the cross correlation between the sequence generated by the first run with the sequence generated by the second run

The results are

The results show that for each block, the sequence generated by the first run is orthogonal to the sequence generated by the second run.


  Sequence Generators Block Parameters