www.pudn.com > mimoprecoding.rar > startsim.asv, change:2006-07-01,size:1667b


function startsim 
clear all 
sim_options = struct( 'PacketLength',1920,... 
'ConvCodeRate','R1/2',...% 
'UseConvCode',0,... 
'InterleaveBits',0,...% 
'Modulation','QPSK',... 
'UseTxPA', 0, ...   %功率放大参数 
'UsePhaseNoise', 0, ...%相位噪声不用 
'TxPowerSpectrum', 0, ... 
'PilotPhaseTracking', 0, ... 
'FreqSync', 0, ... 
'UseTxDiv',2,...%天线分集使用两发两收STBC。值为2时表示有4根发射天线,采用4发2收,或者4发1收,分集增益由波束形成获得 
'UseRxDiv',1,... 
'Freqerror',0,... 
'PktsToSimulate', 100,...%每个信噪比下仿真的包数 
'SNR',10,... 
'ChannelModel', 'AWGN', ...%用于获取信道的冲击响应 ExponentialDecay or AWGN or Rayleigh or Multipath%%Rayleigh暂时不能使用 
'TracebackLength',34,... 
'ViterbiType', 'hard', ...% 
'Nsdec',3,...%%what is it ? 
'ChannelEstimation',0,... 
'PacketDetection', 1, ... 
'FineTimeSync', 0,... 
'ExpDecayTrms', 68,...   %100时,信道长度超过循环前缀长度,会有码间串扰 
'RxTimingOffset', 0,...         %原来没有  RxTimingOffset  的设定 
'A' , [1 1/exp(1) 1/exp(2)]);   %瑞利信道的多径归一化能量 
  % set constants used in simulation 
  set_sim_consts; % system constant 
echo on 
 
% began main program% 
SNR = [2 4 6 8 10 12 14 16]; 
% PKTS = [1e4 1e4 1e4 1e4 1e4 1e4]; 
%  SNR = [0]; 
%  PKTS = [5e3]; 
fid = fopen('result.txt','w'); 
fclose(fid); 
for sim_count = 1:length(SNR) 
   sim_options.SNR = SNR(sim_count); 
   fid = fopen('result.txt','A'); 
   fprintf(fid,'  SNR = %d      ',sim_options.SNR); 
   fclose(fid); 
   %     sim_options.PktsToSimulate = PKTS(sim_count); 
   fprintf('<---- SNR = %d ---->\n',sim_options.SNR); 
   feval('runsim', sim_options);   %execute runsim.m; its parameters are sim_options 
end

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