merge functions conj(a)*b and a*conj(b)

This commit is contained in:
Laurent THOMAS
2025-04-25 14:47:59 +02:00
parent bb93b06663
commit fefb96a115
13 changed files with 70 additions and 144 deletions
+11 -11
View File
@@ -128,10 +128,10 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
for (re = 0; re<256/4; re++) { // loop over 256 points of upsampled PSS
simde__m128i s = sp2[re];
autocorr0[re256] = oai_mm_cpx_mult_conjb(((simde__m128i *)pss6144_0)[re], s, 15);
autocorr1[re256] = oai_mm_cpx_mult_conjb(((simde__m128i *)pss6144_1)[re], s, 15);
autocorr2[re256] = oai_mm_cpx_mult_conjb(((simde__m128i *)pss6144_2)[re], s, 15);
autocorr0[re256] = oai_mm_cpx_mult_conj(s, ((simde__m128i *)pss6144_0)[re], 15);
autocorr1[re256] = oai_mm_cpx_mult_conj(s, ((simde__m128i *)pss6144_1)[re], 15);
autocorr2[re256] = oai_mm_cpx_mult_conj(s, ((simde__m128i *)pss6144_2)[re], 15);
re256 = (re256+1)&0x3f;
}
} else { // Split around DC, this is the negative frequencies
@@ -172,10 +172,10 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
for (re = 0; re<(-f+3)/4; re++) { // loop over 256 points of upsampled PSS
simde__m128i s = sp2[re];
autocorr0[re256] = oai_mm_cpx_mult_conjb(((simde__m128i *)pss6144_0)[re], s, 15);
autocorr1[re256] = oai_mm_cpx_mult_conjb(((simde__m128i *)pss6144_1)[re], s, 15);
autocorr2[re256] = oai_mm_cpx_mult_conjb(((simde__m128i *)pss6144_2)[re], s, 15);
autocorr0[re256] = oai_mm_cpx_mult_conj(s, ((simde__m128i *)pss6144_0)[re], 15);
autocorr1[re256] = oai_mm_cpx_mult_conj(s, ((simde__m128i *)pss6144_1)[re], 15);
autocorr2[re256] = oai_mm_cpx_mult_conj(s, ((simde__m128i *)pss6144_2)[re], 15);
re256 = (re256+1)&0x3f;
}
@@ -212,9 +212,9 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
for (re = 0; re<(256+f)/4; re++) { // loop over 256 points of upsampled PSS
simde__m128i s = sp2[re];
autocorr0[re256] = oai_mm_cpx_mult_conjb(((simde__m128i *)pss6144_0)[re], s, 15);
autocorr1[re256] = oai_mm_cpx_mult_conjb(((simde__m128i *)pss6144_1)[re], s, 15);
autocorr2[re256] = oai_mm_cpx_mult_conjb(((simde__m128i *)pss6144_2)[re], s, 15);
autocorr0[re256] = oai_mm_cpx_mult_conj(s, ((simde__m128i *)pss6144_0)[re], 15);
autocorr1[re256] = oai_mm_cpx_mult_conj(s, ((simde__m128i *)pss6144_1)[re], 15);
autocorr2[re256] = oai_mm_cpx_mult_conj(s, ((simde__m128i *)pss6144_2)[re], 15);
re256 = (re256+1)&0x3f;
}
@@ -467,7 +467,7 @@ void conjch0_mult_ch1(int *ch0,
for (unsigned short rb=0; rb<3*nb_rb; rb++) {
ch0conj_ch1_128[rb] = oai_mm_cpx_mult_conja(dl_ch0_128[rb], dl_ch1_128[rb], output_shift0);
ch0conj_ch1_128[rb] = oai_mm_cpx_mult_conj(dl_ch0_128[rb], dl_ch1_128[rb], output_shift0);
#ifdef DEBUG_RANK_EST
printf("\n Computing conjugates \n");
@@ -142,7 +142,7 @@ int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
ul_ref128 = (simde__m128i *)ul_ref_sigs_rx[u][v][Msc_RS_idx];
for (i = 0; i < Msc_RS >> 2; i++) {
ul_ch128[i] = oai_mm_cpx_mult_conja(ul_ref128[i], rxdataF128[i], 15);
ul_ch128[i] = oai_mm_cpx_mult_conj(ul_ref128[i], rxdataF128[i], 15);
}
alpha_ind = 0;
@@ -370,7 +370,7 @@ int32_t lte_ul_channel_estimation_RRU(LTE_DL_FRAME_PARMS *frame_parms,
ul_ref128 = (simde__m128i *)ul_ref_sigs_rx[u][v][Msc_RS_idx];
for (i = 0; i < Msc_RS >> 2; i++) {
ul_ch128[i] = oai_mm_cpx_mult_conja(ul_ref128[i], rxdataF128[i], 15);
ul_ch128[i] = oai_mm_cpx_mult_conj(ul_ref128[i], rxdataF128[i], 15);
}
alpha_ind = 0;
@@ -659,9 +659,9 @@ int16_t lte_ul_freq_offset_estimation(LTE_DL_FRAME_PARMS *frame_parms, int32_t *
// correlate and average the 2 channel estimates ul_ch1*ul_ch2
for (int rb=0; rb<nb_rb; rb++) {
simde__m128i R[3];
R[0] = oai_mm_cpx_mult_conja(ul_ch1[0], ul_ch2[0], output_shift);
R[1] = oai_mm_cpx_mult_conja(ul_ch1[1], ul_ch2[1], output_shift);
R[2] = oai_mm_cpx_mult_conja(ul_ch1[2], ul_ch2[2], output_shift);
R[0] = oai_mm_cpx_mult_conj(ul_ch1[0], ul_ch2[0], output_shift);
R[1] = oai_mm_cpx_mult_conj(ul_ch1[1], ul_ch2[1], output_shift);
R[2] = oai_mm_cpx_mult_conj(ul_ch1[2], ul_ch2[2], output_shift);
// Horizontal add
R[0] = simde_mm_add_epi16(simde_mm_srai_epi16(R[0], 1), simde_mm_srai_epi16(R[1], 1));