Files
openairinterface5g/openair1/PHY/MODULATION/slot_fep_ul.c
T
Robert Schmidt 8107939f08 Change OAI license to CSSL v1.0 (and others)
- all RAN code, CI code, configuration files, dockerfiles, in CSSL v1.0
- all deployment code (openshift, charts, ancillary files like shell
  scripts), in MIT
- documentation in CC-BY-4.0
- exceptions might apply and are listed in NOTICE
- there is a new LICENSES folder with all licenses
- CONTRIBUTIONS.md has been updated accordingly

For automated changes based on OAI PL v1.1:

    perl -i~ -0pe 's/\/\*.*Licensed to the OpenAirInterface.*openairinterface.org\n#?/\/*\n * SPDX-License-Identifier: LicenseRef-CSSL-1.0\n/s' **/*.{c,h,cpp}
    perl -i~ -0pe 's/\/\*.*Licensed to the OpenAirInterface.*openairinterface.org\n#?/\/*\n * SPDX-License-Identifier: LicenseRef-CSSL-1.0\n/s' **/*.ts
    perl -i~ -0pe 's/<!--.*Licensed to the OpenAirInterface.*openairinterface.org\n.*-->/<!-- SPDX-License-Identifier: LicenseRef-CSSL-1.0 -->/s' **/*.xml

The rest (cmake, files with missing license, cmake) manually.
2026-03-27 16:36:37 +01:00

97 lines
3.0 KiB
C

/*
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
*/
#include "PHY/defs_eNB.h"
//#include "PHY/phy_extern.h"
//#include "modulation_eNB.h"
//#define DEBUG_FEP
int slot_fep_ul(RU_t *ru,
unsigned char l,
unsigned char Ns,
int no_prefix)
{
#ifdef DEBUG_FEP
char fname[40], vname[40];
#endif
unsigned char aa;
RU_COMMON *common=&ru->common;
LTE_DL_FRAME_PARMS *fp = ru->frame_parms;
unsigned char symbol = l+((7-fp->Ncp)*(Ns&1)); ///symbol within sub-frame
unsigned int nb_prefix_samples = (no_prefix ? 0 : fp->nb_prefix_samples);
unsigned int nb_prefix_samples0 = (no_prefix ? 0 : fp->nb_prefix_samples0);
// unsigned int subframe_offset;
unsigned int slot_offset;
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 rx_offset;
int s = fp->ofdm_symbol_size;
if (s != 128 && s != 256 && s != 512 && s != 1024 && s != 1536 && s != 2048)
s = 512;
const dft_size_idx_t dftsize = get_dft(s);
if (no_prefix) {
// subframe_offset = frame_parms->ofdm_symbol_size * frame_parms->symbols_per_tti * (Ns>>1);
slot_offset = fp->ofdm_symbol_size * (fp->symbols_per_tti>>1) * (Ns&1);
} else {
// subframe_offset = frame_parms->samples_per_tti * (Ns>>1);
slot_offset = (fp->samples_per_tti>>1) * (Ns&1);
}
if (l<0 || l>=7-fp->Ncp) {
LOG_E(PHY,"slot_fep: l must be between 0 and %d\n",7-fp->Ncp);
return(-1);
}
if (Ns<0 || Ns>=20) {
LOG_E(PHY,"slot_fep: Ns must be between 0 and 19\n");
return(-1);
}
#ifdef DEBUG_FEP
LOG_D(PHY,"slot_fep: Ns %d offset %d, symbol %d, nb_prefix_samples %d\n",Ns,slot_offset,symbol, nb_prefix_samples);
#endif
for (aa=0; aa<ru->nb_rx; aa++) {
rx_offset = slot_offset +nb_prefix_samples0;
if (l==0) {
#ifdef DEBUG_FEP
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)));
#endif
dft( dftsize,(int16_t *)&common->rxdata_7_5kHz[aa][rx_offset],
(int16_t *)&common->rxdataF[aa][fp->ofdm_symbol_size*symbol],
1
);
} else {
rx_offset += (fp->ofdm_symbol_size+nb_prefix_samples)*l;
// check for 256-bit alignment of input buffer and do DFT directly, else do via intermediate buffer
if( (rx_offset & 15) != 0){
memcpy((void *)&tmp_dft_in,
(void *)&common->rxdata_7_5kHz[aa][(rx_offset % frame_length_samples)],
fp->ofdm_symbol_size*sizeof(int));
dft( dftsize,(short *) tmp_dft_in,
(short*) &common->rxdataF[aa][fp->ofdm_symbol_size*symbol],
1
);
}
else{
dft( dftsize,(short *)&common->rxdata_7_5kHz[aa][rx_offset],
(short*)&common->rxdataF[aa][fp->ofdm_symbol_size*symbol],
1
);
}
}
}
#ifdef DEBUG_FEP
// LOG_D(PHY,"slot_fep: done\n");
#endif
return(0);
}