Maximum length sequence
A maximum length sequence (MLS) is a type of pseudorandom binary sequence.
They are bit sequences generated using maximal linear feedback shift registers and are so called because they are periodic and reproduce every binary sequence (except the zero vector) that can be represented by the shift registers (i.e., for length-m registers they produce a sequence of length 2m − 1). An MLS is also sometimes called an n-sequence or an m-sequence. MLSs are spectrally flat, with the exception of a near-zero DC term.
Practical applications for MLS include measuring impulse responses (e.g., of room reverberation). They are also used as a basis for deriving pseudo-random sequences in digital communication systems that employ direct-sequence spread spectrum and frequency-hopping spread spectrum transmission systems, and in the efficient design of some fMRI experiments
- 1 Generation of maximum length sequences
- 2 Properties of maximum length sequences
- 3 Extraction of impulse responses
- 4 Relationship to Hadamard transform
- 5 See also
- 6 References
- 7 External links
Generation of maximum length sequences
MLS are generated using maximal linear feedback shift registers. An MLS-generating system with a shift register of length 4 is shown in Fig. 1. It can be expressed using the following recursive relation:
where n is the time index and represents modulo-2 addition.
As MLS are periodic and shift registers cycle through every possible binary value (with the exception of the zero vector), registers can be initialized to any state, with the exception of the zero vector.
A polynomial over GF(2) can be associated with the linear feedback shift register. It has degree of the length of the shift register, and has coefficients that are either 0 or 1, corresponding to the taps of the register that feed the xor gate. For example, the polynomial corresponding to Figure 1 is x4 + x + 1.
MLS are inexpensive to implement in hardware or software, and relatively low-order feedback shift registers can generate long sequences; a sequence generated using a shift register of length 20 is 220 − 1 samples long (1,048,575 samples).
Properties of maximum length sequences
The occurrence of 0 and 1 in the sequence should be approximately the same. More precisely, in a maximum length sequence of length there are ones and zeros. The number of ones equals the number of zeros plus one, since the state containing only zeros cannot occur.
Of all the "runs" in the sequence of each type (i.e. runs consisting of "1"s and runs consisting of "0"s):
- One half of the runs are of length 1.
- One quarter of the runs are of length 2.
- One eighth of the runs are of length 3.
- ... etc. ...
A "run" is a sub-sequence of "1"s or "0"s within the MLS concerned. The number of runs is the number of such sub-sequences.
Extraction of impulse responses
If a linear time invariant (LTI) system's impulse response is to be measured using a MLS, the response can be extracted from the measured system output y[n] by taking its circular cross-correlation with the MLS. This is because the autocorrelation of a MLS is 1 for zero-lag, and nearly zero (−1/N where N is the sequence length) for all other lags; in other words, the autocorrelation of the MLS can be said to approach unit impulse function as MLS length increases.
If the impulse response of a system is h[n] and the MLS is s[n], then
Taking the cross-correlation with respect to s[n] of both sides,
and assuming that φss is an impulse (valid for long sequences)
Relationship to Hadamard transform
- Impulse response
- Frequency response
- Polynomial ring
- Federal Standard 1037C
- Gold code
- Complementary sequences
- Golomb, Solomon W.; Guang Gong (2005). Signal Design for Good Correlation: For Wireless Communication, Cryptography, and Radar. Cambridge University Press. ISBN 978-0-521-82104-9.
- Buracas GT, Boynton GM (July 2002). "Efficient design of event-related fMRI experiments using M-sequences". Neuroimage 16 (3 Pt 1): 801–13. doi:10.1006/nimg.2002.1116. PMID 12169264.
- "Linear Feedback Shift Registers-Implementation, M-Sequence Properties, Feedback Tables", New Wave Instruments (NW), Retrieved 2013.12.03.
- Golomb, Solomon W. (1967). Shift register sequences. Holden-Day. ISBN 0-89412-048-4.
- Cohn, M.; Lempel, A. (January 1977). "On Fast M-Sequence Transforms". IEEE Trans. Information Theory 23 (1): 135–7. doi:10.1109/TIT.1977.1055666.
- Bristow-Johnson, Robert. "A Little MLS Tutorial". — Short on-line tutorial describing how MLS is used to obtain the impulse response of a linear time-invariant system. Also describes how nonlinearities in the system can show up as spurious spikes in the apparent impulse response.
- Hee, Jens. "Impulse response measurement using MLS" (PDF). — Paper describing MLS generation. Contains C-code for MLS generation using up to 18-tap-LFSRs and matching Hadamard transform for impulse response extraction.
- Kerr, Wesley; Drucker, Daniel. "Creation of M-Sequences". Geoffrey Aguirre Lab. University of Pennsylvania.
- "Linear Feedback Shift Registers". New Wave Instruments. 2005. — Properties of maximal length sequences, and comprehensive feedback tables for maximal lengths from 7 to 16,777,215 (3 to 24 stages), and partial tables for lengths up to 4,294,967,295 (25 to 32 stages).
- Schäfer, Magnus (October 2012). "Aachen Impulse Response Database". Institute of Communication Systems and Data Processing, RWTH Aachen University. V1.4. A (binaural) room impulse response database generated by means of maximum length sequences]
- "Efficient Shift Registers, LFSR Counters, and Long Pseudo-Random Sequence Generators — Obsolete" (PDF). Xilinx. July 1996. XAPP052 v1.1. — Implementing lfsr's in FPGAs includes listing of taps for 3 to 168 bits