Commit 13483270 authored by knopp's avatar knopp

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5950 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent e67c9df2
......@@ -934,7 +934,7 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
#ifndef USER_MODE
ue_common_vars->rxdata[i] = (int*) RX_DMA_BUFFER[0][i];
#else //USER_MODE
ue_common_vars->rxdata[i] = (int*) malloc16(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(int));
ue_common_vars->rxdata[i] = (int*) malloc16((FRAME_LENGTH_COMPLEX_SAMPLES+2048)*sizeof(int));
#endif //USER_MODE
if (ue_common_vars->rxdata[i]) {
#ifdef DEBUG_PHY
......@@ -1016,7 +1016,7 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
for (i=0; i<frame_parms->nb_antennas_rx; i++)
for (j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++) {
for (j=0; j<4; j++) {
ue_common_vars->dl_ch_estimates[eNB_id][(j<<1) + i] = (int *)malloc16(frame_parms->symbols_per_tti*sizeof(int)*(frame_parms->ofdm_symbol_size)+LTE_CE_FILTER_LENGTH);
if (ue_common_vars->dl_ch_estimates[eNB_id][(j<<1)+i]) {
#ifdef DEBUG_PHY
......@@ -1048,7 +1048,7 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
for (i=0; i<frame_parms->nb_antennas_rx; i++)
for (j=0; j<4; j++) {//frame_parms->nb_antennas_tx; j++) {
for (j=0; j<4; j++) {
ue_common_vars->dl_ch_estimates_time[eNB_id][(j<<1)+i] = (int *)malloc16(sizeof(int)*(frame_parms->ofdm_symbol_size)*2);
if (ue_common_vars->dl_ch_estimates_time[eNB_id][(j<<1)+i]) {
#ifdef DEBUG_PHY
......
......@@ -182,11 +182,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
for (aarx=0;aarx<phy_vars_ue->lte_frame_parms.nb_antennas_rx;aarx++) {
pil = (short *)&pilot[p][0];
#ifndef NEW_FFT
rxF = (short *)&rxdataF[aarx][((symbol_offset+k+phy_vars_ue->lte_frame_parms.first_carrier_offset)<<1)];
#else
rxF = (short *)&rxdataF[aarx][((symbol_offset+k+phy_vars_ue->lte_frame_parms.first_carrier_offset))];
#endif
dl_ch = (short *)&dl_ch_estimates[(p<<1)+aarx][ch_offset];
// if (eNb_id==0)
......@@ -206,11 +202,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2; // Re Im
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=8;
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
......@@ -221,11 +213,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
for (pilot_cnt=2;pilot_cnt<((phy_vars_ue->lte_frame_parms.N_RB_DL)-1);pilot_cnt+=2) {
......@@ -246,11 +234,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
pil+=2; // Re Im
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif // 6 samples in replicated format (Re0 Im0 Re0 Im0) !!!
dl_ch+=8;
// printf("pilot[%d][%d] (%d,%d)\n",p,rb,pil[0],pil[1]);
......@@ -265,11 +249,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
}
......@@ -279,11 +259,8 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
k = (nu + nushift)%6;
if (k > 6)
k -=6;
#ifndef NEW_FFT
rxF = (short *)&rxdataF[aarx][((symbol_offset+1+k)<<1)];
#else
rxF = (short *)&rxdataF[aarx][((symbol_offset+1+k))];
#endif
for (pilot_cnt=0;pilot_cnt<((phy_vars_ue->lte_frame_parms.N_RB_DL)-3);pilot_cnt+=2) {
// printf("pilot[%d][%d] (%d,%d)\n",p,pilot_cnt,pil[0],pil[1]);
// printf("rx[%d] -> (%d,%d)\n", k+6, rxF[0], rxF[1]);
......@@ -298,11 +275,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=8;
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
......@@ -314,11 +287,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
}
......@@ -331,11 +300,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2; // Re Im
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif // remember replicated format (Re0 Im0 Re0 Im0) !!!
dl_ch+=8;
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
......@@ -368,11 +333,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2; // Re Im
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif // remember replicated format (Re0 Im0 Re0 Im0) !!!
dl_ch+=8;
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
......@@ -390,11 +351,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
for (pilot_cnt=2;pilot_cnt<24;pilot_cnt+=2) {
......@@ -418,11 +375,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2; // Re Im
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif // remember replicated format (Re0 Im0 Re0 Im0) !!!
dl_ch+=8;
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
......@@ -439,11 +392,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
}
......@@ -467,11 +416,8 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
// printf("Second half\n");
// Second half of RBs
#ifndef NEW_FFT
rxF = (short *)&rxdataF[aarx][((symbol_offset+1+k)<<1)];
#else
rxF = (short *)&rxdataF[aarx][((symbol_offset+1+k))];
#endif
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
ch[1] = (short)(((int)pil[0]*rxF[1] + (int)pil[1]*rxF[0])>>15);
#ifdef DEBUG_CH
......@@ -486,11 +432,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
for (pilot_cnt=0;pilot_cnt<22;pilot_cnt+=2) {
......@@ -512,11 +454,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=8;
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
......@@ -533,11 +471,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
}
......@@ -558,11 +492,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2; // Re Im
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif// remember replicated format (Re0 Im0 Re0 Im0) !!!
dl_ch+=8;
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
......@@ -601,12 +531,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2; // Re Im
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
// remember replicated format (Re0 Im0 Re0 Im0) !!!
dl_ch+=8;
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
......@@ -617,11 +542,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
}
......@@ -638,11 +559,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
//printf("Second half\n");
//Second half of RBs
#ifndef NEW_FFT
rxF = (short *)&rxdataF[aarx][((symbol_offset+1+nushift + (3*p))<<1)];
#else
rxF = (short *)&rxdataF[aarx][((symbol_offset+1+nushift + (3*p)))];
#endif
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
ch[1] = (short)(((int)pil[0]*rxF[1] + (int)pil[1]*rxF[0])>>15);
......@@ -651,11 +568,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
for (rb=0;rb<28;rb+=4) {
......@@ -673,11 +586,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=8;
ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
......@@ -688,11 +597,7 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
dl_ch,
24);
pil+=2;
#ifndef NEW_FFT
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
#else
rxF+=12;
#endif
dl_ch+=16;
}
......@@ -795,10 +700,11 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
break;
}
// do ifft of channel estimate
for (aa=0;aa<phy_vars_ue->lte_frame_parms.nb_antennas_rx*phy_vars_ue->lte_frame_parms.nb_antennas_tx_eNB;aa++) {
if (phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa])
idft((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][8],
(int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa],1);
for (aarx=0;aarx<phy_vars_ue->lte_frame_parms.nb_antennas_rx;aarx++)
for (p=0;p<phy_vars_ue->lte_frame_parms.nb_antennas_tx_eNB;p++) {
if (phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][(p<<1)+aarx])
idft((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][(p<<1)+aarx][8],
(int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][(p<<1)+aarx],1);
}
return(0);
}
......
......@@ -302,36 +302,32 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
__m128i *dl_ch0_128,*dl_ch1_128;
int *dl_ch0,*dl_ch1;
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_ue->lte_frame_parms;
phy_vars_ue->PHY_measurements.nb_antennas_rx = frame_parms->nb_antennas_rx;
gain_offset = 0;
#ifndef __SSE3__
zeroPMI = _mm_xor_si128(zeroPMI,zeroPMI);
#endif
if (phy_vars_ue->init_averaging == 1) {
for (eNB_id=0;eNB_id<phy_vars_ue->n_connected_eNB;eNB_id++) {
phy_vars_ue->PHY_measurements.rx_power_avg[eNB_id] = 0;
}
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
phy_vars_ue->PHY_measurements.n0_power[aarx] = 0;
phy_vars_ue->PHY_measurements.n0_power_dB[aarx] = 0;
}
phy_vars_ue->PHY_measurements.n0_power_tot = 0;
phy_vars_ue->PHY_measurements.n0_power_tot_dB = 0;
phy_vars_ue->PHY_measurements.n0_power_avg = 0;
phy_vars_ue->PHY_measurements.n0_power_avg_dB = 0;
int nb_subbands,subband_size,last_subband_size;
int N_RB_DL = frame_parms->N_RB_DL;
switch (N_RB_DL) {
case 6:
nb_subbands = 6;
subband_size = 12;
last_subband_size = 0;
break;
default:
case 25:
nb_subbands = 7;
subband_size = 4*12;
last_subband_size = 12;
break;
case 50:
nb_subbands = 9;
subband_size = 6*12;
last_subband_size = 2*12;
break;
case 100:
nb_subbands = 13;
subband_size = 8*12;
last_subband_size = 4*12;
break;
}
// noise measurements
// for abstraction we do noise measurements based on the precalculated phy_vars_ue->N0
// otherwise if there is a symbol where we can take noise measurements on, we measure there
// otherwise do not update the noise measurements
if (abstraction_flag!=0) {
phy_vars_ue->PHY_measurements.n0_power_tot = 0;
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
......@@ -368,7 +364,7 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
for (aatx=0; aatx<frame_parms->nb_antennas_tx_eNB; aatx++) {
phy_vars_ue->PHY_measurements.rx_spatial_power[eNB_id][aatx][aarx] =
(signal_energy_nodc(&phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_id][(aatx<<1) + aarx][0],
(frame_parms->N_RB_DL*12)));
(N_RB_DL*12)));
//- phy_vars_ue->PHY_measurements.n0_power[aarx];
if (phy_vars_ue->PHY_measurements.rx_spatial_power[eNB_id][aatx][aarx]<0)
......@@ -432,19 +428,18 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
dl_ch0 = &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_id][aarx][4];
dl_ch1 = &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_id][2+aarx][4];
for (subband=0;subband<7;subband++) {
for (subband=0;subband<nb_subbands;subband++) {
// cqi
if (aarx==0)
phy_vars_ue->PHY_measurements.subband_cqi_tot[eNB_id][subband]=0;
if (subband<6) {
/*
for (i=0;i<48;i++)
if ((subband<(nb_subbands-1))||(N_RB_DL==6)) {
/*for (i=0;i<48;i++)
msg("subband %d (%d) : %d,%d\n",subband,i,((short *)dl_ch0)[2*i],((short *)dl_ch0)[1+(2*i)]);
*/
phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband] =
(signal_energy_nodc(dl_ch0,48) + signal_energy_nodc(dl_ch1,48));
(signal_energy_nodc(dl_ch0,subband_size) + signal_energy_nodc(dl_ch1,subband_size));
if ( phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband] < 0)
phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband]=0;
/*
......@@ -456,21 +451,22 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB_id][aarx][subband] = dB_fixed2(phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband],
phy_vars_ue->PHY_measurements.n0_power[aarx]);
}
else {
else { // this is for the last subband which is smaller in size
// for (i=0;i<12;i++)
// printf("subband %d (%d) : %d,%d\n",subband,i,((short *)dl_ch0)[2*i],((short *)dl_ch0)[1+(2*i)]);
phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband] = (signal_energy_nodc(dl_ch0,12) + signal_energy_nodc(dl_ch1,12)); // - phy_vars_ue->PHY_measurements.n0_power[aarx];
phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband] = (signal_energy_nodc(dl_ch0,last_subband_size) +
signal_energy_nodc(dl_ch1,last_subband_size)); // - phy_vars_ue->PHY_measurements.n0_power[aarx];
phy_vars_ue->PHY_measurements.subband_cqi_tot[eNB_id][subband] += phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband];
phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB_id][aarx][subband] = dB_fixed2(phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband],
phy_vars_ue->PHY_measurements.n0_power[aarx]);
}
dl_ch1+=48;
dl_ch0+=48;
dl_ch1+=subband_size;
dl_ch0+=subband_size;
// msg("subband_cqi[%d][%d][%d] => %d (%d dB)\n",eNB_id,aarx,subband,phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband],phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB_id][aarx][subband]);
}
}
for (subband=0;subband<7;subband++) {
for (subband=0;subband<nb_subbands;subband++) {
phy_vars_ue->PHY_measurements.subband_cqi_tot_dB[eNB_id][subband] = dB_fixed2(phy_vars_ue->PHY_measurements.subband_cqi_tot[eNB_id][subband],phy_vars_ue->PHY_measurements.n0_power_tot);
// msg("subband_cqi_tot[%d][%d] => %d dB (n0 %d)\n",eNB_id,subband,phy_vars_ue->PHY_measurements.subband_cqi_tot_dB[eNB_id][subband],phy_vars_ue->PHY_measurements.n0_power_tot);
}
......@@ -488,7 +484,7 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
}
#endif
*/
for (subband=0;subband<7;subband++) {
for (subband=0;subband<nb_subbands;subband++) {
// pmi
......@@ -497,7 +493,11 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
pmi128_im = _mm_xor_si128(pmi128_im,pmi128_im);
// limit is the number of groups of 4 REs in a subband (12 = 4 RBs, 3 = 1 RB)
// for 5 MHz channelization, there are 7 subbands, 6 of size 4 RBs and 1 of size 1 RB
limit = (subband < 6) ? 12 : 3;
if ((N_RB_DL==6) || (subband<(nb_subbands-1)))
limit = subband_size>>2;
else
limit = last_subband_size>>2;
for (i=0;i<limit;i++) {
// For each RE in subband perform ch0 * conj(ch1)
......@@ -582,13 +582,13 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
// msg("subband_cqi[%d][%d][%d] => %d (%d dB)\n",eNB_id,aarx,subband,phy_vars_ue->PHY_measurements.subband_cqi[eNB_id][aarx][subband],phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB_id][aarx][subband]);
}
}
for (subband=0;subband<7;subband++) {
for (subband=0;subband<nb_subbands;subband++) {
phy_vars_ue->PHY_measurements.subband_cqi_tot_dB[eNB_id][subband] = dB_fixed2(phy_vars_ue->PHY_measurements.subband_cqi_tot[eNB_id][subband],phy_vars_ue->PHY_measurements.n0_power_tot);
}
}
phy_vars_ue->PHY_measurements.rank[eNB_id] = 0;
for (i=0;i<NUMBER_OF_SUBBANDS;i++) {
for (i=0;i<nb_subbands;i++) {
phy_vars_ue->PHY_measurements.selected_rx_antennas[eNB_id][i] = 0;
if (frame_parms->nb_antennas_rx>1) {
if (phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB_id][0][i] >= phy_vars_ue->PHY_measurements.subband_cqi_dB[eNB_id][1][i])
......
......@@ -834,43 +834,31 @@ void pdcch_extract_rbs_single(int32_t **rxdataF,
rxF_ext = &rxdataF_ext[aarx][symbol*(frame_parms->N_RB_DL*12)];
#ifndef NEW_FFT
rxF = &rxdataF[aarx][(frame_parms->first_carrier_offset + (symbol*(frame_parms->ofdm_symbol_size)))*2];
#else
rxF = &rxdataF[aarx][(frame_parms->first_carrier_offset + (symbol*(frame_parms->ofdm_symbol_size)))];
#endif
if ((frame_parms->N_RB_DL&1) == 0) { // even number of RBs
for (rb=0;rb<frame_parms->N_RB_DL;rb++) {
// For second half of RBs skip DC carrier
if (rb==(frame_parms->N_RB_DL>>1)) {
#ifndef NEW_FFT
rxF = &rxdataF[aarx][(1 + (symbol*(frame_parms->ofdm_symbol_size)))*2];
#else
rxF = &rxdataF[aarx][(1 + (symbol*(frame_parms->ofdm_symbol_size)))];
#endif
//dl_ch0++;
}
if (symbol_mod>0) {
memcpy(dl_ch0_ext,dl_ch0,12*sizeof(int32_t));
for (i=0;i<12;i++) {
#ifndef NEW_FFT
rxF_ext[i]=rxF[i<<1];
#else
rxF_ext[i]=rxF[i];
#endif
}
nb_rb++;
dl_ch0_ext+=12;
rxF_ext+=12;
dl_ch0+=12;
#ifndef NEW_FFT
rxF+=24;
#else
rxF+=12;
#endif
}
else {
j=0;
......@@ -879,11 +867,7 @@ void pdcch_extract_rbs_single(int32_t **rxdataF,
(i!=(nushiftmod3+3)) &&
(i!=(nushiftmod3+6)) &&
(i!=(nushiftmod3+9))) {
#ifndef NEW_FFT
rxF_ext[j]=rxF[i<<1];
#else
rxF_ext[j]=rxF[i];
#endif
// printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j]));
dl_ch0_ext[j++]=dl_ch0[i];
// printf("ch %d => (%d,%d)\n",i,*(short *)&dl_ch0[i],*(1+(short*)&dl_ch0[i]));
......@@ -894,11 +878,7 @@ void pdcch_extract_rbs_single(int32_t **rxdataF,
rxF_ext+=8;
dl_ch0+=12;
#ifndef NEW_FFT
rxF+=24;
#else
rxF+=12;
#endif
}
}
}
......@@ -908,21 +888,13 @@ void pdcch_extract_rbs_single(int32_t **rxdataF,
if (symbol_mod>0) {
memcpy(dl_ch0_ext,dl_ch0,12*sizeof(int32_t));
for (i=0;i<12;i++)
#ifndef NEW_FFT
rxF_ext[i]=rxF[i<<1];
#else
rxF_ext[i]=rxF[i];
#endif
nb_rb++;
dl_ch0_ext+=12;
rxF_ext+=12;
dl_ch0+=12;
#ifndef NEW_FFT
rxF+=24;
#else
rxF+=12;
#endif
}
else {
j=0;
......@@ -931,11 +903,7 @@ void pdcch_extract_rbs_single(int32_t **rxdataF,
(i!=(nushiftmod3+3)) &&
(i!=(nushiftmod3+6)) &&
(i!=(nushiftmod3+9))) {
#ifndef NEW_FFT
rxF_ext[j]=rxF[i<<1];
#else
rxF_ext[j]=rxF[i];
#endif
// printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j],*(1+(short*)&rxF_ext[j]));
dl_ch0_ext[j++]=dl_ch0[i];
// printf("ch %d => (%d,%d)\n",i,*(short *)&dl_ch0[i],*(1+(short*)&dl_ch0[i]));
......@@ -946,11 +914,7 @@ void pdcch_extract_rbs_single(int32_t **rxdataF,
rxF_ext+=8;
dl_ch0+=12;
#ifndef NEW_FFT
rxF+=24;
#else
rxF+=12;
#endif
}
}
// Do middle RB (around DC)
......@@ -962,28 +926,16 @@ void pdcch_extract_rbs_single(int32_t **rxdataF,
if ((i!=nushiftmod3) &&