📄 training_ds.m
字号:
function output=training_ds(train_l,input)
%该程序将输入序列扩频后在其前面加入了训练序列
%train_l: the length of training series
%pn : pn code
%input : information data
input=2*input-1;
if train_l<=0
error('Error,train_l is not of the right size.')
end
if length(input)~=1*5
%error('Error,length of input is not of the right size.')
end
pn=[1 1 1 1 1 -1 -1 1 1 -1 1 -1 1];
xt=[1 -1];
if rem(train_l,2)>0
temp=xt'*ones(1,train_l/2-1);
training=reshape(temp,1,train_l-1);
training=[training,1];
else
temp=xt'*ones(1,train_l/2);
training=reshape(temp,1,train_l);
end
temp=pn'*input;
data=reshape(temp,1,length(input)*length(pn));
output=[training,data];
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -