Commit b830090a authored by luis_pereira87's avatar luis_pereira87

Perform frequency offset correction in two consecutive frames for SA

parent ad37d8ae
......@@ -65,6 +65,7 @@
/* SS/PBCH parameters */
#define N_RB_SS_PBCH_BLOCK (20)
#define NB_SYMBOLS_PBCH (3)
#define NR_N_SYMBOLS_SSB (4)
#define IQ_SIZE (sizeof(int16_t) * 2) /* I and Q are alternatively stored into buffers */
#define N_SYMB_SLOT (14)
......
......@@ -42,6 +42,7 @@
#include "common_lib.h"
#include <math.h>
#include <nr-uesoftmodem.h>
#include "PHY/NR_REFSIG/pss_nr.h"
#include "PHY/NR_REFSIG/sss_nr.h"
......@@ -254,8 +255,18 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
double s_time = 1/(1.0e3*fp->samples_per_subframe); // sampling time
double off_angle = -2*M_PI*s_time*(ue->common_vars.freq_offset); // offset rotation angle compensation per sample
int start = is*fp->samples_per_frame+ue->ssb_offset; // start for offset correction is at ssb_offset (pss time position)
int end = start + 4*(fp->ofdm_symbol_size + fp->nb_prefix_samples); // loop over samples in 4 symbols (ssb size), including prefix
// In SA we need to perform frequency offset correction in two consecutive frames because we need to decode SIB1
// and we do not know yet in which slot it goes.
// start for offset correction
int start = get_softmodem_params()->sa ?
is*fp->samples_per_frame :
is*fp->samples_per_frame + ue->ssb_offset;
// loop over samples
int end = get_softmodem_params()->sa ?
start + (fp->samples_per_frame<<1):
start + NR_N_SYMBOLS_SSB*(fp->ofdm_symbol_size + fp->nb_prefix_samples);
for(int n=start; n<end; n++){
for (int ar=0; ar<fp->nb_antennas_rx; ar++) {
......
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