new code for UE band scanning, more cleanup of warnings in openair1
git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6424 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
@@ -283,13 +283,16 @@ void compute_beta8(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sho
|
||||
|
||||
__m128i *beta128,*alpha128,*beta_ptr;
|
||||
__m128i beta_max;
|
||||
int16_t m11,m10,beta0_16,beta1_16,beta2_16,beta3_16,beta4_16,beta5_16,beta6_16,beta7_16,beta0_2,beta1_2,beta2_2,beta3_2,beta_m;
|
||||
|
||||
llr_t beta0,beta1;
|
||||
|
||||
llr_t beta2,beta3,beta4,beta5,beta6,beta7;
|
||||
__m128i beta_16;
|
||||
|
||||
|
||||
#if 0
|
||||
int16_t m11,m10;
|
||||
int16_t beta0_16,beta1_16,beta2_16,beta3_16,beta4_16,beta5_16,beta6_16,beta7_16,beta0_2,beta1_2,beta2_2,beta3_2,beta_m;
|
||||
__m128i beta_16;
|
||||
// termination for beta initialization
|
||||
|
||||
m11=(int16_t)m_11[2+frame_length];
|
||||
@@ -626,7 +629,8 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
|
||||
llr_t m10[n+16] __attribute__ ((aligned(16)));
|
||||
|
||||
|
||||
int *pi2_p,*pi4_p,*pi5_p,*pi6_p;
|
||||
// int *pi2_p,*pi4_p,*pi5_p,*pi6_p;
|
||||
int *pi4_p,*pi5_p,*pi6_p;
|
||||
llr_t *s,*s1,*s2,*yp1,*yp2,*yp;
|
||||
__m128i *yp128;
|
||||
unsigned int i,j,iind;//,pi;
|
||||
|
||||
@@ -43,10 +43,17 @@
|
||||
/*!\brief Timing drift hysterisis in samples*/
|
||||
#define SYNCH_HYST 1
|
||||
|
||||
|
||||
/*!
|
||||
\brief This function is used for time-frequency scanning prior to complete cell search. It scans
|
||||
over the entire LTE band for maximum correlation and keeps the 10 best scores and the correspoding frequency offset (5 kHz granularity) for each of the 3 PSS sequences.
|
||||
\param ue Pointer to UE variables
|
||||
\param band index of lte band
|
||||
\param DL_freq Central RF Frequency in Hz
|
||||
*/
|
||||
/*!
|
||||
\brief This function allocates memory needed for the synchronization.
|
||||
\param frame_parms LTE DL frame parameter structure
|
||||
|
||||
*/
|
||||
|
||||
int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms); //LTE_UE_COMMON *common_vars
|
||||
|
||||
@@ -190,15 +190,7 @@ int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,uint8_t UE_id,uint8_
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms;
|
||||
LTE_eNB_PUSCH *eNB_pusch_vars = phy_vars_eNB->lte_eNB_pusch_vars[UE_id];
|
||||
int32_t **ul_ch_estimates_time= eNB_pusch_vars->drs_ch_estimates_time[0];
|
||||
int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx;
|
||||
uint8_t harq_pid;
|
||||
uint8_t Ns = 1; //we take the estimate from the second slot
|
||||
uint8_t cyclic_shift = 0;//(frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift +
|
||||
//phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->n_DMRS2 +
|
||||
//frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[(subframe<<1)+Ns]) % 12;
|
||||
|
||||
harq_pid = subframe2harq_pid(frame_parms,phy_vars_eNB->proc[sched_subframe].frame_rx,subframe);
|
||||
|
||||
uint8_t cyclic_shift = 0;
|
||||
int sync_pos = (frame_parms->ofdm_symbol_size-cyclic_shift*frame_parms->ofdm_symbol_size/12)%(frame_parms->ofdm_symbol_size);
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,191 @@
|
||||
/*******************************************************************************
|
||||
OpenAirInterface
|
||||
Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
OpenAirInterface is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenAirInterface.The full GNU General Public License is
|
||||
included in this distribution in the file called "COPYING". If not,
|
||||
see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Contact Information
|
||||
OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
OpenAirInterface Dev : openair4g-devel@eurecom.fr
|
||||
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
/*! \file PHY/LTE_ESTIMATION/lte_sync_timefreq.c
|
||||
* \brief Initial time frequency scan of entire LTE band
|
||||
* \author R. Knopp
|
||||
* \date 2014
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: raymond.knopp@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
/* file: lte_sync_timefreq.c
|
||||
purpose: scan for likely cells over entire LTE band using PSS. Provides coarse frequency offset in addtition to 10 top likelihoods per PSS sequence
|
||||
author: raymond.knopp@eurecom.fr
|
||||
date: 23.01.2015
|
||||
*/
|
||||
|
||||
//#include "defs.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
|
||||
int16_t pss6144_0[512]__attribute__((aligned(16))) ={-1,0,220,902,897,257,0,0,234,912,911,249,-1,-1,250,918,925,237,0,-1,270,920,934,218,-1,-1,295,913,939,189,0,0,327,892,933,145,-1,0,370,847,908,75,-1,0,431,758,845,-41,-1,0,523,578,700,-251,-1,-1,684,186,346,-688,-1,-1,1042,-842,-727,-1906,0,-1,2570,-5411,-8606,-11078,-18707,2819,-6900,13704,-2921,4880,-13868,12867,3212,31675,29080,13411,14492,-12161,-4346,380,9189,12659,18918,-1,13137,-8312,9729,-13278,-4210,-18444,-17822,-503,-308,18095,18542,3748,8014,-10063,3677,-477,18077,-5577,9518,-28369,-18568,-23434,-18707,2819,1866,3765,402,-13074,-15081,-11423,-17312,158,-15211,6289,-9460,16383,10422,15058,14327,-9459,-9460,-16384,-14800,2480,-1627,222,-15081,-11423,-30899,10197,-9093,31103,11795,14790,298,-1071,-10964,8476,-4210,18443,4468,18297,12087,15225,18542,3748,9032,-11975,-12015,-8164,-13868,12867,2703,16345,1145,4949,-9460,16383,10290,32065,32121,10735,14492,-12161,-3895,1841,8412,14854,18077,5576,15706,-414,17019,-6205,6911,-17611,-12957,-9364,-10719,13397,8630,16834,13163,4191,4947,4300,11795,14790,30157,4933,23119,-20716,-4210,-18444,-3763,5826,16581,4209,14492,-12161,5021,-11782,4494,-13565,-9460,-16384,-19234,4948,1759,20734,18077,5576,8599,-5126,5405,3659,18542,3748,22881,-14000,5014,-26653,-13868,-12868,-4043,7370,14695,-1146,6911,-17611,-4867,-12748,-3775,-10738,-15081,-11423,-20274,10778,5370,21891,18918,0,3825,-11116,-2642,-2520,-1,-1,-734,3537,7768,8755,18918,-1,16401,-15607,857,-23063,-15081,-11423,-7284,8627,13528,2043,6911,-17611,-8213,-12164,-4307,-7302,-13868,-12868,-25462,8974,738,26700,18542,3748,593,-6522,194,9894,18077,5576,17204,-11901,5387,-19247,-9460,-16384,-13867,2880,7748,10123,14492,-12161,-4518,-16475,-3109,-6287,-4210,-18444,-29373,-9674,-19296,23535,11795,14790,1378,-6445,-10157,9188,8630,16834,17089,2574,14642,-6655,6911,-17611,-13757,-11647,-7440,13694,18077,5576,8785,-14723,408,-4409,14492,-12161,-6636,-32768,-32768,-7236,-9460,16383,3840,-3477,-15453,-5947,-13868,12867,-936,14477,5909,13694,18542,3748,7269,-18091,-18025,-5395,-4210,18443,12950,5246,833,678,11795,14790,31610,-7688,6673,-31973,-15081,-11423,1133,1287,5307,-14173,-9460,-16384,-15227,-7689,-18198,1381,-9460,16383,13180,10017,8574,-15187,-15081,-11423,-11396,6178,-4139,-382,-18707,2819,-10883,27787,19864,22312,18077,-5577,-2124,-2956,4762,11856,18542,3748,15952,-8792,9401,-15298,-4210,-18444,-16236,-1797,684,15418,18918,-1,6496,-14298,1898,-4069,14492,-12161,-2799,-31900,-28984,-13171,-13868,12867,5814,79,-8363,-12943,-18707,2819,-5164,12981,3456,4816,-1,0,-1159,1572,263,1207,-1,-1,-642,33,-449,384,0,-1,-440,-492,-708,49,-1,-1,-330,-722,-817,-121,0,-1,-261,-834,-864,-218,-1,-1,-214,-891,-882,-278,-1,0,-178,-918,-884,-316,-1,-1,-151,-929,-877,-341,0,-1,-130,-930,-866,-358,0,0,-112,-925,-852,-369,-1,0};
|
||||
|
||||
int16_t pss6144_1[512]__attribute__((aligned(16))) = {0,0,-75,-703,-641,-284,-1,-1,-77,-682,-622,-269,0,0,-81,-650,-592,-247,0,0,-87,-604,-550,-216,0,0,-94,-536,-488,-170,0,-1,-105,-438,-398,-103,0,0,-121,-291,-260,-3,0,-1,-146,-64,-44,154,-1,0,-183,308,320,416,-1,-1,-248,979,1012,908,0,0,-385,2438,2687,2103,-1,0,-1029,7780,12580,10062,18077,-5577,6808,-12074,5571,-9136,1413,-18866,-20051,-12000,-14063,16643,14492,12160,9180,-9248,-739,1189,18918,0,11581,-29398,-22453,-21889,-17045,8208,2659,1930,-9344,-7587,-15081,11422,6001,20595,20667,5444,15630,-10657,2688,-12056,2550,-1019,18077,-5577,12734,-29346,-15053,-28505,-18334,-4669,-1915,-1922,-1177,-13323,-9460,-16384,-19264,-13938,-26108,1564,-9460,16383,8111,1321,-5134,-14849,-18334,-4669,-14428,3684,-14417,7858,-4210,18443,15161,6283,4109,-16836,-17045,-8209,-11025,5771,-8448,1046,-15081,11422,5322,23247,22499,-674,1413,-18866,-10967,-3156,1594,-2038,-9460,-16384,-29439,2511,-9786,27468,14492,12160,2879,-4565,-3994,8819,15630,10656,20286,-13171,-171,-24168,-13868,-12868,-9897,-1934,-1535,-5328,-7781,-17244,-27765,-11606,-27629,13566,-4210,18443,848,317,-13296,-2621,-17045,8208,-12988,16121,-1931,22720,14492,12160,6065,-9110,-15296,-1993,-9460,16383,2388,13523,3104,12712,15630,10656,15155,-12654,-12784,-14450,-15081,11422,3202,11354,-2572,4187,1413,18865,25769,7933,13949,-22090,-13868,-12868,-5746,5444,754,-6292,-18334,-4669,-15498,21223,12113,22762,18918,0,4780,-8566,-1382,-2244,-1,0,-1380,2321,4966,8534,18918,0,13528,-21869,-10693,-23921,-18334,-4669,-5954,2495,-1904,-7586,-13868,-12868,-26234,-1033,-19817,18462,1413,18865,4783,136,-11497,-2792,-15081,11422,-6250,18298,3319,19564,15630,10656,9329,-9042,-12967,-4581,-9460,16383,5794,14245,4795,9919,14492,12160,20513,-9686,-7530,-19197,-17045,8208,4250,12828,-761,688,-4210,18443,25435,17146,23871,-18131,-7781,-17244,-3975,3996,6561,-7492,-13868,-12868,-20972,12234,1201,24266,15630,10656,9506,-948,2451,4888,14492,12160,28553,-5257,12482,-26639,-9460,-16384,-2690,-359,8155,-7807,1413,-18866,-11961,-19146,-22855,-6903,-15081,11422,5002,6796,453,-12322,-17045,-8209,-16763,4862,-13084,10100,-4210,18443,13885,8559,3961,-14225,-18334,-4669,-10421,11873,-5262,6476,-9460,16383,14280,21830,21641,-9602,-9460,-16384,-11078,7683,2560,-585,-18334,-4669,-17288,27291,18985,25813,18077,-5577,-2285,-1696,9035,8468,15630,-10657,-5747,-20618,-20899,-4988,-15081,11422,-2027,11888,-3063,1450,-17045,8208,-7859,30392,19607,24841,18918,-1,1271,47,3357,12686,14492,12160,21317,3859,20355,-11253,1413,-18866,-10826,-254,6990,12044,18077,-5577,2296,-15923,-6286,-4669,0,-1,349,-3376,-1982,-1440,0,0,151,-1328,-786,-592,-1,0,72,-483,-237,-200,-1,-1,27,-37,66,18,0,0,-1,229,251,153,0,-1,-19,398,370,240,-1,-1,-31,510,449,299,-1,0,-40,586,504,339,-1,-1,-46,639,541,367,0,0,-50,675,567,386,0,0};
|
||||
|
||||
int16_t pss6144_2[512]__attribute__((aligned(16))) = {0,0,584,-400,-53,-700,-1,0,567,-387,-50,-676,-1,-1,541,-368,-46,-640,-1,0,504,-340,-40,-587,-1,-1,449,-300,-31,-511,0,-1,370,-241,-19,-399,0,-1,251,-154,-1,-230,-1,0,66,-19,27,36,0,0,-237,199,72,482,0,0,-786,591,151,1327,0,0,-1982,1439,349,3375,-1,0,-6286,4668,2296,15922,18077,5576,6990,-12045,-10826,253,1413,18865,20355,11252,21317,-3860,14492,-12161,3357,-12687,1271,-48,18918,0,19607,-24842,-7859,-30393,-17045,-8209,-3063,-1451,-2027,-11889,-15081,-11423,-20899,4987,-5747,20617,15630,10656,9035,-8469,-2285,1695,18077,5576,18985,-25814,-17288,-27292,-18334,4668,2560,584,-11078,-7684,-9460,16383,21641,9601,14280,-21831,-9460,-16384,-5262,-6477,-10421,-11874,-18334,4668,3961,14224,13885,-8560,-4210,-18444,-13084,-10101,-16763,-4863,-17045,8208,453,12321,5002,-6797,-15081,-11423,-22855,6902,-11961,19145,1413,18865,8155,7806,-2690,358,-9460,16383,12482,26638,28553,5256,14492,-12161,2451,-4889,9506,947,15630,-10657,1201,-24267,-20972,-12235,-13868,12867,6561,7491,-3975,-3997,-7781,17243,23871,18130,25435,-17147,-4210,-18444,-761,-689,4250,-12829,-17045,-8209,-7530,19196,20513,9685,14492,-12161,4795,-9920,5794,-14246,-9460,-16384,-12967,4580,9329,9041,15630,-10657,3319,-19565,-6250,-18299,-15081,-11423,-11497,2791,4783,-137,1413,-18866,-19817,-18463,-26234,1032,-13868,12867,-1904,7585,-5954,-2496,-18334,4668,-10693,23920,13528,21868,18918,-1,4966,-8535,-1380,-2322,-1,0,-1382,2243,4780,8565,18918,-1,12113,-22763,-15498,-21224,-18334,4668,754,6291,-5746,-5445,-13868,12867,13949,22089,25769,-7934,1413,-18866,-2572,-4188,3202,-11355,-15081,-11423,-12784,14449,15155,12653,15630,-10657,3104,-12713,2388,-13524,-9460,-16384,-15296,1992,6065,9109,14492,-12161,-1931,-22721,-12988,-16122,-17045,-8209,-13296,2620,848,-318,-4210,-18444,-27629,-13567,-27765,11605,-7781,17243,-1535,5327,-9897,1933,-13868,12867,-171,24167,20286,13170,15630,-10657,-3994,-8820,2879,4564,14492,-12161,-9786,-27469,-29439,-2512,-9460,16383,1594,2037,-10967,3155,1413,18865,22499,673,5322,-23248,-15081,-11423,-8448,-1047,-11025,-5772,-17045,8208,4109,16835,15161,-6284,-4210,-18444,-14417,-7859,-14428,-3685,-18334,4668,-5134,14848,8111,-1322,-9460,-16384,-26108,-1565,-19264,13937,-9460,16383,-1177,13322,-1915,1921,-18334,4668,-15053,28504,12734,29345,18077,5576,2550,1018,2688,12055,15630,10656,20667,-5445,6001,-20596,-15081,-11423,-9344,7586,2659,-1931,-17045,-8209,-22453,21888,11581,29397,18918,0,-739,-1190,9180,9247,14492,-12161,-14063,-16644,-20051,11999,1413,18865,5571,9135,6808,12073,18077,5576,12580,-10063,-1029,-7781,-1,-1,2687,-2104,-385,-2439,0,-1,1012,-909,-248,-980,-1,-1,320,-417,-183,-309,-1,0,-44,-155,-146,63,-1,0,-260,2,-121,290,-1,0,-398,102,-105,437,-1,0,-488,169,-94,535,0,0,-550,215,-87,603,-1,-1,-592,246,-81,649,0,0,-622,268,-77,681,0,0};
|
||||
|
||||
void lte_sync_timefreq(PHY_VARS_UE *ue,int band,int DL_freq) {
|
||||
|
||||
UE_SCAN_INFO_t *scan_info = &ue->scan_info[band];
|
||||
int16_t spectrum[12288] __attribute__((aligned(16)));
|
||||
int16_t spectrum_p5ms[12288] __attribute__((aligned(16)));
|
||||
int i,f,f2;
|
||||
__m128i autocorr0[256/4],autocorr1[256/4],autocorr2[256/4];
|
||||
__m128i autocorr0_t[256/4],autocorr1_t[256/4],autocorr2_t[256/4];
|
||||
__m128i tmp_t[256/4];
|
||||
int32_t *rxp;
|
||||
int16_t *sp;
|
||||
__m128i *sp2;
|
||||
__m128i s;
|
||||
int re;
|
||||
__m128i mmtmp00,mmtmp01,mmtmp02,mmtmp10,mmtmp11,mmtmp12;
|
||||
int maxcorr[3],minamp,pos,pssind;
|
||||
|
||||
for (f = -2000;f<1999;f++){ // this is -10MHz to 10 MHz in 5 kHz steps
|
||||
|
||||
for (i=0;i<38400*4;i+=3072) { // steps of 200 us with 100 us overlap, 0 to 5s
|
||||
//compute frequency-domain representation of 6144-sample chunk
|
||||
|
||||
|
||||
for (rxp = &ue->lte_ue_common_vars.rxdata[0][i],sp=spectrum;;rxp = &ue->lte_ue_common_vars.rxdata[0][i+38400*4],sp=spectrum_p5ms) {
|
||||
//compute frequency-domain representation of 6144-sample chunk
|
||||
fft6144((int16_t *)rxp,
|
||||
sp);
|
||||
|
||||
|
||||
|
||||
|
||||
if ((f<-256)||(f>=0)) { // no split around DC
|
||||
sp2 = (f<0) ? (__m128i*)&sp[6144] : (__m128i*)sp;
|
||||
for (re = 0; re<256/4; re++) { // loop over 256 points of upsampled PSS
|
||||
f2 = f>>2;
|
||||
s = sp2[f2];
|
||||
mmtmp00 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_0)[re],s),15);
|
||||
mmtmp01 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_1)[re],s),15);
|
||||
mmtmp02 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_2)[re],s),15);
|
||||
|
||||
s = _mm_shufflelo_epi16(s,_MM_SHUFFLE(2,3,0,1));
|
||||
s = _mm_shufflehi_epi16(s,_MM_SHUFFLE(2,3,0,1));
|
||||
s = _mm_sign_epi16(s,*(__m128i*)&conjugate[0]);
|
||||
mmtmp10 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_0)[re],s),15);
|
||||
mmtmp11 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_1)[re],s),15);
|
||||
mmtmp12 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_2)[re],s),15);
|
||||
|
||||
autocorr0[re] = _mm_packs_epi32(_mm_unpacklo_epi32(mmtmp00,mmtmp10),_mm_unpackhi_epi32(mmtmp00,mmtmp10));
|
||||
autocorr1[re] = _mm_packs_epi32(_mm_unpacklo_epi32(mmtmp01,mmtmp11),_mm_unpackhi_epi32(mmtmp01,mmtmp11));
|
||||
autocorr2[re] = _mm_packs_epi32(_mm_unpacklo_epi32(mmtmp02,mmtmp12),_mm_unpackhi_epi32(mmtmp02,mmtmp12));
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
sp2 = (__m128i*)&sp[6144];
|
||||
for (re = 0; re<(256+f)/4; re++) { // loop over 256 points of upsampled PSS
|
||||
f2 = f>>2;
|
||||
s = sp2[f2];
|
||||
mmtmp00 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_0)[re],s),15);
|
||||
mmtmp01 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_1)[re],s),15);
|
||||
mmtmp02 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_2)[re],s),15);
|
||||
|
||||
s = _mm_shufflelo_epi16(s,_MM_SHUFFLE(2,3,0,1));
|
||||
s = _mm_shufflehi_epi16(s,_MM_SHUFFLE(2,3,0,1));
|
||||
s = _mm_sign_epi16(s,*(__m128i*)&conjugate[0]);
|
||||
mmtmp10 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_0)[re],s),15);
|
||||
mmtmp11 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_1)[re],s),15);
|
||||
mmtmp12 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_2)[re],s),15);
|
||||
|
||||
autocorr0[re] = _mm_packs_epi32(_mm_unpacklo_epi32(mmtmp00,mmtmp10),_mm_unpackhi_epi32(mmtmp00,mmtmp10));
|
||||
autocorr1[re] = _mm_packs_epi32(_mm_unpacklo_epi32(mmtmp01,mmtmp11),_mm_unpackhi_epi32(mmtmp01,mmtmp11));
|
||||
autocorr2[re] = _mm_packs_epi32(_mm_unpacklo_epi32(mmtmp02,mmtmp12),_mm_unpackhi_epi32(mmtmp02,mmtmp12));
|
||||
|
||||
|
||||
}
|
||||
sp2 = (__m128i*)sp;
|
||||
for (re = (256+f)/4; re<256/4; re++) { // loop over 256 points of upsampled PSS
|
||||
f2 = f>>2;
|
||||
s = sp2[f2];
|
||||
mmtmp00 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_0)[re],s),15);
|
||||
mmtmp01 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_1)[re],s),15);
|
||||
mmtmp02 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_2)[re],s),15);
|
||||
|
||||
s = _mm_shufflelo_epi16(s,_MM_SHUFFLE(2,3,0,1));
|
||||
s = _mm_shufflehi_epi16(s,_MM_SHUFFLE(2,3,0,1));
|
||||
s = _mm_sign_epi16(s,*(__m128i*)&conjugate[0]);
|
||||
mmtmp10 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_0)[re],s),15);
|
||||
mmtmp11 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_1)[re],s),15);
|
||||
mmtmp12 = _mm_srai_epi32(_mm_madd_epi16(((__m128i*)pss6144_2)[re],s),15);
|
||||
|
||||
autocorr0[re] = _mm_packs_epi32(_mm_unpacklo_epi32(mmtmp00,mmtmp10),_mm_unpackhi_epi32(mmtmp00,mmtmp10));
|
||||
autocorr1[re] = _mm_packs_epi32(_mm_unpacklo_epi32(mmtmp01,mmtmp11),_mm_unpackhi_epi32(mmtmp01,mmtmp11));
|
||||
autocorr2[re] = _mm_packs_epi32(_mm_unpacklo_epi32(mmtmp02,mmtmp12),_mm_unpackhi_epi32(mmtmp02,mmtmp12));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
// ifft, accumulate energy over two half-frames
|
||||
idft256((int16_t*)autocorr0,(int16_t*)tmp_t,1);
|
||||
for (re=0;re<(256/4);re++)
|
||||
autocorr0_t[re] = _mm_adds_epi16(autocorr0_t[re],_mm_madd_epi16(tmp_t[re],tmp_t[re]));
|
||||
idft256((int16_t*)autocorr1,(int16_t*)autocorr1_t,1);
|
||||
for (re=0;re<(256/4);re++)
|
||||
autocorr1_t[re] = _mm_adds_epi16(autocorr1_t[re],_mm_madd_epi16(tmp_t[re],tmp_t[re]));
|
||||
idft256((int16_t*)autocorr2,(int16_t*)autocorr2_t,1);
|
||||
for (re=0;re<(256/4);re++)
|
||||
autocorr2_t[re] = _mm_adds_epi16(autocorr2_t[re],_mm_madd_epi16(tmp_t[re],tmp_t[re]));
|
||||
}
|
||||
//compute max correlation over time window
|
||||
maxcorr[0] = 0;
|
||||
maxcorr[1] = 0;
|
||||
maxcorr[2] = 0;
|
||||
for (re=0;re<256;re++) {
|
||||
if (((int32_t*)autocorr0_t)[re] > maxcorr[0])
|
||||
maxcorr[0]=((int32_t*)autocorr0_t)[re];
|
||||
if (((int32_t*)autocorr1_t)[re] > maxcorr[1])
|
||||
maxcorr[1]=((int32_t*)autocorr1_t)[re];
|
||||
if (((int32_t*)autocorr2_t)[re] > maxcorr[2])
|
||||
maxcorr[2]=((int32_t*)autocorr2_t)[re];
|
||||
}
|
||||
for (pssind=0;pssind<3;pssind++) {
|
||||
minamp=(int)((1<<30)-1);
|
||||
for (i=0;i<10;i++)
|
||||
if (minamp < scan_info->amp[pssind][i]) {
|
||||
minamp = scan_info->amp[pssind][i];
|
||||
pos = i;
|
||||
}
|
||||
if (maxcorr[pssind]>minamp) {
|
||||
scan_info->amp[pssind][pos]=maxcorr[pssind];
|
||||
scan_info->freq_offset_Hz[pssind][pos]=(f*5000)+DL_freq;
|
||||
}
|
||||
} // loop on pss index
|
||||
} // loop on time index i
|
||||
} // loop on frequency shift f
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
% OCTAVE Code to generate upsampled pss0-2
|
||||
|
||||
n=0:61;
|
||||
d0 = zeros(1,62);
|
||||
d1 = zeros(1,62);
|
||||
d2 = zeros(1,62);
|
||||
d0(1+(0:30)) = exp(-sqrt(-1)*pi*25*(0:30).*(1:31)/63);
|
||||
d1(1+(0:30)) = exp(-sqrt(-1)*pi*29*(0:30).*(1:31)/63);
|
||||
d2(1+(0:30)) = exp(-sqrt(-1)*pi*34*(0:30).*(1:31)/63);
|
||||
d0(1+(31:61)) = exp(-sqrt(-1)*pi*25*(32:62).*(33:63)/63);
|
||||
d1(1+(31:61)) = exp(-sqrt(-1)*pi*29*(32:62).*(33:63)/63);
|
||||
d2(1+(31:61)) = exp(-sqrt(-1)*pi*34*(32:62).*(33:63)/63);
|
||||
|
||||
pss0f = zeros(1,2048);
|
||||
pss0f(2:32) = d0(1:31);
|
||||
pss0f(2048+(-30:0)) = d0(32:62);
|
||||
pss1f = zeros(1,2048);
|
||||
pss1f(2:32) = d1(1:31);
|
||||
pss1f(2048+(-30:0)) = d1(32:62);
|
||||
pss2f = zeros(1,2048);
|
||||
pss2f(2:32) = d2(1:31);
|
||||
pss2f(2048+(-30:0)) = d2(32:62);
|
||||
|
||||
|
||||
pss0_6144f = fftshift(fft(ifft(pss0f)*sqrt(2048),6144)/sqrt(6144));
|
||||
pss1_6144f = fftshift(fft(ifft(pss1f)*sqrt(2048),6144)/sqrt(6144));
|
||||
pss2_6144f = fftshift(fft(ifft(pss2f)*sqrt(2048),6144)/sqrt(6144));
|
||||
|
||||
pss0_6144_fp = zeros(1,512);
|
||||
pss0_6144_fp(1:2:512) = (floor(32767*real(pss0_6144f(3072+(-128:127)))));
|
||||
pss0_6144_fp(2:2:512) = (floor(32767*imag(pss0_6144f(3072+(-128:127)))));
|
||||
pss1_6144_fp = zeros(1,512);
|
||||
pss1_6144_fp(1:2:512) = (floor(32767*real(pss1_6144f(3072+(-128:127)))));
|
||||
pss1_6144_fp(2:2:512) = (floor(32767*imag(pss1_6144f(3072+(-128:127)))));
|
||||
pss2_6144_fp = zeros(1,512);
|
||||
pss2_6144_fp(1:2:512) = (floor(32767*real(pss2_6144f(3072+(-128:127)))));
|
||||
pss2_6144_fp(2:2:512) = (floor(32767*imag(pss2_6144f(3072+(-128:127)))));
|
||||
|
||||
fprintf("int16_t pss6144_0[512]={");
|
||||
fprintf("%d,",pss0_6144_fp(1:511));
|
||||
fprintf("%d};\n",pss0_6144_fp(512));
|
||||
fprintf("int16_t pss6144_1[512]={");
|
||||
fprintf("%d,",pss1_6144_fp(1:511));
|
||||
fprintf("%d};\n",pss1_6144_fp(512));
|
||||
fprintf("int16_t pss6144_2[512]={");
|
||||
fprintf("%d,",pss2_6144_fp(1:511));
|
||||
fprintf("%d};\n",pss2_6144_fp(512));
|
||||
@@ -105,10 +105,8 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
|
||||
*temp_out_fft_1_ptr = (int32_t*)0,*out_fft_ptr_1 = (int32_t*)0,
|
||||
*temp_in_ifft_ptr = (int32_t*)0;
|
||||
|
||||
#ifdef NEW_FFT
|
||||
__m128i *rxdataF128,*ul_ref128,*ul_ch128;
|
||||
__m128i mmtmpU0,mmtmpU1,mmtmpU2,mmtmpU3;
|
||||
#endif
|
||||
|
||||
Msc_RS = N_rb_alloc*12;
|
||||
|
||||
@@ -142,15 +140,7 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef NEW_FFT
|
||||
if ( (frame_parms->ofdm_symbol_size == 128) ||
|
||||
(frame_parms->ofdm_symbol_size == 512) )
|
||||
rx_power_correction = 2;
|
||||
else
|
||||
rx_power_correction = 1;
|
||||
#else
|
||||
rx_power_correction = 1;
|
||||
#endif
|
||||
|
||||
if (l == (3 - frame_parms->Ncp)) {
|
||||
|
||||
@@ -159,13 +149,6 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
|
||||
for (aa=0; aa<nb_antennas_rx; aa++){
|
||||
// msg("Componentwise prod aa %d, symbol_offset %d,ul_ch_estimates %p,ul_ch_estimates[aa] %p,ul_ref_sigs_rx[0][0][Msc_RS_idx] %p\n",aa,symbol_offset,ul_ch_estimates,ul_ch_estimates[aa],ul_ref_sigs_rx[0][0][Msc_RS_idx]);
|
||||
|
||||
#ifndef NEW_FFT
|
||||
mult_cpx_vector_norep2((int16_t*) &rxdataF_ext[aa][symbol_offset<<1],
|
||||
(int16_t*) ul_ref_sigs_rx[u][v][Msc_RS_idx],
|
||||
(int16_t*) &ul_ch_estimates[aa][symbol_offset],
|
||||
Msc_RS,
|
||||
15);
|
||||
#else
|
||||
rxdataF128 = (__m128i *)&rxdataF_ext[aa][symbol_offset];
|
||||
ul_ch128 = (__m128i *)&ul_ch_estimates[aa][symbol_offset];
|
||||
ul_ref128 = (__m128i *)ul_ref_sigs_rx[u][v][Msc_RS_idx];
|
||||
@@ -219,7 +202,6 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
|
||||
ul_ref128+=3;
|
||||
rxdataF128+=3;
|
||||
}
|
||||
#endif
|
||||
|
||||
alpha_ind = 0;
|
||||
if((cyclic_shift != 0)){
|
||||
|
||||
@@ -125,29 +125,8 @@ void generate_ul_ref_sigs_rx(void) {
|
||||
for (n=0;n<dftsizes[Msc_RS];n++) {
|
||||
m=n%ref_primes[Msc_RS];
|
||||
phase = (double)q*m*(m+1)/ref_primes[Msc_RS];
|
||||
#ifndef IFFT_FPGA
|
||||
#ifndef NEW_FFT
|
||||
ul_ref_sigs_rx[u][v][Msc_RS][n<<2] =(int16_t)(floor(32767*cos(M_PI*phase)));
|
||||
ul_ref_sigs_rx[u][v][Msc_RS][1+(n<<2)] =-(int16_t)(floor(32767*sin(M_PI*phase)));
|
||||
ul_ref_sigs_rx[u][v][Msc_RS][2+(n<<2)] =(int16_t)(floor(32767*sin(M_PI*phase)));
|
||||
ul_ref_sigs_rx[u][v][Msc_RS][3+(n<<2)] =(int16_t)(floor(32767*cos(M_PI*phase)));
|
||||
#else
|
||||
ul_ref_sigs_rx[u][v][Msc_RS][n<<1] =(int16_t)(floor(32767*cos(M_PI*phase)));
|
||||
ul_ref_sigs_rx[u][v][Msc_RS][1+(n<<1)] =-(int16_t)(floor(32767*sin(M_PI*phase)));
|
||||
#endif
|
||||
#else
|
||||
#ifndef OFDMA_ULSCH
|
||||
ul_ref_sigs_rx[u][v][Msc_RS][n<<2] =(int16_t)(floor(32767*cos(M_PI*phase)));
|
||||
ul_ref_sigs_rx[u][v][Msc_RS][1+(n<<2)] =-(int16_t)(floor(32767*sin(M_PI*phase)));
|
||||
ul_ref_sigs_rx[u][v][Msc_RS][2+(n<<2)] =(int16_t)(floor(32767*sin(M_PI*phase)));
|
||||
ul_ref_sigs_rx[u][v][Msc_RS][3+(n<<2)] =(int16_t)(floor(32767*cos(M_PI*phase)));
|
||||
#else
|
||||
ul_ref_sigs_rx[u][v][Msc_RS][n<<2] =(int16_t) ((cos(M_PI*phase)>=0) ? ONE_OVER_SQRT2_Q15 : -ONE_OVER_SQRT2_Q15);
|
||||
ul_ref_sigs_rx[u][v][Msc_RS][1+(n<<2)] =(int16_t)((-sin(M_PI*phase)>=0) ? ONE_OVER_SQRT2_Q15 : -ONE_OVER_SQRT2_Q15);
|
||||
ul_ref_sigs_rx[u][v][Msc_RS][2+(n<<2)] =(int16_t)((-sin(M_PI*phase)>=0) ? -ONE_OVER_SQRT2_Q15 : ONE_OVER_SQRT2_Q15);
|
||||
ul_ref_sigs_rx[u][v][Msc_RS][3+(n<<2)] =(int16_t) ((cos(M_PI*phase)>=0) ? ONE_OVER_SQRT2_Q15 : -ONE_OVER_SQRT2_Q15);
|
||||
#endif
|
||||
#endif
|
||||
#ifdef MAIN
|
||||
if (Msc_RS<5)
|
||||
printf("(%d,%d) ",ul_ref_sigs_rx[u][v][Msc_RS][n<<2],ul_ref_sigs_rx[u][v][Msc_RS][1+(n<<2)]);
|
||||
@@ -165,60 +144,19 @@ void generate_ul_ref_sigs_rx(void) {
|
||||
for (u=0;u<30;u++) {
|
||||
ul_ref_sigs_rx[u][0][0] = (int16_t*)malloc16(4*sizeof(int16_t)*dftsizes[0]);
|
||||
for (n=0;n<dftsizes[0];n++) {
|
||||
#ifndef IFFT_FPGA
|
||||
#ifndef NEW_FFT
|
||||
ul_ref_sigs_rx[u][0][0][n<<2] = (int16_t)(floor(32767*cos(M_PI*ref12[(u*12) + n]/4)));
|
||||
ul_ref_sigs_rx[u][0][0][1+(n<<2)]= (int16_t)(floor(32767*sin(M_PI*ref12[(u*12) + n]/4)));
|
||||
ul_ref_sigs_rx[u][0][0][2+(n<<2)]=-(int16_t)(floor(32767*sin(M_PI*ref12[(u*12) + n]/4)));
|
||||
ul_ref_sigs_rx[u][0][0][3+(n<<2)]= (int16_t)(floor(32767*cos(M_PI*ref12[(u*12) + n]/4)));
|
||||
#else
|
||||
ul_ref_sigs_rx[u][0][0][n<<1] = (int16_t)(floor(32767*cos(M_PI*ref12[(u*12) + n]/4)));
|
||||
ul_ref_sigs_rx[u][0][0][1+(n<<1)]= (int16_t)(floor(32767*sin(M_PI*ref12[(u*12) + n]/4)));
|
||||
#endif
|
||||
#else
|
||||
#ifndef OFDMA_ULSCH
|
||||
ul_ref_sigs_rx[u][0][0][n<<2] = (int16_t)(floor(32767*cos(M_PI*ref12[(u*12) + n]/4)));
|
||||
ul_ref_sigs_rx[u][0][0][1+(n<<2)]= (int16_t)(floor(32767*sin(M_PI*ref12[(u*12) + n]/4)));
|
||||
ul_ref_sigs_rx[u][0][0][2+(n<<2)]=-(int16_t)(floor(32767*sin(M_PI*ref12[(u*12) + n]/4)));
|
||||
ul_ref_sigs_rx[u][0][0][3+(n<<2)]= (int16_t)(floor(32767*cos(M_PI*ref12[(u*12) + n]/4)));
|
||||
#else
|
||||
ul_ref_sigs_rx[u][0][0][n<<2] = (int16_t)((cos(M_PI*ref12[(u*12) + n]/4)>=0) ? ONE_OVER_SQRT2_Q15 : -ONE_OVER_SQRT2_Q15);
|
||||
ul_ref_sigs_rx[u][0][0][1+(n<<2)]= (int16_t)((sin(M_PI*ref12[(u*12) + n]/4)>=0) ? ONE_OVER_SQRT2_Q15 : -ONE_OVER_SQRT2_Q15);
|
||||
ul_ref_sigs_rx[u][0][0][2+(n<<2)]= (int16_t)((sin(M_PI*ref12[(u*12) + n]/4)>=0) ? -ONE_OVER_SQRT2_Q15 : ONE_OVER_SQRT2_Q15);
|
||||
ul_ref_sigs_rx[u][0][0][3+(n<<2)]= (int16_t)((cos(M_PI*ref12[(u*12) + n]/4)>=0) ? ONE_OVER_SQRT2_Q15 : -ONE_OVER_SQRT2_Q15);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// These are the sequences for RB 2
|
||||
for (u=0;u<30;u++) {
|
||||
ul_ref_sigs_rx[u][0][1] = (int16_t*)malloc16(4*sizeof(int16_t)*dftsizes[1]);
|
||||
for (n=0;n<dftsizes[1];n++) {
|
||||
#ifndef IFFT_FPGA
|
||||
#ifndef NEW_FFT
|
||||
ul_ref_sigs_rx[u][0][1][n<<2] = (int16_t)(floor(32767*cos(M_PI*ref24[(u*24) + n]/4)));
|
||||
ul_ref_sigs_rx[u][0][1][1+(n<<2)]= (int16_t)(floor(32767*sin(M_PI*ref24[(u*24) + n]/4)));
|
||||
#else
|
||||
ul_ref_sigs_rx[u][0][1][n<<1] = (int16_t)(floor(32767*cos(M_PI*ref24[(u*24) + n]/4)));
|
||||
ul_ref_sigs_rx[u][0][1][1+(n<<1)]= (int16_t)(floor(32767*sin(M_PI*ref24[(u*24) + n]/4)));
|
||||
#endif
|
||||
ul_ref_sigs_rx[u][0][1][2+(n<<2)]=-(int16_t)(floor(32767*sin(M_PI*ref24[(u*24) + n]/4)));
|
||||
ul_ref_sigs_rx[u][0][1][3+(n<<2)]= (int16_t)(floor(32767*cos(M_PI*ref24[(u*24) + n]/4)));
|
||||
#else
|
||||
#ifndef OFDMA_ULSCH
|
||||
ul_ref_sigs_rx[u][0][1][n<<2] = (int16_t)(floor(32767*cos(M_PI*ref24[(u*24) + n]/4)));
|
||||
ul_ref_sigs_rx[u][0][1][1+(n<<2)]= (int16_t)(floor(32767*sin(M_PI*ref24[(u*24) + n]/4)));
|
||||
ul_ref_sigs_rx[u][0][1][2+(n<<2)]=-(int16_t)(floor(32767*sin(M_PI*ref24[(u*24) + n]/4)));
|
||||
ul_ref_sigs_rx[u][0][1][3+(n<<2)]= (int16_t)(floor(32767*cos(M_PI*ref24[(u*24) + n]/4)));
|
||||
#else
|
||||
ul_ref_sigs_rx[u][0][1][n<<2] = (int16_t)((cos(M_PI*ref24[(u*24) + n]/4)>=0) ? ONE_OVER_SQRT2_Q15 : -ONE_OVER_SQRT2_Q15);
|
||||
ul_ref_sigs_rx[u][0][1][1+(n<<2)]= (int16_t)((sin(M_PI*ref24[(u*24) + n]/4)>=0) ? ONE_OVER_SQRT2_Q15 : -ONE_OVER_SQRT2_Q15);
|
||||
ul_ref_sigs_rx[u][0][1][2+(n<<2)]= (int16_t)((sin(M_PI*ref24[(u*24) + n]/4)>=0) ? -ONE_OVER_SQRT2_Q15 : ONE_OVER_SQRT2_Q15);
|
||||
ul_ref_sigs_rx[u][0][1][3+(n<<2)]= (int16_t)((cos(M_PI*ref24[(u*24) + n]/4)>=0) ? ONE_OVER_SQRT2_Q15 : -ONE_OVER_SQRT2_Q15);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2550,11 +2550,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *phy_vars_ue,
|
||||
uint8_t format0_found=0,format_c_found=0;
|
||||
uint8_t tmode = phy_vars_ue->transmission_mode[eNB_id];
|
||||
uint8_t frame_type = frame_parms->frame_type;
|
||||
uint8_t format1A_size_bits,format1A_size_bytes;
|
||||
uint8_t format0_size_bits,format0_size_bytes;
|
||||
uint8_t format1_size_bits,format1_size_bytes;
|
||||
uint8_t format2_size_bits,format2_size_bytes;
|
||||
uint8_t format2A_size_bits,format2A_size_bytes;
|
||||
uint8_t format1A_size_bits=0,format1A_size_bytes=0;
|
||||
uint8_t format0_size_bits=0,format0_size_bytes=0;
|
||||
uint8_t format1_size_bits=0,format1_size_bytes=0;
|
||||
uint8_t format2_size_bits=0,format2_size_bytes=0;
|
||||
uint8_t format2A_size_bits=0,format2A_size_bytes=0;
|
||||
|
||||
switch (frame_parms->N_RB_DL) {
|
||||
case 6:
|
||||
|
||||
@@ -5371,7 +5371,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
|
||||
// uint32_t current_dlsch_cqi = phy_vars_ue->current_dlsch_cqi[eNB_id];
|
||||
|
||||
uint32_t cqi_req;
|
||||
uint32_t dai;
|
||||
uint32_t dai=0;
|
||||
uint32_t cshift;
|
||||
uint32_t TPC;
|
||||
uint32_t ndi;
|
||||
@@ -6141,7 +6141,6 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
|
||||
uint32_t dai = 0;
|
||||
uint32_t cshift = 0;
|
||||
uint32_t TPC = 0;
|
||||
uint32_t ndi = 0;
|
||||
uint32_t mcs = 0;
|
||||
uint32_t rballoc = UINT32_MAX;
|
||||
uint32_t RIV_max = 0;
|
||||
@@ -6170,7 +6169,6 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
|
||||
dai = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->dai;
|
||||
cshift = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->cshift;
|
||||
TPC = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->TPC;
|
||||
ndi = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->ndi;
|
||||
mcs = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->mcs;
|
||||
rballoc = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->rballoc;
|
||||
// hopping = ((DCI0_1_5MHz_TDD_1_6_t *)dci_pdu)->hopping;
|
||||
@@ -6180,7 +6178,6 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
|
||||
cqi_req = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->cqi_req;
|
||||
cshift = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->cshift;
|
||||
TPC = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->TPC;
|
||||
ndi = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->ndi;
|
||||
mcs = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->mcs;
|
||||
rballoc = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->rballoc;
|
||||
// hopping = ((DCI0_1_5MHz_FDD_t *)dci_pdu)->hopping;
|
||||
@@ -6197,7 +6194,6 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
|
||||
dai = ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->dai;
|
||||
cshift = ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->cshift;
|
||||
TPC = ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->TPC;
|
||||
ndi = ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->ndi;
|
||||
mcs = ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->mcs;
|
||||
rballoc = ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->rballoc;
|
||||
// hopping = ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->hopping;
|
||||
@@ -6207,7 +6203,6 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
|
||||
cqi_req = ((DCI0_5MHz_FDD_t *)dci_pdu)->cqi_req;
|
||||
cshift = ((DCI0_5MHz_FDD_t *)dci_pdu)->cshift;
|
||||
TPC = ((DCI0_5MHz_FDD_t *)dci_pdu)->TPC;
|
||||
ndi = ((DCI0_5MHz_FDD_t *)dci_pdu)->ndi;
|
||||
mcs = ((DCI0_5MHz_FDD_t *)dci_pdu)->mcs;
|
||||
rballoc = ((DCI0_5MHz_FDD_t *)dci_pdu)->rballoc;
|
||||
// hopping = ((DCI0_5MHz_FDD_t *)dci_pdu)->hopping;
|
||||
@@ -6224,7 +6219,6 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
|
||||
dai = ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->dai;
|
||||
cshift = ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->cshift;
|
||||
TPC = ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->TPC;
|
||||
ndi = ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->ndi;
|
||||
mcs = ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->mcs;
|
||||
rballoc = ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->rballoc;
|
||||
// hopping = ((DCI0_10MHz_TDD_1_6_t *)dci_pdu)->hopping;
|
||||
@@ -6234,7 +6228,6 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
|
||||
cqi_req = ((DCI0_10MHz_FDD_t *)dci_pdu)->cqi_req;
|
||||
cshift = ((DCI0_10MHz_FDD_t *)dci_pdu)->cshift;
|
||||
TPC = ((DCI0_10MHz_FDD_t *)dci_pdu)->TPC;
|
||||
ndi = ((DCI0_10MHz_FDD_t *)dci_pdu)->ndi;
|
||||
mcs = ((DCI0_10MHz_FDD_t *)dci_pdu)->mcs;
|
||||
rballoc = ((DCI0_10MHz_FDD_t *)dci_pdu)->rballoc;
|
||||
// hopping = ((DCI0_10MHz_FDD_t *)dci_pdu)->hopping;
|
||||
@@ -6251,7 +6244,6 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
|
||||
dai = ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->dai;
|
||||
cshift = ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->cshift;
|
||||
TPC = ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->TPC;
|
||||
ndi = ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->ndi;
|
||||
mcs = ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->mcs;
|
||||
rballoc = ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->rballoc;
|
||||
// hopping = ((DCI0_20MHz_TDD_1_6_t *)dci_pdu)->hopping;
|
||||
@@ -6261,7 +6253,6 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
|
||||
cqi_req = ((DCI0_20MHz_FDD_t *)dci_pdu)->cqi_req;
|
||||
cshift = ((DCI0_20MHz_FDD_t *)dci_pdu)->cshift;
|
||||
TPC = ((DCI0_20MHz_FDD_t *)dci_pdu)->TPC;
|
||||
ndi = ((DCI0_20MHz_FDD_t *)dci_pdu)->ndi;
|
||||
mcs = ((DCI0_20MHz_FDD_t *)dci_pdu)->mcs;
|
||||
rballoc = ((DCI0_20MHz_FDD_t *)dci_pdu)->rballoc;
|
||||
// hopping = ((DCI0_20MHz_FDD_t *)dci_pdu)->hopping;
|
||||
@@ -6288,14 +6279,12 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
|
||||
}
|
||||
|
||||
#ifdef DEBUG_DCI
|
||||
LOG_D(PHY,"generate_eNB_ulsch_params_from_dci: subframe %d, rnti %x,harq_pid %d,ndi %d,cqi_req %d\n",subframe,rnti,harq_pid,ndi,cqi_req);
|
||||
LOG_D(PHY,"generate_eNB_ulsch_params_from_dci: subframe %d, rnti %x,harq_pid %d,cqi_req %d\n",subframe,rnti,harq_pid,cqi_req);
|
||||
#endif
|
||||
|
||||
ulsch->harq_processes[harq_pid]->dci_alloc = 1;
|
||||
ulsch->harq_processes[harq_pid]->rar_alloc = 0;
|
||||
ulsch->harq_processes[harq_pid]->TPC = TPC;
|
||||
// ulsch->harq_processes[harq_pid]->Ndi = ndi;
|
||||
|
||||
ulsch->harq_processes[harq_pid]->n_DMRS = cshift;
|
||||
|
||||
|
||||
|
||||
@@ -474,19 +474,19 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
#include "LAYER2/MAC/defs.h"
|
||||
#endif
|
||||
|
||||
int dlsch_abstraction_EESM(double* sinr_dB, uint8_t TM, uint32_t rb_alloc[4], uint8_t mcs, uint8_t dl_power_off) {
|
||||
|
||||
int index,ii;
|
||||
int dlsch_abstraction_EESM(double* sinr_dB, uint8_t TM, uint32_t rb_alloc[4], uint8_t mcs, uint8_t dl_power_off) {
|
||||
|
||||
int ii;
|
||||
double sinr_eff = 0;
|
||||
int rb_count = 0;
|
||||
int offset;
|
||||
double bler = 0;
|
||||
if(TM==5 && dl_power_off==1)
|
||||
{ //do nothing -- means there is no second UE and TM 5 is behaving like TM 6 for a singal user
|
||||
}
|
||||
}
|
||||
else
|
||||
TM = TM-1;
|
||||
|
||||
TM = TM-1;
|
||||
|
||||
for (offset = 0; offset <= 24; offset++) {
|
||||
if (rb_alloc[0] & (1<<offset)) {
|
||||
rb_count++;
|
||||
@@ -505,12 +505,12 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
LOG_D(OCM,"sinr_eff (lin, weighted) = %f\n",sinr_eff);
|
||||
sinr_eff = 10 * log10(sinr_eff);
|
||||
LOG_D(OCM,"sinr_eff (dB) = %f\n",sinr_eff);
|
||||
|
||||
|
||||
bler = interp(sinr_eff,&sinr_bler_map[mcs][0][0],&sinr_bler_map[mcs][1][0],table_length[mcs]);
|
||||
|
||||
|
||||
#ifdef USER_MODE // need to be adapted for the emulation in the kernel space
|
||||
if (uniformrandom() < bler) {
|
||||
LOG_I(OCM,"abstraction_decoding failed (mcs=%d, sinr_eff=%f, bler=%f, TM %d)\n",mcs,sinr_eff,bler, TM);
|
||||
if (uniformrandom() < bler) {
|
||||
LOG_I(OCM,"abstraction_decoding failed (mcs=%d, sinr_eff=%f, bler=%f, TM %d)\n",mcs,sinr_eff,bler, TM);
|
||||
return(1);
|
||||
}
|
||||
else {
|
||||
@@ -520,11 +520,11 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
#endif
|
||||
}
|
||||
|
||||
int dlsch_abstraction_MIESM(double* sinr_dB,uint8_t TM, uint32_t rb_alloc[4], uint8_t mcs,uint8_t dl_power_off) {
|
||||
int index,ii;
|
||||
int dlsch_abstraction_MIESM(double* sinr_dB,uint8_t TM, uint32_t rb_alloc[4], uint8_t mcs,uint8_t dl_power_off) {
|
||||
int ii;
|
||||
double sinr_eff = 0;
|
||||
double x = 0;
|
||||
double I =0;
|
||||
double I =0;
|
||||
double qpsk_max=12.2;
|
||||
double qam16_max=19.2;
|
||||
double qam64_max=25.2;
|
||||
|
||||
@@ -658,19 +658,10 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
|
||||
re_offset -= (frame_parms->ofdm_symbol_size);
|
||||
|
||||
symbol_offset = (unsigned int)frame_parms->ofdm_symbol_size*l;
|
||||
#ifndef NEW_FFT
|
||||
rxptr = (int16_t *)&eNB_common_vars->rxdataF[0][aa][2*symbol_offset];
|
||||
#else
|
||||
rxptr = (int16_t *)&eNB_common_vars->rxdataF[0][aa][symbol_offset];
|
||||
#endif
|
||||
for (i=0;i<12;i++,j+=2,re_offset++) {
|
||||
#ifndef NEW_FFT
|
||||
rxcomp[aa][j] = (int16_t)((rxptr[re_offset<<2]*(int32_t)zptr[j])>>15) - ((rxptr[1+(re_offset<<2)]*(int32_t)zptr[1+j])>>15);
|
||||
rxcomp[aa][1+j] = (int16_t)((rxptr[re_offset<<2]*(int32_t)zptr[1+j])>>15) + ((rxptr[1+(re_offset<<2)]*(int32_t)zptr[j])>>15);
|
||||
#else
|
||||
rxcomp[aa][j] = (int16_t)((rxptr[re_offset<<1]*(int32_t)zptr[j])>>15) - ((rxptr[1+(re_offset<<1)]*(int32_t)zptr[1+j])>>15);
|
||||
rxcomp[aa][1+j] = (int16_t)((rxptr[re_offset<<1]*(int32_t)zptr[1+j])>>15) + ((rxptr[1+(re_offset<<1)]*(int32_t)zptr[j])>>15);
|
||||
#endif
|
||||
if (re_offset==frame_parms->ofdm_symbol_size)
|
||||
re_offset = 0;
|
||||
#ifdef DEBUG_PUCCH_RX
|
||||
@@ -956,7 +947,7 @@ int32_t rx_pucch_emul(PHY_VARS_eNB *phy_vars_eNB,
|
||||
|
||||
rnti = phy_vars_eNB->ulsch_eNB[UE_index]->rnti;
|
||||
for (UE_id=0;UE_id<NB_UE_INST;UE_id++) {
|
||||
if (rnti == PHY_vars_UE_g[UE_id][phy_vars_eNB->CC_id]->lte_ue_pdcch_vars[0]->crnti)
|
||||
if (rnti == PHY_vars_UE_g[UE_id][CC_id]->lte_ue_pdcch_vars[0]->crnti)
|
||||
break;
|
||||
}
|
||||
if (UE_id==NB_UE_INST) {
|
||||
@@ -965,19 +956,19 @@ int32_t rx_pucch_emul(PHY_VARS_eNB *phy_vars_eNB,
|
||||
}
|
||||
|
||||
if (fmt == pucch_format1) {
|
||||
payload[0] = PHY_vars_UE_g[UE_id][phy_vars_eNB->CC_id]->sr[subframe];
|
||||
payload[0] = PHY_vars_UE_g[UE_id][CC_id]->sr[subframe];
|
||||
}
|
||||
else if (fmt == pucch_format1a) {
|
||||
payload[0] = PHY_vars_UE_g[UE_id][phy_vars_eNB->CC_id]->pucch_payload[0];
|
||||
payload[0] = PHY_vars_UE_g[UE_id][CC_id]->pucch_payload[0];
|
||||
}
|
||||
else if (fmt == pucch_format1b) {
|
||||
payload[0] = PHY_vars_UE_g[UE_id][phy_vars_eNB->CC_id]->pucch_payload[0];
|
||||
payload[1] = PHY_vars_UE_g[UE_id][phy_vars_eNB->CC_id]->pucch_payload[1];
|
||||
payload[0] = PHY_vars_UE_g[UE_id][CC_id]->pucch_payload[0];
|
||||
payload[1] = PHY_vars_UE_g[UE_id][CC_id]->pucch_payload[1];
|
||||
}
|
||||
else
|
||||
LOG_E(PHY,"[eNB] Frame %d: Can't handle formats 2/2a/2b\n",phy_vars_eNB->proc[sched_subframe].frame_rx);
|
||||
|
||||
if (PHY_vars_UE_g[UE_id][phy_vars_eNB->CC_id]->pucch_sel[subframe] == n1_pucch_sel)
|
||||
if (PHY_vars_UE_g[UE_id][CC_id]->pucch_sel[subframe] == n1_pucch_sel)
|
||||
return(99);
|
||||
else
|
||||
return(0);
|
||||
|
||||
@@ -184,7 +184,6 @@ int generate_ue_ulsch_params_from_rar(PHY_VARS_UE *phy_vars_ue,
|
||||
uint8_t harq_pid = subframe2harq_pid(frame_parms,phy_vars_ue->frame_tx,subframe);
|
||||
uint16_t rballoc;
|
||||
uint8_t cqireq;
|
||||
double sinr_eff;
|
||||
uint16_t *RIV2nb_rb_LUT, *RIV2first_rb_LUT;
|
||||
uint16_t RIV_max = 0;
|
||||
|
||||
@@ -258,12 +257,6 @@ int generate_ue_ulsch_params_from_rar(PHY_VARS_UE *phy_vars_ue,
|
||||
}
|
||||
|
||||
ulsch->uci_format = HLC_subband_cqi_nopmi;
|
||||
/*
|
||||
if(flag_LA==1)
|
||||
sinr_eff = sinr_eff_cqi_calc(phy_vars_ue, eNB_id);
|
||||
else
|
||||
sinr_eff = meas->wideband_cqi_avg[eNB_id];
|
||||
*/
|
||||
fill_CQI(ulsch,meas,eNB_id,0,phy_vars_ue->lte_frame_parms.N_RB_DL,0, transmission_mode,phy_vars_ue->sinr_eff);
|
||||
|
||||
if (((phy_vars_ue->frame_tx % 100) == 0) || (phy_vars_ue->frame_tx < 10))
|
||||
|
||||
@@ -175,46 +175,24 @@ int pss_sss_extract(PHY_VARS_UE *phy_vars_ue,
|
||||
// (rx_offset + (symbol*(frame_parms->ofdm_symbol_size)))*2,
|
||||
// LTE_CE_OFFSET+ch_offset+(symbol_mod*(frame_parms->ofdm_symbol_size)));
|
||||
|
||||
#ifndef NEW_FFT
|
||||
pss_rxF = &rxdataF[aarx][(rx_offset + (pss_symb*(frame_parms->ofdm_symbol_size)))*2];
|
||||
sss_rxF = &rxdataF[aarx][(rx_offset + (sss_symb*(frame_parms->ofdm_symbol_size)))*2];
|
||||
#else
|
||||
pss_rxF = &rxdataF[aarx][(rx_offset + (pss_symb*(frame_parms->ofdm_symbol_size)))];
|
||||
sss_rxF = &rxdataF[aarx][(rx_offset + (sss_symb*(frame_parms->ofdm_symbol_size)))];
|
||||
#endif
|
||||
pss_rxF_ext = &pss_ext[aarx][0];
|
||||
|
||||
sss_rxF_ext = &sss_ext[aarx][0];
|
||||
|
||||
for (rb=0; rb<nb_rb; rb++) {
|
||||
// skip DC carrier
|
||||
if (rb==3) {
|
||||
#ifndef NEW_FFT
|
||||
sss_rxF = &rxdataF[aarx][(1 + (sss_symb*(frame_parms->ofdm_symbol_size)))*2];
|
||||
pss_rxF = &rxdataF[aarx][(1 + (pss_symb*(frame_parms->ofdm_symbol_size)))*2];
|
||||
#else
|
||||
sss_rxF = &rxdataF[aarx][(1 + (sss_symb*(frame_parms->ofdm_symbol_size)))];
|
||||
pss_rxF = &rxdataF[aarx][(1 + (pss_symb*(frame_parms->ofdm_symbol_size)))];
|
||||
#endif
|
||||
}
|
||||
for (i=0;i<12;i++) {
|
||||
#ifndef NEW_FFT
|
||||
pss_rxF_ext[i]=pss_rxF[i<<1];
|
||||
sss_rxF_ext[i]=sss_rxF[i<<1];
|
||||
#else
|
||||
pss_rxF_ext[i]=pss_rxF[i];
|
||||
sss_rxF_ext[i]=sss_rxF[i];
|
||||
#endif
|
||||
}
|
||||
#ifndef NEW_FFT
|
||||
pss_rxF+=24;
|
||||
sss_rxF+=24;
|
||||
#else
|
||||
pss_rxF+=12;
|
||||
sss_rxF+=12;
|
||||
#endif
|
||||
pss_rxF_ext+=12;
|
||||
|
||||
sss_rxF_ext+=12;
|
||||
}
|
||||
|
||||
|
||||
@@ -220,7 +220,6 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
PHY_MEASUREMENTS *meas = &phy_vars_ue->PHY_measurements;
|
||||
LTE_UE_ULSCH_t *ulsch=phy_vars_ue->ulsch_ue[eNB_id];
|
||||
LTE_UE_DLSCH_t **dlsch = phy_vars_ue->dlsch_ue[eNB_id];
|
||||
double sinr_eff;
|
||||
uint16_t rnti;
|
||||
|
||||
if (!ulsch) {
|
||||
@@ -249,12 +248,6 @@ uint32_t ulsch_encoding(uint8_t *a,
|
||||
|
||||
// fill CQI/PMI information
|
||||
if (ulsch->O>0) {
|
||||
/* //not correctly done
|
||||
if (flag_LA==1)
|
||||
sinr_eff = sinr_eff_cqi_calc(phy_vars_ue, 0); //eNB_id is missing here
|
||||
else
|
||||
sinr_eff = 0;
|
||||
*/
|
||||
rnti = phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->crnti;
|
||||
fill_CQI(ulsch,meas,0,harq_pid,phy_vars_ue->lte_frame_parms.N_RB_DL,rnti, tmode,phy_vars_ue->sinr_eff);
|
||||
|
||||
@@ -888,7 +881,6 @@ int ulsch_encoding_emul(uint8_t *ulsch_buffer,
|
||||
LTE_UE_DLSCH_t **dlsch = phy_vars_ue->dlsch_ue[eNB_id];
|
||||
PHY_MEASUREMENTS *meas = &phy_vars_ue->PHY_measurements;
|
||||
uint8_t tmode = phy_vars_ue->transmission_mode[eNB_id];
|
||||
double sinr_eff;
|
||||
uint16_t rnti=phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->crnti;
|
||||
LOG_D(PHY,"EMUL UE ulsch_encoding for eNB %d,mod_id %d, harq_pid %d rnti %x, ACK(%d,%d) \n",
|
||||
eNB_id,phy_vars_ue->Mod_id, harq_pid, rnti,ulsch->o_ACK[0],ulsch->o_ACK[1]);
|
||||
|
||||
@@ -138,19 +138,9 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
|
||||
msg("[PHY] symbol %d/%d (%p,%p -> %p)\n",i,nb_symbols,input,&input[i<<log2fftsize],&output[(i<<log2fftsize) + ((i)*nb_prefix_samples)]);
|
||||
#endif
|
||||
|
||||
#ifndef NEW_FFT
|
||||
fft((short *)&input[i<<log2fftsize],
|
||||
temp,
|
||||
twiddle_ifft,
|
||||
rev,
|
||||
log2fftsize,
|
||||
log2fftsize/2, // normalized FFT (i.e. 1/sqrt(N) multiplicative factor)
|
||||
0);
|
||||
#else
|
||||
idft((int16_t *)&input[i<<log2fftsize],
|
||||
(log2fftsize==7) ? (int16_t *)temp : (int16_t *)&output[(i<<log2fftsize) + ((1+i)*nb_prefix_samples)],
|
||||
1);
|
||||
#endif
|
||||
// write_output("fft_out.m","fftout",temp,(1<<log2fftsize)*2,1,1);
|
||||
|
||||
//memset(temp,0,1<<log2fftsize);
|
||||
@@ -167,21 +157,12 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
|
||||
|
||||
// msg("Doing cyclic prefix method\n");
|
||||
|
||||
#ifndef NEW_FFT
|
||||
for (j=0;j<((1<<log2fftsize)) ; j++) {
|
||||
|
||||
output_ptr[j] = temp_ptr[j];
|
||||
output_ptr[j] = temp_ptr[2*j];
|
||||
|
||||
}
|
||||
#else
|
||||
if (log2fftsize==7) {
|
||||
for (j=0;j<((1<<log2fftsize)) ; j++) {
|
||||
output_ptr[j] = temp_ptr[j];
|
||||
}
|
||||
}
|
||||
j=(1<<log2fftsize);
|
||||
#endif
|
||||
|
||||
for (k=-1;k>=-nb_prefix_samples;k--) {
|
||||
output_ptr[k] = output_ptr[--j];
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
*******************************************************************************/
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "defs.h"
|
||||
//#define DEBUG_FEP
|
||||
|
||||
@@ -79,38 +80,22 @@ int slot_fep_ul(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
}
|
||||
|
||||
if (l<0 || l>=7-frame_parms->Ncp) {
|
||||
msg("slot_fep: l must be between 0 and %d\n",7-frame_parms->Ncp);
|
||||
LOG_E(PHY,"slot_fep: l must be between 0 and %d\n",7-frame_parms->Ncp);
|
||||
return(-1);
|
||||
}
|
||||
if (Ns<0 || Ns>=20) {
|
||||
msg("slot_fep: Ns must be between 0 and 19\n");
|
||||
LOG_E(PHY,"slot_fep: Ns must be between 0 and 19\n");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_FEP
|
||||
msg("slot_fep: Ns %d offset %d, symbol %d, nb_prefix_samples %d\n",Ns,slot_offset,symbol, nb_prefix_samples);
|
||||
LOG_D(PHY,"slot_fep: Ns %d offset %d, symbol %d, nb_prefix_samples %d\n",Ns,slot_offset,symbol, nb_prefix_samples);
|
||||
#endif
|
||||
|
||||
for (aa=0;aa<frame_parms->nb_antennas_rx;aa++) {
|
||||
|
||||
if (l==0) {
|
||||
|
||||
#ifndef NEW_FFT
|
||||
fft(
|
||||
#ifndef OFDMA_ULSCH
|
||||
(short *)&eNB_common_vars->rxdata_7_5kHz[eNB_id][aa][slot_offset +
|
||||
nb_prefix_samples0],
|
||||
#else
|
||||
(short *)&eNB_common_vars->rxdata[eNB_id][aa][((frame_parms->samples_per_tti>>1)*Ns) +
|
||||
nb_prefix_samples0],
|
||||
#endif
|
||||
(short*)&eNB_common_vars->rxdataF[eNB_id][aa][2*frame_parms->ofdm_symbol_size*symbol],
|
||||
frame_parms->twiddle_fft,
|
||||
frame_parms->rev,
|
||||
frame_parms->log2_symbol_size,
|
||||
frame_parms->log2_symbol_size>>1,
|
||||
0);
|
||||
#else
|
||||
dft(
|
||||
#ifndef OFDMA_ULSCH
|
||||
(int16_t *)&eNB_common_vars->rxdata_7_5kHz[eNB_id][aa][slot_offset +
|
||||
@@ -120,26 +105,8 @@ int slot_fep_ul(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
nb_prefix_samples0],
|
||||
#endif
|
||||
(int16_t *)&eNB_common_vars->rxdataF[eNB_id][aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
#ifndef NEW_FFT
|
||||
fft(
|
||||
#ifndef OFDMA_ULSCH
|
||||
(short *)&eNB_common_vars->rxdata_7_5kHz[eNB_id][aa][slot_offset +
|
||||
#else
|
||||
(short *)&eNB_common_vars->rxdata[eNB_id][aa][((frame_parms->samples_per_tti>>1)*Ns) +
|
||||
#endif
|
||||
(frame_parms->ofdm_symbol_size+nb_prefix_samples0+nb_prefix_samples) +
|
||||
(frame_parms->ofdm_symbol_size+nb_prefix_samples)*(l-1)],
|
||||
(short*)&eNB_common_vars->rxdataF[eNB_id][aa][2*frame_parms->ofdm_symbol_size*symbol],
|
||||
frame_parms->twiddle_fft,
|
||||
frame_parms->rev,
|
||||
frame_parms->log2_symbol_size,
|
||||
frame_parms->log2_symbol_size>>1,
|
||||
0);
|
||||
#else
|
||||
dft(
|
||||
#ifndef OFDMA_ULSCH
|
||||
(short *)&eNB_common_vars->rxdata_7_5kHz[eNB_id][aa][slot_offset +
|
||||
@@ -149,12 +116,11 @@ int slot_fep_ul(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
(frame_parms->ofdm_symbol_size+nb_prefix_samples0+nb_prefix_samples) +
|
||||
(frame_parms->ofdm_symbol_size+nb_prefix_samples)*(l-1)],
|
||||
(short*)&eNB_common_vars->rxdataF[eNB_id][aa][frame_parms->ofdm_symbol_size*symbol],1);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG_FEP
|
||||
msg("slot_fep: done\n");
|
||||
LOG_D(PHY,"slot_fep: done\n");
|
||||
#endif
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ PHY_OBJS += $(TOP_DIR)/PHY/MODULATION/slot_fep_ul.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/MODULATION/ul_7_5_kHz.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/freq_equalization.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_sync_time.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_sync_timefreq.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_adjust_sync.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.o
|
||||
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.o
|
||||
|
||||
@@ -1048,8 +1048,7 @@ int mult_cpx_vector_norep_conj2(int16_t *x1,
|
||||
|
||||
|
||||
|
||||
// int16_t *temps;
|
||||
int *tempw;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1089,20 +1088,10 @@ int mult_cpx_vector_norep_conj2(int16_t *x1,
|
||||
printf("x2 : %d,%d,%d,%d,%d,%d,%d,%d\n",temps[0],temps[1],temps[2],temps[3],temps[4],temps[5],temps[6],temps[7]);
|
||||
*/
|
||||
m0 = _mm_madd_epi16(m4,x2_128[0]); //pmaddwd_r2r(mm1,mm0); // 1- compute x1[0]*x2[0]
|
||||
/*
|
||||
temp = m0;
|
||||
|
||||
tempd = &temp;
|
||||
printf("m0 : %d,%d,%d,%d\n",tempd[0],tempd[1],tempd[2],tempd[3]);
|
||||
|
||||
tempw = (int *)&m0;
|
||||
printf("m0[0] : %d,%d,%d,%d\n",tempw[0],tempw[1],tempw[2],tempw[3]);
|
||||
|
||||
*/
|
||||
m0 = _mm_sra_epi32(m0,shift); // 1- shift right by shift in order to compensate for the input amplitude
|
||||
|
||||
|
||||
tempw = (int *)&m0;
|
||||
// tempw = (int *)&m0;
|
||||
// printf("m0[1] : %d,%d,%d,%d\n",tempw[0],tempw[1],tempw[2],tempw[3]);
|
||||
|
||||
|
||||
|
||||
@@ -46,14 +46,14 @@ int32_t subcarrier_energy(int32_t *input,uint32_t length, int32_t *subcarrier_en
|
||||
|
||||
int32_t i, subcarrier_pwr;
|
||||
register __m64 mm0,mm1, subcarrier;
|
||||
subcarrier = _m_pxor(subcarrier,subcarrier);
|
||||
subcarrier = _mm_setzero_si64();//_m_pxor(subcarrier,subcarrier);
|
||||
__m64 *in = (__m64 *)input;
|
||||
|
||||
#ifdef MAIN
|
||||
int16_t *printb;
|
||||
#endif
|
||||
|
||||
mm0 = _m_pxor(mm0,mm0);
|
||||
mm0 = _mm_setzero_si64();//pxor(mm0,mm0);
|
||||
|
||||
for (i=0;i<length>>1;i++) {
|
||||
|
||||
@@ -82,8 +82,8 @@ int32_t signal_energy(int32_t *input,uint32_t length) {
|
||||
int16_t *printb;
|
||||
#endif
|
||||
|
||||
mm0 = _m_pxor(mm0,mm0);
|
||||
mm3 = _m_pxor(mm3,mm3);
|
||||
mm0 = _mm_setzero_si64();//pxor(mm0,mm0);
|
||||
mm3 = _mm_setzero_si64();//pxor(mm3,mm3);
|
||||
|
||||
for (i=0;i<length>>1;i++) {
|
||||
|
||||
@@ -156,20 +156,19 @@ int32_t signal_energy_nodc(int32_t *input,uint32_t length) {
|
||||
|
||||
int32_t i;
|
||||
int32_t temp;
|
||||
register __m64 mm0,mm1,mm2,mm3;
|
||||
register __m64 mm0,mm1;//,mm2,mm3;
|
||||
__m64 *in = (__m64 *)input;
|
||||
|
||||
#ifdef MAIN
|
||||
int16_t *printb;
|
||||
#endif
|
||||
|
||||
mm0 = _m_pxor(mm0,mm0);
|
||||
mm3 = _m_pxor(mm3,mm3);
|
||||
mm0 = _mm_setzero_si64();//_pxor(mm0,mm0);
|
||||
// mm3 = _mm_setzero_si64();//pxor(mm3,mm3);
|
||||
|
||||
for (i=0;i<length>>1;i++) {
|
||||
|
||||
mm1 = in[i];
|
||||
mm2 = mm1;
|
||||
mm1 = _m_pmaddwd(mm1,mm1);// SIMD complex multiplication
|
||||
mm1 = _m_psradi(mm1,shift);
|
||||
mm0 = _m_paddd(mm0,mm1);
|
||||
|
||||
@@ -120,6 +120,8 @@
|
||||
|
||||
#define NUMBER_OF_eNB_SECTORS_MAX 3
|
||||
|
||||
#define NB_BANDS_MAX 8
|
||||
|
||||
typedef enum {normal_txrx=0,rx_calib_ue=1,rx_calib_ue_med=2,rx_calib_ue_byp=3,debug_prach=4,no_L2_connect=5} runmode_t;
|
||||
|
||||
enum transmission_access_mode{
|
||||
@@ -131,6 +133,13 @@ enum transmission_access_mode{
|
||||
CBA_ACCESS
|
||||
};
|
||||
|
||||
typedef struct UE_SCAN_INFO_s {
|
||||
/// 10 best amplitudes (linear) for each pss signals
|
||||
int32_t amp[2][10];
|
||||
/// 10 frequency offsets (kHz) corresponding to best amplitudes, with respect do minimum DL frequency in the band
|
||||
int32_t freq_offset_Hz[2][10];
|
||||
} UE_SCAN_INFO_t;
|
||||
|
||||
#if defined(ENABLE_RAL)
|
||||
typedef struct ral_threshold_phy_s {
|
||||
SLIST_ENTRY(ral_threshold_phy_s) ral_thresholds;
|
||||
@@ -439,6 +448,7 @@ typedef struct
|
||||
uint32_t high_speed_flag;
|
||||
uint32_t perfect_ce;
|
||||
int16_t ch_est_alpha;
|
||||
UE_SCAN_INFO_t scan_info[NB_BANDS_MAX];
|
||||
|
||||
char ulsch_no_allocation_counter[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ uint8_t get_Msg3_harq_pid(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
unsigned char current_subframe) {
|
||||
|
||||
uint8_t ul_subframe=0;
|
||||
uint32_t ul_frame;
|
||||
uint32_t ul_frame=0;
|
||||
|
||||
if (frame_parms->frame_type ==FDD) {
|
||||
ul_subframe = (current_subframe>3) ? (current_subframe-4) : (current_subframe+6);
|
||||
|
||||
@@ -609,7 +609,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
|
||||
uint16_t first_rb, nb_rb;
|
||||
uint8_t harq_pid;
|
||||
unsigned int input_buffer_length;
|
||||
unsigned int i,aa;
|
||||
unsigned int aa;
|
||||
uint8_t Msg3_flag=0;
|
||||
uint8_t pucch_ack_payload[2];
|
||||
uint8_t n1_pucch;
|
||||
@@ -632,6 +632,9 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
|
||||
int frame_tx = phy_vars_ue->frame_tx;
|
||||
int Mod_id = phy_vars_ue->Mod_id;
|
||||
int CC_id = phy_vars_ue->CC_id;
|
||||
#ifndef OPENAIR2
|
||||
int i;
|
||||
#endif
|
||||
|
||||
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX,VCD_FUNCTION_IN);
|
||||
start_meas(&phy_vars_ue->phy_proc_tx);
|
||||
@@ -1395,7 +1398,6 @@ void lte_ue_measurement_procedures(uint16_t l, PHY_VARS_UE *phy_vars_ue,uint8_t
|
||||
int aa;
|
||||
#endif
|
||||
int Mod_id=phy_vars_ue->Mod_id;
|
||||
int frame_rx = phy_vars_ue->frame_rx;
|
||||
int slot_rx = phy_vars_ue->slot_rx;
|
||||
int subframe_rx = slot_rx>>1;
|
||||
|
||||
@@ -1871,14 +1873,19 @@ int lte_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *phy_vars_ue,uint8_t abst
|
||||
unsigned int dci_cnt=0, i;
|
||||
//DCI_PDU *DCI_pdu;
|
||||
//uint16_t ra_RNTI;
|
||||
uint8_t harq_pid;
|
||||
int UE_id;
|
||||
int CC_id;
|
||||
|
||||
|
||||
int frame_rx = phy_vars_ue->frame_rx;
|
||||
int slot_rx = phy_vars_ue->slot_rx;
|
||||
int subframe_rx = slot_rx>>1;
|
||||
|
||||
|
||||
#ifdef PHY_ABSTRACTION
|
||||
int CC_id;
|
||||
int UE_id;
|
||||
uint8_t harq_pid;
|
||||
#endif
|
||||
|
||||
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_PDCCH_PROCEDURES, VCD_FUNCTION_IN);
|
||||
|
||||
/*
|
||||
@@ -2299,13 +2306,15 @@ int lte_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *phy_vars_ue,uint8_t abst
|
||||
|
||||
uint16_t l,m,n_symb;
|
||||
// int eNB_id = 0,
|
||||
int eNB_id_i = 1;
|
||||
uint8_t dual_stream_UE = 0;
|
||||
int ret=0;
|
||||
uint8_t harq_pid = -1;
|
||||
int timing_advance;
|
||||
uint8_t pilot1,pilot2,pilot3;
|
||||
#ifndef DLSCH_THREAD
|
||||
uint8_t i_mod = 0;
|
||||
int eNB_id_i = 1;
|
||||
uint8_t dual_stream_UE = 0;
|
||||
#endif
|
||||
int i;
|
||||
#ifndef OPENAIR2
|
||||
uint8_t *rar;
|
||||
@@ -2318,7 +2327,9 @@ int lte_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *phy_vars_ue,uint8_t abst
|
||||
int slot_rx = phy_vars_ue->slot_rx;
|
||||
int subframe_rx = slot_rx>>1;
|
||||
int subframe_prev = (subframe_rx+9)%10;
|
||||
#ifdef OPENAIR2
|
||||
int CC_id = phy_vars_ue->CC_id;
|
||||
#endif
|
||||
|
||||
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_IN);
|
||||
vcd_signal_dumper_dump_variable_by_name(VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_UE, (slot_rx + 1) % 20);
|
||||
@@ -3413,9 +3424,13 @@ void phy_UE_lte_check_measurement_thresholds(instance_t instanceP, ral_threshold
|
||||
unsigned int Mod_id;
|
||||
int result;
|
||||
#endif
|
||||
# if defined(ENABLE_RAL)
|
||||
int CC_id =0;
|
||||
#endif
|
||||
int frame_rx = phy_vars_ue->frame_rx;
|
||||
#ifdef OPENAIR2
|
||||
int frame_tx = phy_vars_ue->frame_tx;
|
||||
#endif
|
||||
int slot_rx = phy_vars_ue->slot_rx;
|
||||
int slot_tx = phy_vars_ue->slot_tx;
|
||||
int subframe_tx = slot_tx>>1;
|
||||
|
||||
@@ -133,7 +133,6 @@ test: $(SIMULATION_OBJS) $(TOOLS_OBJS) $(TOP_DIR)/PHY/INIT/lte_init.o test.c
|
||||
OBJ += $(LIST_OBJ)
|
||||
OBJ += $(MEM_OBJ)
|
||||
$(OBJ) : %.o : %.c
|
||||
@echo
|
||||
@echo Compiling $< ...
|
||||
@$(CC) -c $(CFLAGS) -o $@ $<
|
||||
|
||||
|
||||
Reference in New Issue
Block a user