NR_UE: reset max_pos_fil in timing synchronization whenever we add/remove a sample
This commit is contained in:
+4
-2
@@ -464,14 +464,16 @@ int computeSamplesShift(PHY_VARS_NR_UE *UE) {
|
||||
if ( UE->rx_offset < UE->frame_parms.samples_per_frame/2 &&
|
||||
UE->rx_offset > 0 ) {
|
||||
//LOG_I(PHY,"!!!adjusting -1 samples!!!\n");
|
||||
UE->rx_offset = 0; // reset so that it is not applied falsely in case of SSB being only in every second frame
|
||||
UE->rx_offset = 0; // reset so that it is not applied falsely in case of SSB being only in every second frame
|
||||
UE->max_pos_fil = 0; // reset IIR filter when sample shift is applied
|
||||
return -1 ;
|
||||
}
|
||||
|
||||
if ( UE->rx_offset > UE->frame_parms.samples_per_frame/2 &&
|
||||
UE->rx_offset < UE->frame_parms.samples_per_frame ) {
|
||||
//LOG_I(PHY,"!!!adjusting +1 samples!!!\n");
|
||||
UE->rx_offset = 0; // reset so that it is not applied falsely in case of SSB being only in every second frame
|
||||
UE->rx_offset = 0; // reset so that it is not applied falsely in case of SSB being only in every second frame
|
||||
UE->max_pos_fil = 0; // reset IIR filter when sample shift is applied
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms,
|
||||
short coef)
|
||||
{
|
||||
|
||||
static int max_pos_fil = 0;
|
||||
static int count_max_pos_ok = 0;
|
||||
static int first_time = 1;
|
||||
int max_val = 0, max_pos = 0;
|
||||
@@ -74,14 +73,14 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
// filter position to reduce jitter
|
||||
if (clear == 1)
|
||||
max_pos_fil = max_pos;
|
||||
ue->max_pos_fil = max_pos;
|
||||
else
|
||||
max_pos_fil = ((max_pos_fil * coef) + (max_pos * ncoef)) >> 15;
|
||||
ue->max_pos_fil = ((ue->max_pos_fil * coef) + (max_pos * ncoef)) >> 15;
|
||||
|
||||
// do not filter to have proactive timing adjustment
|
||||
//max_pos_fil = max_pos;
|
||||
//ue->max_pos_fil = max_pos;
|
||||
|
||||
int diff = max_pos_fil - sync_pos;
|
||||
int diff = ue->max_pos_fil - sync_pos;
|
||||
|
||||
if (frame_parms->freq_range==nr_FR2)
|
||||
sync_offset = 2;
|
||||
@@ -129,7 +128,7 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms,
|
||||
ue->rx_offset,
|
||||
clear,
|
||||
max_pos,
|
||||
max_pos_fil,
|
||||
ue->max_pos_fil,
|
||||
max_val,
|
||||
sync_pos);
|
||||
#endif //DEBUG_PHY
|
||||
|
||||
@@ -921,9 +921,10 @@ typedef struct {
|
||||
uint8_t init_sync_frame;
|
||||
/// temporary offset during cell search prior to MIB decoding
|
||||
int ssb_offset;
|
||||
uint16_t symbol_offset; // offset in terms of symbols for detected ssb in sync
|
||||
int rx_offset; /// Timing offset
|
||||
uint16_t symbol_offset; /// offset in terms of symbols for detected ssb in sync
|
||||
int rx_offset; /// Timing offset
|
||||
int rx_offset_diff; /// Timing adjustment for ofdm symbol0 on HW USRP
|
||||
int max_pos_fil; /// Timing offset IIR filter
|
||||
int time_sync_cell;
|
||||
|
||||
/// Timing Advance updates variables
|
||||
|
||||
Reference in New Issue
Block a user