File Exchange

image thumbnail

Kasami Sequences, m-sequences, Linear Feedback Shift Registers

version (17.1 KB) by Travis Wiens
LFSRs are used to generate sequences, including MLS and sets of Kasami sequences.


Updated 17 Jul 2009

View License

Linear feedback shift registers (LFSR) are a simple method of generating sequences, including pseudorandom number sequences. The LFSR code provided is very unrestricted, allowing for any feedback polynomial, initial state or decimation factor. The code is written for a 32 bit LFSR, but minor alterations allow for 8-64 bit versions. A equivalent mex file is included, which runs approximately 100 times faster than the m file.

Some of these LFSR sequences have special properties; a maximal length sequence (MLS or m-sequence) has a large autocorrelation at zero lag, with near zero autocorrelation elsewhere. This 'impulsive' autocorrelation function allows one to quickly determine the impulse response of a linear time invariant (LTI) system. An example of this system identification is provided.

Maximal length sequences are also the base of sets of sequences with good correlation properties. One such set is the small set of Kasami sequences. These sequences have small off-peak autocorrelations and also small cross correlations between sequences. This property allows for code-division multiplexing as well as accurately determining the arrival time of a transmitted sequence, even in the presence of other interfering transmissions. An example of this, too, is provided.

See for more.

Cite As

Travis Wiens (2020). Kasami Sequences, m-sequences, Linear Feedback Shift Registers (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (4)


Great. Just what I needed.

Perfect. Great thanks.


Removed GPL per Mathworks' requirements.

MATLAB Release Compatibility
Created with R2007a
Compatible with any release
Platform Compatibility
Windows macOS Linux