Commit d6cdcb91 authored by knopp's avatar knopp
Browse files

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
${OPENAIR1_DIR}/PHY/CODING/viterbi_lte.c
${OPENAIR1_DIR}/PHY/INIT/lte_init.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/fft.c
${OPENAIR1_DIR}/PHY/TOOLS/lte_dfts.c
${OPENAIR1_DIR}/PHY/TOOLS/log2_approx.c
${OPENAIR1_DIR}/PHY/TOOLS/cmult_sv.c
......
This diff is collapsed.
......@@ -36,16 +36,6 @@
#include "MAC_INTERFACE/extern.h"
//#include "ARCH/CBMIMO1/DEVICE_DRIVER/extern.h"
#ifdef CBMIMO1
#include "ARCH/COMMON/defs.h"
#include "ARCH/CBMIMO1/DEVICE_DRIVER/from_grlib_softconfig.h"
#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_device.h"
#include "ARCH/CBMIMO1/DEVICE_DRIVER/defs.h"
#include "ARCH/CBMIMO1/DEVICE_DRIVER/extern.h"
#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_pci.h"
//#include "pci_commands.h"
#endif //CBMIMO1
/*!
* @addtogroup _PHY_STRUCTURES_
* Memory Initializaion and Cleanup for LTE MODEM.
......@@ -56,357 +46,6 @@
//#define DEBUG_PHY
/*
#ifndef USER_MODE
#include "SCHED/defs.h"
#endif //USER_MODE
*/
#ifndef USER_MODE
dma_addr_t dma_handle[4];
// Get from HW addresses
int init_signal_buffers(LTE_DL_FRAME_PARMS *frame_parms)
{
unsigned char card_id,i;
int *tmp_ptr;
mod_sym_t *tmp_ptr_tx;
unsigned int tx_dma_buffer_size_bytes;
for (card_id=0; card_id<number_of_cards; card_id++) {
for (i=0; i<NB_ANTENNAS_TX; i++) {
// Allocate memory for TX DMA Buffer
#ifdef IFFT_FPGA
tx_dma_buffer_size_bytes = NUMBER_OF_USEFUL_CARRIERS*NUMBER_OF_SYMBOLS_PER_FRAME*sizeof(mod_sym_t);
#else
#ifdef BIT8_TX
tx_dma_buffer_size_bytes = FRAME_LENGTH_BYTES>>1;
#else
tx_dma_buffer_size_bytes = FRAME_LENGTH_BYTES;
#endif
#endif
tmp_ptr_tx = (mod_sym_t *)bigmalloc16(tx_dma_buffer_size_bytes+2*PAGE_SIZE);
if (tmp_ptr_tx==NULL) {
msg("[PHY][INIT] Could not allocate TX_DMA %d (%x bytes)\n",i,
(unsigned int)(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(mod_sym_t) + 2*PAGE_SIZE));
return(-1);
} else {
bzero(tmp_ptr_tx,tx_dma_buffer_size_bytes+2*PAGE_SIZE);
pci_buffer[card_id][(2*i)] = (unsigned int)tmp_ptr_tx;
tmp_ptr_tx = (mod_sym_t*)(((unsigned int)tmp_ptr_tx + PAGE_SIZE -1) & PAGE_MASK);
// reserve_mem(tmp_ptr_tx,FRAME_LENGTH_BYTES+2*PAGE_SIZE);
#ifdef DEBUG_PHY
msg("[PHY][INIT] TX_DMA_BUFFER %d at %p (%p), size 0x%x\n",i,
(void *)tmp_ptr_tx,
(void *)virt_to_phys(tmp_ptr_tx),
(unsigned int)(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(mod_sym_t)+2*PAGE_SIZE));
#endif
}
TX_DMA_BUFFER[card_id][i] = (int) tmp_ptr_tx;
}
for (i=0; i<NB_ANTENNAS_RX; i++) {
// RX DMA Buffers
tmp_ptr = (int *)bigmalloc16(FRAME_LENGTH_BYTES+OFDM_SYMBOL_SIZE_BYTES+2*PAGE_SIZE);
if (tmp_ptr==NULL) {
#ifdef DEBUG_PHY
msg("[PHY][INIT] Could not allocate RX_DMA %d (%x bytes)\n",i,
FRAME_LENGTH_BYTES+2*OFDM_SYMBOL_SIZE_BYTES + 2*PAGE_SIZE);
#endif
return(-1);
} else {
bzero(tmp_ptr,FRAME_LENGTH_BYTES+OFDM_SYMBOL_SIZE_BYTES+2*PAGE_SIZE);
pci_buffer[card_id][1+(2*i)] = (int) tmp_ptr;
tmp_ptr = (int*) (((unsigned long)tmp_ptr + PAGE_SIZE -1) & PAGE_MASK);
// reserve_mem(tmp_ptr,FRAME_LENGTH_BYTES+2*PAGE_SIZE);
#ifdef DEBUG_PHY
msg("[PHY][INIT] RX_DMA_BUFFER %d at %p (%p), size 0x%x\n",i,
(void *)tmp_ptr,
(void *)virt_to_phys(tmp_ptr),(unsigned int)(FRAME_LENGTH_BYTES+OFDM_SYMBOL_SIZE_BYTES+2*PAGE_SIZE));
#endif
}
RX_DMA_BUFFER[card_id][i] = (int) tmp_ptr;
}
}
#ifndef NOCARD_TEST
for (card_id=0; card_id<number_of_cards; card_id++) {
// Allocate memory for PCI interface and store pointers to dma buffers
if (vid != XILINX_VENDOR) {
msg("[PHY][INIT] Setting up Leon PCI interface structure\n");
pci_interface[card_id] = (PCI_interface_t *)bigmalloc16(sizeof(PCI_interface_t));
msg("[PHY][INIT] PCI interface %d at %p\n",card_id,pci_interface[card_id]);
openair_writel(pdev[card_id],FROM_GRLIB_CFG_GRPCI_EUR_CTRL0_OFFSET+4,(unsigned int)virt_to_phys((volatile void*)pci_interface[card_id]));
for (i=0; i<NB_ANTENNAS_RX; i++) {
pci_interface[card_id]->adc_head[i] = (unsigned int)virt_to_phys((volatile void*)RX_DMA_BUFFER[card_id][i]);
pci_interface[card_id]->dac_head[i] = (unsigned int)virt_to_phys((volatile void*)TX_DMA_BUFFER[card_id][i]);
}
mbox = (unsigned int)(&pci_interface[0]->adac_cnt);
msg("[PHY][INIT] mbox = %p\n",mbox);
} else {
msg("[PHY][INIT] PCIe interface %d at %p\n",card_id,exmimo_pci_interface);
// openair_writel(pdev[card_id],FROM_GRLIB_CFG_GRPCI_EUR_CTRL0_OFFSET+4,(unsigned int)virt_to_phys((volatile void*)pci_interface[card_id]));
DAQ_MBOX = (unsigned int)bigmalloc16(16);
exmimo_pci_interface->rf.mbox = (unsigned int)virt_to_phys((volatile void*)DAQ_MBOX);
for (i=0; i<NB_ANTENNAS_RX; i++) {
exmimo_pci_interface->rf.adc_head[i] = (unsigned int)virt_to_phys((volatile void*)RX_DMA_BUFFER[card_id][i]);
exmimo_pci_interface->rf.dac_head[i] = (unsigned int)virt_to_phys((volatile void*)TX_DMA_BUFFER[card_id][i]);
}
}
}
#endif //NOCARD_TEST
return(0);
}
#endif // USER_MODE
/*
int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms) {
if (frame_parms->Ncp==1) {
frame_parms->nb_prefix_samples0=512;
frame_parms->nb_prefix_samples = 512;
frame_parms->symbols_per_tti = 12;
}
else {
frame_parms->nb_prefix_samples0 = 160;
frame_parms->nb_prefix_samples = 144;
frame_parms->symbols_per_tti = 14;
}
switch (frame_parms->N_RB_DL) {
case 100:
frame_parms->ofdm_symbol_size = 2048;
frame_parms->log2_symbol_size = 11;
frame_parms->samples_per_tti = 30720;
frame_parms->first_carrier_offset = 1448;
break;
case 50:
frame_parms->ofdm_symbol_size = 1024;
frame_parms->log2_symbol_size = 10;
frame_parms->samples_per_tti = 15360;
frame_parms->first_carrier_offset = 724;
frame_parms->nb_prefix_samples>>=1;
frame_parms->nb_prefix_samples0>>=1;
break;
case 25:
frame_parms->ofdm_symbol_size = 512;
frame_parms->log2_symbol_size = 9;
frame_parms->samples_per_tti = 7680;
frame_parms->first_carrier_offset = 362;
frame_parms->nb_prefix_samples>>=2;
frame_parms->nb_prefix_samples0>>=2;
break;
case 15:
frame_parms->ofdm_symbol_size = 256;
frame_parms->log2_symbol_size = 8;
frame_parms->samples_per_tti = 3840;
frame_parms->first_carrier_offset = 166;
frame_parms->nb_prefix_samples>>=3;
frame_parms->nb_prefix_samples0>>=1;
break;
case 6:
frame_parms->ofdm_symbol_size = 128;
frame_parms->log2_symbol_size = 7;
frame_parms->samples_per_tti = 1920;
frame_parms->first_carrier_offset = 92;
frame_parms->nb_prefix_samples>>=4;
frame_parms->nb_prefix_samples0>>=1;
break;
default:
msg("init_frame_parms: Error: Number of resource blocks (N_RB_DL %d) undefined, frame_parms = %p \n",frame_parms->N_RB_DL, frame_parms);
return(-1);
break;
}
// frame_parms->tdd_config=3;
return(0);
}
*/
int phy_init_top(LTE_DL_FRAME_PARMS *frame_parms)
{
// bzero((void *)PHY_vars,sizeof(PHY_VARS));
LOG_I(PHY,"[INIT] OFDM size : %d\n",NUMBER_OF_OFDM_CARRIERS);
LOG_I(PHY,"[INIT] FRAME_LENGTH_SAMPLES : %d\n",FRAME_LENGTH_SAMPLES);
LOG_I(PHY,"[INIT] NUMBER_OF_SYMBOLS_PER_FRAME : %d\n",NUMBER_OF_SYMBOLS_PER_FRAME);
LOG_I(PHY,"[INIT] Initializing FFT engine using %d point fft (%d, %p)\n",NUMBER_OF_OFDM_CARRIERS,LOG2_NUMBER_OF_OFDM_CARRIERS,rev );
#ifndef USER_MODE
init_signal_buffers(frame_parms);
#endif
// Initialize fft variables
init_fft(NUMBER_OF_OFDM_CARRIERS,LOG2_NUMBER_OF_OFDM_CARRIERS,rev); // TX/RX
init_fft(4*NUMBER_OF_OFDM_CARRIERS,2+LOG2_NUMBER_OF_OFDM_CARRIERS,rev_times4); // Synch
init_fft(NUMBER_OF_OFDM_CARRIERS/2,LOG2_NUMBER_OF_OFDM_CARRIERS-1,rev_half); // for interpolation of channel est
init_fft(8192,13,rev8192);
init_fft(4096,12,rev4096);
init_fft(2048,11,rev2048);
init_fft(1024,10,rev1024);
init_fft(512,9,rev512);
twiddle_fft = (short *)malloc16(4095*4*2);
twiddle_ifft = (short *)malloc16(4095*4*2);
twiddle_fft_times4 = (short*)malloc16(4095*4*2);
twiddle_ifft_times4 = (short*)malloc16(4095*4*2);
twiddle_fft_half = (short*)malloc16(4095*4*2);
twiddle_ifft_half = (short*)malloc16(4095*4*2);
LOG_I(PHY,"[INIT] twiddle_fft= %p, twiddle_ifft=%p, twiddle_fft_times4=%p,twiddle_ifft_times4=%p\n",
(void *)twiddle_fft,(void *)twiddle_ifft,(void *)twiddle_fft_times4,(void *)twiddle_ifft_times4);
switch (NUMBER_OF_OFDM_CARRIERS) {
case 64:
memcpy(twiddle_fft,&twiddle_fft64[0],63*4*2);
memcpy(twiddle_ifft,&twiddle_ifft64[0],63*4*2);
memcpy(twiddle_fft_times4,&twiddle_fft256[0],255*4*2);
memcpy(twiddle_ifft_times4,&twiddle_ifft256[0],255*4*2);
//memcpy(twiddle_fft_half,&twiddle_fft32[0],31*4*2);
//memcpy(twiddle_ifft_half,&twiddle_ifft32[0],31*4*2);
break;
case 128:
memcpy(twiddle_fft,&twiddle_fft128[0],127*4*2);
memcpy(twiddle_ifft,&twiddle_ifft128[0],127*4*2);
memcpy(twiddle_fft_times4,&twiddle_fft512[0],511*4*2);
memcpy(twiddle_ifft_times4,&twiddle_ifft512[0],511*4*2);
memcpy(twiddle_fft_half,&twiddle_fft64[0],63*4*2);
memcpy(twiddle_ifft_half,&twiddle_ifft64[0],63*4*2);
break;
case 256:
memcpy(twiddle_fft,&twiddle_fft256[0],255*4*2);
memcpy(twiddle_ifft,&twiddle_ifft256[0],255*4*2);
memcpy(twiddle_fft_times4,&twiddle_fft1024[0],1023*4*2);
memcpy(twiddle_ifft_times4,&twiddle_ifft1024[0],1023*4*2);
memcpy(twiddle_fft_half,&twiddle_fft128[0],127*4*2);
memcpy(twiddle_ifft_half,&twiddle_ifft128[0],127*4*2);
break;
case 512:
memcpy(twiddle_fft,&twiddle_fft512[0],511*4*2);
memcpy(twiddle_ifft,&twiddle_ifft512[0],511*4*2);
memcpy(twiddle_fft_times4,&twiddle_fft2048[0],2047*4*2);
memcpy(twiddle_ifft_times4,&twiddle_ifft2048[0],2047*4*2);
memcpy(twiddle_fft_half,&twiddle_fft256[0],255*4*2);
memcpy(twiddle_ifft_half,&twiddle_ifft256[0],255*4*2);
break;
case 1024:
memcpy(twiddle_fft,&twiddle_fft1024[0],1023*4*2);
memcpy(twiddle_ifft,&twiddle_ifft1024[0],1023*4*2);
memcpy(twiddle_fft_times4,&twiddle_fft4096[0],4095*4*2);
memcpy(twiddle_ifft_times4,&twiddle_ifft4096[0],4095*4*2);
memcpy(twiddle_fft_half,&twiddle_fft512[0],511*4*2);
memcpy(twiddle_ifft_half,&twiddle_ifft512[0],511*4*2);
break;
case 2048:
memcpy(twiddle_fft,&twiddle_fft2048[0],2047*4*2);
memcpy(twiddle_ifft,&twiddle_ifft2048[0],2047*4*2);
memcpy(twiddle_fft_times4,&twiddle_fft8192[0],8191*4*2);
memcpy(twiddle_ifft_times4,&twiddle_ifft8192[0],8191*4*2);
memcpy(twiddle_fft_half,&twiddle_fft1024[0],1023*4*2);
memcpy(twiddle_ifft_half,&twiddle_ifft1024[0],1023*4*2);
break;
default:
memcpy(twiddle_fft,&twiddle_fft64[0],63*4*2);
memcpy(twiddle_ifft,&twiddle_ifft64[0],63*4*2);
memcpy(twiddle_fft_times4,&twiddle_fft256[0],255*4*2);
memcpy(twiddle_ifft_times4,&twiddle_ifft256[0],255*4*2);
//memcpy(twiddle_fft_half,&twiddle_fft32[0],31*4*2);
//memcpy(twiddle_ifft_half,&twiddle_ifft32[0],31*4*2);
break;
}
frame_parms->twiddle_fft = twiddle_fft;
frame_parms->twiddle_ifft = twiddle_ifft;
frame_parms->rev = rev;
return(1);
}
void phy_cleanup(void)
{
#ifndef USER_MODE
unsigned int dummy_ptr;
unsigned char card_id,i;
#endif //USER_MODE
// stop PHY_thread
LOG_I(PHY,"[INIT] cleanup\n");
#ifndef USER_MODE
for (card_id=0; card_id<number_of_cards; card_id++) {
for (i=0; i<NB_ANTENNAS_RX; i++) {
if (pci_buffer[card_id][2*i]) {
#ifdef DEBUG_PHY
msg("[openair][PHY][INIT] pci_buffer card %d %d\n",card_id,2*i);
#endif
bigfree(pci_buffer[card_id][2*i],FRAME_LENGTH_BYTES+2*PAGE_SIZE);
// free_pages(pci_buffer[2*i],8);
#ifdef DEBUG_PHY
msg("[openair][PHY][INIT] Freed TX_DMA_BUFFER %d\n",i);
#endif
}
if (pci_buffer[card_id][1+(2*i)]) {
#ifdef DEBUG_PHY
msg("[openair][PHY][INIT] pci_buffer %d %d\n",card_id,1+(2*i));
#endif
dummy_ptr = virt_to_phys(pci_buffer[card_id][1+(2*i)]);
bigfree(pci_buffer[card_id][1+(2*i)],FRAME_LENGTH_BYTES+2*PAGE_SIZE);
// free_pages(pci_buffer[1+(2*i)],8);
#ifdef DEBUG_PHY
msg("[openair][PHY][INIT] Freed RX_DMA_BUFFER %d\n",i);
#endif
}
}
}
#else
// Do USER_MODE cleanup here
#endif // USER_MODE
msg("[openair][CLEANUP] Done!\n");
}
/*
......
......@@ -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++) {
// do ifft of channel estimate
fft((short*) &lte_eNb_srs->srs_ch_estimates[ind][aa][0],
(short*) lte_eNb_srs->srs_ch_estimates_time[ind][aa],
frame_parms->twiddle_ifft,
frame_parms->rev,
frame_parms->log2_symbol_size,
frame_parms->log2_symbol_size/2,
0);
switch(frame_parms->N_RB_DL) {
case 6:
dft128((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 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 DEBUG_PHY
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,
temp = 0;
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
Re = ((int16_t*)lte_eNb_srs->srs_ch_estimates_time[ind][aa])[(i<<2)];
Im = ((int16_t*)lte_eNb_srs->srs_ch_estimates_time[ind][aa])[1+(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<<1)];
temp += (Re*Re/2) + (Im*Im/2);
}
......
......@@ -752,14 +752,36 @@ int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *phy_vars_ue,
// 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++) {
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],
(short*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa],
phy_vars_ue->lte_frame_parms.twiddle_ifft,
phy_vars_ue->lte_frame_parms.rev,
phy_vars_ue->lte_frame_parms.log2_symbol_size,
phy_vars_ue->lte_frame_parms.log2_symbol_size/2,
0);
if (phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa]) {
switch (phy_vars_ue->lte_frame_parms.N_RB_DL) {
case 6:
idft128((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 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);
......
......@@ -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
(short*)sync_tmp, /// complex output
switch (frame_parms->N_RB_DL) {
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->rev, /// bit reversed permutation vector
frame_parms->log2_symbol_size,/// log2(FFT_SIZE)
(frame_parms->log2_symbol_size/2),
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++)
((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;
......@@ -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
(short*)sync_tmp, /// complex output
frame_parms->twiddle_ifft, /// complex twiddle factors
frame_parms->rev, /// bit reversed permutation vector
frame_parms->log2_symbol_size,/// log2(FFT_SIZE)
frame_parms->log2_symbol_size/2,
0) ; /// 0 - input is in complex Q1.15 format, 1 - input is in complex redundant Q1.15 format)
switch (frame_parms->N_RB_DL) {
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;
}
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;
......@@ -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
(short*)sync_tmp, /// complex output
frame_parms->twiddle_ifft, /// complex twiddle factors
frame_parms->rev, /// bit reversed permutation vector
frame_parms->log2_symbol_size,/// log2(FFT_SIZE)
frame_parms->log2_symbol_size/2,
0); /// 0 - input is in complex Q1.15 format, 1 - input is in complex redundant Q1.15 format)
switch (frame_parms->N_RB_DL) {
case 6: