Pluto-Network/code/matlab/BPSK/receiver/tx_gen_m_seq.m

18 lines
607 B
Matlab
Raw Permalink Normal View History

2018-01-30 06:11:44 +00:00
function seq = tx_gen_m_seq(m_init)
%MSRG<52><47>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD>ͷ<EFBFBD>ͣ<EFBFBD><CDA3>
connections =m_init;
m=length(connections);%<25><>λ<EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
L=2^m-1;%m<><6D><EFBFBD>г<EFBFBD><D0B3><EFBFBD>
registers=[zeros(1,m-1) 1];%<25>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC>
seq(1)=registers(m);%m<><6D><EFBFBD>еĵ<D0B5>һλȡ<CEBB><C8A1>λ<EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
for i=2:L,
new_reg_cont(1)=connections(1)*seq(i-1);%<25>¼Ĵ<C2BC><C4B4><EFBFBD><EFBFBD>ĵ<EFBFBD>һλ<D2BB><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD>˼Ĵ<CBBC><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һλ
for j=2:m,
new_reg_cont(j)=rem(registers(j-1)+connections(j)*seq(i-1),2);%<25><><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>ǰ<EFBFBD>ߵļĴ<C4BC><C4B4><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD>˼Ĵ<CBBC><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һλ
end
registers=new_reg_cont;
seq(i)=registers(m);%<25><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>ѭ<EFBFBD><D1AD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һλ<D2BB>õ<EFBFBD>m<EFBFBD><6D><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>λ
end
end