File Exchange

image thumbnail

m-sequence generation program using a search algorithm

version 1.0 (1.92 KB) by

Generates maximum length sequences (m-sequences) of length a^b-1, where a is any prime number <=31



View License

Maximum length sequence assuming distinct
values = baseVal^powerVal-1


ms: generated maximum length sequence, of length
basisVal^powerVal-1 such that all values occur
with equal frequency=basisVal except zero,
which occurs basisVal-1 times

baseVal: any prime number up to 31
powerVal: an integer
NB: the algorithm is performing search in m-sequence
register space so the calculation time grows with
baseVal and powerVal
Tested on Matlab 7.9.0 (R2009b)

(C) Written by Giedrius T. Buracas, SNL-B, Salk Institute
and Center for Functional MRI, UCSD

Comments and Ratings (1)


Karin (view profile)

Everything is working well. I just wondered if I could ask a question: My understanding is that in theory it is possible to create m-sequences when the number of levels is a power of a prime integer (so, for example,for an experiment that uses 9 stimuli). Is that possible within this program, or can I only generate sequences in which the number of levels is a prime integer?

MATLAB Release
MATLAB 7.9 (R2009b)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today