Commit 5f10dfa3 authored by Sakthivel Velumani's avatar Sakthivel Velumani

Code cleanup and documentation

parent 6acad6ff
...@@ -40,8 +40,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ...@@ -40,8 +40,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
int pilot[1320] __attribute__((aligned(16))); int pilot[1320] __attribute__((aligned(16)));
unsigned char aarx; unsigned char aarx;
unsigned short k; unsigned short k;
unsigned int pilot_cnt; int16_t ch[10],*pil,*rxF,*ul_ch;
int16_t ch[10],*pil,*rxF,*ul_ch,*fl,*fm,*fr,*fml,*fmr,*fmm;
int ch_offset,symbol_offset, length_dmrs, UE_id = 0; int ch_offset,symbol_offset, length_dmrs, UE_id = 0;
unsigned short n_idDMRS[2] = {0,1}; //to update from pusch config unsigned short n_idDMRS[2] = {0,1}; //to update from pusch config
int32_t temp_in_ifft_0[8192*2] __attribute__((aligned(16))); int32_t temp_in_ifft_0[8192*2] __attribute__((aligned(16)));
...@@ -68,36 +67,11 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ...@@ -68,36 +67,11 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
k = bwp_start_subcarrier; k = bwp_start_subcarrier;
int re_offset = k; int re_offset = k;
/*
#ifdef DEBUG_CH #ifdef DEBUG_CH
printf("PUSCH Channel Estimation : gNB_offset %d ch_offset %d, symbol_offset %d OFDM size %d, Ncp=%d, l=%d, Ns=%d, k=%d symbol %d\n", gNB_offset,ch_offset,symbol_offset,gNB->frame_parms.ofdm_symbol_size, printf("PUSCH Channel Estimation : gNB_offset %d ch_offset %d, symbol_offset %d OFDM size %d, Ncp=%d, l=%d, Ns=%d, k=%d symbol %d\n", gNB_offset,ch_offset,symbol_offset,gNB->frame_parms.ofdm_symbol_size,
gNB->frame_parms.Ncp,l,Ns,k, symbol); gNB->frame_parms.Ncp,l,Ns,k, symbol);
#endif #endif
*/
switch (nushift) {
case 0:
fl = filt8_l0;
fm = filt8_m0;
fr = filt8_r0;
fmm = filt8_mm0;
fml = filt8_m0;
fmr = filt8_mr0;
break;
case 1:
fl = filt8_l1;
fm = filt8_m1;
fr = filt8_r1;
fmm = filt8_mm1;
fml = filt8_ml1;
fmr = filt8_m1;
break;
default:
printf("pusch_channel_estimation: nushift=%d -> ERROR\n",nushift);
return(-1);
break;
}
//------------------generate DMRS------------------// //------------------generate DMRS------------------//
...@@ -250,16 +224,3 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB, ...@@ -250,16 +224,3 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
return(0); return(0);
} }
/*void simple_lerp(int16_t *in, int16_t *out)
{
__m128i est, sign;
__m128i *x0 = (__m128i*)in;
__m128i *x1 = (__m128i*)(in+2);
__m128i *y = (__m128i*)out;
est = _mm_add_epi16 (*x0, *x1);
sign = _mm_and_si128(est, _mm_set1_epi16(0x8000));
est = _mm_or_si128(_mm_srli_epi16(est, 1), sign);
y[0] = _mm_unpacklo_epi32(*x0, est);
y[1] = _mm_unpackhi_epi32(*x0, est);
}*/
...@@ -666,8 +666,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -666,8 +666,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
int pilot[3276] __attribute__((aligned(16))); int pilot[3276] __attribute__((aligned(16)));
unsigned char aarx; unsigned char aarx;
unsigned short k; unsigned short k;
unsigned int pilot_cnt; int16_t ch[10],*pil,*rxF,*dl_ch;
int16_t ch[10],*pil,*rxF,*dl_ch,*fl,*fm,*fr,*fml,*fmr,*fmm;
int ch_offset,symbol_offset; int ch_offset,symbol_offset;
//uint16_t Nid_cell = (eNB_offset == 0) ? ue->frame_parms.Nid_cell : ue->measurements.adj_cell_id[eNB_offset-1]; //uint16_t Nid_cell = (eNB_offset == 0) ? ue->frame_parms.Nid_cell : ue->measurements.adj_cell_id[eNB_offset-1];
...@@ -694,31 +693,6 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue, ...@@ -694,31 +693,6 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
ue->frame_parms.Ncp,Ns,k, symbol); ue->frame_parms.Ncp,Ns,k, symbol);
#endif #endif
switch (nushift) {
case 0:
fl = filt8_l0;
fm = filt8_m0;
fr = filt8_r0;
fmm = filt8_mm0;
fml = filt8_m0;
fmr = filt8_mr0;
break;
case 1:
fl = filt8_l1;
fm = filt8_m1;
fr = filt8_r1;
fmm = filt8_mm1;
fml = filt8_ml1;
fmr = filt8_m1;
break;
default:
msg("pdsch_channel_estimation: nushift=%d -> ERROR\n",nushift);
return(-1);
break;
}
// generate pilot // generate pilot
uint16_t rb_offset = (bwp_start_subcarrier - ue->frame_parms.first_carrier_offset) / 12; uint16_t rb_offset = (bwp_start_subcarrier - ue->frame_parms.first_carrier_offset) / 12;
......
...@@ -509,7 +509,6 @@ void simple_lerp(int16_t *in, ...@@ -509,7 +509,6 @@ void simple_lerp(int16_t *in,
simd_q15_t *x1 = (__m128i*)(in+2); simd_q15_t *x1 = (__m128i*)(in+2);
simd_q15_t *y = (__m128i*)out; simd_q15_t *y = (__m128i*)out;
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
est = _mm_add_epi16 (*x0, *x1); est = _mm_add_epi16 (*x0, *x1);
sign = _mm_and_si128(est, _mm_set1_epi16(0x8000)); sign = _mm_and_si128(est, _mm_set1_epi16(0x8000));
......
...@@ -87,6 +87,16 @@ void multadd_complex_vector_real_scalar(int16_t *x, ...@@ -87,6 +87,16 @@ void multadd_complex_vector_real_scalar(int16_t *x,
uint8_t zero_flag, uint8_t zero_flag,
uint32_t N); uint32_t N);
/*!\fn void simple_lerp(int16_t* in,int16_t* out)
This function performs linear interpolation on a vector of 5 complex samples. The output vector contais 8 complex samples consisting of the first 4 samples from input and 4 estimated samples.
@param in Input vector of 5 complex samples or 10 integers(real and img).
@param out Output vector of first 4 input samples and 4 estimated samples.
The function implemented is : \f$\mathbf{y_1} = (mathbf{y_0} + mathbf{y_2}) / 2\f$
*/
void simple_lerp(int16_t *in,
int16_t *out);
int rotate_cpx_vector(int16_t *x, int rotate_cpx_vector(int16_t *x,
int16_t *alpha, int16_t *alpha,
int16_t *y, int16_t *y,
......
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