www.pudn.com > wcdma_simulink.rar > dl_star_back.m


function [N, N_frame, K, C,CRC,tail,nPilot,TPC,TFI,ratem_flag] = dl_start(nCode, c_type, Kindex,  nFrames)
%
% MIGHT WANNA ADD LATER tx_ch_type
%
% nCode = spreading factor
% c_type = mode indicating the channel coding scheme
%      1 = Convolutional coding with   
%      3 = Turbo coding (NOT YET)
% K_index = Coding ratio (input values: (1,2)
% nFrames = number of frames in each block interleaver
% 
%
% N = User input block size
% K = Coding ratio  (output values: 2 or 3)
% nTail = tail length
% nPilot  = number of Pilot bits per slot
% TPC  = number of power bits per slot
% TFI = number of TFI bits per slot
% ratem_flag = 0 or 1 depending if ratematching is used or not


R = 4096000;        % chips /s
nSlot = 16;         % Number of slots per frame
tFrame = 1/100;     % 10 ms

if (c_type == 1)

if (Kindex >1) disp('Only coding ratio 3 is implemented currently'); end; 
K = 3 ;

tail = 8;
nPilot = 8;
TPC = 3;
TFI = 2;
CRC = 16;

nCode 
if length(nCode) < 2
for(i=1:nCode)  C(i) = (-1)^i; end; 

else 
 C = nCode;
 nCode = length(C);
end;

total_bits = R/nCode * 2
bits_slot = total_bits * tFrame / nSlot
coded_bits_frame = (bits_slot - nPilot -TPC - TFI) * nSlot
N_tmp = ( nFrames * coded_bits_frame - CRC*K - tail) 
N = floor(N_tmp/K) 
N_frame =coded_bits_frame; 

ratem_flag=0
return;
end;


if (c_type > 1)
    disp('Only the convolutiona channel coding (1/3, 9) is implemented currently');
    
    return;
end;

if (nargin > 2)

end;