OAILTE 开源代码详细研究手稿随机接入部分.docx
《OAILTE 开源代码详细研究手稿随机接入部分.docx》由会员分享,可在线阅读,更多相关《OAILTE 开源代码详细研究手稿随机接入部分.docx(40页珍藏版)》请在冰豆网上搜索。
OAILTE开源代码详细研究手稿随机接入部分
/*!
\filePHY/LTE_TRANSPORT/prach.c
*\briefTop-levelroutinesforgeneratinganddecodingthePRACHphysicalchannelV8.62009-03
*\authorR.Knopp
*\date2011
*\version0.1
*\companyEurecom
*\email:
knopp@eurecom.fr
*\note
*\warning
*/
#include"PHY/sse_intrin.h"
#include"PHY/defs.h"
//定义了PHY_VARS_UE和PHY_VARS_eNB两个常用结构体,里面包含UE侧和eNB侧的各种配置参数
#include"PHY/extern.h"
//#include"prach.h"
#include"PHY/LTE_TRANSPORT/if4_tools.h"
#include"SCHED/defs.h"
#include"SCHED/extern.h"
#include"UTIL/LOG/vcd_signal_dumper.h"
//#definePRACH_DEBUG1
//下面定义了三个用于确定NCS值的数组
uint16_tNCS_unrestricted[16]={0,13,15,18,22,26,32,38,46,59,76,93,119,167,279,419};
uint16_tNCS_restricted[15]={15,18,22,26,32,38,46,55,68,82,100,128,158,202,237};//high-speedcase
//上面两个数组用于preambleformats为0-3的情况,unrestricted用于普通非高速场景,restricted用于高速场景,详见下表:
uint16_tNCS_4[7]={2,4,6,8,10,12,15};
//上面这个数组用于preambleformats为4的情况,参数对应关系见下表:
//可见,通过三个参数prach-ConfigIndex(确定preambleformats格式)、zeroCorrelationZoneConfig、highSpeedFlag可确定唯一的NCS值。
int16_tru[2*839];//quantizedrootsofunity
uint32_tZC_inv[839];//multiplicativeinverseforrootsu
uint16_tdu[838];
typedefstruct{
uint8_tf_ra;
uint8_tt0_ra;
uint8_tt1_ra;
uint8_tt2_ra;
}PRACH_TDD_PREAMBLE_MAP_elem;
//上面这个结构体定义了一个四元数组(用于计算发送preamble所需的时频位置)
typedefstruct{
uint8_tnum_prach;
PRACH_TDD_PREAMBLE_MAP_elemmap[6];
}PRACH_TDD_PREAMBLE_MAP;
//上面结构体的定义进一步包含了与四元素组相对应的num_prach(一个二维数组单元中四元数组的个数),map[6]是因为TDDtype2有7种帧结构,每种帧结构对应一个不同的四元素组。
prach-ConfigIndex、帧结构与四元素组的详细对应关系见下表(部分截取):
//下面列出了详细表格内容
//Thisistable5.7.1-4from36.211
PRACH_TDD_PREAMBLE_MAPtdd_preamble_map[64][7]={
//TDDConfigurationIndex0
{{1,{{0,1,0,2}}},{1,{{0,1,0,1}}},{1,{{0,1,0,0}}},{1,{{0,1,0,2}}},{1,{{0,1,0,1}}},{1,{{0,1,0,0}}},{1,{{0,1,0,2}}}},
//TDDConfigurationIndex1
{{1,{{0,2,0,2}}},{1,{{0,2,0,1}}},{1,{{0,2,0,0}}},{1,{{0,2,0,2}}},{1,{{0,2,0,1}}},{1,{{0,2,0,0}}},{1,{{0,2,0,2}}}},
//TDDConfigurationIndex2
{{1,{{0,1,1,2}}},{1,{{0,1,1,1}}},{1,{{0,1,1,0}}},{1,{{0,1,0,1}}},{1,{{0,1,0,0}}},{0,{{0,0,0,0}}},{1,{{0,1,1,1}}}},
//TDDConfigurationIndex3
{{1,{{0,0,0,2}}},{1,{{0,0,0,1}}},{1,{{0,0,0,0}}},{1,{{0,0,0,2}}},{1,{{0,0,0,1}}},{1,{{0,0,0,0}}},{1,{{0,0,0,2}}}},
//TDDConfigurationIndex4
{{1,{{0,0,1,2}}},{1,{{0,0,1,1}}},{1,{{0,0,1,0}}},{1,{{0,0,0,1}}},{1,{{0,0,0,0}}},{0,{{0,0,0,0}}},{1,{{0,0,1,1}}}},
//TDDConfigurationIndex5
{{1,{{0,0,0,1}}},{1,{{0,0,0,0}}},{0,{{0,0,0,0}}},{1,{{0,0,0,0}}},{0,{{0,0,0,0}}},{0,{{0,0,0,0}}},{1,{{0,0,0,1}}}},
//TDDConfigurationIndex6
{{2,{{0,0,0,2},{0,0,1,2}}},{2,{{0,0,0,1},{0,0,1,1}}},{2,{{0,0,0,0},{0,0,1,0}}},{2,{{0,0,0,1},{0,0,0,2}}},{2,{{0,0,0,0},{0,0,0,1}}},{2,{{0,0,0,0},{1,0,0,0}}},{2,{{0,0,0,2},{0,0,1,1}}}},
//TDDConfigurationIndex7
{{2,{{0,0,0,1},{0,0,1,1}}},{2,{{0,0,0,0},{0,0,1,0}}},{0,{{0,0,0,0},{0,0,0,0}}},{2,{{0,0,0,0},{0,0,0,2}}},{0,{{0,0,0,0},{0,0,0,0}}},{0,{{0,0,0,0},{0,0,0,0}}},{2,{{0,0,0,1},{0,0,1,0}}}},
//TDDConfigurationIndex8
{{2,{{0,0,0,0},{0,0,1,0}}},{0,{{0,0,0,0},{0,0,0,0}}},{0,{{0,0,0,0},{0,0,0,0}}},{2,{{0,0,0,0},{0,0,0,1}}},{0,{{0,0,0,0},{0,0,0,0}}},{0,{{0,0,0,0},{0,0,0,0}}},{2,{{0,0,0,0},{0,0,1,1}}}},
//TDDConfigurationIndex9
{{3,{{0,0,0,1},{0,0,0,2},{0,0,1,2}}},{3,{{0,0,0,0},{0,0,0,1},{0,0,1,1}}},{3,{{0,0,0,0},{0,0,1,0},{1,0,0,0}}},{3,{{0,0,0,0},{0,0,0,1},{0,0,0,2}}},{3,{{0,0,0,0},{0,0,0,1},{1,0,0,1}}},{3,{{0,0,0,0},{1,0,0,0},{2,0,0,0}}},{3,{{0,0,0,1},{0,0,0,2},{0,0,1,1}}}},
//TDDConfigurationIndex10
{{3,{{0,0,0,0},{0,0,1,0},{0,0,1,1}}},{3,{{0,0,0,1},{0,0,1,0},{0,0,1,1}}},{3,{{0,0,0,0},{0,0,1,0},{1,0,1,0}}},{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}},{3,{{0,0,0,0},{0,0,0,1},{1,0,0,0}}},{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}},{3,{{0,0,0,0},{0,0,0,2},{0,0,1,0}}}},
//TDDConfigurationIndex11
{{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}},{3,{{0,0,0,0},{0,0,0,1},{0,0,1,0}}},{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}},{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}},{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}},{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}},{3,{{0,0,0,1},{0,0,1,0},{0,0,1,1}}}},
//TDDConfigurationIndex12
{{4,{{0,0,0,1},{0,0,0,2},{0,0,1,1},{0,0,1,2}}},{4,{{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1}}},
{4,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0}}},
{4,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{1,0,0,2}}},
{4,{{0,0,0,0},{0,0,0,1},{1,0,0,0},{1,0,0,1}}},
{4,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0}}},
{4,{{0,0,0,1},{0,0,0,2},{0,0,1,0},{0,0,1,1}}}
},
//TDDConfigurationIndex13
{{4,{{0,0,0,0},{0,0,0,2},{0,0,1,0},{0,0,1,2}}},{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
{4,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{1,0,0,1}}},
{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
{4,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,1,1}}}
},
//TDDConfigurationIndex14
{{4,{{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1}}},{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
{4,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{1,0,0,0}}},
{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
{4,{{0,0,0,0},{0,0,0,2},{0,0,1,0},{0,0,1,1}}}
},
//TDDConfigurationIndex15
{{5,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,1,1},{0,0,1,2}}},{5,{{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1},{1,0,0,1}}},
{5,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0},{2,0,0,0}}},{5,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{1,0,0,1},{1,0,0,2}}},
{5,{{0,0,0,0},{0,0,0,1},{1,0,0,0},{1,0,0,1},{2,0,0,1}}},{5,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0},{4,0,0,0}}},
{5,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,1,0},{0,0,1,1}}}
},
//TDDConfigurationIndex16
{{5,{{0,0,0,1},{0,0,0,2},{0,0,1,0},{0,0,1,1},{0,0,1,2}}},{5,{{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1},{1,0,1,1}}},
{5,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0},{2,0,1,0}}},{5,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{1,0,0,0},{1,0,0,2}}},
{5,{{0,0,0,0},{0,0,0,1},{1,0,0,0},{1,0,0,1},{2,0,0,0}}},{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}
},
//TDDConfigurationIndex17
{{5,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,1,0},{0,0,1,2}}},{5,{{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1},{1,0,0,0}}},
{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},{5,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{1,0,0,0},{1,0,0,1}}},
{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}
},
//TDDConfigurationIndex18
{{6,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,1,0},{0,0,1,1},{0,0,1,2}}},
{6,{{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1},{1,0,0,1},{1,0,1,1}}},
{6,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0},{2,0,0,0},{2,0,1,0}}},
{6,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{1,0,0,0},{1,0,0,1},{1,0,0,2}}},
{6,{{0,0,0,0},{0,0,0,1},{1,0,0,0},{1,0,0,1},{2,0,0,0},{2,0,0,1}}},
{6,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0},{4,0,0,0},{5,0,0,0}}},
{6,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,1,0},{0,0,1,1},{1,0,0,2}}}
},
//TDDConfigurationIndex19
{{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
{6,{{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1},{1,0,0,0},{1,0,1,0}}},
{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
{6,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,1,0},{0,0,1,1},{1,0,1,1}}}
},
//TDDConfigurationIndex20
{{1,{{0,1,0,1}}},{1,{{0,1,0,0}}},{0,{{0,0,0,0}}},{1,{{0,1,0,1}}},{1,{{0,1,0,0}}},{0,{{0,0,0,0}}},{1,{{0,1,0,1}}}},
//TDDConfigurationIndex21
{{1,{{0,2,0,1}}},{1,{{0,2,0,0}}},{0,{{0,0,0,0}}},{1,{{0,2,0,1}}},{1,{{0,2,0,0}}},{0,{{0,0,0,0}}},{1,{{0,2,0,1}}}},
//TDDConfigurationIndex22
{{1,{{0,1,1,1}}},{1,{{0,1,1,0}}},{0,{{0,0,0,0}}},{0,{{0,0,0,0}}},{0,{{0,0,0,0}}},{0,{{0,0,0,0}}},{1,{{0,1,1,0}}}},
//TDDConfigurationIndex23
{{1,{{0,0,0,1}}},{1,{{0,0,0,0}}},{0,{{0,0,0,0}}},{1,{{0,0,0,1}}},{1,{{0,0,0,0}}},{0,{{0,0,0,0}}},{1,{{0,0,0,1}}}},
//TDDConfigurationIndex24
{{1,{{0,0,1,1}}},{1,{{0,0,1,0}}},{0,{{0,0,0,0}}},{0,{{0,0,0,0}}},{0,{{0,0,0,0}}},{0,{{0,0,0,0}}},{1,{{0,0,1,0}}}},
//TDDConfigurationIndex25
{{2,{{0,0,0,1},{0,0,1,1}}},{2,{{0,0,0,0},{0,0,1,0}}},{0,{{0,0,0,0},{0,0,0,0}}},{2,{{0,0,0,1},{1,0,0,1}}},{2,{{0,0,0,0},{1,0,0,0}}},{0,{{0,0,0,0},{0,0,0,0}}},{2,{{0,0,0,1},{0,0,1,0}}}},
//TDDConfigurationIndex26
{{3,{{0,0,0,1},{0,0,1,1},{1,0,0,1}}},{3,{{0,0,0,0},{0,0,1,0},{1,0,0,0}}},{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}},{3,{{0,0,0,1},{1,0,0,1},{2,0,0,1}}},{3,{{0,0,0,0},{1,0,0,0},{2,0,0,0}}},{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}},{3,{{0,0,0,1},{0,0,1,0},{1,0,0,1}}}},
//TDDConfigurationIndex27
{{4,{{0,0,0,1},{0,0,1,1},{1,0,0,1},{1,0,1,1}}},{4,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0}}},
{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
{4,{{0,0,0,1},{1,0,0,1},{2,0,0,1},{3,0,0,1}}},
{4,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0}}},
{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
{4,{{0,0,0,1},{0,0,1,0},{1,0,0,1},{1,0,1,0}}}
},
//TDDConfigurationIndex28
{{5,{{0,0,0,1},{0,0,1,1},{1,0,0,1},{1,0,1,1},{2,0,0,1}}},{5,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0},{2,0,0,0}}},
{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},{5,{{0,0,0,1},{1,0,0,1},{2,0,0,1},{3,0,0,1},{4,0,0,1}}},
{5,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0},{4,0,0,0}}},{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
{5,{{0,0,0,1},{0,0,1,0},{1,0,0,1},{1,0,1,0},{2,0,0,1}}}
},
//TDDConfigurationIndex29
{{6,{{0,0,0,1},{0,0,1,1},{1,0,0,1},{1,0,1,1},{2,0,0,1},{2,0,1,1}}},
{6,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0},{2,0,0,0},{2,0,1,0}}},
{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
{6,{{0,0,0,1},{1,0,0,1},{2,0,0,1},{3,0,0,1},{4,0,0,1},{5,0,0,1}}},
{6,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0},{4,0,0,0},{5,0,0,0}}},
{0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
{6,{{0,0,0,