Commit 843e9cf0 authored by Sakthi's avatar Sakthi

updated lerp channel estimation

nulled estimates at DC
parent 75a5e5f3
......@@ -749,16 +749,23 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
for (uint8_t idxPil=0; idxPil<10; idxPil+=2 ) {
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
ch[idxPil] = (int16_t)(((int32_t)pil[idx8Sym*8+idxPil]*rxF[0] - (int32_t)pil[idx8Sym*idxPil+1]*rxF[1])>>15);
ch[idxPil+1] = (int16_t)(((int32_t)pil[idx8Sym*8+idxPil]*rxF[1] + (int32_t)pil[idx8Sym*idxPil+1]*rxF[0])>>15);
ch[idxPil] = (int16_t)(((int32_t)pil[idx8Sym*8+idxPil]*rxF[0] - (int32_t)pil[idx8Sym*8+idxPil+1]*rxF[1])>>15);
ch[idxPil+1] = (int16_t)(((int32_t)pil[idx8Sym*8+idxPil]*rxF[1] + (int32_t)pil[idx8Sym*8+idxPil+1]*rxF[0])>>15);
// Nulling estimates at DC
if (re_offset == 0) {
ch[idxPil] = 0;
ch[idxPil+1] = 0;
}
re_offset = (re_offset+2)&(ue->frame_parms.ofdm_symbol_size-1);
}
simple_lerp(ch, dl_ch);
#ifdef DEBUG_PDSCH
for(uint8_t i=0; i<16; i++) {
printf("%d\t",dl_ch[i]);
}
printf("\n");
#endif
dl_ch += 16;
re_offset = (re_offset-2)&(ue->frame_parms.ofdm_symbol_size-1);
}
......@@ -770,6 +777,11 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
ch[idxPil] = (int16_t)(((int32_t)pil[used_pils+idxPil]*rxF[0] - (int32_t)pil[used_pils*idxPil+1]*rxF[1])>>15);
ch[idxPil+1] = (int16_t)(((int32_t)pil[used_pils+idxPil]*rxF[1] + (int32_t)pil[used_pils*idxPil+1]*rxF[0])>>15);
// Nulling estimates at DC
if (re_offset == 0) {
ch[idxPil] = 0;
ch[idxPil+1] = 0;
}
re_offset = (re_offset+2)&(ue->frame_parms.ofdm_symbol_size-1);
}
......@@ -788,16 +800,14 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
void simple_lerp(int16_t *in, int16_t *out)
{
__m128i est, sum, sign;
__m128i est, sign;
__m128i *x0 = (__m128i*)in;
__m128i *x1 = (__m128i*)(in+2);
__m128i *y = (__m128i*)out;
est = _mm_add_epi16 (*x0, *x1);
//sum = _mm_and_si128(est, _mm_set1_epi16(0x7FFF));
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);
}
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