Commit 3a5eda8c authored by Xiwen JIANG's avatar Xiwen JIANG

cleanness and comments

parent f9052430
...@@ -46,7 +46,7 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue, ...@@ -46,7 +46,7 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue,
unsigned char aarx,l,lprime,nsymb,skip_half=0,sss_symb,pss_symb=0,rb_alloc_ind,harq_pid,uespec_pilots=0; unsigned char aarx,l,lprime,nsymb,skip_half=0,sss_symb,pss_symb=0,rb_alloc_ind,harq_pid,uespec_pilots=0;
int beamforming_mode, ch_offset; int beamforming_mode, ch_offset;
uint8_t subframe; uint8_t subframe;
int8_t uespec_nushift, uespec_poffset=0, pil_offset; int8_t uespec_nushift, uespec_poffset=0, pil_offset=0;
uint8_t pilot0,pilot1,pilot2,pilot3; uint8_t pilot0,pilot1,pilot2,pilot3;
short ch[2], *pil, *rxF, *dl_bf_ch, *dl_bf_ch_prev; short ch[2], *pil, *rxF, *dl_bf_ch, *dl_bf_ch_prev;
...@@ -81,7 +81,7 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue, ...@@ -81,7 +81,7 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue,
subframe = Ns>>1; subframe = Ns>>1;
if (beamforming_mode==7) { // if (beamforming_mode==7) {
//generate ue specific pilots //generate ue specific pilots
lprime = symbol/3-1; lprime = symbol/3-1;
lte_dl_ue_spec_rx(phy_vars_ue,uespec_pilot,Ns,5,lprime,0,dlsch0_harq->nb_rb); lte_dl_ue_spec_rx(phy_vars_ue,uespec_pilot,Ns,5,lprime,0,dlsch0_harq->nb_rb);
...@@ -161,11 +161,12 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue, ...@@ -161,11 +161,12 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue,
f2r = filt16_2r1; f2r = filt16_2r1;
break; break;
} }
} // beamforming mode extension
/* }
else if (beamforming_mode==0) else if (beamforming_mode==0)
msg("lte_dl_bf_channel_estimation:No beamforming is performed.\n"); msg("lte_dl_bf_channel_estimation:No beamforming is performed.\n");
else else
msg("lte_dl_bf_channel_estimation:Beamforming mode not supported yet.\n"); msg("lte_dl_bf_channel_estimation:Beamforming mode not supported yet.\n");*/
l=symbol; l=symbol;
...@@ -183,20 +184,22 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue, ...@@ -183,20 +184,22 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue,
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
rxF = (short *)&rxdataF[aarx][pil_offset + frame_parms->first_carrier_offset + symbol*frame_parms->ofdm_symbol_size]; rxF = (short *)&rxdataF[aarx][pil_offset + frame_parms->first_carrier_offset + symbol*frame_parms->ofdm_symbol_size];
pil = (short*)uespec_pilot; pil = (short *)uespec_pilot;
dl_bf_ch = (short *)&dl_bf_ch_estimates[aarx][ch_offset]; dl_bf_ch = (short *)&dl_bf_ch_estimates[aarx][ch_offset];
memset(dl_bf_ch,0,4*(frame_parms->ofdm_symbol_size)); memset(dl_bf_ch,0,4*(frame_parms->ofdm_symbol_size));
//memset(dl_bf_ch,0,2*(frame_parms->ofdm_symbol_size)); //memset(dl_bf_ch,0,2*(frame_parms->ofdm_symbol_size));
if (phy_vars_ue->high_speed_flag==0) // multiply previous channel estimate by ch_est_alpha if (phy_vars_ue->high_speed_flag==0) {
if (frame_parms->Ncp==0) // multiply previous channel estimate by ch_est_alpha
if (frame_parms->Ncp==0){
multadd_complex_vector_real_scalar(dl_bf_ch-(frame_parms->ofdm_symbol_size<<1), multadd_complex_vector_real_scalar(dl_bf_ch-(frame_parms->ofdm_symbol_size<<1),
phy_vars_ue->ch_est_alpha,dl_bf_ch-(frame_parms->ofdm_symbol_size<<1), phy_vars_ue->ch_est_alpha,dl_bf_ch-(frame_parms->ofdm_symbol_size<<1),
1,frame_parms->ofdm_symbol_size); 1,frame_parms->ofdm_symbol_size);
else } else {
msg("lte_dl_bf_channel_estimation: beamforming channel estimation not supported for TM7 Extended CP.\n"); // phy_vars_ue->ch_est_beta should be defined equaling 1/3 msg("lte_dl_bf_channel_estimation: beamforming channel estimation not supported for TM7 Extended CP.\n"); // phy_vars_ue->ch_est_beta should be defined equaling 1/3
}
}
//estimation and interpolation //estimation and interpolation
if ((frame_parms->N_RB_DL&1) == 0) // even number of RBs if ((frame_parms->N_RB_DL&1) == 0) // even number of RBs
...@@ -215,7 +218,7 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue, ...@@ -215,7 +218,7 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue,
// For second half of RBs skip DC carrier // For second half of RBs skip DC carrier
if (rb==(frame_parms->N_RB_DL>>1)) { if (rb==(frame_parms->N_RB_DL>>1)) {
rxF = &rxdataF[aarx][(1 + (symbol*(frame_parms->ofdm_symbol_size)))]; rxF = (short *)&rxdataF[aarx][(1 + (symbol*(frame_parms->ofdm_symbol_size)))];
} }
if (rb_alloc_ind==1) { if (rb_alloc_ind==1) {
......
...@@ -91,14 +91,14 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB, ...@@ -91,14 +91,14 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB,
@param p antenna index @param p antenna index
@param SS_flag Flag to indicate special subframe @param SS_flag Flag to indicate special subframe
*/ */
int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB, /*int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
uint8_t UE_id, uint8_t UE_id,
mod_sym_t *output, mod_sym_t *output,
short amp, short amp,
uint8_t Ns, uint8_t Ns,
uint8_t lprime, uint8_t lprime,
uint8_t p, uint8_t p,
int SS_flag); int SS_flag);*/
/*! \brief This function generates the MBSFN reference signal sequence (36-211, Sec 6.10.1.2) /*! \brief This function generates the MBSFN reference signal sequence (36-211, Sec 6.10.1.2)
@param phy_vars_eNB Pointer to eNB variables @param phy_vars_eNB Pointer to eNB variables
...@@ -128,6 +128,16 @@ int lte_dl_cell_spec_rx(PHY_VARS_UE *phy_vars_ue, ...@@ -128,6 +128,16 @@ int lte_dl_cell_spec_rx(PHY_VARS_UE *phy_vars_ue,
unsigned char l, unsigned char l,
unsigned char p); unsigned char p);
/*!\brief This function generates the ue-specific reference signal
* sequence (36-211, Sec 6.10.3.1) for beamforming channel estimation upon reception
@param phy_vars_ue Pointer to UE variables
@param output Output vector for OFDM symbol (Frequency Domain)
@param Ns Slot number (0..19)
@param p antenna port intex
@param lprime symbol (0,1)
@param SS_flag Flag to indicate special subframe
@param nRB_PDSCH number of allocated PDSCH RBs
*/
int lte_dl_ue_spec_rx(PHY_VARS_UE *phy_vars_ue, int lte_dl_ue_spec_rx(PHY_VARS_UE *phy_vars_ue,
mod_sym_t *output, mod_sym_t *output,
unsigned char Ns, unsigned char Ns,
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
int Wbar_NCP[8][4] = {{1,1,1,1},{1,-1,1,-1},{1,1,1,1},{1,-1,1,-1},{1,1,-1,-1},{-1,-1,1,1},{1,-1,-1,1},{-1,1,1,-1}}; int Wbar_NCP[8][4] = {{1,1,1,1},{1,-1,1,-1},{1,1,1,1},{1,-1,1,-1},{1,1,-1,-1},{-1,-1,1,1},{1,-1,-1,1},{-1,1,1,-1}};
/*
int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB, int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
uint8_t UE_id, uint8_t UE_id,
mod_sym_t *output, mod_sym_t *output,
...@@ -62,7 +63,7 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB, ...@@ -62,7 +63,7 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
int SS_flag) int SS_flag)
{ {
/* mod_sym_t qpsk[4],nqpsk[4]; mod_sym_t qpsk[4],nqpsk[4];
int16_t k=0,a; int16_t k=0,a;
int mprime,ind,ind_dword,ind_qpsk_symb; int mprime,ind,ind_dword,ind_qpsk_symb;
unsigned nushift,kprime; unsigned nushift,kprime;
...@@ -126,8 +127,9 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB, ...@@ -126,8 +127,9 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
LOG_E(PHY,"Illegal p %d UE specific pilots\n",p); LOG_E(PHY,"Illegal p %d UE specific pilots\n",p);
} }
return(0);*/ return(0);
} }
*/
int lte_dl_ue_spec_rx(PHY_VARS_UE *phy_vars_ue, int lte_dl_ue_spec_rx(PHY_VARS_UE *phy_vars_ue,
...@@ -139,7 +141,6 @@ int lte_dl_ue_spec_rx(PHY_VARS_UE *phy_vars_ue, ...@@ -139,7 +141,6 @@ int lte_dl_ue_spec_rx(PHY_VARS_UE *phy_vars_ue,
uint16_t nRB_PDSCH) uint16_t nRB_PDSCH)
{ {
mod_sym_t qpsk[4],nqpsk[4],*qpsk_p,*output_p; mod_sym_t qpsk[4],nqpsk[4],*qpsk_p,*output_p;
int16_t a;
int w,mprime,ind,l,ind_dword,ind_qpsk_symb,nPRB; int w,mprime,ind,l,ind_dword,ind_qpsk_symb,nPRB;
short pamp; short pamp;
...@@ -172,126 +173,123 @@ int lte_dl_ue_spec_rx(PHY_VARS_UE *phy_vars_ue, ...@@ -172,126 +173,123 @@ int lte_dl_ue_spec_rx(PHY_VARS_UE *phy_vars_ue,
output_p = output; output_p = output;
//for (lprime=0; lprime<2; lprime++) { ind = 3*lprime*phy_vars_ue->lte_frame_parms.N_RB_DL;
l = lprime + ((Ns&1)<<1);
ind = 3*lprime*phy_vars_ue->lte_frame_parms.N_RB_DL;
l = lprime + ((Ns&1)<<1);
// loop over pairs of PRBs, this is the periodicity of the W_bar_NCP sequence // loop over pairs of PRBs, this is the periodicity of the W_bar_NCP sequence
// unroll the computations for the 6 pilots, select qpsk or nqpsk as function of W_bar_NCP // unroll the computations for the 6 pilots, select qpsk or nqpsk as function of W_bar_NCP
for (nPRB=0; nPRB<phy_vars_ue->lte_frame_parms.N_RB_DL; nPRB+=2) { for (nPRB=0; nPRB<phy_vars_ue->lte_frame_parms.N_RB_DL; nPRB+=2) {
// First pilot // First pilot
w = Wbar_NCP[p-7][l]; w = Wbar_NCP[p-7][l];
qpsk_p = (w==1) ? qpsk : nqpsk; qpsk_p = (w==1) ? qpsk : nqpsk;
ind_dword = ind>>4; ind_dword = ind>>4;
ind_qpsk_symb = ind&0xf; ind_qpsk_symb = ind&0xf;
*output_p = qpsk_p[(phy_vars_ue->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3]; *output_p = qpsk_p[(phy_vars_ue->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3];
#ifdef DEBUG_DL_UESPEC #ifdef DEBUG_DL_UESPEC
LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n", LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n",
Ns,l,m,ind_dword,ind_qpsk_symb); Ns,l,m,ind_dword,ind_qpsk_symb);
LOG_D(PHY,"index = %d\n",(phy_vars_eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3); LOG_D(PHY,"index = %d\n",(phy_vars_eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3);
#endif #endif
output_p++; output_p++;
ind++; ind++;
w = Wbar_NCP[p-7][3-l]; w = Wbar_NCP[p-7][3-l];
qpsk_p = (w==1) ? qpsk : nqpsk; qpsk_p = (w==1) ? qpsk : nqpsk;
// Second pilot // Second pilot
ind_dword = ind>>4; ind_dword = ind>>4;
ind_qpsk_symb = ind&0xf; ind_qpsk_symb = ind&0xf;
*output_p = qpsk_p[(phy_vars_ue->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3]; *output_p = qpsk_p[(phy_vars_ue->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3];
#ifdef DEBUG_DL_UESPEC #ifdef DEBUG_DL_UESPEC
LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n", LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n",
Ns,l,m,ind_dword,ind_qpsk_symb); Ns,l,m,ind_dword,ind_qpsk_symb);
LOG_D(PHY,"index = %d\n",(phy_vars_ue->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3); LOG_D(PHY,"index = %d\n",(phy_vars_ue->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3);
#endif #endif
output_p++; output_p++;
ind++; ind++;
w = Wbar_NCP[p-7][l]; w = Wbar_NCP[p-7][l];
qpsk_p = (w==1) ? qpsk : nqpsk; qpsk_p = (w==1) ? qpsk : nqpsk;
// Third pilot // Third pilot
ind_dword = ind>>4; ind_dword = ind>>4;
ind_qpsk_symb = ind&0xf; ind_qpsk_symb = ind&0xf;
*output_p = qpsk_p[(phy_vars_ue->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3]; *output_p = qpsk_p[(phy_vars_ue->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3];
#ifdef DEBUG_DL_UESPEC #ifdef DEBUG_DL_UESPEC
LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n", LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n",
Ns,l,m,ind_dword,ind_qpsk_symb); Ns,l,m,ind_dword,ind_qpsk_symb);
LOG_D(PHY,"index = %d\n",(phy_vars_eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3); LOG_D(PHY,"index = %d\n",(phy_vars_eNB->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3);
#endif #endif
output_p++; output_p++;
ind++; ind++;
// Fourth pilot // Fourth pilot
w = Wbar_NCP[p-7][3-l]; w = Wbar_NCP[p-7][3-l];
qpsk_p = (w==1) ? qpsk : nqpsk; qpsk_p = (w==1) ? qpsk : nqpsk;
ind_dword = ind>>4; ind_dword = ind>>4;
ind_qpsk_symb = ind&0xf; ind_qpsk_symb = ind&0xf;
*output_p = qpsk_p[(phy_vars_ue->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3]; *output_p = qpsk_p[(phy_vars_ue->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3];
#ifdef DEBUG_DL_UESPEC #ifdef DEBUG_DL_UESPEC
LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n", LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n",
Ns,l,m,ind_dword,ind_qpsk_symb); Ns,l,m,ind_dword,ind_qpsk_symb);
LOG_D(PHY,"index = %d\n",(phy_vars_ue->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3); LOG_D(PHY,"index = %d\n",(phy_vars_ue->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3);
#endif #endif
output_p++; output_p++;
ind++; ind++;
w = Wbar_NCP[p-7][l]; w = Wbar_NCP[p-7][l];
qpsk_p = (w==1) ? qpsk : nqpsk; qpsk_p = (w==1) ? qpsk : nqpsk;
// Fifth pilot // Fifth pilot
ind_dword = ind>>4; ind_dword = ind>>4;
ind_qpsk_symb = ind&0xf; ind_qpsk_symb = ind&0xf;
*output_p = qpsk_p[(phy_vars_ue->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3]; *output_p = qpsk_p[(phy_vars_ue->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3];
#ifdef DEBUG_DL_UESPEC #ifdef DEBUG_DL_UESPEC
LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n", LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n",
Ns,l,m,ind_dword,ind_qpsk_symb); Ns,l,m,ind_dword,ind_qpsk_symb);
LOG_D(PHY,"index = %d\n",(phy_vars_ue->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3); LOG_D(PHY,"index = %d\n",(phy_vars_ue->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3);
#endif #endif
output_p++; output_p++;
ind++; ind++;
w = Wbar_NCP[p-7][3-l]; w = Wbar_NCP[p-7][3-l];
qpsk_p = (w==1) ? qpsk : nqpsk; qpsk_p = (w==1) ? qpsk : nqpsk;
// Sixth pilot // Sixth pilot
ind_dword = ind>>4; ind_dword = ind>>4;
ind_qpsk_symb = ind&0xf; ind_qpsk_symb = ind&0xf;
*output_p = qpsk_p[(phy_vars_ue->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3]; *output_p = qpsk_p[(phy_vars_ue->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3];
#ifdef DEBUG_DL_UESPEC #ifdef DEBUG_DL_UESPEC
LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n", LOG_D(PHY,"Ns %d, l %d, m %d,ind_dword %d, ind_qpsk_symbol %d\n",
Ns,l,m,ind_dword,ind_qpsk_symb); Ns,l,m,ind_dword,ind_qpsk_symb);
LOG_D(PHY,"index = %d\n",(phy_vars_ue->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3); LOG_D(PHY,"index = %d\n",(phy_vars_ue->lte_gold_uespec_table[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3);
#endif #endif
output_p++; output_p++;
ind++; ind++;
} }
// }
} else { } else {
LOG_E(PHY,"Special subframe not supported for UE specific pilots yet\n"); LOG_E(PHY,"Special subframe not supported for UE specific pilots yet\n");
} }
...@@ -301,7 +299,6 @@ int lte_dl_ue_spec_rx(PHY_VARS_UE *phy_vars_ue, ...@@ -301,7 +299,6 @@ int lte_dl_ue_spec_rx(PHY_VARS_UE *phy_vars_ue,
output_p = output; output_p = output;
if (phy_vars_ue->lte_frame_parms.Ncp == NORMAL) { if (phy_vars_ue->lte_frame_parms.Ncp == NORMAL) {
//for (lprime=0;lprime<4;lprime++) {
for (mprime=0;mprime<3*nRB_PDSCH;mprime++) { for (mprime=0;mprime<3*nRB_PDSCH;mprime++) {
ind = 3*lprime*nRB_PDSCH+mprime; ind = 3*lprime*nRB_PDSCH+mprime;
...@@ -310,10 +307,9 @@ int lte_dl_ue_spec_rx(PHY_VARS_UE *phy_vars_ue, ...@@ -310,10 +307,9 @@ int lte_dl_ue_spec_rx(PHY_VARS_UE *phy_vars_ue,
*output_p = qpsk[(phy_vars_ue->lte_gold_uespec_port5_table[Ns][ind_dword]>>(2*ind_qpsk_symb))&3]; *output_p = qpsk[(phy_vars_ue->lte_gold_uespec_port5_table[Ns][ind_dword]>>(2*ind_qpsk_symb))&3];
//printf("lprime=%d,ind=%d,Ns=%d,output_p=(%d,%d)\n",lprime,ind,Ns,((short *)&output_p[0])[0],((short *)&output_p[0])[1]); //printf("lprime=%d,ind=%d,Ns=%d,output_p=(%d,%d)\n",lprime,ind,Ns,((short *)&output_p[0])[0],((short *)&output_p[0])[1]);
*output_p++; output_p++;
} }
// }
} }
} }
} else { } else {
......
...@@ -145,30 +145,27 @@ void lte_gold_ue_spec(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_uespec_t ...@@ -145,30 +145,27 @@ void lte_gold_ue_spec(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_uespec_t
void lte_gold_ue_spec_port5(uint32_t lte_gold_uespec_port5_table[20][38],uint16_t Nid_cell, uint16_t n_rnti) void lte_gold_ue_spec_port5(uint32_t lte_gold_uespec_port5_table[20][38],uint16_t Nid_cell, uint16_t n_rnti)
{ {
unsigned char ns,l; unsigned char ns;
unsigned int n,x1,x2; unsigned int n,x1,x2;
for (ns=0; ns<20; ns++) { for (ns=0; ns<20; ns++) {
//for (l=0; l<2; l++) {
x2 = ((((ns>>1)+1)*((Nid_cell<<1)+1))<<16) + n_rnti; x2 = ((((ns>>1)+1)*((Nid_cell<<1)+1))<<16) + n_rnti;
//x2 = frame_parms->Ncp + (Nid_cell<<1) + (1+(Nid_cell<<1))*(1 + (3*l) + (7*(1+ns))); //cinit //x2 = frame_parms->Ncp + (Nid_cell<<1) + (1+(Nid_cell<<1))*(1 + (3*l) + (7*(1+ns))); //cinit
//n = 0 //n = 0
// printf("cinit (ns %d, l %d) => %d\n",ns,l,x2); //printf("cinit (ns %d, l %d) => %d\n",ns,l,x2);
x1 = 1+ (1<<31); x1 = 1+ (1<<31);
x2=x2 ^ ((x2 ^ (x2>>1) ^ (x2>>2) ^ (x2>>3))<<31); x2=x2 ^ ((x2 ^ (x2>>1) ^ (x2>>2) ^ (x2>>3))<<31);
// skip first 50 double words (1600 bits) //skip first 50 double words (1600 bits)
//printf("n=0 : x1 %x, x2 %x\n",x1,x2); //printf("n=0 : x1 %x, x2 %x\n",x1,x2);
for (n=1; n<50; n++) { for (n=1; n<50; n++) {
x1 = (x1>>1) ^ (x1>>4); x1 = (x1>>1) ^ (x1>>4);
x1 = x1 ^ (x1<<31) ^ (x1<<28); x1 = x1 ^ (x1<<31) ^ (x1<<28);
x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4); x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4);
x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28); x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28);
// printf("x1 : %x, x2 : %x\n",x1,x2); //printf("x1 : %x, x2 : %x\n",x1,x2);
} }
for (n=0; n<38; n++) { for (n=0; n<38; n++) {
...@@ -177,10 +174,9 @@ void lte_gold_ue_spec_port5(uint32_t lte_gold_uespec_port5_table[20][38],uint16_ ...@@ -177,10 +174,9 @@ void lte_gold_ue_spec_port5(uint32_t lte_gold_uespec_port5_table[20][38],uint16_
x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4); x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4);
x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28); x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28);
lte_gold_uespec_port5_table[ns][n] = x1^x2; lte_gold_uespec_port5_table[ns][n] = x1^x2;
// printf("n=%d : c %x\n",n,x1^x2); //printf("n=%d : c %x\n",n,x1^x2);
} }
// }
} }
} }
......
...@@ -259,7 +259,7 @@ int dlsch_encoding(unsigned char *a, ...@@ -259,7 +259,7 @@ int dlsch_encoding(unsigned char *a,
unsigned char mod_order; unsigned char mod_order;
unsigned int Kr=0,Kr_bytes,r,r_offset=0; unsigned int Kr=0,Kr_bytes,r,r_offset=0;
unsigned short m=dlsch->harq_processes[harq_pid]->mcs; unsigned short m=dlsch->harq_processes[harq_pid]->mcs;
uint8_t transmission_mode_7to9=0; uint8_t beamforming_mode=0;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ENCODING, VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ENCODING, VCD_FUNCTION_IN);
...@@ -268,12 +268,12 @@ int dlsch_encoding(unsigned char *a, ...@@ -268,12 +268,12 @@ int dlsch_encoding(unsigned char *a,
mod_order = get_Qm(dlsch->harq_processes[harq_pid]->mcs); mod_order = get_Qm(dlsch->harq_processes[harq_pid]->mcs);
if(dlsch->harq_processes[harq_pid]->mimo_mode == TM7) if(dlsch->harq_processes[harq_pid]->mimo_mode == TM7)
transmission_mode_7to9 = 7; beamforming_mode = 7;
else if(dlsch->harq_processes[harq_pid]->mimo_mode == TM8) else if(dlsch->harq_processes[harq_pid]->mimo_mode == TM8)
transmission_mode_7to9 = 8; beamforming_mode = 8;
else if(dlsch->harq_processes[harq_pid]->mimo_mode == TM9_10) else if(dlsch->harq_processes[harq_pid]->mimo_mode == TM9_10)
transmission_mode_7to9 = 9; beamforming_mode = 9;
G = get_G(frame_parms,nb_rb,dlsch->harq_processes[harq_pid]->rb_alloc,mod_order,dlsch->harq_processes[harq_pid]->Nl,num_pdcch_symbols,frame,subframe,transmission_mode_7to9); G = get_G(frame_parms,nb_rb,dlsch->harq_processes[harq_pid]->rb_alloc,mod_order,dlsch->harq_processes[harq_pid]->Nl,num_pdcch_symbols,frame,subframe,beamforming_mode);
// if (dlsch->harq_processes[harq_pid]->Ndi == 1) { // this is a new packet // if (dlsch->harq_processes[harq_pid]->Ndi == 1) { // this is a new packet
......
...@@ -338,8 +338,6 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue, ...@@ -338,8 +338,6 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
aarx = frame_parms->nb_antennas_rx; aarx = frame_parms->nb_antennas_rx;
if (dlsch0_harq->mimo_mode<LARGE_CDD) {// SISO or ALAMOUTI if (dlsch0_harq->mimo_mode<LARGE_CDD) {// SISO or ALAMOUTI
printf("dlsch compensation: symbol %d, dl_estimates_ext[0][300] %d \n",symbol, *(short*)&lte_ue_pdsch_vars[eNB_id]->dl_ch_estimates_ext[0][300]);
printf("dlsch compensation: symbol %d, dl_estimates_ext[0][2400] %d \n",symbol, lte_ue_pdsch_vars[eNB_id]->dl_ch_estimates_ext[0][2400]);
dlsch_channel_compensation(lte_ue_pdsch_vars[eNB_id]->rxdataF_ext, dlsch_channel_compensation(lte_ue_pdsch_vars[eNB_id]->rxdataF_ext,
lte_ue_pdsch_vars[eNB_id]->dl_ch_estimates_ext, lte_ue_pdsch_vars[eNB_id]->dl_ch_estimates_ext,
...@@ -557,8 +555,6 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue, ...@@ -557,8 +555,6 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
1); 1);
} }
} else if (dlsch0_harq->mimo_mode==TM7) { //TM7