Commit d6cdcb91 authored by knopp's avatar knopp

removed PHY/TOOLS/fft.c and all uses of this FFT implementation. All are...

removed PHY/TOOLS/fft.c and all uses of this FFT implementation. All are replaced by the faster versions in PHY/TOOLS/lte_dfts.c

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7390 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent f8bc7e38
...@@ -768,9 +768,7 @@ set(PHY_SRC ...@@ -768,9 +768,7 @@ set(PHY_SRC
${OPENAIR1_DIR}/PHY/CODING/viterbi_lte.c ${OPENAIR1_DIR}/PHY/CODING/viterbi_lte.c
${OPENAIR1_DIR}/PHY/INIT/lte_init.c ${OPENAIR1_DIR}/PHY/INIT/lte_init.c
${OPENAIR1_DIR}/PHY/INIT/lte_parms.c ${OPENAIR1_DIR}/PHY/INIT/lte_parms.c
${OPENAIR1_DIR}/PHY/INIT/init_top.c
${OPENAIR1_DIR}/PHY/TOOLS/file_output.c ${OPENAIR1_DIR}/PHY/TOOLS/file_output.c
${OPENAIR1_DIR}/PHY/TOOLS/fft.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
......
This diff is collapsed.
This diff is collapsed.
...@@ -133,14 +133,28 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -133,14 +133,28 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) { for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
// do ifft of channel estimate // do ifft of channel estimate
fft((short*) &lte_eNb_srs->srs_ch_estimates[ind][aa][0], switch(frame_parms->N_RB_DL) {
(short*) lte_eNb_srs->srs_ch_estimates_time[ind][aa], case 6:
frame_parms->twiddle_ifft, dft128((int16_t*) &lte_eNb_srs->srs_ch_estimates[ind][aa][0],
frame_parms->rev, (int16_t*) lte_eNb_srs->srs_ch_estimates_time[ind][aa],
frame_parms->log2_symbol_size, 1);
frame_parms->log2_symbol_size/2, break;
0); case 25:
dft512((int16_t*) &lte_eNb_srs->srs_ch_estimates[ind][aa][0],
(int16_t*) lte_eNb_srs->srs_ch_estimates_time[ind][aa],
1);
break;
case 50:
dft1024((int16_t*) &lte_eNb_srs->srs_ch_estimates[ind][aa][0],
(int16_t*) lte_eNb_srs->srs_ch_estimates_time[ind][aa],
1);
break;
case 100:
dft2048((int16_t*) &lte_eNb_srs->srs_ch_estimates[ind][aa][0],
(int16_t*) lte_eNb_srs->srs_ch_estimates_time[ind][aa],
1);
break;
}
#ifdef USER_MODE #ifdef USER_MODE
#ifdef DEBUG_PHY #ifdef DEBUG_PHY
sprintf(fname,"srs_ch_estimates_time_%d%d.m",ind,aa); sprintf(fname,"srs_ch_estimates_time_%d%d.m",ind,aa);
...@@ -156,8 +170,8 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -156,8 +170,8 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
temp = 0; temp = 0;
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) { for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
Re = ((int16_t*)lte_eNb_srs->srs_ch_estimates_time[ind][aa])[(i<<2)]; Re = ((int16_t*)lte_eNb_srs->srs_ch_estimates_time[ind][aa])[(i<<1)];
Im = ((int16_t*)lte_eNb_srs->srs_ch_estimates_time[ind][aa])[1+(i<<2)]; Im = ((int16_t*)lte_eNb_srs->srs_ch_estimates_time[ind][aa])[1+(i<<1)];
temp += (Re*Re/2) + (Im*Im/2); temp += (Re*Re/2) + (Im*Im/2);
} }
......
...@@ -752,14 +752,36 @@ int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *phy_vars_ue, ...@@ -752,14 +752,36 @@ int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *phy_vars_ue,
// do ifft of channel estimate // do ifft of channel estimate
for (aa=0; aa<phy_vars_ue->lte_frame_parms.nb_antennas_rx*phy_vars_ue->lte_frame_parms.nb_antennas_tx; aa++) { for (aa=0; aa<phy_vars_ue->lte_frame_parms.nb_antennas_rx*phy_vars_ue->lte_frame_parms.nb_antennas_tx; aa++) {
if (phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa]) if (phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa]) {
fft((short*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][LTE_CE_OFFSET], switch (phy_vars_ue->lte_frame_parms.N_RB_DL) {
(short*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa], case 6:
phy_vars_ue->lte_frame_parms.twiddle_ifft, idft128((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][LTE_CE_OFFSET],
phy_vars_ue->lte_frame_parms.rev, (int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa],
phy_vars_ue->lte_frame_parms.log2_symbol_size, 1);
phy_vars_ue->lte_frame_parms.log2_symbol_size/2, break;
0); case 25:
idft512((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][LTE_CE_OFFSET],
(int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa],
1);
break;
case 50:
idft1024((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][LTE_CE_OFFSET],
(int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa],
1);
break;
case 75:
idft1536((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][LTE_CE_OFFSET],
(int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa]);
break;
case 100:
idft2048((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][LTE_CE_OFFSET],
(int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa],
1);
break;
default:
break;
}
}
} }
return(0); return(0);
......
...@@ -156,17 +156,46 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com ...@@ -156,17 +156,46 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com
} }
} }
fft((short*)syncF_tmp, /// complex input switch (frame_parms->N_RB_DL) {
(short*)sync_tmp, /// complex output case 6:
idft128((short*)syncF_tmp, /// complex input
(short*)sync_tmp, /// complex output
1);
break;
case 25:
idft512((short*)syncF_tmp, /// complex input
(short*)sync_tmp, /// complex output
1);
break;
case 50:
idft1024((short*)syncF_tmp, /// complex input
(short*)sync_tmp, /// complex output
1);
break;
case 75:
idft1536((short*)syncF_tmp, /// complex input
(short*)sync_tmp); /// complex output
break;
case 100:
idft2048((short*)syncF_tmp, /// complex input
(short*)sync_tmp, /// complex output
1);
break;
default:
LOG_E(PHY,"Unsupported N_RB_DL %d\n",frame_parms->N_RB_DL);
break;
}
/*
frame_parms->twiddle_ifft, /// complex twiddle factors frame_parms->twiddle_ifft, /// complex twiddle factors
frame_parms->rev, /// bit reversed permutation vector frame_parms->rev, /// bit reversed permutation vector
frame_parms->log2_symbol_size,/// log2(FFT_SIZE) frame_parms->log2_symbol_size,/// log2(FFT_SIZE)
(frame_parms->log2_symbol_size/2), (frame_parms->log2_symbol_size/2),
0); /// 0 - input is in complex Q1.15 format, 1 - input is in complex redundant Q1.15 format) 0); /// 0 - input is in complex Q1.15 format, 1 - input is in complex redundant Q1.15 format)
*/
for (i=0; i<frame_parms->ofdm_symbol_size; i++) for (i=0; i<frame_parms->ofdm_symbol_size; i++)
((int32_t*)primary_synch0_time)[i] = sync_tmp[2*i]; ((int32_t*)primary_synch0_time)[i] = sync_tmp[i];
k=frame_parms->ofdm_symbol_size-36; k=frame_parms->ofdm_symbol_size-36;
...@@ -181,16 +210,40 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com ...@@ -181,16 +210,40 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com
} }
} }
fft((short*)syncF_tmp, /// complex input switch (frame_parms->N_RB_DL) {
(short*)sync_tmp, /// complex output case 6:
frame_parms->twiddle_ifft, /// complex twiddle factors idft128((short*)syncF_tmp, /// complex input
frame_parms->rev, /// bit reversed permutation vector (short*)sync_tmp, /// complex output
frame_parms->log2_symbol_size,/// log2(FFT_SIZE) 1);
frame_parms->log2_symbol_size/2, break;
0) ; /// 0 - input is in complex Q1.15 format, 1 - input is in complex redundant Q1.15 format) case 25:
idft512((short*)syncF_tmp, /// complex input
(short*)sync_tmp, /// complex output
1);
break;
case 50:
idft1024((short*)syncF_tmp, /// complex input
(short*)sync_tmp, /// complex output
1);
break;
case 75:
idft1536((short*)syncF_tmp, /// complex input
(short*)sync_tmp /// complex output
);
break;
case 100:
idft2048((short*)syncF_tmp, /// complex input
(short*)sync_tmp, /// complex output
1);
break;
default:
LOG_E(PHY,"Unsupported N_RB_DL %d\n",frame_parms->N_RB_DL);
break;
}
for (i=0; i<frame_parms->ofdm_symbol_size; i++) for (i=0; i<frame_parms->ofdm_symbol_size; i++)
((int32_t*)primary_synch1_time)[i] = sync_tmp[2*i]; ((int32_t*)primary_synch1_time)[i] = sync_tmp[i];
k=frame_parms->ofdm_symbol_size-36; k=frame_parms->ofdm_symbol_size-36;
...@@ -205,16 +258,40 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com ...@@ -205,16 +258,40 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms ) // LTE_UE_COMMON *com
} }
} }
fft((short*)syncF_tmp, /// complex input switch (frame_parms->N_RB_DL) {
(short*)sync_tmp, /// complex output case 6:
frame_parms->twiddle_ifft, /// complex twiddle factors idft128((short*)syncF_tmp, /// complex input
frame_parms->rev, /// bit reversed permutation vector (short*)sync_tmp, /// complex output
frame_parms->log2_symbol_size,/// log2(FFT_SIZE) 1);
frame_parms->log2_symbol_size/2, break;
0); /// 0 - input is in complex Q1.15 format, 1 - input is in complex redundant Q1.15 format) case 25:
idft512((short*)syncF_tmp, /// complex input
(short*)sync_tmp, /// complex output
1);
break;
case 50:
idft1024((short*)syncF_tmp, /// complex input
(short*)sync_tmp, /// complex output
1);
break;
case 75:
idft1536((short*)syncF_tmp, /// complex input
(short*)sync_tmp /// complex output
);
break;
case 100:
idft2048((short*)syncF_tmp, /// complex input
(short*)sync_tmp, /// complex output
1);
break;
default:
LOG_E(PHY,"Unsupported N_RB_DL %d\n",frame_parms->N_RB_DL);
break;
}
for (i=0; i<frame_parms->ofdm_symbol_size; i++) for (i=0; i<frame_parms->ofdm_symbol_size; i++)
((int32_t*)primary_synch2_time)[i] = sync_tmp[2*i]; ((int32_t*)primary_synch2_time)[i] = sync_tmp[i];
......
...@@ -87,7 +87,7 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq) ...@@ -87,7 +87,7 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
while (1) { while (1) {
//compute frequency-domain representation of 6144-sample chunk //compute frequency-domain representation of 6144-sample chunk
fft6144((int16_t *)rxp, dft6144((int16_t *)rxp,
sp); sp);
......
This diff is collapsed.
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
#include "LAYER2/MAC/extern.h" #include "LAYER2/MAC/extern.h"
//uint8_t ncs_cell[20][7]; //uint8_t ncs_cell[20][7];
//#define DEBUG_PUCCH_TX #define DEBUG_PUCCH_TX
//#define DEBUG_PUCCH_RX #define DEBUG_PUCCH_RX
int16_t cfo_pucch_np[24*7] = {20787,-25330,27244,-18205,31356,-9512,32767,0,31356,9511,27244,18204,20787,25329, int16_t cfo_pucch_np[24*7] = {20787,-25330,27244,-18205,31356,-9512,32767,0,31356,9511,27244,18204,20787,25329,
27244,-18205,30272,-12540,32137,-6393,32767,0,32137,6392,30272,12539,27244,18204, 27244,-18205,30272,-12540,32137,-6393,32767,0,32137,6392,30272,12539,27244,18204,
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
*/ */
/** /**
\fn void PHY_ofdm_mod(int *input,int *output,unsigned char log2fftsize,unsigned char nb_symbols,unsigned short nb_prefix_samples,short *twiddle_ifft,unsigned short *rev,Extension_t etype) \fn void PHY_ofdm_mod(int *input,int *output,unsigned char log2fftsize,unsigned char nb_symbols,unsigned short nb_prefix_samples,Extension_t etype)
This function performs OFDM modulation with cyclic extension or zero-padding. This function performs OFDM modulation with cyclic extension or zero-padding.
@param input The sequence input samples in the frequency-domain. This is a concatenation of the input symbols in SIMD redundant format @param input The sequence input samples in the frequency-domain. This is a concatenation of the input symbols in SIMD redundant format
...@@ -42,8 +42,6 @@ This function performs OFDM modulation with cyclic extension or zero-padding. ...@@ -42,8 +42,6 @@ This function performs OFDM modulation with cyclic extension or zero-padding.
@param log2fftsize Base-2 logarithm of the OFDM symbol size (\f$N_d\f$) @param log2fftsize Base-2 logarithm of the OFDM symbol size (\f$N_d\f$)
@param nb_symbols The number of OFDM symbols in the block @param nb_symbols The number of OFDM symbols in the block
@param nb_prefix_samples The number of prefix/suffix/zero samples @param nb_prefix_samples The number of prefix/suffix/zero samples
@param twiddle_ifft Pointer to the ifft twiddle factors
@param rev Pointer to the bit-reversal permutation
@param etype Type of extension (CYCLIC_PREFIX,CYCLIC_SUFFIX,ZEROS) @param etype Type of extension (CYCLIC_PREFIX,CYCLIC_SUFFIX,ZEROS)
*/ */
...@@ -52,8 +50,6 @@ void PHY_ofdm_mod(int *input, ...@@ -52,8 +50,6 @@ void PHY_ofdm_mod(int *input,
unsigned char log2fftsize, unsigned char log2fftsize,
unsigned char nb_symbols, unsigned char nb_symbols,
unsigned short nb_prefix_samples, unsigned short nb_prefix_samples,
short *twiddle_ifft,
unsigned short *rev,
Extension_t etype Extension_t etype
); );
......
...@@ -66,8 +66,6 @@ void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRA ...@@ -66,8 +66,6 @@ void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRA
frame_parms->log2_symbol_size, // log2_fft_size frame_parms->log2_symbol_size, // log2_fft_size
1, // number of symbols 1, // number of symbols
frame_parms->nb_prefix_samples0, // number of prefix samples frame_parms->nb_prefix_samples0, // number of prefix samples
frame_parms->twiddle_ifft, // IFFT twiddle factors
frame_parms->rev, // bit-reversal permutation
CYCLIC_PREFIX); CYCLIC_PREFIX);
#ifdef DEBUG_OFDM_MOD #ifdef DEBUG_OFDM_MOD
printf("slot i %d (txdata offset %d)\n",i,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0+(i*frame_parms->samples_per_tti>>1)); printf("slot i %d (txdata offset %d)\n",i,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0+(i*frame_parms->samples_per_tti>>1));
...@@ -78,8 +76,6 @@ void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRA ...@@ -78,8 +76,6 @@ void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRA
frame_parms->log2_symbol_size, // log2_fft_size frame_parms->log2_symbol_size, // log2_fft_size
(short_offset==1) ? 1 :(frame_parms->symbols_per_tti>>1)-1,//6, // number of symbols (short_offset==1) ? 1 :(frame_parms->symbols_per_tti>>1)-1,//6, // number of symbols
frame_parms->nb_prefix_samples, // number of prefix samples frame_parms->nb_prefix_samples, // number of prefix samples
frame_parms->twiddle_ifft, // IFFT twiddle factors
frame_parms->rev, // bit-reversal permutation
CYCLIC_PREFIX); CYCLIC_PREFIX);
...@@ -91,8 +87,6 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input ...@@ -91,8 +87,6 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
unsigned char log2fftsize, /// log2(FFT_SIZE) unsigned char log2fftsize, /// log2(FFT_SIZE)
unsigned char nb_symbols, /// number of OFDM symbols unsigned char nb_symbols, /// number of OFDM symbols
unsigned short nb_prefix_samples, /// cyclic prefix length unsigned short nb_prefix_samples, /// cyclic prefix length
short *twiddle_ifft, /// pointer to precomputed twiddle table
unsigned short *rev, /// pointer to bit-reversal table
Extension_t etype /// type of extension Extension_t etype /// type of extension
) )
{ {
...@@ -253,8 +247,6 @@ void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t ...@@ -253,8 +247,6 @@ void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t
frame_parms->log2_symbol_size, // log2_fft_size frame_parms->log2_symbol_size, // log2_fft_size
12, // number of symbols 12, // number of symbols
frame_parms->ofdm_symbol_size>>2, // number of prefix samples frame_parms->ofdm_symbol_size>>2, // number of prefix samples
frame_parms->twiddle_ifft, // IFFT twiddle factors
frame_parms->rev, // bit-reversal permutation
CYCLIC_PREFIX); CYCLIC_PREFIX);
if (frame_parms->Ncp == EXTENDED) if (frame_parms->Ncp == EXTENDED)
...@@ -263,8 +255,6 @@ void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t ...@@ -263,8 +255,6 @@ void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t
frame_parms->log2_symbol_size, // log2_fft_size frame_parms->log2_symbol_size, // log2_fft_size
2, // number of symbols 2, // number of symbols
frame_parms->nb_prefix_samples, // number of prefix samples frame_parms->nb_prefix_samples, // number of prefix samples
frame_parms->twiddle_ifft, // IFFT twiddle factors
frame_parms->rev, // bit-reversal permutation
CYCLIC_PREFIX); CYCLIC_PREFIX);
else { else {
LOG_D(PHY,"Frame %d, subframe %d: Doing PDCCH modulation\n",frame,next_slot>>1); LOG_D(PHY,"Frame %d, subframe %d: Doing PDCCH modulation\n",frame,next_slot>>1);
...@@ -281,8 +271,6 @@ void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t ...@@ -281,8 +271,6 @@ void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t
frame_parms->log2_symbol_size, // log2_fft_size frame_parms->log2_symbol_size, // log2_fft_size
6, // number of symbols 6, // number of symbols
frame_parms->nb_prefix_samples, // number of prefix samples frame_parms->nb_prefix_samples, // number of prefix samples
frame_parms->twiddle_ifft, // IFFT twiddle factors
frame_parms->rev, // bit-reversal permutation
CYCLIC_PREFIX); CYCLIC_PREFIX);
else { else {
normal_prefix_mod(&txdataF[aa][slot_offset_F], normal_prefix_mod(&txdataF[aa][slot_offset_F],
......
...@@ -124,18 +124,6 @@ int slot_fep_mbsfn(PHY_VARS_UE *phy_vars_ue, ...@@ -124,18 +124,6 @@ int slot_fep_mbsfn(PHY_VARS_UE *phy_vars_ue,
SOFFSET) % frame_length_samples], SOFFSET) % frame_length_samples],
(int16_t *)&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*l],1); (int16_t *)&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*l],1);
stop_meas(&phy_vars_ue->rx_dft_stats); stop_meas(&phy_vars_ue->rx_dft_stats);
/*
fft((short *)&ue_common_vars->rxdata[aa][sample_offset +
nb_prefix_samples0 +
subframe_offset -
SOFFSET],
(short*)&ue_common_vars->rxdataF[aa][2*frame_parms->ofdm_symbol_size*l],
frame_parms->twiddle_fft,
frame_parms->rev,
frame_parms->log2_symbol_size,
frame_parms->log2_symbol_size>>1,
0);
*/
} else { } else {
if ((sample_offset + if ((sample_offset +
(frame_parms->ofdm_symbol_size+nb_prefix_samples0+nb_prefix_samples) + (frame_parms->ofdm_symbol_size+nb_prefix_samples0+nb_prefix_samples) +
...@@ -154,26 +142,8 @@ int slot_fep_mbsfn(PHY_VARS_UE *phy_vars_ue, ...@@ -154,26 +142,8 @@ int slot_fep_mbsfn(PHY_VARS_UE *phy_vars_ue,
SOFFSET) % frame_length_samples], SOFFSET) % frame_length_samples],
(int16_t *)&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*l],1); (int16_t *)&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*l],1);
stop_meas(&phy_vars_ue->rx_dft_stats); stop_meas(&phy_vars_ue->rx_dft_stats);
/*
fft((short *)&ue_common_vars->rxdata[aa][sample_offset +
(frame_parms->ofdm_symbol_size+nb_prefix_samples0+nb_prefix_samples) +
(frame_parms->ofdm_symbol_size+nb_prefix_samples)*(l-1) +
subframe_offset-
SOFFSET],
(short*)&ue_common_vars->rxdataF[aa][2*frame_parms->ofdm_symbol_size*l],
frame_parms->twiddle_fft,
frame_parms->rev,
frame_parms->log2_symbol_size,
frame_parms->log2_symbol_size>>1,
0);
*/
} }
/*
memcpy(&ue_common_vars->rxdataF2[aa][2*subframe_offset_F+2*frame_parms->ofdm_symbol_size*l],
&ue_common_vars->rxdataF[aa][2*frame_parms->ofdm_symbol_size*l],
2*frame_parms->ofdm_symbol_size*sizeof(int));
*/
} }
//if ((l==0) || (l==(4-frame_parms->Ncp))) { //if ((l==0) || (l==(4-frame_parms->Ncp))) {
......
...@@ -304,7 +304,7 @@ This function performs optimized fixed-point radix-2 FFT/IFFT. ...@@ -304,7 +304,7 @@ This function performs optimized fixed-point radix-2 FFT/IFFT.
@param scale Total number of shifts (should be log2size/2 for normalized FFT) @param scale Total number of shifts (should be log2size/2 for normalized FFT)
@param input_fmt (0 - input is in complex Q1.15 format, 1 - input is in complex redundant Q1.15 format) @param input_fmt (0 - input is in complex Q1.15 format, 1 - input is in complex redundant Q1.15 format)
*/ */
void fft(int16_t *x, /*void fft(int16_t *x,
int16_t *y, int16_t *y,
int16_t *twiddle, int16_t *twiddle,
uint16_t *rev, uint16_t *rev,
...@@ -312,30 +312,31 @@ void fft(int16_t *x, ...@@ -312,30 +312,31 @@ void fft(int16_t *x,
uint8_t scale, uint8_t scale,
uint8_t input_fmt uint8_t input_fmt
); );
*/
void ifft1536(int16_t *sigF,int16_t *sig); void idft1536(int16_t *sigF,int16_t *sig);
void ifft6144(int16_t *sigF,int16_t *sig); void idft6144(int16_t *sigF,int16_t *sig);
void ifft12288(int16_t *sigF,int16_t *sig); void idft12288(int16_t *sigF,int16_t *sig);
void ifft18432(int16_t *sigF,int16_t *sig); void idft18432(int16_t *sigF,int16_t *sig);
void ifft3072(int16_t *sigF,int16_t *sig); void idft3072(int16_t *sigF,int16_t *sig);
void ifft24576(int16_t *sigF,int16_t *sig); void idft24576(int16_t *sigF,int16_t *sig);
void fft1536(int16_t *sigF,int16_t *sig); void dft1536(int16_t *sigF,int16_t *sig);
void fft6144(int16_t *sigF,int16_t *sig); void dft6144(int16_t *sigF,int16_t *sig);
void fft12288(int16_t *sigF,int16_t *sig); void dft12288(int16_t *sigF,int16_t *sig);
void fft18432(int16_t *sigF,int16_t *sig); void dft18432(int16_t *sigF,int16_t *sig);
void fft3072(int16_t *sigF,int16_t *sig); void dft3072(int16_t *sigF,int16_t *sig);
void fft24576(int16_t *sigF,int16_t *sig); void dft24576(int16_t *sigF,int16_t *sig);
/*!\fn int rotate_cpx_vector(int16_t *x,int16_t *alpha,int16_t *y,uint32_t N,uint16_t output_shift, uint8_t format) /*!\fn int rotate_cpx_vector(int16_t *x,int16_t *alpha,int16_t *y,uint32_t N,uint16_t output_shift, uint8_t format)
...@@ -594,12 +595,16 @@ void dft256(int16_t *x,int16_t *y,int scale); ...@@ -594,12 +595,16 @@ void dft256(int16_t *x,int16_t *y,int scale);
void dft512(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 dft1024(int16_t *x,int16_t *y,int scale);
void dft2048(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 idft64(int16_t *x,int16_t *y,int scale);
void idft128(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 idft256(int16_t *x,int16_t *y,int scale);
void idft512(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 idft1024(int16_t *x,int16_t *y,int scale);
void idft2048(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);
/** @} */ /** @} */
......
This diff is collapsed.
k=0;
for i=0:5,
for n=0:(2^i)-1,
twiddleFFT_64(1+(4*k)) = round(16384*cos(2*pi*n/(2^(i+1))));
twiddleIFFT_64(1+(4*k)) = twiddleFFT_64(1+(4*k));
twiddleFFT_64(2+(4*k)) = round(16384*sin(2*pi*n/(2^(i+1))));
twiddleIFFT_64(2+(4*k)) = -twiddleFFT_64(2+(4*k));
twiddleFFT_64(3+(4*k)) = -twiddleFFT_64(2+(4*k));
twiddleIFFT_64(3+(4*k)) = twiddleFFT_64(2+(4*k));
twiddleFFT_64(4+(4*k)) = twiddleFFT_64(1+(4*k));
twiddleIFFT_64(4+(4*k)) = twiddleFFT_64(1+(4*k));
k=k+1;
end
end
[fid, msg] = fopen("twiddle64.h","w","ieee-le");
fprintf(fid,"short twiddle_fft64[63*4] = {");
fprintf(fid,"%d,%d,%d,%d,\n",twiddleFFT_64(1:248));
fprintf(fid,"%d,%d,%d,%d};\n\n",twiddleFFT_64(249:252));
fprintf(fid,"short twiddle_ifft64[63*4] = {");
fprintf(fid,"%d,%d,%d,%d,\n",twiddleIFFT_64(1:248));
fprintf(fid,"%d,%d,%d,%d};\n\n",twiddleIFFT_64(249:252));
fclose(fid);
k=0;
for i=0:6,
for n=0:(2^i)-1,
twiddleFFT_128(1+(4*k)) = round(16384*cos(2*pi*n/(2^(i+1))));
twiddleIFFT_128(1+(4*k)) = twiddleFFT_128(1+(4*k));
twiddleFFT_128(2+(4*k)) = round(16384*sin(2*pi*n/(2^(i+1))));
twiddleIFFT_128(2+(4*k)) = -twiddleFFT_128(2+(4*k));
twiddleFFT_128(3+(4*k)) = -twiddleFFT_128(2+(4*k));
twiddleIFFT_128(3+(4*k)) = twiddleFFT_128(2+(4*k));
twiddleFFT_128(4+(4*k)) = twiddleFFT_128(1+(4*k));
twiddleIFFT_128(4+(4*k)) = twiddleFFT_128(1+(4*k));
k=k+1;
end
end
[fid, msg] = fopen("twiddle128.h","w","ieee-le");
fprintf(fid,"short twiddle_fft128[127*4] = {");
fprintf(fid,"%d,%d,%d,%d,\n",twiddleFFT_128(1:504));
fprintf(fid,"%d,%d,%d,%d};\n\n",twiddleFFT_128(505:508));
fprintf(fid,"short twiddle_ifft128[127*4] = {");
fprintf(fid,"%d,%d,%d,%d,\n",twiddleIFFT_128(1:504));
fprintf(fid,"%d,%d,%d,%d};\n\n",twiddleIFFT_128(505:508));
fclose(fid);
k=0;
for i=0:7,
for n=0:(2^i)-1,
twiddleFFT_256(1+(4*k)) = round(16384*cos(2*pi*n/(2^(i+1))));
twiddleIFFT_256(1+(4*k)) = twiddleFFT_256(1+(4*k));
twiddleFFT_256(2+(4*k)) = round(16384*sin(2*pi*n/(2^(i+1))));
twiddleIFFT_256(2+(4*k)) = -twiddleFFT_256(2+(4*k));
twiddleFFT_256(3+(4*k)) = -twiddleFFT_256(2+(4*k));
twiddleIFFT_256(3+(4*k)) = twiddleFFT_256(2+(4*k));
twiddleFFT_256(4+(4*k)) = twiddleFFT_256(1+(4*k));
twiddleIFFT_256(4+(4*k)) = twiddleFFT_256(1+(4*k));
k=k+1;
end