matlab生成m序列
source_bits=m_generate([1 1 0 1 0 0 1 ]);function[mg]=m_generate(f)n=length(f); %移位寄存器长度N=2^n-1; %伪随机码的周期register=[zeros(1,n-1) 1];for i=1:Nnewregister(1)=mod(sum(f.*register),2); %异或运算for j=2:nnewregister(j)=register(j-1); %移位e