Commit c6ce6b79 authored by Marwan Hammouda's avatar Marwan Hammouda

time-varying frequency offset added to Qt scope

parent 79e8fa3d
......@@ -436,8 +436,8 @@ int uePosY = 0;
int fdopplerComp = 1; // flag to activate continous frequency offset compensation (=0 deacticated, =1 activated (default case))
int tdriftComp = 1;
int32_t fdopplerPrePost = 0; //pre/post compensation of the Doppler shift at the gNB side. Dummy definition at UE to avoid linking error.
double FO_PScaling = 0.33; // P scaling factor of the PID controller for the Doppler compensation at UE side
double FO_IScaling = 0.5; // I scaling factor of the PID controller for the Doppler compensation at UE side
double FO_PScaling = 0; // P scaling factor of the PID controller for the Doppler compensation at UE side
double FO_IScaling = 0; // I scaling factor of the PID controller for the Doppler compensation at UE side
double TO_PScaling = 1;
double TO_IScaling = 0.1;
......
......@@ -74,8 +74,8 @@
{"PET" , CONFIG_HLP_PathEnd, 0, .u16ptr=&pathEndingTime, .defintval=1280, TYPE_UINT16, 0}, \
{"ue_PosY" , CONFIG_HLP_uePosY, 0, .iptr=&uePosY, .defintval=0, TYPE_INT, 0}, \
{"TC" , CONFIG_HLP_TDriftComp, 0, .iptr=&tdriftComp, .defintval=1, TYPE_INT, 0}, \
{"FOP" , CONFIG_HLP_FO_PScaling, 0, .dblptr=&FO_PScaling, .defdblval=0.33, TYPE_DOUBLE, 0}, \
{"FOI" , CONFIG_HLP_FO_IScaling, 0, .dblptr=&FO_IScaling, .defdblval=0.5, TYPE_DOUBLE, 0}, \
{"FOP" , CONFIG_HLP_FO_PScaling, 0, .dblptr=&FO_PScaling, .defdblval=0, TYPE_DOUBLE, 0}, \
{"FOI" , CONFIG_HLP_FO_IScaling, 0, .dblptr=&FO_IScaling, .defdblval=0, TYPE_DOUBLE, 0}, \
{"TOP" , CONFIG_HLP_TP_Scaling, 0, .dblptr=&TO_PScaling, .defdblval=1.0, TYPE_DOUBLE, 0}, \
{"TOI" , CONFIG_HLP_TI_Scaling, 0, .dblptr=&TO_IScaling, .defdblval=0.1, TYPE_DOUBLE, 0}, \
{"TOII", CONFIG_HLP_TO_Iinit, 0, .iptr=&TO_IScalingInit, .defintval=0, TYPE_INT, 0}, \
......
......@@ -190,6 +190,7 @@ void init_nr_prs_ue_vars(PHY_VARS_NR_UE *ue)
init_nr_gold_prs(ue);
}
extern int commonDoppler;
int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
{
// create shortcuts
......@@ -383,6 +384,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
// set the initial frequency offset to 0
ue->DopplerEst = 0;
ue->DopplerEstTot = (float)commonDoppler;
return 0;
}
......
......@@ -414,7 +414,6 @@ unsigned char sign(int8_t x) {
const uint8_t pbch_deinterleaving_pattern[32] = {28, 0, 31, 30, 7, 29, 25, 27, 5, 8, 24, 9, 10, 11, 12, 13,
1, 4, 3, 14, 15, 16, 17, 2, 26, 18, 19, 20, 21, 22, 6, 23};
int nr_rx_pbch(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc,
int estimateSz,
......@@ -532,6 +531,10 @@ int nr_rx_pbch(PHY_VARS_NR_UE *ue,
// (DopplerErr-DopplerErrLast)*D_ScalingFN/D_ScalingFD); //PID controller
ue->DopplerEst = (int32_t)( (DopplerErr * FO_PScaling) + (Doppler_I_Ctrl * FO_IScaling) ); //PI controller
DopplerErrLast = DopplerErr;
ue->DopplerEstTot += (float)ue->DopplerEst;
//extern int commonDoppler;
//LOG_A(PHY, "commonDoppler: %d, DopplerEst: %f, ue->DopplerEst: %d, ue->DopplerEstTot: %f\n", commonDoppler, DopplerEst, ue->DopplerEst, ue->DopplerEstTot);
#ifdef DEBUG_PBCH
double rx_gain = openair0_cfg[0].rx_gain[0];
......
......@@ -946,7 +946,7 @@ float PainterWidgetUE::getValue()
return (float)getKPIUE()->nofRBs;
case PlotTypeUE::frequencyOffset:
return (float)this->ue->common_vars.freq_offset;
return (float)this->ue->DopplerEstTot; //common_vars.freq_offset;
case PlotTypeUE::timingAdvance:
return (float)this->ue->timing_advance;
......
......@@ -560,6 +560,7 @@ typedef struct {
// Estimated Doppler frequency shift from the DMRS
int32_t DopplerEst;
float DopplerEstTot;
/// Timing Advance updates variables
/// Timing advance update computed from the TA command signalled from gNB
......
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