sp.mls

Module providing the functionality to generate Maximal Length Sequences. Based on wiki’s description and polynomial representation. http://en.wikipedia.org/wiki/Maximum_length_sequence

Example Usage

mls

import numpy
import pylab
from sp import mls
from sp import filter
nbits = 9
m = mls.mls(nbits)
pylab.figure()
pylab.title('%d bit M-Sequence Periodic Autocorrelation' % nbits)
m = numpy.where(m, 1.0, -1.0)
pylab.plot((numpy.roll(filter.ccorr(m, m).real, 2**nbits/2 - 1)))
pylab.xlim(0, len(m))
pylab.show()

(Source code, png, hires.png, pdf)

_images/mls-1.png

See the individual methods below for further details.

Functions

sp.mls.mls(n, seed=None)[source]

Generate a Maximal Length Sequence 2^n - 1 bits long

sp.mls.lfsr(taps, buf)[source]

Function implements a linear feedback shift register taps: List of Polynomial exponents for non-zero terms other than 1 and n buf: List of buffer initialisation values as 1’s and 0’s or booleans

Table Of Contents

Previous topic

sp.gold

Next topic

sp.multirate

This Page