Commit ae81246e authored by Vincent Savaux's avatar Vincent Savaux

add few modif in extract RB dlsch

parent 754fc0e9
......@@ -4071,7 +4071,7 @@ unsigned short dlsch_extract_rbs_single_NB_IoT(int **rxdataF,
int *dl_ch0,*dl_ch0_ext,*rxF,*rxF_ext;
unsigned short UL_RB_ID_NB_IoT; // index of the NB-IoT RB
uint8_t id_offset; // offset of pilot position in symbols: 0,1,2
unsigned short NB_IoT_start,bandwidth_even_odd; // Index of the first RE in the RB dedicated for NB-IoT, bandwidth_even_odd = 0 even 1 odd
unsigned char symbol_mod,crs_pilots=0,j=0,poffset=0;
unsigned char nrs_pilots=0,nrs_offset=0; // nrs_pilots: flag of presence of pilot, nrs_offset: offset from first subcarrier
......@@ -4110,8 +4110,14 @@ unsigned short dlsch_extract_rbs_single_NB_IoT(int **rxdataF,
rxF_ext = &rxdataF_ext[aarx][symbol*(frame_parms->N_RB_DL*12)];
bandwidth_even_odd = frame_parms->N_RB_DL % 2; // 0 for even, 1 for odd
// if ((frame_parms->N_RB_DL&1) == 0) // even number of RBs
if(UL_RB_ID_NB_IoT <= (frame_parms->N_RB_DL>>1))
{ // RB in first half (below DC)
NB_IoT_start = UL_RB_ID_NB_IoT*12 + frame_parms->first_carrier_offset;
} else { // RB in the second half (above DC): DC is taken into account
NB_IoT_start = 1 + bandwidth_even_odd*6 + 6*(2*UL_RB_ID_NB_IoT - (frame_parms->N_RB_DL+bandwidth_even_odd));
}
for (rb=0;rb<1;rb++) {
......@@ -4129,14 +4135,8 @@ unsigned short dlsch_extract_rbs_single_NB_IoT(int **rxdataF,
if (rb_alloc_ind == 1)
nb_rb++;
// if (rb==(frame_parms->N_RB_DL>>1)) {
if (UL_RB_ID_NB_IoT <= (frame_parms->N_RB_DL>>1)) { // NB-IoT RB is in the first half
rxF = &rxdataF[aarx][(UL_RB_ID_NB_IoT*12 + frame_parms->first_carrier_offset + (symbol*(frame_parms->ofdm_symbol_size)))];
}// For second half of RBs skip DC carrier
else{ // NB-IoT RB is in the second half
rxF = &rxdataF[aarx][(1 + 6*(2*UL_RB_ID_NB_IoT - frame_parms->N_RB_DL) + (symbol*(frame_parms->ofdm_symbol_size)))];
//dl_ch0++;
}
rxF = &rxdataF[aarx][NB_IoT_start + (symbol*(frame_parms->ofdm_symbol_size))];
// // PBCH
// if (subframe==0) {
......
......@@ -212,10 +212,10 @@ int rx_nsss_NB_IoT(PHY_VARS_UE_NB_IoT *ue,int32_t *tot_metric)
return(-1);
}
for (k=0;k<126;k++){
for (k=0;k<126;k++){ // corresponds to u in standard
metric = 0;
for (m=0;m<132;m++){
for (m=0;m<132;m++){ // 132 resource elements in NSSS subframe
metric += (int32_t)d[(k*126+m)<<1] * (int32_t)nsss_sf[(k*126+m)<<1] +
(int32_t)d[((k*126+m)<<1)+1] * (int32_t)nsss_sf[((k*126+m)<<1)+1]; // real part of correlation
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment