generator_gold.m
来自「用matlab语言实现Goldsequence产生」· M 代码 · 共 17 行
M
17 行
function[gold_seq1,gold_seq]=generator_gold(connections1,connections2)
clear;
%first determine the maximal length shift-register sequences.
%assume the initial shift-register content as "00001"
connections1=[1 0 1 0 0];
connections2=[1 1 1 0 1];
sequence1=ss_mlsrs(connections1);
sequence2=ss_mlsrs(connections2);
%cyclically shift the second sequence and add it to the first one.
L=2^length(connections1)-1;
for shift_amount=0:L-1,
temp=[sequence2(shift_amount+1:L) sequence2(1:shift_amount)];
gold_seq1(shift_amount+1,:)=(sequence1+temp)-floor((sequence1+temp)./2).*2;
end
gold_seq=2*gold_seq1-1
gold_seq1(1,:)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?