⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 set_sim_consts.m

📁 Woven码在TD-SCDMA中的应用仿真程序
💻 M
字号:
function sim_consts = set_sim_consts
% set the parameters used in the simulation. to know detail, run the
% function 'set_sim_consts'.
% this function will save all the parameters in a global variable 'sim_consts'

    global sim_consts;
    
    % downlink's parameters;    
    % for simulation control
    sim_consts.ferrlim = 15 ;                      % the max error frame number
    sim_consts.nframeAll = 15 ;                    % the max number of frame
    sim_consts.errAll = 500;                       % the max error bit number
    sim_consts.EbN0 = [ -2] ;                      % Signal Noise Ratio
    
    % for channel and JD
    sim_consts.channel = 'case3';           % channel type 'case1','case2','case3'
    sim_consts.fc = 2000 ;                  % MHz         
    sim_consts.chipRate = 1.28;             % MChips
    sim_consts.a = 1; 
    
    % for interleave 
    sim_consts.sortT = 8;                   % sort matrix's row , see Page.58 in Dr. Xie' book for detail
   
    % for downlink type 12.2 64 144 384
    sim_consts.linkRate = '12.2';   % downlink type '12.2','64','144','384'
    
    sim_consts.cDisturb = 1;        % wheather to add  disturb.   set 1 to add, 0 not.
    sim_consts.cAvailable = 10;     % total code channel number can be used in a time slot. should be large than 10
        
    % any processing
    switch sim_consts.channel
        case 'case1'
            sim_consts.v  = 3 ;                     % km/h
            sim_consts.nsdelay = [0,2928];          % ns delay of each rayleigh path
            sim_consts.averagePower = [0,-10] ;     % averagePower of each rayleigh path  
            
        case 'case2'
            sim_consts.v  = 3 ;                     % km/h
            sim_consts.nsdelay = [0,2928,12000];    % ns delay of each rayleigh path
            sim_consts.averagePower = [0,0,0] ;     % averagePower of each rayleigh path  
            
        case 'case3'
            sim_consts.v  = 120 ;                   % km/h
            sim_consts.nsdelay = [0,781,1563,2344]; % ns delay of each rayleigh path
            sim_consts.averagePower = [0,-3,-6,-9]; % averagePower of each rayleigh path  
    end
    
    switch sim_consts.linkRate
        case '12.2'
            sim_consts.tsNumber = 1;                % used time slot
            sim_consts.cNumber = 2;                 % used code channel        
            sim_consts.L_total = 234;	            % infomation bits plus tail bits
            
        case '64'
            sim_consts.tsNumber = 1;                % used time slot
            sim_consts.cNumber = 8;                 % used code channel        
            sim_consts.L_total = 936;	           % infomation bits plus tail bits    
            
        case '144'
            sim_consts.tsNumber = 2;                % used time slot
            sim_consts.cNumber = 8;                 % used code channel       
            sim_consts.L_total = 1872;	           % infomation bits plus tail bits    
            
        case '384'
            sim_consts.tsNumber = 4;                % used time slot
            sim_consts.cNumber = 10;                % used code channel
            sim_consts.L_total = 4680;	           % infomation bits plus tail bits
            
    end
    sim_consts.subFrames = 4 ;                      % set the number of subframes that a info block will be transmited by
    
    sim_consts.startT   = 0;                            % simu start time (s)
    sim_consts.endT     = 0.000675*sim_consts.tsNumber; % simu end time (s).   for example :0.000675 means a time slot' time
    sim_consts.deltaT   = 0.00000078125;                % each chip's time.   for example  1/1.28e006 means under TD-SCDMA

    sim_consts.W = ...                                  % max chipdelay
        round(max(sim_consts.nsdelay)*10^-9/sim_consts.deltaT)+1 ;    
    sim_consts.ka = 8 ;                                 % number of antennas
    sim_consts.hsig = zeros(sim_consts.ka,864*sim_consts.tsNumber);     % init 8 antennas's h
    sim_consts.gu = zeros(sim_consts.ka,sim_consts.W);                  % init 8 antennas's estimated h    
    
    
   
    % conv codec's parameters
    sim_consts.g = [ 557 663 711 ];  
    sim_consts.k = [ 9 ];     
    sim_consts.t = poly2trellis(sim_consts.k,sim_consts.g);
    sim_consts.niter = 1;
    sim_consts.m = 8 ;
    sim_consts.tblen = 8;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -