Files
openairinterface5g/openair1/PHY/LTE_UE_TRANSPORT/srs_modulation.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

152 lines
5.6 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
*/
/*!
* \brief Top-level routines for generating sounding reference signal (SRS) V8.6 2009-03
*/
#include "PHY/defs_UE.h"
#include "PHY/phy_extern.h"
#include "common/utils/LOG/log.h"
static const unsigned short msrsb_6_40[8][4] =
{{36, 12, 4, 4}, {32, 16, 8, 4}, {24, 4, 4, 4}, {20, 4, 4, 4}, {16, 4, 4, 4}, {12, 4, 4, 4}, {8, 4, 4, 4}, {4, 4, 4, 4}};
static const unsigned short msrsb_41_60[8][4] =
{{48, 24, 12, 4}, {48, 16, 8, 4}, {40, 20, 4, 4}, {36, 12, 4, 4}, {32, 16, 8, 4}, {24, 4, 4, 4}, {20, 4, 4, 4}, {16, 4, 4, 4}};
static const unsigned short msrsb_61_80[8][4] = {{72, 24, 12, 4},
{64, 32, 16, 4},
{60, 20, 4, 4},
{48, 24, 12, 4},
{48, 16, 8, 4},
{40, 20, 4, 4},
{36, 12, 4, 4},
{32, 16, 8, 4}};
static const unsigned short msrsb_81_110[8][4] = {{96, 48, 24, 4},
{96, 32, 16, 4},
{80, 40, 20, 4},
{72, 24, 12, 4},
{64, 32, 16, 4},
{60, 20, 4, 4},
{48, 24, 12, 4},
{48, 16, 8, 4}};
// static const unsigned short transmission_offset_tdd[16] = {2,6,10,18,14,22,26,30,70,74,194,326,586,210};
int compareints (const void * a, const void * b)
{
return ( *(unsigned short*)a - *(unsigned short*)b );
}
#define DEBUG_SRS
int32_t generate_srs(LTE_DL_FRAME_PARMS *frame_parms,
SOUNDINGRS_UL_CONFIG_DEDICATED *soundingrs_ul_config_dedicated,
int32_t *txptr,
int16_t amp,
uint32_t subframe)
{
uint16_t msrsb=0,Nb=0,nb,b,msrs0=0,k,Msc_RS,Msc_RS_idx,carrier_pos;
uint16_t *Msc_idx_ptr;
int32_t k0;
//uint32_t subframe_offset;
uint8_t Bsrs = soundingrs_ul_config_dedicated->srs_Bandwidth;
uint8_t Csrs = frame_parms->soundingrs_ul_config_common.srs_BandwidthConfig;
uint8_t n_RRC = soundingrs_ul_config_dedicated->freqDomainPosition;
uint8_t kTC = soundingrs_ul_config_dedicated->transmissionComb;
// u is the PUCCH sequence-group number defined in Section 5.5.1.3
// ν is the base sequence number defined in Section 5.5.1.4
uint32_t u=frame_parms->pucch_config_common.grouphop[1+(subframe<<1)];;
uint32_t v=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[1+(subframe<<1)];
LOG_D(PHY,"SRS root sequence: u %d, v %d\n",u,v);
LOG_D(PHY,"CommonSrsConfig: Csrs %d, Ssrs %d, AnSrsSimultan %d \n",Csrs,
frame_parms->soundingrs_ul_config_common.srs_SubframeConfig,
frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission);
LOG_D(PHY,"DedicatedSrsConfig: Bsrs %d, bhop %d, nRRC %d, Isrs %d, kTC %d, n_SRS %d\n",Bsrs,soundingrs_ul_config_dedicated->srs_HoppingBandwidth,n_RRC
,soundingrs_ul_config_dedicated->srs_ConfigIndex,kTC
,soundingrs_ul_config_dedicated->cyclicShift);
if (frame_parms->N_RB_UL < 41) {
msrs0 = msrsb_6_40[Csrs][0];
msrsb = msrsb_6_40[Csrs][Bsrs];
Nb = Nb_6_40[Csrs][Bsrs];
} else if (frame_parms->N_RB_UL < 61) {
msrs0 = msrsb_41_60[Csrs][0];
msrsb = msrsb_41_60[Csrs][Bsrs];
Nb = Nb_41_60[Csrs][Bsrs];
} else if (frame_parms->N_RB_UL < 81) {
msrs0 = msrsb_61_80[Csrs][0];
msrsb = msrsb_61_80[Csrs][Bsrs];
Nb = Nb_61_80[Csrs][Bsrs];
} else if (frame_parms->N_RB_UL <111) {
msrs0 = msrsb_81_110[Csrs][0];
msrsb = msrsb_81_110[Csrs][Bsrs];
Nb = Nb_81_110[Csrs][Bsrs];
}
Msc_RS = msrsb * 6;
k0 = ( ( (int16_t)(frame_parms->N_RB_UL>>1) - (int16_t)(msrs0>>1) ) * 12 ) + kTC;
AssertFatal(msrsb,"divide by 0");
nb = (4*n_RRC/msrsb)%Nb;
for (b=0; b<=Bsrs; b++) {
k0 += 2*nb*Msc_RS;
}
if (k0<0) {
LOG_E(PHY,"generate_srs: invalid parameter set msrs0=%d, msrsb=%d, Nb=%d => nb=%d, k0=%d\n",msrs0,msrsb,Nb,nb,k0);
return(-1);
}
Msc_idx_ptr = (uint16_t*) bsearch((uint16_t*) &Msc_RS, (uint16_t*) dftsizes, 34, sizeof(uint16_t), compareints);
if (Msc_idx_ptr)
Msc_RS_idx = Msc_idx_ptr - dftsizes;
else {
LOG_E(PHY,"generate_srs: index for Msc_RS=%d not found\n",Msc_RS);
return(-1);
}
#ifdef DEBUG_SRS
LOG_D(PHY,"generate_srs_tx: Msc_RS = %d, Msc_RS_idx = %d, k0 = %d\n",Msc_RS, Msc_RS_idx,k0);
#endif
carrier_pos = (frame_parms->first_carrier_offset + k0);
if (carrier_pos>frame_parms->ofdm_symbol_size) {
carrier_pos -= frame_parms->ofdm_symbol_size;
}
for (k=0; k<Msc_RS; k++) {
int32_t real = ((int32_t) amp * (int32_t) ul_ref_sigs[u][v][Msc_RS_idx][k<<1]) >> 15;
int32_t imag = ((int32_t) amp * (int32_t) ul_ref_sigs[u][v][Msc_RS_idx][(k<<1)+1]) >> 15;
txptr[carrier_pos] = (real&0xFFFF) + ((imag<<16)&0xFFFF0000);
carrier_pos = carrier_pos+2;
if (carrier_pos >= frame_parms->ofdm_symbol_size)
carrier_pos=carrier_pos-frame_parms->ofdm_symbol_size;
}
return(0);
}
int generate_srs_tx_emul(PHY_VARS_UE *phy_vars_ue,uint8_t subframe)
{
LOG_D(PHY,"[UE] generate_srs_tx_emul for subframe %d\n",subframe);
return(0);
}
#ifdef MAIN
main()
{
}
#endif