function mseqbur = mseqburmeth(a) % mseqbur = mseqburmeth % % This function creates a pseudomsequence with 9 event levels using the way % suggested by Buracas from Buracas and Boyton 2002. % % This method is to: % 1. Take a binary [0 1] msequence of the correct length. % 2. Cyclically shift the sequence (no specific shift, try to see what % works) % 3. Multiply the sequence by 2. % 4. Add the original sequence. % 5. Multiply a binary [0 1] msequence by 4. % 6. Shift the [0 4] sequence cyclically. % 7. Add the [0 1 2 3] sequence to the shifted [0 4] sequence. % 8. View and test sequence. % % % Input: % a : shift of [0 2] mseq % b : negative shift of [0 4] mseq % % % Buracas GT, Boyton GM (2002). "Efficient Design of Event-Related fMRI % Experiments Using M-Sequences" NeuroImage 16, 801-813. % % The msequence generator called in this function is subject to copyright. % % Contact: % Wesley Kerr % wesleytk@sas.upenn.edu baseseq=mseq(3,6); nlength=length(baseseq); for i=1:nlength if baseseq(i)==-1 baseseq(i)=2; end end base3=baseseq*3; base3b=zeros(nlength,1); burseq=zeros(nlength,1); for i=1:nlength shift3=mod(i+a,nlength)+1; base3b(i)=base3(shift3); burseq(i)=baseseq(i)+base3b(i); end clear baseseq i base3 base3b shift3 nlength mseqbur=burseq; clear burseq