Back to Kemp Acoustics Home
Next: Auto-correlation property of MLS Up: Maximum length sequences Previous: Maximum length sequences   Contents

## Generating an MLS sequence

Generation of an MLS signal can be done using a feedback shift register [68,65]. The shift register consists of a group of binary memory elements in a line. At each time unit the numbers held in the memory elements are passed on one step to the right and the vacated element on the left is generated by a recursion relation which depends on the number of memory elements, . The values which exit the element group on the right hand side form the output sequence.

There are several recursion relations that may be used to generate an MLS. We will not derive these, rather we will use the simplest (and therefore most computationally efficient) available. As an example, consider a shift register of elements. The recursion relation we use is directly related to the primitive polynomial [69]

 (7.3)

The memory elements corresponding to the terms in are added and the result taken modulo 2 (ie. the remainder when divided by two) to give the left entry on the following time step. As is shown in figure 7.10, the term 1 in corresponds to the value held in , the term refers to the term and the term is not part of the sum because there are only 4 memory elements. The primitive polynomial therefore corresponds to the recursion relation . The last and second last elements are therefore used to calculate the new left hand element, and since the sum is taken modulo 2 the operation is equivalent to the exclusive OR gate as shown in the figure.

In order to generate an MLS in practice we have to specify an initial state for the memory elements. Here we will use 1111. The last and second last elements are both 1, so the sum is 2, which when taken modulo 2 gives a result of 0 for the left hand element at the next step. The other elements shift one step to the right, giving 0111 as the next state of the four elements, and the 1 which exited on the right is the first term in the output sequence.

Table 7.1 shows the state of the memory element group at each time step and the MLS can be seen building up vertically down the right hand column. The MLS sequence appears random, but repeats with a period of 15. In fact, the element group takes every binary value possible except 0000 which would be a dead end for the sequence since a 1 would never be generated. The number of possible values for a binary number with digits is so the maximum length for an MLS signal must therefore be , hence the name maximum length sequence. It follows that the initial state is unimportant to the properties of the MLS signal (as long as 0000 is not taken) since the sequence covers all non-zero states and is periodic.

Table 7.1: MLS element sequence for
 Time step, Elements, MLS signal, 0 1111 1 1 0111 1 2 0011 1 3 0001 1 4 1000 0 5 0100 0 6 0010 0 7 1001 1 8 1100 0 9 0110 0 10 1011 1 11 0101 1 12 1010 0 13 1101 1 14 1110 0 15 1111 1 16 0111 1 : : :

For other values of , the only difference in the method for generating an MLS is that we use memory elements and we must use a different primitive polynomial, of order . The polynomials up to are listed by Stahnke [69] and are shown in recursion relation form up to in table 7.2. The length of an sequence is samples which corresponds to over 23 seconds of sound when played as an acoustic signal at 44.1 kHz.

Table 7.2: Recursion relations for MLS of length
 Recursion relation 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Back to Kemp Acoustics Home
Next: Auto-correlation property of MLS Up: Maximum length sequences Previous: Maximum length sequences   Contents
Jonathan Kemp 2003-03-24