Commit e450fe88 authored by Marwan Hammouda's avatar Marwan Hammouda

command line option added to activate/deactivate timing offset simulation on RFSimulator

parent 1a700b82
......@@ -116,6 +116,7 @@
#define CONFIG_HLP_GNBK2 "Set the additional k2 for NTN at gNB\n"
#define CONFIG_HLP_ULSCHEDF "Set the maximum number of buffered UL scheduled frames at gNB\n"
#define CONFIG_HLP_FDoppler "Set the maximum Doppler frequency shift\n"
#define CONFIG_HLP_TShift "Set the maximum Doppler frequency shift\n"
#define CONFIG_HLP_FDopplerComp "Execute continous frequency offset compensation\n"
#define CONFIG_HLP_TDRIFT "Set the timing offset/drift per frame in the RF simulator (expressed in number of samples per frame)\n"
#define CONFIG_HLP_PathStart "Set the time [sec] at which satellite is becoming visible to the UE"
......@@ -185,6 +186,7 @@ extern uint16_t NTN_UE_k2; //the additional k2 value at UE
extern uint16_t NTN_gNB_k2; //the additional k2 value at gNB
extern uint16_t max_ul_sched_frame; //Set the maximum number of buffered UL scheduled frames at gNB, for UL_tti_req_ahead and vrb_map_UL
extern int fdoppler; // flag to simulate frequency offset at the RF-Simulator (default active = 1, 0 = de-activate)
extern int tshift; // flag to simulate timing offset at the RF-Simulator (default active = 1, 0 = de-activate)
extern int fdopplerComp; // flag to activate/deactivate continous frequency offset compensation
extern int RFsim_DriftPerFrame; //the timing offset/drift per frame in the RF simulator (expressed in number of samples per frame)
extern uint16_t pathStartingTime; // time [sec] at which satellite is becoming visible to the UE.
......
......@@ -572,6 +572,7 @@ uint64_t RFsim_PropDelay = 0;
uint16_t NTN_gNB_k2 = 0;
uint16_t max_ul_sched_frame = 1;
int fdoppler = 1; // flag to simulate frequency offset at the RF-Simulator (default active = 1, 0 = de-activate)
int tshift = 0; // flag to simulate timing offset at the RF-Simulator (default de-activate = 0, 0 = activate)
int fdopplerComp = 1;
int RFsim_DriftPerFrame = 0;
uint16_t pathStartingTime = 1050;
......
......@@ -36,6 +36,7 @@
{"gnb_k2" , CONFIG_HLP_GNBK2, 0, .u16ptr=&NTN_gNB_k2, .defintval=0, TYPE_UINT16, 0}, \
{"ul_sched_f" , CONFIG_HLP_ULSCHEDF, 0, .u16ptr=&max_ul_sched_frame, .defintval=1, TYPE_UINT16, 0}, \
{"FD" , CONFIG_HLP_FDoppler, 0, .iptr=&fdoppler, .defintval=1, TYPE_INT, 0}, \
{"TS" , CONFIG_HLP_TShift, 0, .iptr=&tshift, .defintval=0, TYPE_INT, 0}, \
{"TD" , CONFIG_HLP_TDRIFT, 0, .iptr=&RFsim_DriftPerFrame, .defintval=0, TYPE_INT, 0}, \
{"PST" , CONFIG_HLP_PathStart, 0, .u16ptr=&pathStartingTime, .defintval=1050, TYPE_UINT16, 0}, \
{"PET" , CONFIG_HLP_PathEnd, 0, .u16ptr=&pathEndingTime, .defintval=1280, TYPE_UINT16, 0}, \
......
......@@ -429,6 +429,7 @@ uint16_t NTN_UE_k2 = 0;
uint16_t NTN_UE_slot_Rx_to_Tx = 0;
int RFsim_DriftPerFrame = 0;
int32_t fdoppler = 1; // flag to simulate frequency offset at the RF-Simulator (default active = 1, 0 = de-activate)
int32_t tshift = 0; // flag to simulate timing offset at the RF-Simulator (default de-activate = 0, 1 = activate)
uint16_t pathStartingTime = 1050;
uint16_t pathEndingTime = 1280;
int uePosY = 0;
......
......@@ -67,6 +67,7 @@
{"ue_slot_Rx_Tx" , CONFIG_HLP_UESLOTRXTX, 0, .u16ptr=&NTN_UE_slot_Rx_to_Tx, .defintval=0, TYPE_UINT16, 0}, \
{"ue_k2" , CONFIG_HLP_UEK2, 0, .u16ptr=&NTN_UE_k2, .defintval=0, TYPE_UINT16, 0}, \
{"FD" , CONFIG_HLP_FDoppler, 0, .iptr=&fdoppler, .defintval=1, TYPE_INT, 0}, \
{"TS" , CONFIG_HLP_TShift, 0, .iptr=&tshift, .defintval=0, TYPE_INT, 0}, \
{"FC" , CONFIG_HLP_FDopplerComp, 0, .iptr=&fdopplerComp, .defintval=1, TYPE_INT, 0}, \
{"TD" , CONFIG_HLP_TDRIFT, 0, .iptr=&RFsim_DriftPerFrame, .defintval=0, TYPE_INT, 0}, \
{"PST" , CONFIG_HLP_PathStart, 0, .u16ptr=&pathStartingTime, .defintval=1050, TYPE_UINT16, 0}, \
......
......@@ -836,6 +836,7 @@ static bool flushInput(rfsimulator_state_t *t, int timeout, int nsamps_for_initi
//Paramters for Doppler shift. Assume the Doppler frequency changes every frame
extern int32_t fdoppler; // flag to simulate frequency offset (default active = 1, 0 = de-activate)
extern int tshift;
const uint32_t fsamp = 61440000; //sampling frequency
extern uint16_t pathStartingTime; // time [sec] at which satellite is becoming visible to the UE
extern uint16_t pathEndingTime; // time [sec] at which satellite is no more visible to the UE
......@@ -972,7 +973,8 @@ static int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimest
currDoppler = (currDopplerTmp - initDoppler) ;
}
RFsim_PropDelay = (2 * norm_d / c) * fsamp;
if(tshift)
RFsim_PropDelay = (2 * norm_d / c) * fsamp;
//printf("**** counter: %lu, RFsim_PropDelay[Samp]: %lu , Doppler: %d, freqScale: %f ***** \n ", counter, RFsim_PropDelay, currDoppler, freqScale);
//LOG_I(HW, "nbAnt_tx %d\n",nbAnt_tx);
......
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