www.pudn.com > mimoprecoding.rar > tx_gen_preamble.m, change:2006-06-09,size:2430b


function [preamble, long_tr] = tx_gen_preamble(sim_options); 
 
global sim_consts; 
global flag; 
%Generate first ten short training symbols 
short_tr = sim_consts.ShortTrainingSymbols; 
% generate four short training symbols 
short_tr_symbols = tx_freqd_to_timed(short_tr); 
% Pick one short training symbol 
Strs = short_tr_symbols(1:16); 
% extend to ten short training symbols 
short_trs=[Strs Strs Strs Strs Strs Strs Strs Strs Strs Strs]; %短训练序列长度为 16×10=160 
short_trs_len=length(short_trs); 
 
% next generate the two long training symbols 
if ~flag 
  long_tr = sim_consts.LongTrainingSymbols; 
else 
  long_tr = zeros(1,size(sim_consts.LongTrainingSymbols,2));%randsrc(1,size(sim_consts.LongTrainingSymbols,2)); 
end 
long_tr_symbol = tx_freqd_to_timed(long_tr); %64点的ifft 
if ~sim_options.UseTxDiv 
   % single antenna preamble 
   % extend with the 2*guard interval in front and then two long training symbols  
   long_trs_signal = [long_tr_symbol(64-2*16+1:64) long_tr_symbol long_tr_symbol]; %使用单天线长训练序列为 32+64+64 
elseif sim_options.UseTxDiv == 1 
   % generate the two antenna preamble, 
   % long training symbols are not transmitted simultaneously from both antennas to allow 
   % channel estimation in receiver 
   long_trs_signal(1,:) = sqrt(2)*[long_tr_symbol(64-16+1:64) long_tr_symbol ...   %注意零的位置 
         zeros(1,80)]; 
   long_trs_signal(2,:) = sqrt(2)*[zeros(1,80) ... 
         long_tr_symbol(64-16+1:64) long_tr_symbol]; 
else 
   long_trs_signal(1,:) = sqrt(2)*[long_tr_symbol(64-16+1:64) long_tr_symbol ...   %注意零的位置 
         zeros(1,80)]; 
   long_trs_signal(2,:) = sqrt(2)*[zeros(1,80) ... 
         long_tr_symbol(64-16+1:64) long_tr_symbol]; 
   long_trs_signal(3,:) = sqrt(2)*[long_tr_symbol(64-16+1:64) long_tr_symbol ...   %注意零的位置 
         zeros(1,80)]; 
   long_trs_signal(4,:) = sqrt(2)*[zeros(1,80) ... 
         long_tr_symbol(64-16+1:64) long_tr_symbol]; 
end 
% concatenate first short training symbols and long training symbols 
preamble(1,:) = [short_trs(1,:) long_trs_signal(1,:)];  %长短合并在一起,对单天线长度为320,对2天线长度为320 
% add the second antenna preamble 
if sim_options.UseTxDiv 
   preamble(2,:) = [short_trs(1,:) long_trs_signal(2,:)]; 
end 
if sim_options.UseTxDiv == 2 
   preamble(3,:) = [short_trs(1,:) long_trs_signal(2,:)]; 
   preamble(4,:) = [short_trs(1,:) long_trs_signal(2,:)]; 
end

2018无需申请注册送58体验金