Commit e7acad26 authored by Xiwen JIANG's avatar Xiwen JIANG

bug fix in the receiver for UE spec RS demodulation

parent c03803da
......@@ -4639,7 +4639,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
rxF_ext[j]=rxF[i];
dl_ch0_ext[j++]=dl_ch0[i];
#ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j-1],*(1+(short*)&rxF_ext[j-1]));
#endif
}
}
......@@ -4652,7 +4652,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
rxF_ext[j]=rxF[i];
dl_ch0_ext[j++]=dl_ch0[i];
#ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j-1],*(1+(short*)&rxF_ext[j-1]));
#endif
}
}
......@@ -4667,7 +4667,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
rxF_ext[j]=rxF[(i+6)];
dl_ch0_ext[j++]=dl_ch0[i+6];
#ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j-1],*(1+(short*)&rxF_ext[j-1]));
#endif
}
}
......@@ -4692,11 +4692,13 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
for (i=0; i<12; i++){
if (frame_parms->Ncp==0){
if (i!=uespec_nushift+uespec_poffset && i!=uespec_nushift+uespec_poffset+4 && i!=(uespec_nushift+uespec_poffset+8)%12){
if ((i!=uespec_nushift+uespec_poffset) && (i!=uespec_nushift+uespec_poffset+4) && (i!=(uespec_nushift+uespec_poffset+8))%12){
rxF_ext[j] = rxF[i];
dl_ch0_ext[j++] = dl_ch0[i];
#ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d, j %d => (%d,%d)\n",symbol,rb,i,j-1,*(short *)&dl_ch0[j],*(1+(short*)&dl_ch0[i]));
printf("uespec_nushift=%d, uespec_poffset=%d\n", uespec_nushift, uespec_poffset);
printf("extract rb %d, re %d rxF => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j-1],*(1+(short*)&rxF_ext[j-1]));
printf("extract rb %d, re %d ch => (%d,%d)\n",rb,i,*(short *)&dl_ch0[j-1],*(1+(short*)&dl_ch0[j-1]));
#endif
}
} else{
......@@ -4775,7 +4777,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
dl_ch0_ext[i]=dl_ch0[i];
rxF_ext[i]=rxF[i];
#ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif
}
......@@ -4785,13 +4787,13 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
dl_ch0_ext[i]=dl_ch0[i];
rxF_ext[i]=rxF[(1+i-6)];
#ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif
}
dl_ch0_ext+=12;
rxF_ext+=12;
} else if(pilots==1 && uespec_pilots==0){ // pilots==1
} else if(pilots==1 && uespec_pilots==0) { // pilots==1
j=0;
for (i=0; i<6; i++) {
......@@ -4799,7 +4801,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
dl_ch0_ext[j]=dl_ch0[i];
rxF_ext[j++]=rxF[i];
#ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif
}
}
......@@ -4811,7 +4813,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
dl_ch0_ext[j]=dl_ch0[i];
rxF_ext[j++]=rxF[(1+i-6)];
#ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif
}
}
......@@ -4827,7 +4829,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
dl_ch0_ext[j]=dl_ch0[i];
rxF_ext[j++] = rxF[i];
#ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif
}
} else {
......@@ -4835,7 +4837,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
dl_ch0_ext[j]=dl_ch0[i];
rxF_ext[j++] = rxF[i];
#ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif
}
}
......@@ -4849,7 +4851,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
dl_ch0_ext[j]=dl_ch0[i];
rxF_ext[j++]=rxF[(1+i-6)];
#ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif
}
} else {
......@@ -4857,7 +4859,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
dl_ch0_ext[j]=dl_ch0[i];
rxF_ext[j++] = rxF[(1+i-6)];
#ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif
}
}
......@@ -4959,7 +4961,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
for (i=0; i<6; i++) {
rxF_ext[i]=rxF[i];
#ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif
}
......@@ -4972,7 +4974,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
for (i=0; i<6; i++) {
rxF_ext[i]=rxF[i+6];
#ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif
}
......@@ -4986,7 +4988,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
for (i=0; i<12; i++) {
rxF_ext[i]=rxF[i];
#ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif
}
......@@ -5003,7 +5005,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
rxF_ext[j]=rxF[i];
dl_ch0_ext[j++]=dl_ch0[i];
#ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif
}
}
......@@ -5016,7 +5018,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
rxF_ext[j]=rxF[(i+6)];
dl_ch0_ext[j++]=dl_ch0[i+6];
#ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif
}
}
......@@ -5076,7 +5078,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
rxF_ext[j]=rxF[i+6];
dl_ch0_ext[j++]=dl_ch0[i+6];
#ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif
}
}
......@@ -5089,7 +5091,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
rxF_ext[j]=rxF[(i+6)];
dl_ch0_ext[j++]=dl_ch0[i+6];
#ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif
}
}
......@@ -5104,7 +5106,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
rxF_ext[j] = rxF[i];
dl_ch0_ext[j++]=dl_ch0[i];
#ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif
}
} else{
......@@ -5112,7 +5114,7 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
rxF_ext[j] = rxF[i];
dl_ch0_ext[j++]=dl_ch0[i];
#ifdef DEBUG_DLSCH_DEMOD
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
printf("extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[i],*(1+(short*)&rxF_ext[i]));
#endif
}
}
......
......@@ -16,7 +16,7 @@ int read_calibration_matrix(int32_t **tdd_calib_coeffs, char *calibF_fname, LTE_
if (openair_dir == NULL) {
printf("ERR: OPENAIR_DIR not defined (did you source oaienv?)\n");
exit(1);
return(1);
}
sprintf(calibF_file_name, "%s/targets/PROJECTS/TDDREC/result/%s", openair_dir, calibF_fname);
......
......@@ -294,6 +294,8 @@ void do_OFDM_mod_symbol(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t ne
int32_t **txdataF = eNB_common_vars->txdataF[eNB_id];
int32_t **txdataF_BF = eNB_common_vars->txdataF_BF[eNB_id];
int32_t **txdata = eNB_common_vars->txdata[eNB_id];
char txsigF0_BF_fname[20];
char txsF0_BF_value[20];
aa = antenna;
slot_offset = (next_slot)*(frame_parms->samples_per_tti>>1);
......@@ -306,6 +308,10 @@ void do_OFDM_mod_symbol(LTE_eNB_COMMON *eNB_common_vars, int eNB_id, uint16_t ne
beam_precoding(txdataF,txdataF_BF,frame_parms,eNB_common_vars->beam_weights[eNB_id],next_slot,l,aa);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_BEAM_PRECODING,0);
/*sprintf(txsigF0_BF_fname, "txsigF0_BF%d.m",l);
sprintf(txsF0_BF_value, "txsF0_BF%d",l);
write_output(txsigF0_BF_fname, txsF0_BF_value, txdataF_BF[0], frame_parms->ofdm_symbol_size,1,1);*/
//PMCH case not implemented...
if (frame_parms->Ncp == 1)
......
......@@ -70,7 +70,7 @@ void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
uint32_t bcch_pdu;
uint64_t dlsch_pdu;
LOG_I(PHY,"frame %d, subframe %d, transmission_mode %d\n",proc->frame_tx,proc->subframe_tx,transmission_mode);
//LOG_I(PHY,"frame %d, subframe %d, transmission_mode %d\n",proc->frame_tx,proc->subframe_tx,transmission_mode);
DCI_pdu->Num_common_dci = 0;
DCI_pdu->Num_ue_spec_dci=0;
......@@ -282,15 +282,25 @@ void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
} else {
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_5MHz_TDD_t;
harq_pid_value = ( ((proc->frame_tx * 10) + subframe) % 8 );
if (!(subframe&1)) // even subframe
dci_ndi_toggle_tmp = &(dci_ndi_toggle_even[harq_pid_value]);
else // odd subframe
dci_ndi_toggle_tmp = &(dci_ndi_toggle_odd[harq_pid_value]);
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rballoc = rballoc; //computeRIV(25,10,3);
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->TPC = 0;
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->dai = 0;
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->harq_pid = subframe % 5;
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->harq_pid = harq_pid_value; //subframe % 5;
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->mcs = eNB->target_ue_dl_mcs;
//((DCI1_5MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((eNB->frame%1024)%28);
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->ndi = subframe / 5;
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->ndi = (*dci_ndi_toggle_tmp);//subframe / 5;
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rv = 0;
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rah = 0;
(*dci_ndi_toggle_tmp) = ((*dci_ndi_toggle_tmp) + 1) & 1;
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_5MHz_TDD_t));
/*
......
......@@ -655,11 +655,11 @@ int main(int argc, char **argv)
cell_spec_bf_weights[aa][re] = 0x00007fff>>4;
}
}
*/
if (transmission_mode==7){
lte_gold_ue_spec_port5(eNB->lte_gold_uespec_port5_table[0],Nid_cell,n_rnti);
lte_gold_ue_spec_port5(UE->lte_gold_uespec_port5_table,Nid_cell,n_rnti);
}*/
}
eNB_id_i = UE->n_connected_eNB;
......@@ -2877,14 +2877,13 @@ PMI_FEEDBACK:
aa);
if (n_frames==1) {
if (transmission_mode<7)
write_output("txsigF0.m","txsF0", &eNB->common_vars.txdataF[eNB_id][0][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],
write_output("txsigF0.m","txsF0", &eNB->common_vars.txdataF[eNB_id][0][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],
nsymb*eNB->frame_parms.ofdm_symbol_size,1,1);
else if (transmission_mode==7)
write_output("txsigF0.m","txsF0", &eNB->common_vars.txdataF[eNB_id][5][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],
if (transmission_mode==7)
write_output("txsigF5.m","txsF5", &eNB->common_vars.txdataF[eNB_id][5][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],
nsymb*eNB->frame_parms.ofdm_symbol_size,1,1);
write_output("txsigF0_BF.m","txsF0_BF", &eNB->common_vars.txdataF_BF[eNB_id][0][0],
eNB->frame_parms.ofdm_symbol_size,1,1);
//write_output("txsigF0_BF.m","txsF0_BF", &eNB->common_vars.txdataF_BF[eNB_id][0][0],
// eNB->frame_parms.ofdm_symbol_size,1,1);
if (eNB->frame_parms.nb_antennas_tx>1)// to be updated
write_output("txsigF1.m","txsF1", &eNB->common_vars.txdataF[eNB_id][1][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],
......
......@@ -1310,7 +1310,8 @@ void init_openair0() {
}
if (frame_parms[0]->frame_type==TDD)
openair0_cfg[card].duplex_mode = duplex_mode_TDD;
//openair0_cfg[card].duplex_mode = duplex_mode_TDD;
openair0_cfg[card].duplex_mode = duplex_mode_FDD;
else //FDD
openair0_cfg[card].duplex_mode = duplex_mode_FDD;
......@@ -1635,7 +1636,8 @@ int main( int argc, char **argv )
for (j=0; j<frame_parms[CC_id]->nb_antennas_tx; j++)
for (re=0; re<frame_parms[CC_id]->ofdm_symbol_size; re++)
//In softmodem: the power constraint is on each antenna, so we do not norm the beam weights
PHY_vars_eNB_g[0][CC_id]->common_vars.beam_weights[0][0][j][re] = 0x00007fff;///sqrt(frame_parms[CC_id]->nb_antennas_tx);
PHY_vars_eNB_g[0][CC_id]->common_vars.beam_weights[0][0][j][re] = 0x00007fff;
//PHY_vars_eNB_g[0][CC_id]->common_vars.beam_weights[0][0][j][re] = 0x00007fff/sqrt(frame_parms[CC_id]->nb_antennas_tx);
}
if (phy_test==1) PHY_vars_eNB_g[0][CC_id]->mac_enabled = 0;
else PHY_vars_eNB_g[0][CC_id]->mac_enabled = 1;
......
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