www.pudn.com > tryGUI.rar > 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];