function [size, crc, chCode, C, control] = dl_start(nCode, c_type, Kindex, nFrames,tx_ch)
%
%
% FUNCTION: dl_start
% AUTHOR: Maarit Melvasalo
% DATE: April 21, 1999
%
% DESC: This fuction set values for downlink transport channels
% defined in Simulink library: utra_lib
% These values have been obtained from ETSI UTRA
% for ITU-R RTT.
%
% NOTE: Parameter value may be changed, but be carefully!
% Do not change the calcutions.
%
% HISTORY: June 17,1999 Maarit Melvasalo
% Comments added
% Copyright disclaimer:
% This software was developed at the National Institute of Standards
% and Technology by employees of the Federal Government in the course
% of their official duties. Pursuant to title 17 Section 105 of the
% United States Code this software is not subject to copyright
% protection and is in the public domain.
%
% We would appreciate acknowledgement if the software is used.
%
% *******************************************************************
%
% INPUTS:
%
% nCode =[code_length, index ] =
% spreading factor and index (NOTE index is not required!!)
% If the code has been pre set i.e nCode = C, nothing is done
% 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
% tx_ch = transport channel type
% 1 = Dedicated transport channel
% 2 = Primarly common control physical cahnnel (NO CRC)
% 3 = Secondary common control physical channel (FACH or PCH)
%
% OUTPUTS:
%
% size = [N = input_block_size bits_in_frame nFrames N_offset nSlot]
% input_block_size= number of bits in each input block (calculated)
% bits_in_frame = number of coded bits in frame (calculated)
% Note that this does not include contorl bits
% nFrames = number of frames in each block (calculated)
% N_offset = offset required to obtain correct blocksize (calculated)
% after channel coding (and before interleaving)
% nSlot = number of slots in frame (set by user)
% chips_in_slot = number of slots in frame (constant for given bit bandwidth)
%
% crc = [nCRC poly]
% nCRC = number of CRC bits (set by user) different for different
% physical channels
% poly = generating polynomial for CRC (set by user)
%
% chCode = [c_type K tail poly]
% c_type = channel type (given in function call = set by user)
% K = Coding gain (given in function call = set by user)
% tail = Coding tail length (set by user)
% poly = Generating polynomials for channel coding (set by user)
%
% C = spreading code
% spreading code depends on given parameters (calculated / given by user)
%
% control = [nPilot TPC TFI]
% nPilot = number of Pilot bits (given by user)
% TPC = number of Power control bits (given by user)
% TFI = number of Transport Format Indicator bits (given by user)
%
%
%
%
% ***************************************************************
%
% Common parameters to all Downlink transport channels
%
% ***************************************************************
R = 4096000; % chips rate 1/s
nSlot = 16; % Number of slots per frame same as
% wcdma_config.h = SLOTS_IN_FRAME
tFrame = 1/100; % 10 ms = frame time
% Simulink s-functions use TD_FRAME = 1
% defined in wcdma_config.h
chips_in_slot = R/nSlot*tFrame;
% Number of chips in each slot (constant)
% ***************************************************************
% If only only one argument is given at the function call
% only the basic parameters are returned to the user
if(nargin == 1)
size = [nSlot,chips_in_slot];
crc =0;
C = 0;
chCode = 0;
control =0;
return
end;
% ***************************************************************
%
% CRC Basic settings
%
% ***************************************************************
nCRC = 16 ; % Number of CRC bits;
crc_q = '1021'; % ARIB in decimal presentation 4129
CRCQ = base2dec(crc_q,16); % same in decimal representation
crc = [nCRC CRCQ];
% ***************************************************************
%
% CONVOLUTIONAL CODING PARAMETERS
%
% ***************************************************************
if (c_type == 1)
% CODING RATIO
% Kindex == 1 -> K = 2;
% Kindex == 2 -> K = 3;
K = Kindex + 1 ; tail = 8;
%*****************************************
% The Generator polynomials for convolutional coding and decoding
% see UTRA specification chapter 5.2.1.1.1
Base = 8; % indicates the base in which the numbers are given/**/
if (K == 3)
p1_o = '557'; % desimal: 367;
p2_o = '663'; % desimal: 435;
p3_o = '711'; % desimal: 457;
else
p1_o = '561'; % desimal: 367;
p2_o = '753'; % desimal: 435;
p3_o = '0'; % desimal: N/A;
end;
poly = [base2dec(p1_o,Base) base2dec(p2_o,Base) base2dec(p3_o,Base)];
% ***************************************************************
%
% NUMBER OF CONTROL BITS
%
% ***************************************************************
nPilot = 8; TPC = 3; TFI = 2;
% If not Dedicated transport channel update the following parameters:
if(tx_ch == 3)
TPC = 0; TFI = 0; % Secondary common control
end;
if (tx_ch == 2)
TPC = 0; TFI = 0; nCRC = 0; % Primary common control
crc = [nCRC CRCQ];
if (nCode(1) < 256)
disp('Only Spreading ratio 256 allowed for Primary common control channel');
nCode(1)=256;
end;
end;
% ***************************************************************
% Update return values
chCode = [c_type K tail poly];
control = [nPilot TPC TFI];
% ***************************************************************
%
% SPREADING CODE
%
% ***************************************************************
% if the spreading code has not been assigned
if ( length(nCode) < 3)
% set the code index for a inital value
index = nCode(1) / 2 ;
% If the code index has been defined by the use
% in thefunction call check that is valid index
if ((length(nCode) == 2) & ((index <= nCode) & (index >0) ))
index = nCode(2); end;
% Call a matalb mex function which returns the code
C = get_ovsf_code(nCode(1),index);
end;
if ( length(nCode) > 2) % if the spreading code has already been assigned
C = nCode;
nCode = length(C);
end;
% ***************************************************************
%
% NUMBER OF BITS IN BLOCK, FRAME AND SLOT ETC
%
% DO NOT CHANGE!!!!!!!!
%
% ***************************************************************
total_bits = R/nCode(1) * 2 ;
bits_in_slot = total_bits * tFrame / nSlot ;
coded_bits_frame = (bits_in_slot - nPilot -TPC - TFI) * nSlot ;
% NOTE:
% Size of the inputblock to CRC must be * 8
N_total = nFrames * coded_bits_frame - tail ;
N_tmp = floor(N_total / K);
if( nCRC > 0)
N_tmp = 8 * floor(N_tmp / 8) ;
end;
N = N_tmp - nCRC ;
N_offset = N_total - N_tmp*K;
size =[N coded_bits_frame nFrames
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Nokia研究人员写的WCDMA的仿真代码·包含信道编码,交织,速率匹配,调制,扩频,信道模型,RACK接收机.rar (77个子文件)
www.pudn.com.txt 218B
wcdma_simulink
s_buffer.mexsol 15KB
koe_channel_rake.mdl 17KB
koe_intra_deint.mdl 11KB
koe_ch_auki.mdl 15KB
s_crc_remove.mexsol 16KB
koe_spreading.mdl 6KB
s_compile_utra.m 2KB
koe_mod_demod.mdl 13KB
koe_chcode_crc_mask.mdl 17KB
koe_channel_rake_inter_control.mdl 35KB
koe_chcode_crc.mdl 15KB
ajo_perjantai.m 309B
koe_chcode.mdl 9KB
ajo_n_times.m 563B
params.m 343B
dl_utra.m 1KB
koe_mod.mdl 14KB
koe_channel_rake_inter.mdl 19KB
s_rake.mexsol 22KB
s_derate.mexsol 19KB
koe_s_code.mdl 12KB
s_intra_deinterleaver.mexsol 21KB
koe_rate.mdl 10KB
channel_param.m 1KB
s_frame_buffer.mexsol 17KB
s_hard_decission.mexsol 15KB
s_code.mexsol 18KB
koe_buffer.mdl 14KB
koe_inter_int.mdl 9KB
s_ber_calc.mexsol 15KB
dl_2_start.m 4KB
s_interleaver.mexsol 19KB
s_deinterleaver.mexsol 19KB
utra.m 6KB
s_channel_estimator.mexsol 14KB
get_ovsf_code_indexes.mexsol 6KB
koe_channel_one.mdl 13KB
s_conv_detection.mexsol 17KB
koe_ul_opne.mdl 18KB
koe_channel_awgn.mdl 23KB
dl_star_back.m 1KB
ajo_ke26.m 208B
s_chcoding.mexsol 25KB
s_spreading.mexsol 17KB
koe_code_one.mdl 6KB
s_channel_real_input.mexsol 24KB
s_ber_direct.mexsol 15KB
s_channel.mexsol 33KB
get_ovsf_code.mexsol 6KB
s_chdecoding.mexsol 31KB
koe_mod_demod_control.mdl 15KB
ajo_la2.m 533B
koe_chcode_crc_rate.mdl 14KB
start.m 631B
koe_interleaver_right_size.mdl 34KB
s_pulse_shaping.mexsol 14KB
koe_crc.mdl 7KB
koe_inter_new.mdl 14KB
s_rate.mexsol 19KB
koe_inter_deinter.mdl 9KB
s_dl_demod_buffer.mexsol 18KB
ul_start.m 8KB
s_crc_add.mexsol 16KB
s_mod_plain.mexsol 14KB
koe_tmp.mdl 18KB
koe_channel_real_one.mdl 14KB
s_dl_discmod.mexsol 21KB
koe_inter_all.mdl 14KB
koe_pulse_shaping.mdl 5KB
ajo.m 93B
dl_start.m 8KB
koe_control_buffer.mdl 14KB
s_intra_interleaver.mexsol 19KB
DISCLAIMER 578B
ajo_lauantai.m 693B
utra_lib.mdl 199KB
共 77 条
- 1
zzushop
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
前往页