Commit b44c49bc authored by Florian Kaltenberger's avatar Florian Kaltenberger

adjusting power levels in alamouti receiver and dlsim. now TM2 dlsim tests pass again.

Conflicts:
	openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c
	openair1/PHY/impl_defs_top.h
parent e0b8998d
...@@ -3817,14 +3817,15 @@ void dlsch_alamouti(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -3817,14 +3817,15 @@ void dlsch_alamouti(LTE_DL_FRAME_PARMS *frame_parms,
#if defined(__x86_64__)||defined(__i386__) #if defined(__x86_64__)||defined(__i386__)
short *rxF0,*rxF1; short *rxF0,*rxF1;
__m128i *ch_mag0,*ch_mag1,*ch_mag0b,*ch_mag1b, amp, *rxF0_128; __m128i *ch_mag0,*ch_mag1,*ch_mag0b,*ch_mag1b, *rxF0_128;
unsigned char rb,re; unsigned char rb,re;
int jj = (symbol*frame_parms->N_RB_DL*12); int jj = (symbol*frame_parms->N_RB_DL*12);
uint8_t symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol; uint8_t symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
uint8_t pilots = ((symbol_mod==0)||(symbol_mod==(4-frame_parms->Ncp))) ? 1 : 0; uint8_t pilots = ((symbol_mod==0)||(symbol_mod==(4-frame_parms->Ncp))) ? 1 : 0;
rxF0_128 = (__m128i*) &rxdataF_comp[0][jj]; rxF0_128 = (__m128i*) &rxdataF_comp[0][jj];
amp = _mm_set1_epi16(ONE_OVER_SQRT2_Q15); //amp = _mm_set1_epi16(ONE_OVER_SQRT2_Q15);
//amp = _mm_set1_epi16(ONE_OVER_2_Q15);
// printf("Doing alamouti!\n"); // printf("Doing alamouti!\n");
rxF0 = (short*)&rxdataF_comp[0][jj]; //tx antenna 0 h0*y rxF0 = (short*)&rxdataF_comp[0][jj]; //tx antenna 0 h0*y
...@@ -3861,6 +3862,7 @@ void dlsch_alamouti(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -3861,6 +3862,7 @@ void dlsch_alamouti(LTE_DL_FRAME_PARMS *frame_parms,
ch_mag0b[1] = _mm_adds_epi16(ch_mag0b[1],ch_mag1b[1]); ch_mag0b[1] = _mm_adds_epi16(ch_mag0b[1],ch_mag1b[1]);
// account for 1/sqrt(2) scaling at transmission // account for 1/sqrt(2) scaling at transmission
/*
ch_mag0[0] = _mm_srai_epi16(ch_mag0[0],1); ch_mag0[0] = _mm_srai_epi16(ch_mag0[0],1);
ch_mag0[1] = _mm_srai_epi16(ch_mag0[1],1); ch_mag0[1] = _mm_srai_epi16(ch_mag0[1],1);
ch_mag0b[0] = _mm_srai_epi16(ch_mag0b[0],1); ch_mag0b[0] = _mm_srai_epi16(ch_mag0b[0],1);
...@@ -3870,16 +3872,19 @@ void dlsch_alamouti(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -3870,16 +3872,19 @@ void dlsch_alamouti(LTE_DL_FRAME_PARMS *frame_parms,
rxF0_128[0] = _mm_slli_epi16(rxF0_128[0],1); rxF0_128[0] = _mm_slli_epi16(rxF0_128[0],1);
rxF0_128[1] = _mm_mulhi_epi16(rxF0_128[1],amp); rxF0_128[1] = _mm_mulhi_epi16(rxF0_128[1],amp);
rxF0_128[1] = _mm_slli_epi16(rxF0_128[1],1); rxF0_128[1] = _mm_slli_epi16(rxF0_128[1],1);
*/
if (pilots==0) { if (pilots==0) {
ch_mag0[2] = _mm_adds_epi16(ch_mag0[2],ch_mag1[2]); ch_mag0[2] = _mm_adds_epi16(ch_mag0[2],ch_mag1[2]);
ch_mag0b[2] = _mm_adds_epi16(ch_mag0b[2],ch_mag1b[2]); ch_mag0b[2] = _mm_adds_epi16(ch_mag0b[2],ch_mag1b[2]);
/*
ch_mag0[2] = _mm_srai_epi16(ch_mag0[2],1); ch_mag0[2] = _mm_srai_epi16(ch_mag0[2],1);
ch_mag0b[2] = _mm_srai_epi16(ch_mag0b[2],1); ch_mag0b[2] = _mm_srai_epi16(ch_mag0b[2],1);
rxF0_128[2] = _mm_mulhi_epi16(rxF0_128[2],amp); rxF0_128[2] = _mm_mulhi_epi16(rxF0_128[2],amp);
rxF0_128[2] = _mm_slli_epi16(rxF0_128[2],1); rxF0_128[2] = _mm_slli_epi16(rxF0_128[2],1);
*/
ch_mag0+=3; ch_mag0+=3;
ch_mag1+=3; ch_mag1+=3;
......
...@@ -233,8 +233,9 @@ void DL_channel(PHY_VARS_eNB *eNB,PHY_VARS_UE *UE,int subframe,int awgn_flag,dou ...@@ -233,8 +233,9 @@ void DL_channel(PHY_VARS_eNB *eNB,PHY_VARS_UE *UE,int subframe,int awgn_flag,dou
} }
//AWGN //AWGN
// This is the SNR on the PDSCH for OFDM symbols without pilots -> rho_A // tx_lev is the average energy over the whole subframe
sigma2_dB = 10*log10((double)tx_lev) +10*log10((double)eNB->frame_parms.ofdm_symbol_size/(double)(eNB->frame_parms.N_RB_DL*12)) - SNR - get_pa_dB(eNB->pdsch_config_dedicated); // but SNR should be better defined wrt the energy in the reference symbols
sigma2_dB = 10*log10((double)tx_lev) +10*log10((double)eNB->frame_parms.ofdm_symbol_size/(double)(eNB->frame_parms.N_RB_DL*12)) - SNR;
sigma2 = pow(10,sigma2_dB/10); sigma2 = pow(10,sigma2_dB/10);
for (i=0; i<2*UE->frame_parms.samples_per_tti; i++) { for (i=0; i<2*UE->frame_parms.samples_per_tti; i++) {
......
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