Recent from talks
Nothing was collected or created yet.
Maximum length sequence
View on WikipediaA 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.
These sequences may be represented as coefficients of irreducible polynomials in a polynomial ring over Z/2Z.
Practical applications for MLS include measuring impulse responses (e.g., of room reverberation or arrival times from towed sources in the ocean[1]). 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.[2]
Generation
[edit]
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. For bit values 0 = FALSE or 1 = TRUE, this is equivalent to the XOR operation.
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.
Polynomial interpretation
[edit]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 .
A necessary and sufficient condition for the sequence generated by a LFSR to be maximal length is that its corresponding polynomial be primitive.[3]
Implementation
[edit]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
[edit]MLS have the following properties, as formulated by Solomon Golomb.[4]
Balance property
[edit]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.
Run property
[edit]A "run" is a sub-sequence of consecutive "1"s or consecutive "0"s within the MLS concerned. The number of runs is the number of such sub-sequences. [vague]
Of all the "runs" (consisting of "1"s or "0"s) in the sequence :
- 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. ...
Correlation property
[edit]The circular autocorrelation of an MLS is a Kronecker delta function[5][6] (with DC offset and time delay, depending on implementation). For the ±1 convention, i.e., bit value 1 is assigned and bit value 0 , mapping XOR to the negative of the product:
where represents the complex conjugate and represents a circular shift.
The linear autocorrelation of an MLS approximates a Kronecker delta.
Extraction of impulse responses
[edit]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)
Any signal with an impulsive autocorrelation can be used for this purpose, but signals with high crest factor, such as the impulse itself, produce impulse responses with poor signal-to-noise ratio. It is commonly assumed that the MLS would then be the ideal signal, as it consists of only full-scale values and its digital crest factor is the minimum, 0 dB.[7][8] However, after analog reconstruction, the sharp discontinuities in the signal produce strong intersample peaks, degrading the crest factor by 4-8 dB or more, increasing with signal length, making it worse than a sine sweep.[9] Other signals have been designed with minimal crest factor, though it is unknown if it can be improved beyond 3 dB.[10]
Relationship to Hadamard transform
[edit]Cohn and Lempel[11] showed the relationship of the MLS to the Hadamard transform. This relationship allows the correlation of an MLS to be computed in a fast algorithm similar to the FFT.
See also
[edit]References
[edit]- 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.
- ^ Gemba, Kay L.; Vazquez, Heriberto J.; Fialkowski, Joseph; Edelmann, Geoffrey F.; Dzieciuch, Matthew A.; Hodgkiss, William S. (October 2021). "A performance comparison between m-sequences and linear frequency-modulated sweeps for the estimation of travel-time with a moving source". The Journal of the Acoustical Society of America. 150 (4): 2613–2623. Bibcode:2021ASAJ..150.2613G. doi:10.1121/10.0006656. PMID 34717519. S2CID 240355915.
- ^ 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. S2CID 7433120.
- ^ "Linear Feedback Shift Registers-Implementation, M-Sequence Properties, Feedback Tables"[1], New Wave Instruments (NW), Retrieved 2013.12.03.
- ^ Golomb, Solomon W. (1967). Shift register sequences. Holden-Day. ISBN 0-89412-048-4.
- ^ Jacobsen, Finn; Juhl, Peter Moller (2013-06-04). Fundamentals of General Linear Acoustics. John Wiley & Sons. ISBN 978-1118636176.
A maximum-length sequence is a binary sequence whose circular autocorrelation (except for a small DC-error) is a delta function.
- ^ Sarwate, D. V.; Pursley, M. B. (1980-05-01). "Crosscorrelation properties of pseudorandom and related sequences". Proceedings of the IEEE. 68 (5): 593–619. doi:10.1109/PROC.1980.11697. ISSN 0018-9219. S2CID 6179951.
- ^ "A Little MLS (Maximum-Length Sequence) Tutorial | dspGuru.com". dspguru.com. Retrieved 2016-05-19.
its RMS and peak values are both X, making its crest factor (peak/RMS) equal to 1, the lowest it can get.
- ^ "Other Electro-Acoustical Measurement Techniques". www.clear.rice.edu. Retrieved 2016-05-19.
The crest factor for MLS is very close to 1, so it makes sense to use this kind of input signal when we need a high signal-to-noise ratio for our measurement
- ^ Chan, Ian H. "Swept Sine Chirps for Measuring Impulse Response" (PDF). thinksrs.com. Retrieved 2016-05-19.
Maximum-length sequence (MLS) theoretically fits the bill because it has a mathematical crest factor of 0dB, the lowest crest factor possible. However, in practice, the sharp transitions and bandwidth-limited reproduction of the signal result in a crest factor of about 8dB
- ^ Friese, M. (1997-10-01). "Multitone signals with low crest factor" (PDF). IEEE Transactions on Communications. 45 (10): 1338–1344. doi:10.1109/26.634697. ISSN 0090-6778.
- ^ Cohn, M.; Lempel, A. (January 1977). "On Fast M-Sequence Transforms". IEEE Trans. Inf. Theory. 23 (1): 135–7. doi:10.1109/TIT.1977.1055666.
External links
[edit]- 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.
- 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
Maximum length sequence
View on GrokipediaIntroduction
Definition
A maximum length sequence (MLS), also known as an m-sequence, is a type of pseudorandom binary sequence generated by a maximal linear feedback shift register (LFSR) of degree , achieving the longest possible period of for that register length.[4][5] The sequence is deterministic and periodic, repeating every symbols, but within one full period, it mimics the statistical behavior of random noise due to its uniform traversal of all non-zero states of the LFSR.[6] Key characteristics of an MLS include its binary nature, consisting of symbols that can be represented as 0 and 1, and its common mapping to +1 and -1 in applications requiring symmetry, such as signal processing and testing.[7] This mapping results in a nearly zero mean over one period, enhancing its utility as pseudorandom noise.[8] MLSs are widely used for generating pseudorandom signals in communications, system identification, and measurement techniques because of their noise-like appearance despite being fully deterministic.[6] The sequence is typically notated as for , where .[9]Historical Development
The development of maximum length sequences (MLS), also known as m-sequences, traces its roots to the 1940s and 1950s, emerging from research on linear feedback shift registers (LFSRs) amid wartime demands for secure communications and radar systems resistant to jamming. During World War II, efforts to create noise-like signals for anti-interference purposes laid foundational groundwork, with early experiments in pseudorandom sequences appearing in spread-spectrum techniques by the late 1940s, such as Mortimer Rogoff's work on correlation using stored noise signals.[10] In the 1950s, Solomon W. Golomb advanced the mathematical understanding of LFSRs while at the Jet Propulsion Laboratory, identifying sequences that achieve maximal period lengths for pseudorandom properties suitable for cryptography and error-correcting codes. Golomb's research culminated in his influential 1967 book Shift Register Sequences, which systematically formalized the construction and characteristics of these sequences, establishing them as a cornerstone of digital sequence theory.[11][12] Key early applications emerged in space communications during the late 1950s and 1960s, including the use of m-sequences in 1958 for determining the orbit of Explorer I and in 1961 for ranging to Venus, achieving unprecedented accuracy improvements. By the 1970s, MLS gained traction in acoustics through Manfred R. Schroeder's pioneering 1975 paper on diffuse sound reflection via maximum-length sequences, which inspired practical measurement systems like MLSSA in the late 1980s for room impulse response analysis.[13][14] Into the 1990s, MLS transitioned from theoretical constructs to standard tools in digital signal processing, supporting efficient correlation-based testing in communications and beyond, as evidenced by their integration into standards like GPS and 3G systems.[13]Mathematical Foundations
Linear Feedback Shift Registers
A linear feedback shift register (LFSR) consists of a chain of n flip-flops or memory elements arranged in series, forming a shift register, with feedback connections from selected output positions (taps) combined using exclusive-OR (XOR) gates, which perform modulo-2 addition, to generate the input for the first stage.[1][4] The structure operates synchronously, shifting the contents of the register toward the output on each clock cycle, while the feedback bit determines the new value entering the input end.[1] In the context of generating maximum length sequences (MLS), the LFSR produces binary sequences, typically represented as elements in {0,1}, which can be mapped to {+1,-1} for signal processing applications by substituting 0 → +1 and 1 → -1.[2] The operation of an LFSR is governed by a linear recurrence relation over the finite field GF(2), where the next state of the register is computed as the XOR of the tapped positions. For a register of length n, if the current state is , the next bit is given by where T denotes the set of tap positions (with indices starting from 0 or 1 depending on convention).[4][1] This recursive process generates a periodic sequence, and the LFSR must be initialized to a non-all-zero state to avoid locking into a trivial constant-zero output.[1] A maximal LFSR is configured such that its feedback polynomial is primitive over GF(2), ensuring the register cycles through all possible non-zero states before repeating, thereby producing an MLS of maximum period .[4][1] The all-zero state is excluded from the cycle, as it leads to perpetual zeros under the linear feedback rule.[2] For illustration, consider a simple n=3 LFSR with taps at positions 1 and 3 (corresponding to the polynomial ), initialized to the state [1,1,1]. The sequence of output bits generated is 1,1,1,0,1,0,0 (or equivalently, shifting through states: 111 → 110 → 101 → 100 → 011 → 010 → 001 → 111), repeating every 7 steps and visiting all non-zero ternary combinations.[1][2]Primitive Polynomials
A primitive polynomial of degree over the Galois field GF(2 is defined as an irreducible polynomial whose one root in the extension field GF() is a primitive element, generating the entire multiplicative group of order .[15] Equivalently, it is an irreducible polynomial that divides but does not divide for any proper divisor of . In the context of linear feedback shift registers (LFSRs), the feedback polynomial must be primitive to ensure the register produces a maximum length sequence (MLS) of period exactly , traversing all possible nonzero states.[1] The coefficients of the polynomial determine the tap positions in the LFSR; for instance, the primitive polynomial over GF(2 corresponds to taps at positions 4 and 1 (with the constant term implicit), yielding an MLS of length 15 for a 4-stage register.[16] To test whether an irreducible polynomial of degree over GF(2 is primitive, one verifies that the smallest positive integer such that is exactly . This involves checking that divides and that the order is not smaller by testing against the prime factors of .[15] Examples of primitive polynomials over GF(2 for small degrees include:| Degree | Primitive Polynomial | Period |
|---|---|---|
| 2 | 3 | |
| 3 | 7 | |
| 4 | 15 | |
| 5 | 31 |
Generation
Polynomial Interpretation
Maximum length sequences admit an algebraic interpretation in terms of polynomials over the finite field GF(2. Consider a primitive irreducible polynomial of degree over GF(2, which serves as the characteristic polynomial for generating the sequence. The sequence satisfies the linear recurrence relation defined by the coefficients of , where the feedback is given by the polynomial's non-leading terms. For instance, with , the recurrence is for , with initial conditions determining the specific shift of the periodic sequence.[18] The generating function of the sequence provides a compact algebraic representation. The formal power series can be expressed as , where is the reciprocal polynomial of (defined as ) and is a polynomial of degree less than determined by the initial terms of the sequence. For initial conditions corresponding to the impulse response (starting from a single 1), this reduces to the power series expansion of in the ring of formal power series over GF(2. The periodicity arises because the sequence repeats every terms, reflecting the structure of the quotient ring GF(2) / (p(x)), where the element has multiplicative order due to the primitivity of . This ensures no shorter cycles, as any proper divisor would contradict the maximal order property of primitive polynomials.[18][19] An explicit formula for the sequence entries links it directly to finite field elements. Let be a root of in the extension field GF(); then is a primitive element generating the multiplicative group of nonzero field elements. The sequence is given by , where is the absolute trace function defined as . This trace representation underscores the balanced and pseudorandom nature of the sequence, as the trace maps elements uniformly to 0 or 1 over the field.[19]Practical Implementation
Maximum length sequences are commonly implemented in software using simulations of linear feedback shift registers (LFSRs), where the register state is updated via right-shifting and XOR operations on specified tap positions defined by the primitive polynomial. Languages like Python or C are suitable, with the register typically represented as an integer or bit array initialized to a non-zero value to ensure the sequence cycles through all 2^n - 1 non-zero states. For instance, the feedback bit is computed as the XOR of the bits at the tap locations, then shifted into the register's most significant position.[20][21] In hardware, MLS generation leverages field-programmable gate arrays (FPGAs) or application-specific integrated circuits (ASICs), employing D flip-flops for the shift register stages and XOR gates for feedback computation based on the polynomial taps. This configuration enables compact, high-throughput designs; for example, VHDL-based FPGA implementations for 8-, 16-, and 32-bit LFSRs demonstrate low resource usage and maximal sequence lengths, suitable for built-in self-test applications.[22][23] The following pseudocode illustrates an n=4 MLS generation using the primitive polynomial (taps at positions 0 and 1, 0-based from the least significant bit), starting from state 0001 (decimal 1). The output is the least significant bit at each step, yielding the full 15-bit sequence: 100010011010111.n = 4
state = 1 # Initial non-zero state: binary 0001
[sequence](/page/Sequence) = []
taps = [0, 1] # Positions for x^4 + x + 1
for _ in range(2**n - 1):
output = state & 1 # Extract LSB as output
[sequence](/page/Sequence).append(output)
feedback = 0
for tap in taps:
feedback ^= (state >> tap) & 1
state = (state >> 1) | (feedback << (n - 1)) # Shift right, insert feedback at MSB
# Output: [1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1]
n = 4
state = 1 # Initial non-zero state: binary 0001
[sequence](/page/Sequence) = []
taps = [0, 1] # Positions for x^4 + x + 1
for _ in range(2**n - 1):
output = state & 1 # Extract LSB as output
[sequence](/page/Sequence).append(output)
feedback = 0
for tap in taps:
feedback ^= (state >> tap) & 1
state = (state >> 1) | (feedback << (n - 1)) # Shift right, insert feedback at MSB
# Output: [1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1]
