Commit 4649034b authored by frtabu's avatar frtabu

create dft shared lib

parent b630a983
...@@ -1330,6 +1330,9 @@ add_library(ldpc MODULE ${PHY_LDPC_OPTIM8SEGMULTI_SRC} ) ...@@ -1330,6 +1330,9 @@ add_library(ldpc MODULE ${PHY_LDPC_OPTIM8SEGMULTI_SRC} )
add_library(coding MODULE ${PHY_TURBOSRC} ) add_library(coding MODULE ${PHY_TURBOSRC} )
add_library(dfts MODULE ${OPENAIR1_DIR}/PHY/TOOLS/oai_dfts.c )
set(PHY_SRC_COMMON set(PHY_SRC_COMMON
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci_tools_common.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci_tools_common.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/lte_mcs.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/lte_mcs.c
...@@ -1370,7 +1373,7 @@ set(PHY_SRC_COMMON ...@@ -1370,7 +1373,7 @@ set(PHY_SRC_COMMON
${OPENAIR1_DIR}/PHY/INIT/lte_parms.c ${OPENAIR1_DIR}/PHY/INIT/lte_parms.c
${OPENAIR1_DIR}/PHY/INIT/lte_param_init.c ${OPENAIR1_DIR}/PHY/INIT/lte_param_init.c
${OPENAIR1_DIR}/PHY/TOOLS/cadd_vv.c ${OPENAIR1_DIR}/PHY/TOOLS/cadd_vv.c
${OPENAIR1_DIR}/PHY/TOOLS/lte_dfts.c # ${OPENAIR1_DIR}/PHY/TOOLS/lte_dfts.c
${OPENAIR1_DIR}/PHY/TOOLS/log2_approx.c ${OPENAIR1_DIR}/PHY/TOOLS/log2_approx.c
${OPENAIR1_DIR}/PHY/TOOLS/cmult_sv.c ${OPENAIR1_DIR}/PHY/TOOLS/cmult_sv.c
${OPENAIR1_DIR}/PHY/TOOLS/cmult_vv.c ${OPENAIR1_DIR}/PHY/TOOLS/cmult_vv.c
...@@ -1585,6 +1588,7 @@ endif () ...@@ -1585,6 +1588,7 @@ endif ()
add_library(PHY_COMMON ${PHY_SRC_COMMON}) add_library(PHY_COMMON ${PHY_SRC_COMMON})
add_dependencies(PHY_COMMON rrc_flag) add_dependencies(PHY_COMMON rrc_flag)
add_dependencies(PHY_COMMON dfts)
add_library(PHY ${PHY_SRC}) add_library(PHY ${PHY_SRC})
add_dependencies(PHY rrc_flag) add_dependencies(PHY rrc_flag)
add_library(PHY_UE ${PHY_SRC_UE}) add_library(PHY_UE ${PHY_SRC_UE})
......
...@@ -56,22 +56,22 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -56,22 +56,22 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
// do ifft of channel estimate // do ifft of channel estimate
switch(frame_parms->N_RB_DL) { switch(frame_parms->N_RB_DL) {
case 6: case 6:
dft128((int16_t*) &lte_eNB_srs->srs_ch_estimates[aa][0], dft(DFT_128,(int16_t*) &lte_eNB_srs->srs_ch_estimates[aa][0],
(int16_t*) lte_eNB_srs->srs_ch_estimates_time[aa], (int16_t*) lte_eNB_srs->srs_ch_estimates_time[aa],
1); 1);
break; break;
case 25: case 25:
dft512((int16_t*) &lte_eNB_srs->srs_ch_estimates[aa][0], dft(DFT_512,(int16_t*) &lte_eNB_srs->srs_ch_estimates[aa][0],
(int16_t*) lte_eNB_srs->srs_ch_estimates_time[aa], (int16_t*) lte_eNB_srs->srs_ch_estimates_time[aa],
1); 1);
break; break;
case 50: case 50:
dft1024((int16_t*) &lte_eNB_srs->srs_ch_estimates[aa][0], dft(DFT_1024,(int16_t*) &lte_eNB_srs->srs_ch_estimates[aa][0],
(int16_t*) lte_eNB_srs->srs_ch_estimates_time[aa], (int16_t*) lte_eNB_srs->srs_ch_estimates_time[aa],
1); 1);
break; break;
case 100: case 100:
dft2048((int16_t*) &lte_eNB_srs->srs_ch_estimates[aa][0], dft(DFT_2048,(int16_t*) &lte_eNB_srs->srs_ch_estimates[aa][0],
(int16_t*) lte_eNB_srs->srs_ch_estimates_time[aa], (int16_t*) lte_eNB_srs->srs_ch_estimates_time[aa],
1); 1);
break; break;
......
...@@ -141,28 +141,28 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com ...@@ -141,28 +141,28 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com
switch (frame_parms->N_RB_DL) { switch (frame_parms->N_RB_DL) {
case 6: case 6:
idft128((short*)syncF_tmp, /// complex input idft(IDFT_128,(short*)syncF_tmp, /// complex input
(short*)sync_tmp, /// complex output (short*)sync_tmp, /// complex output
1); 1);
break; break;
case 25: case 25:
idft512((short*)syncF_tmp, /// complex input idft(IDFT_512,(short*)syncF_tmp, /// complex input
(short*)sync_tmp, /// complex output (short*)sync_tmp, /// complex output
1); 1);
break; break;
case 50: case 50:
idft1024((short*)syncF_tmp, /// complex input idft(IDFT_1024,(short*)syncF_tmp, /// complex input
(short*)sync_tmp, /// complex output (short*)sync_tmp, /// complex output
1); 1);
break; break;
case 75: case 75:
idft1536((short*)syncF_tmp, /// complex input idft(IDFT_1536,(short*)syncF_tmp, /// complex input
(short*)sync_tmp, (short*)sync_tmp,
1); /// complex output 1); /// complex output
break; break;
case 100: case 100:
idft2048((short*)syncF_tmp, /// complex input idft(IDFT_2048,(short*)syncF_tmp, /// complex input
(short*)sync_tmp, /// complex output (short*)sync_tmp, /// complex output
1); 1);
break; break;
...@@ -189,28 +189,28 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com ...@@ -189,28 +189,28 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com
switch (frame_parms->N_RB_DL) { switch (frame_parms->N_RB_DL) {
case 6: case 6:
idft128((short*)syncF_tmp, /// complex input idft(IDFT_128,(short*)syncF_tmp, /// complex input
(short*)sync_tmp, /// complex output (short*)sync_tmp, /// complex output
1); 1);
break; break;
case 25: case 25:
idft512((short*)syncF_tmp, /// complex input idft(IDFT_512,(short*)syncF_tmp, /// complex input
(short*)sync_tmp, /// complex output (short*)sync_tmp, /// complex output
1); 1);
break; break;
case 50: case 50:
idft1024((short*)syncF_tmp, /// complex input idft(IDFT_1024,(short*)syncF_tmp, /// complex input
(short*)sync_tmp, /// complex output (short*)sync_tmp, /// complex output
1); 1);
break; break;
case 75: case 75:
idft1536((short*)syncF_tmp, /// complex input idft(IDFT_1536,(short*)syncF_tmp, /// complex input
(short*)sync_tmp, /// complex output (short*)sync_tmp, /// complex output
1); 1);
break; break;
case 100: case 100:
idft2048((short*)syncF_tmp, /// complex input idft(IDFT_2048,(short*)syncF_tmp, /// complex input
(short*)sync_tmp, /// complex output (short*)sync_tmp, /// complex output
1); 1);
break; break;
...@@ -237,28 +237,28 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com ...@@ -237,28 +237,28 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com
switch (frame_parms->N_RB_DL) { switch (frame_parms->N_RB_DL) {
case 6: case 6:
idft128((short*)syncF_tmp, /// complex input idft(IDFT_128,(short*)syncF_tmp, /// complex input
(short*)sync_tmp, /// complex output (short*)sync_tmp, /// complex output
1); 1);
break; break;
case 25: case 25:
idft512((short*)syncF_tmp, /// complex input idft(IDFT_512,(short*)syncF_tmp, /// complex input
(short*)sync_tmp, /// complex output (short*)sync_tmp, /// complex output
1); 1);
break; break;
case 50: case 50:
idft1024((short*)syncF_tmp, /// complex input idft(IDFT_1024,(short*)syncF_tmp, /// complex input
(short*)sync_tmp, /// complex output (short*)sync_tmp, /// complex output
1); 1);
break; break;
case 75: case 75:
idft1536((short*)syncF_tmp, /// complex input idft(IDFT_1536,(short*)syncF_tmp, /// complex input
(short*)sync_tmp, /// complex output (short*)sync_tmp, /// complex output
1); 1);
break; break;
case 100: case 100:
idft2048((short*)syncF_tmp, /// complex input idft(IDFT_2048,(short*)syncF_tmp, /// complex input
(short*)sync_tmp, /// complex output (short*)sync_tmp, /// complex output
1); 1);
break; break;
...@@ -492,28 +492,28 @@ int ru_sync_time_init(RU_t *ru) // LTE_UE_COMMON *common_vars ...@@ -492,28 +492,28 @@ int ru_sync_time_init(RU_t *ru) // LTE_UE_COMMON *common_vars
switch (ru->frame_parms->N_RB_DL) { switch (ru->frame_parms->N_RB_DL) {
case 6: case 6:
idft128((int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]), idft(IDFT_128,(int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]),
ru->dmrssync, /// complex output ru->dmrssync, /// complex output
1); 1);
break; break;
case 25: case 25:
idft512((int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]), idft(IDFT_512,(int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]),
ru->dmrssync, /// complex output ru->dmrssync, /// complex output
1); 1);
break; break;
case 50: case 50:
idft1024((int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]), idft(IDFT_1024,(int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]),
ru->dmrssync, /// complex output ru->dmrssync, /// complex output
1); 1);
break; break;
case 75: case 75:
idft1536((int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]), idft(IDFT_1536,(int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]),
ru->dmrssync, ru->dmrssync,
1); /// complex output 1); /// complex output
break; break;
case 100: case 100:
idft2048((int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]), idft(IDFT_2048,(int16_t*)(&dmrsp[0][3*ru->frame_parms->ofdm_symbol_size]),
ru->dmrssync, /// complex output ru->dmrssync, /// complex output
1); 1);
break; break;
......
...@@ -246,25 +246,25 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB, ...@@ -246,25 +246,25 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *eNB,
switch(frame_parms->N_RB_DL) { switch(frame_parms->N_RB_DL) {
case 6: case 6:
idft128((int16_t *) temp_in_ifft_0, idft(IDFT_128,(int16_t *) temp_in_ifft_0,
(int16_t *) ul_ch_estimates_time[aa], (int16_t *) ul_ch_estimates_time[aa],
1); 1);
break; break;
case 25: case 25:
idft512((int16_t *) temp_in_ifft_0, idft(IDFT_512,(int16_t *) temp_in_ifft_0,
(int16_t *) ul_ch_estimates_time[aa], (int16_t *) ul_ch_estimates_time[aa],
1); 1);
break; break;
case 50: case 50:
idft1024((int16_t *) temp_in_ifft_0, idft(IDFT_1024,(int16_t *) temp_in_ifft_0,
(int16_t *) ul_ch_estimates_time[aa], (int16_t *) ul_ch_estimates_time[aa],
1); 1);
break; break;
case 100: case 100:
idft2048((int16_t *) temp_in_ifft_0, idft(IDFT_2048,(int16_t *) temp_in_ifft_0,
(int16_t *) ul_ch_estimates_time[aa], (int16_t *) ul_ch_estimates_time[aa],
1); 1);
break; break;
...@@ -575,25 +575,25 @@ int32_t lte_ul_channel_estimation_RRU(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -575,25 +575,25 @@ int32_t lte_ul_channel_estimation_RRU(LTE_DL_FRAME_PARMS *frame_parms,
switch(frame_parms->N_RB_DL) { switch(frame_parms->N_RB_DL) {
case 6: case 6:
idft128((int16_t *) temp_in_ifft_0, idft(IDFT_128,(int16_t *) temp_in_ifft_0,
(int16_t *) ul_ch_estimates_time[aa], (int16_t *) ul_ch_estimates_time[aa],
1); 1);
break; break;
case 25: case 25:
idft512((int16_t *) temp_in_ifft_0, idft(IDFT_512,(int16_t *) temp_in_ifft_0,
(int16_t *) ul_ch_estimates_time[aa], (int16_t *) ul_ch_estimates_time[aa],
1); 1);
break; break;
case 50: case 50:
idft1024((int16_t *) temp_in_ifft_0, idft(IDFT_1024,(int16_t *) temp_in_ifft_0,
(int16_t *) ul_ch_estimates_time[aa], (int16_t *) ul_ch_estimates_time[aa],
1); 1);
break; break;
case 100: case 100:
idft2048((int16_t *) temp_in_ifft_0, idft(IDFT_2048,(int16_t *) temp_in_ifft_0,
(int16_t *) ul_ch_estimates_time[aa], (int16_t *) ul_ch_estimates_time[aa],
1); 1);
break; break;
......
...@@ -298,24 +298,24 @@ void rx_prach0(PHY_VARS_eNB *eNB, ...@@ -298,24 +298,24 @@ void rx_prach0(PHY_VARS_eNB *eNB,
switch (fp->N_RB_UL) { switch (fp->N_RB_UL) {
case 6: case 6:
if (prach_fmt == 4) { if (prach_fmt == 4) {
dft256(prach2,rxsigF[aa],1); dft(DFT_256,prach2,rxsigF[aa],1);
} else { } else {
dft1536(prach2,rxsigF[aa],1); dft(DFT_1536,prach2,rxsigF[aa],1);
if (prach_fmt>1) if (prach_fmt>1)
dft1536(prach2+3072,rxsigF[aa]+3072,1); dft(DFT_1536,prach2+3072,rxsigF[aa]+3072,1);
} }
break; break;
case 15: case 15:
if (prach_fmt == 4) { if (prach_fmt == 4) {
dft256(prach2,rxsigF[aa],1); dft(DFT_256,prach2,rxsigF[aa],1);
} else { } else {
dft3072(prach2,rxsigF[aa],1); dft(DFT_3072,prach2,rxsigF[aa],1);
if (prach_fmt>1) if (prach_fmt>1)
dft3072(prach2+6144,rxsigF[aa]+6144,1); dft(DFT_3072,prach2+6144,rxsigF[aa]+6144,1);
} }
break; break;
...@@ -323,13 +323,13 @@ void rx_prach0(PHY_VARS_eNB *eNB, ...@@ -323,13 +323,13 @@ void rx_prach0(PHY_VARS_eNB *eNB,
case 25: case 25:
default: default:
if (prach_fmt == 4) { if (prach_fmt == 4) {
dft1024(prach2,rxsigF[aa],1); dft(DFT_1024,prach2,rxsigF[aa],1);
fft_size = 1024; fft_size = 1024;
} else { } else {
dft6144(prach2,rxsigF[aa],1); dft(DFT_6144,prach2,rxsigF[aa],1);
if (prach_fmt>1) if (prach_fmt>1)
dft6144(prach2+12288,rxsigF[aa]+12288,1); dft(DFT_6144,prach2+12288,rxsigF[aa]+12288,1);
fft_size = 6144; fft_size = 6144;
} }
...@@ -338,24 +338,24 @@ void rx_prach0(PHY_VARS_eNB *eNB, ...@@ -338,24 +338,24 @@ void rx_prach0(PHY_VARS_eNB *eNB,
case 50: case 50:
if (prach_fmt == 4) { if (prach_fmt == 4) {
dft2048(prach2,rxsigF[aa],1); dft(DFT_2048,prach2,rxsigF[aa],1);
} else { } else {
dft12288(prach2,rxsigF[aa],1); dft(DFT_12288,prach2,rxsigF[aa],1);
if (prach_fmt>1) if (prach_fmt>1)
dft12288(prach2+24576,rxsigF[aa]+24576,1); dft(DFT_12288,prach2+24576,rxsigF[aa]+24576,1);
} }
break; break;
case 75: case 75:
if (prach_fmt == 4) { if (prach_fmt == 4) {
dft3072(prach2,rxsigF[aa],1); dft(DFT_3072,prach2,rxsigF[aa],1);
} else { } else {
dft18432(prach2,rxsigF[aa],1); dft(DFT_18432,prach2,rxsigF[aa],1);
if (prach_fmt>1) if (prach_fmt>1)
dft18432(prach2+36864,rxsigF[aa]+36864,1); dft(DFT_18432,prach2+36864,rxsigF[aa]+36864,1);
} }
break; break;
...@@ -363,21 +363,21 @@ void rx_prach0(PHY_VARS_eNB *eNB, ...@@ -363,21 +363,21 @@ void rx_prach0(PHY_VARS_eNB *eNB,
case 100: case 100:
if (fp->threequarter_fs==0) { if (fp->threequarter_fs==0) {
if (prach_fmt == 4) { if (prach_fmt == 4) {
dft4096(prach2,rxsigF[aa],1); dft(DFT_4096,prach2,rxsigF[aa],1);
} else { } else {
dft24576(prach2,rxsigF[aa],1); dft(DFT_24576,prach2,rxsigF[aa],1);
if (prach_fmt>1) if (prach_fmt>1)
dft24576(prach2+49152,rxsigF[aa]+49152,1); dft(DFT_24576,prach2+49152,rxsigF[aa]+49152,1);
} }
} else { } else {
if (prach_fmt == 4) { if (prach_fmt == 4) {
dft3072(prach2,rxsigF[aa],1); dft(DFT_3072,prach2,rxsigF[aa],1);
} else { } else {
dft18432(prach2,rxsigF[aa],1); dft(DFT_18432,prach2,rxsigF[aa],1);
if (prach_fmt>1) if (prach_fmt>1)
dft18432(prach2+36864,rxsigF[aa]+36864,1); dft(DFT_18432,prach2+36864,rxsigF[aa]+36864,1);
} }
} }
...@@ -589,13 +589,13 @@ void rx_prach0(PHY_VARS_eNB *eNB, ...@@ -589,13 +589,13 @@ void rx_prach0(PHY_VARS_eNB *eNB,
// Now do IFFT of size 1024 (N_ZC=839) or 256 (N_ZC=139) // Now do IFFT of size 1024 (N_ZC=839) or 256 (N_ZC=139)
if (N_ZC == 839) { if (N_ZC == 839) {
log2_ifft_size = 10; log2_ifft_size = 10;
idft1024(prachF,prach_ifft_tmp,1); idft(IDFT_1024,prachF,prach_ifft_tmp,1);
// compute energy and accumulate over receive antennas and repetitions for BR // compute energy and accumulate over receive antennas and repetitions for BR
for (i=0; i<2048; i++) for (i=0; i<2048; i++)
prach_ifft[i] += (prach_ifft_tmp[i<<1]*prach_ifft_tmp[i<<1] + prach_ifft_tmp[1+(i<<1)]*prach_ifft_tmp[1+(i<<1)])>>9; prach_ifft[i] += (prach_ifft_tmp[i<<1]*prach_ifft_tmp[i<<1] + prach_ifft_tmp[1+(i<<1)]*prach_ifft_tmp[1+(i<<1)])>>9;
} else { } else {
idft256(prachF,prach_ifft_tmp,1); idft(IDFT_256,prachF,prach_ifft_tmp,1);
log2_ifft_size = 8; log2_ifft_size = 8;
// compute energy and accumulate over receive antennas and repetitions for BR // compute energy and accumulate over receive antennas and repetitions for BR
......
...@@ -95,41 +95,41 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input ...@@ -95,41 +95,41 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
volatile int *output_ptr=(int*)0; volatile int *output_ptr=(int*)0;
int *temp_ptr=(int*)0; int *temp_ptr=(int*)0;
void (*idft)(int16_t *,int16_t *, int); idft_size_idx_t idftsize;
switch (fftsize) { switch (fftsize) {
case 128: case 128:
idft = idft128; idftsize = IDFT_128;
break; break;
case 256: case 256:
idft = idft256; idftsize = IDFT_256;
break; break;
case 512: case 512:
idft = idft512; idftsize = IDFT_512;
break; break;
case 1024: case 1024:
idft = idft1024; idftsize = IDFT_1024;
break; break;
case 1536: case 1536:
idft = idft1536; idftsize = IDFT_1536;
break; break;
case 2048: case 2048:
idft = idft2048; idftsize = IDFT_2048;
break; break;
case 3072: case 3072:
idft = idft3072; idftsize = IDFT_3072;
break; break;
case 4096: case 4096:
idft = idft4096; idftsize = IDFT_4096;
break; break;
default: default:
idft = idft512; idftsize = IDFT_512;
break; break;
} }
...@@ -148,12 +148,12 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input ...@@ -148,12 +148,12 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
#ifndef __AVX2__ #ifndef __AVX2__
// handle 128-bit alignment for 128-bit SIMD (SSE4,NEON,AltiVEC) // handle 128-bit alignment for 128-bit SIMD (SSE4,NEON,AltiVEC)
idft((int16_t *)&input[i*fftsize], idft(idftsize,(int16_t *)&input[i*fftsize],
(fftsize==128) ? (int16_t *)temp : (int16_t *)&output[(i*fftsize) + ((1+i)*nb_prefix_samples)], (fftsize==128) ? (int16_t *)temp : (int16_t *)&output[(i*fftsize) + ((1+i)*nb_prefix_samples)],
1); 1);
#else #else
// on AVX2 need 256-bit alignment // on AVX2 need 256-bit alignment
idft((int16_t *)&input[i*fftsize], idft(idftsize,(int16_t *)&input[i*fftsize],
(int16_t *)temp, (int16_t *)temp,
1); 1);
......
...@@ -62,44 +62,44 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue, ...@@ -62,44 +62,44 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
unsigned int rx_offset; unsigned int rx_offset;
void (*dft)(int16_t *,int16_t *, int); dft_size_idx_t dftsize;
int tmp_dft_in[8192] __attribute__ ((aligned (32))); // This is for misalignment issues for 6 and 15 PRBs int tmp_dft_in[8192] __attribute__ ((aligned (32))); // This is for misalignment issues for 6 and 15 PRBs
switch (frame_parms->ofdm_symbol_size) { switch (frame_parms->ofdm_symbol_size) {
case 128: case 128:
dft = dft128; dftsize = DFT_128;
break; break;
case 256: case 256:
dft = dft256; dftsize = DFT_256;
break; break;
case 512: case 512:
dft = dft512; dftsize = DFT_512;
break; break;
case 1024: case 1024:
dft = dft1024; dftsize = DFT_1024;
break; break;
case 1536: case 1536:
dft = dft1536; dftsize = DFT_1536;
break; break;
case 2048: case 2048:
dft = dft2048; dftsize = DFT_2048;
break; break;
case 3072: case 3072:
dft = dft3072; dftsize = DFT_3072;
break; break;
case 4096: case 4096:
dft = dft4096; dftsize = DFT_4096;
break; break;
case 8192: case 8192:
dft = dft8192; dftsize = DFT_8192;
break; break;
default: default:
...@@ -155,14 +155,14 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue, ...@@ -155,14 +155,14 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
memcpy((void *)tmp_dft_in, memcpy((void *)tmp_dft_in,
(void *) &common_vars->rxdata[aa][rx_offset % frame_length_samples], (void *) &common_vars->rxdata[aa][rx_offset % frame_length_samples],
frame_parms->ofdm_symbol_size*sizeof(int)); frame_parms->ofdm_symbol_size*sizeof(int));
dft((int16_t *)tmp_dft_in, dft(dftsize,(int16_t *)tmp_dft_in,
(int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); (int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
} else { // use dft input from RX buffer directly } else { // use dft input from RX buffer directly
#if UE_TIMING_TRACE #if UE_TIMING_TRACE
start_meas(&ue->rx_dft_stats); start_meas(&ue->rx_dft_stats);
#endif #endif
dft((int16_t *) &common_vars->rxdata[aa][(rx_offset) % frame_length_samples], dft(dftsize,(int16_t *) &common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
(int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); (int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
#if UE_TIMING_TRACE #if UE_TIMING_TRACE
stop_meas(&ue->rx_dft_stats); stop_meas(&ue->rx_dft_stats);
...@@ -183,11 +183,11 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue, ...@@ -183,11 +183,11 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
memcpy((void *)tmp_dft_in, memcpy((void *)tmp_dft_in,
(void *) &common_vars->rxdata[aa][(rx_offset) % frame_length_samples], (void *) &common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
frame_parms->ofdm_symbol_size*sizeof(int)); frame_parms->ofdm_symbol_size*sizeof(int));
dft((int16_t *)tmp_dft_in, dft(dftsize,(int16_t *)tmp_dft_in,
(int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); (int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
} else { // use dft input from RX buffer directly } else { // use dft input from RX buffer directly
dft((int16_t *) &common_vars->rxdata[aa][(rx_offset) % frame_length_samples], dft(dftsize,(int16_t *) &common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
(int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1); (int16_t *)&common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[Ns]].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
} }
#if UE_TIMING_TRACE #if UE_TIMING_TRACE
...@@ -400,43 +400,43 @@ int nr_slot_fep_ul(NR_DL_FRAME_PARMS *frame_parms, ...@@ -400,43 +400,43 @@ int nr_slot_fep_ul(NR_DL_FRAME_PARMS *frame_parms,
unsigned int nb_prefix_samples = (no_prefix ? 0 : frame_parms->nb_prefix_samples); unsigned int nb_prefix_samples = (no_prefix ? 0 : frame_parms->nb_prefix_samples);
unsigned int nb_prefix_samples0 = (no_prefix ? 0 : frame_parms->nb_prefix_samples0); unsigned int nb_prefix_samples0 = (no_prefix ? 0 : frame_parms->nb_prefix_samples0);
void (*dft)(int16_t *,int16_t *, int); dft_size_idx_t dftsize;
switch (frame_parms->ofdm_symbol_size) { switch (frame_parms->ofdm_symbol_size) {
case 128: case 128:
dft = dft128; dftsize = DFT_128;
break; break;
case 256: case 256:
dft = dft256; dftsize = DFT_256;
break; break;
case 512: case 512:
dft = dft512; dftsize = DFT_512;
break; break;
case 1024: case 1024:
dft = dft1024; dftsize = DFT_1024;
break; break;
case 1536: case 1536:
dft = dft1536; dftsize = DFT_1536;
break; break;
case 2048: case 2048:
dft = dft2048; dftsize = DFT_2048;
break; break;
case 4096: case 4096:
dft = dft4096; dftsize = DFT_4096;
break; break;
case 8192: case 8192:
dft = dft8192; dftsize = DFT_8192;
break; break;
default: default:
dft = dft512; dftsize = DFT_512;
break; break;
} }
...@@ -448,7 +448,7 @@ int nr_slot_fep_ul(NR_DL_FRAME_PARMS *frame_parms, ...@@ -448,7 +448,7 @@ int nr_slot_fep_ul(NR_DL_FRAME_PARMS *frame_parms,
else else
rxdata_offset = slot_offset + nb_prefix_samples0 + (symbol * (frame_parms->ofdm_symbol_size + nb_prefix_samples)) - SOFFSET; rxdata_offset = slot_offset + nb_prefix_samples0 + (symbol * (frame_parms->ofdm_symbol_size + nb_prefix_samples)) - SOFFSET;
dft((int16_t *)&rxdata[rxdata_offset], dft(dftsize,(int16_t *)&rxdata[rxdata_offset],
(int16_t *)&rxdataF[symbol * frame_parms->ofdm_symbol_size], 1); (int16_t *)&rxdataF[symbol * frame_parms->ofdm_symbol_size], 1);
return(0); return(0);
......
...@@ -44,7 +44,7 @@ int slot_fep_ul(RU_t *ru, ...@@ -44,7 +44,7 @@ int slot_fep_ul(RU_t *ru,
unsigned int slot_offset; unsigned int slot_offset;
void (*dft)(int16_t *,int16_t *, int); dft_size_idx_t dftsize;
int tmp_dft_in[2048] __attribute__ ((aligned (32))); // This is for misalignment issues for 6 and 15 PRBs int tmp_dft_in[2048] __attribute__ ((aligned (32))); // This is for misalignment issues for 6 and 15 PRBs
unsigned int frame_length_samples = fp->samples_per_tti * 10; unsigned int frame_length_samples = fp->samples_per_tti * 10;
...@@ -52,31 +52,31 @@ int slot_fep_ul(RU_t *ru, ...@@ -52,31 +52,31 @@ int slot_fep_ul(RU_t *ru,
switch (fp->ofdm_symbol_size) { switch (fp->ofdm_symbol_size) {
case 128: case 128:
dft = dft128; dftsize = DFT_128;
break; break;
case 256: case 256:
dft = dft256; dftsize = DFT_256;
break; break;
case 512: case 512:
dft = dft512; dftsize = DFT_512;
break; break;
case 1024: case 1024:
dft = dft1024; dftsize = DFT_1024;
break; break;
case 1536: case 1536:
dft = dft1536; dftsize = DFT_1536;
break; break;
case 2048: case 2048:
dft = dft2048; dftsize = DFT_2048;
break; break;
default: default:
dft = dft512; dftsize = DFT_512;
break; break;
} }
...@@ -109,7 +109,7 @@ int slot_fep_ul(RU_t *ru, ...@@ -109,7 +109,7 @@ int slot_fep_ul(RU_t *ru,
LOG_D(PHY,"slot_fep: symbol 0 %d dB\n", LOG_D(PHY,"slot_fep: symbol 0 %d dB\n",
dB_fixed(signal_energy(&common->rxdata_7_5kHz[aa][rx_offset],fp->ofdm_symbol_size))); dB_fixed(signal_energy(&common->rxdata_7_5kHz[aa][rx_offset],fp->ofdm_symbol_size)));
#endif #endif
dft( (int16_t *)&common->rxdata_7_5kHz[aa][rx_offset], dft( dftsize,(int16_t *)&common->rxdata_7_5kHz[aa][rx_offset],
(int16_t *)&common->rxdataF[aa][fp->ofdm_symbol_size*symbol], (int16_t *)&common->rxdataF[aa][fp->ofdm_symbol_size*symbol],
1 1
); );
...@@ -121,13 +121,13 @@ int slot_fep_ul(RU_t *ru, ...@@ -121,13 +121,13 @@ int slot_fep_ul(RU_t *ru,
memcpy((void *)&tmp_dft_in, memcpy((void *)&tmp_dft_in,
(void *)&common->rxdata_7_5kHz[aa][(rx_offset % frame_length_samples)], (void *)&common->rxdata_7_5kHz[aa][(rx_offset % frame_length_samples)],
fp->ofdm_symbol_size*sizeof(int)); fp->ofdm_symbol_size*sizeof(int));
dft( (short *) tmp_dft_in, dft( dftsize,(short *) tmp_dft_in,
(short*) &common->rxdataF[aa][fp->ofdm_symbol_size*symbol], (short*) &common->rxdataF[aa][fp->ofdm_symbol_size*symbol],
1 1
); );
} }
else{ else{
dft( (short *)&common->rxdata_7_5kHz[aa][rx_offset], dft( dftsize,(short *)&common->rxdata_7_5kHz[aa][rx_offset],
(short*)&common->rxdataF[aa][fp->ofdm_symbol_size*symbol], (short*)&common->rxdataF[aa][fp->ofdm_symbol_size*symbol],
1 1
); );
......
...@@ -179,29 +179,234 @@ This function performs optimized fixed-point radix-2 FFT/IFFT. ...@@ -179,29 +179,234 @@ This function performs optimized fixed-point radix-2 FFT/IFFT.
); );
*/ */
void idft1536(int16_t *sigF,int16_t *sig,int scale);
void idft6144(int16_t *sigF,int16_t *sig,int scale);
void idft12288(int16_t *sigF,int16_t *sig,int scale);
void idft18432(int16_t *sigF,int16_t *sig,int scale);
void idft3072(int16_t *sigF,int16_t *sig,int scale);
void idft24576(int16_t *sigF,int16_t *sig,int scale);
void dft1536(int16_t *sigF,int16_t *sig,int scale);
void dft3072(int16_t *sigF,int16_t *sig,int scale); #ifdef OAIDFTS
typedef void(*adftfunc_t)(int16_t *sigF,int16_t *sig,unsigned char scale_flag);
typedef void(*aidftfunc_t)(int16_t *sigF,int16_t *sig,unsigned char scale_flag);
void dft6144(int16_t *sigF,int16_t *sig,int scale); void dft12(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft24(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft36(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft48(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft60(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft72(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft96(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft108(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft120(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft144(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft180(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft192(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft216(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft240(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft288(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft300(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft324(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft360(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft384(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft432(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft480(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft540(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft576(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft600(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft648(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft720(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft768(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft864(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft900(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft960(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft972(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft1080(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft1152(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft1200(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft64(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft128(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft256(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft512(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft1024(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft2048(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft4096(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft8192(int16_t *x,int16_t *y,uint8_t scale_flag);
void idft64(int16_t *x,int16_t *y,uint8_t scale_flag);
void idft128(int16_t *x,int16_t *y,uint8_t scale_flag);
void idft256(int16_t *x,int16_t *y,uint8_t scale_flag);
void idft512(int16_t *x,int16_t *y,uint8_t scale_flag);
void idft1024(int16_t *x,int16_t *y,uint8_t scale_flag);
void idft2048(int16_t *x,int16_t *y,uint8_t scale_flag);
void idft4096(int16_t *x,int16_t *y,uint8_t scale_flag);
void idft8192(int16_t *x,int16_t *y,uint8_t scale_flag);
void idft1536(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void idft6144(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void idft12288(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void idft18432(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void idft3072(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void idft24576(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void dft1536(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void dft3072(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void dft6144(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void dft12288(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void dft18432(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
void dft24576(int16_t *sigF,int16_t *sig,uint8_t scale_flag);
#else
typedef void(*dftfunc_t)(uint8_t sizeidx,int16_t *sigF,int16_t *sig,unsigned char scale_flag);
typedef void(*idftfunc_t)(uint8_t sizeidx,int16_t *sigF,int16_t *sig,unsigned char scale_flag);
extern dftfunc_t dft;
extern idftfunc_t idft;
#endif
void dft12288(int16_t *sigF,int16_t *sig,int scale); typedef enum DFT_size_idx {
DFT_12,
DFT_24,
DFT_36,
DFT_48,
DFT_60,
DFT_72,
DFT_96,
DFT_108,
DFT_120,
DFT_128,
DFT_144,
DFT_180,
DFT_192,
DFT_216,
DFT_240,
DFT_256,
DFT_288,
DFT_300,
DFT_324,
DFT_360,
DFT_384,
DFT_432,
DFT_480,
DFT_512,
DFT_540,
DFT_576,
DFT_600,
DFT_648,
DFT_720,
DFT_768,
DFT_864,
DFT_900,
DFT_960,
DFT_972,
DFT_1024,
DFT_1080,
DFT_1152,
DFT_1200,
DFT_1536,
DFT_2048,
DFT_3072,
DFT_4096,
DFT_6144,
DFT_8192,
DFT_12288,
DFT_18432,
DFT_24576,
DFT_SIZE_IDXTABLESIZE,
} dft_size_idx_t;
#ifdef OAIDFTS
adftfunc_t dft_ftab[]={
dft12,
dft24,
dft36,
dft48,
dft60,
dft72,
dft96,
dft108,
dft120,
dft128,
dft144,
dft180,
dft192,
dft216,
dft240,
dft256,
dft288,
dft300,
dft324,
dft360,
dft384,
dft432,
dft480,
dft512,
dft540,
dft576,
dft600,
dft648,
dft720,
dft768,
dft864,
dft900,
dft960,
dft972,
dft1024,
dft1080,
dft1152,
dft1200,
dft1536,
dft2048,
dft3072,
dft4096,
dft6144,
dft8192,
dft12288,
dft18432,
dft24576,
};
#endif
void dft18432(int16_t *sigF,int16_t *sig,int scale); typedef enum idft_size_idx {
IDFT_128,
IDFT_256,
IDFT_288,
IDFT_300,
IDFT_324,
IDFT_360,
IDFT_384,
IDFT_432,
IDFT_480,
IDFT_512,
IDFT_1024,
IDFT_1536,
IDFT_2048,
IDFT_3072,
IDFT_4096,
IDFT_6144,
IDFT_8192,
IDFT_12288,
IDFT_18432,
IDFT_24576,
IDFT_SIZE_IDXTABLESIZE,
} idft_size_idx_t;
#ifdef OAIDFTS
aidftfunc_t idft_ftab[]={
idft128,
idft256,
idft512,
idft1024,
idft1536,
idft2048,
idft3072,
idft4096,
idft6144,
idft8192,
idft12288,
idft18432,
idft24576,
};
#endif
void dft24576(int16_t *sigF,int16_t *sig,int scale);
void dft49152(int16_t *sigF,int16_t *sig,int scale); void dft49152(int16_t *sigF,int16_t *sig,int scale);
void idft49152(int16_t *sigF,int16_t *sig,int scale); void idft49152(int16_t *sigF,int16_t *sig,int scale);
...@@ -387,57 +592,7 @@ int64_t dot_product64(int16_t *x, ...@@ -387,57 +592,7 @@ int64_t dot_product64(int16_t *x,
uint32_t N, //must be a multiple of 8 uint32_t N, //must be a multiple of 8
uint8_t output_shift); uint8_t output_shift);
void dft12(int16_t *x,int16_t *y);
void dft24(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft36(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft48(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft60(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft72(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft96(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft108(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft120(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft144(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft180(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft192(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft216(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft240(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft288(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft300(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft324(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft360(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft384(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft432(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft480(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft540(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft576(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft600(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft648(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft720(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft768(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft864(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft900(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft960(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft972(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft1080(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft1152(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft1200(int16_t *x,int16_t *y,uint8_t scale_flag);
void dft64(int16_t *x,int16_t *y,int scale);
void dft128(int16_t *x,int16_t *y,int scale);
void dft256(int16_t *x,int16_t *y,int scale);
void dft512(int16_t *x,int16_t *y,int scale);
void dft1024(int16_t *x,int16_t *y,int scale);
void dft2048(int16_t *x,int16_t *y,int scale);
void dft4096(int16_t *x,int16_t *y,int scale);
void dft8192(int16_t *x,int16_t *y,int scale);
void idft64(int16_t *x,int16_t *y,int scale);
void idft128(int16_t *x,int16_t *y,int scale);
void idft256(int16_t *x,int16_t *y,int scale);
void idft512(int16_t *x,int16_t *y,int scale);
void idft1024(int16_t *x,int16_t *y,int scale);
void idft2048(int16_t *x,int16_t *y,int scale);
void idft4096(int16_t *x,int16_t *y,int scale);
void idft8192(int16_t *x,int16_t *y,int scale);
/** @} */ /** @} */
......
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