Commit faf8953d authored by Florian Kaltenberger's avatar Florian Kaltenberger
Browse files

fixed UL time domain channel estimation (was using the dft instead of idft)...

fixed UL time domain channel estimation (was using the dft instead of idft) and removed repeated format issues
fixed bug in timing advance procedures in UE and eNB


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7446 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 29f79094
...@@ -216,8 +216,8 @@ int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,uint8_t UE_id,uint8_ ...@@ -216,8 +216,8 @@ int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,uint8_t UE_id,uint8_
temp = 0; temp = 0;
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) { for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
Re = ((int16_t*)ul_ch_estimates_time[aa])[(i<<2)]; Re = ((int16_t*)ul_ch_estimates_time[aa])[(i<<1)];
Im = ((int16_t*)ul_ch_estimates_time[aa])[1+(i<<2)]; Im = ((int16_t*)ul_ch_estimates_time[aa])[1+(i<<1)];
temp += (Re*Re/2) + (Im*Im/2); temp += (Re*Re/2) + (Im*Im/2);
} }
...@@ -227,6 +227,8 @@ int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,uint8_t UE_id,uint8_ ...@@ -227,6 +227,8 @@ int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,uint8_t UE_id,uint8_
} }
} }
if (max_pos>frame_parms->ofdm_symbol_size/2)
max_pos = max_pos-frame_parms->ofdm_symbol_size;
// filter position to reduce jitter // filter position to reduce jitter
if (first_run == 1) { if (first_run == 1) {
......
...@@ -253,25 +253,25 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB, ...@@ -253,25 +253,25 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
switch(frame_parms->N_RB_DL) { switch(frame_parms->N_RB_DL) {
case 6: case 6:
dft128((int16_t*) temp_in_ifft_0, idft128((int16_t*) temp_in_ifft_0,
(int16_t*) ul_ch_estimates_time[aa], (int16_t*) ul_ch_estimates_time[aa],
1); 1);
break; break;
case 25: case 25:
dft512((int16_t*) temp_in_ifft_0, idft512((int16_t*) temp_in_ifft_0,
(int16_t*) ul_ch_estimates_time[aa], (int16_t*) ul_ch_estimates_time[aa],
1); 1);
break; break;
case 50: case 50:
dft1024((int16_t*) temp_in_ifft_0, idft1024((int16_t*) temp_in_ifft_0,
(int16_t*) ul_ch_estimates_time[aa], (int16_t*) ul_ch_estimates_time[aa],
1); 1);
break; break;
case 100: case 100:
dft2048((int16_t*) temp_in_ifft_0, idft2048((int16_t*) temp_in_ifft_0,
(int16_t*) ul_ch_estimates_time[aa], (int16_t*) ul_ch_estimates_time[aa],
1); 1);
break; break;
...@@ -283,9 +283,9 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB, ...@@ -283,9 +283,9 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
if (Ns == 0) { if (Ns == 0) {
write_output("rxdataF_ext.m","rxF_ext",&rxdataF_ext[aa][symbol_offset],512*2,2,1); write_output("rxdataF_ext.m","rxF_ext",&rxdataF_ext[aa][symbol_offset],512*2,2,1);
write_output("tmpin_ifft.m","drs_in",temp_in_ifft_0,512,1,1); write_output("tmpin_ifft.m","drs_in",temp_in_ifft_0,512,1,1);
write_output("drs_est0.m","drs0",ul_ch_estimates_time[aa],512*2,2,1); write_output("drs_est0.m","drs0",ul_ch_estimates_time[aa],512,1,1);
} else } else
write_output("drs_est1.m","drs1",ul_ch_estimates_time[aa],512*2,2,1); write_output("drs_est1.m","drs1",ul_ch_estimates_time[aa],512,1,1);
} }
#endif #endif
...@@ -467,7 +467,6 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB, ...@@ -467,7 +467,6 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
if((aa == 0)&& (cooperation_flag == 2)) { if((aa == 0)&& (cooperation_flag == 2)) {
write_output("test1.m","t1",temp_in_ifft_0,512,1,1); write_output("test1.m","t1",temp_in_ifft_0,512,1,1);
write_output("test2.m","t2",temp_out_ifft_0,512*2,2,1); write_output("test2.m","t2",temp_out_ifft_0,512*2,2,1);
// write_output("test2.m","t2",ul_ch_estimates_time[aa],512*2,2,1);
write_output("test3.m","t3",temp_in_fft_0,512,1,1); write_output("test3.m","t3",temp_in_fft_0,512,1,1);
write_output("test4.m","t4",temp_out_fft_0,512,1,1); write_output("test4.m","t4",temp_out_fft_0,512,1,1);
write_output("test5.m","t5",temp_in_fft_1,512,1,1); write_output("test5.m","t5",temp_in_fft_1,512,1,1);
......
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
#include "LAYER2/MAC/extern.h" #include "LAYER2/MAC/extern.h"
//uint8_t ncs_cell[20][7]; //uint8_t ncs_cell[20][7];
#define DEBUG_PUCCH_TX //#define DEBUG_PUCCH_TX
#define DEBUG_PUCCH_RX //#define DEBUG_PUCCH_RX
int16_t cfo_pucch_np[24*7] = {20787,-25330,27244,-18205,31356,-9512,32767,0,31356,9511,27244,18204,20787,25329, int16_t cfo_pucch_np[24*7] = {20787,-25330,27244,-18205,31356,-9512,32767,0,31356,9511,27244,18204,20787,25329,
27244,-18205,30272,-12540,32137,-6393,32767,0,32137,6392,30272,12539,27244,18204, 27244,-18205,30272,-12540,32137,-6393,32767,0,32137,6392,30272,12539,27244,18204,
......
...@@ -209,13 +209,13 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, ...@@ -209,13 +209,13 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
} }
} }
// Channel Impulse Response (still repeated format) // Channel Impulse Response
if (chest_t != NULL) { if (chest_t != NULL) {
ymax = 0; ymax = 0;
if (chest_t[0] !=NULL) { if (chest_t[0] !=NULL) {
for (i=0; i<(frame_parms->ofdm_symbol_size); i++) { for (i=0; i<(frame_parms->ofdm_symbol_size); i++) {
chest_t_abs[0][i] = (float) (chest_t[0][4*i]*chest_t[0][4*i]+chest_t[0][4*i+1]*chest_t[0][4*i+1]); chest_t_abs[0][i] = (float) (chest_t[0][2*i]*chest_t[0][2*i]+chest_t[0][2*i+1]*chest_t[0][2*i+1]);
if (chest_t_abs[0][i] > ymax) if (chest_t_abs[0][i] > ymax)
ymax = chest_t_abs[0][i]; ymax = chest_t_abs[0][i];
...@@ -227,7 +227,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form, ...@@ -227,7 +227,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
for (arx=1; arx<nb_antennas_rx; arx++) { for (arx=1; arx<nb_antennas_rx; arx++) {
if (chest_t[arx] !=NULL) { if (chest_t[arx] !=NULL) {
for (i=0; i<(frame_parms->ofdm_symbol_size>>3); i++) { for (i=0; i<(frame_parms->ofdm_symbol_size>>3); i++) {
chest_t_abs[arx][i] = (float) (chest_t[arx][4*i]*chest_t[arx][4*i]+chest_t[arx][4*i+1]*chest_t[arx][4*i+1]); chest_t_abs[arx][i] = (float) (chest_t[arx][2*i]*chest_t[arx][2*i]+chest_t[arx][2*i+1]*chest_t[arx][2*i+1]);
if (chest_t_abs[arx][i] > ymax) if (chest_t_abs[arx][i] > ymax)
ymax = chest_t_abs[arx][i]; ymax = chest_t_abs[arx][i];
......
...@@ -342,15 +342,13 @@ void process_timing_advance(uint8_t Mod_id,uint8_t CC_id,int16_t timing_advance) ...@@ -342,15 +342,13 @@ void process_timing_advance(uint8_t Mod_id,uint8_t CC_id,int16_t timing_advance)
// uint32_t frame = PHY_vars_UE_g[Mod_id]->frame; // uint32_t frame = PHY_vars_UE_g[Mod_id]->frame;
if ((timing_advance>>5) & 1) //it is negative // timing advance has Q1.5 format
timing_advance = timing_advance - (1<<6); timing_advance = timing_advance - (1<<5);
if (openair_daq_vars.manual_timing_advance == 0) { if (openair_daq_vars.manual_timing_advance == 0) {
//if ( (frame % 100) == 0) { //if ( (frame % 100) == 0) {
//if ((timing_advance > 3) || (timing_advance < -3) ) //if ((timing_advance > 3) || (timing_advance < -3) )
PHY_vars_UE_g[Mod_id][CC_id]->timing_advance = cmax(0,(int)PHY_vars_UE_g[Mod_id][CC_id]->timing_advance+timing_advance*4); PHY_vars_UE_g[Mod_id][CC_id]->timing_advance = PHY_vars_UE_g[Mod_id][CC_id]->timing_advance+timing_advance*4; //this is for 25RB only!!!
//}
} }
LOG_D(PHY,"[UE %d] Got timing advance %d from MAC, new value %d\n",Mod_id, timing_advance, PHY_vars_UE_g[Mod_id][CC_id]->timing_advance); LOG_D(PHY,"[UE %d] Got timing advance %d from MAC, new value %d\n",Mod_id, timing_advance, PHY_vars_UE_g[Mod_id][CC_id]->timing_advance);
...@@ -1203,15 +1201,17 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra ...@@ -1203,15 +1201,17 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
openair_daq_vars.timing_advance- openair_daq_vars.timing_advance-
phy_vars_ue->timing_advance- phy_vars_ue->timing_advance-
phy_vars_ue->N_TA_offset+5)%(LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti); phy_vars_ue->N_TA_offset+5)%(LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti);
LOG_D(PHY,"[UE %d] Frame %d, subframe %d: ulsch_start = %d (rxoff %d, HW TA %d, TA %d, TA_offset %d\n", #else //this is the normal case
ulsch_start = (frame_parms->samples_per_tti*subframe_tx)-phy_vars_ue->N_TA_offset; //-phy_vars_ue->timing_advance;
#endif //else EXMIMO
LOG_D(PHY,"[UE %d] Frame %d, subframe %d: ulsch_start = %d (rxoff %d, HW TA %d, timing advance %d, TA_offset %d\n",
Mod_id,frame_tx,subframe_tx,
ulsch_start,
phy_vars_ue->rx_offset, phy_vars_ue->rx_offset,
openair_daq_vars.timing_advance, openair_daq_vars.timing_advance,
phy_vars_ue->timing_advance, phy_vars_ue->timing_advance,
phy_vars_ue->N_TA_offset); phy_vars_ue->N_TA_offset);
#else //this is the normal case
ulsch_start = (frame_parms->samples_per_tti*subframe_tx)-phy_vars_ue->N_TA_offset;
#endif //else EXMIMO
if (generate_ul_signal == 1 ) { if (generate_ul_signal == 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