Commit 153b206d authored by Guy De Souza's avatar Guy De Souza

DC subcarrier fix/minor changes

parent db326bbf
...@@ -68,12 +68,10 @@ int nr_generate_pss( int16_t *d_pss, ...@@ -68,12 +68,10 @@ int nr_generate_pss( int16_t *d_pss,
for (m = 0; m < NR_PSS_LENGTH; m++) { for (m = 0; m < NR_PSS_LENGTH; m++) {
((int16_t*)txdataF[aa])[2*(l*frame_parms->ofdm_symbol_size + k)] = (a * d_pss[m]) >> 15; ((int16_t*)txdataF[aa])[2*(l*frame_parms->ofdm_symbol_size + k)] = (a * d_pss[m]) >> 15;
k+=1; k++;
if (k >= frame_parms->ofdm_symbol_size) { if (k >= frame_parms->ofdm_symbol_size)
k++; //skip DC
k-=frame_parms->ofdm_symbol_size; k-=frame_parms->ofdm_symbol_size;
}
} }
} }
......
...@@ -78,12 +78,10 @@ int nr_generate_sss( int16_t *d_sss, ...@@ -78,12 +78,10 @@ int nr_generate_sss( int16_t *d_sss,
for (m = 0; m < NR_SSS_LENGTH; m++) { for (m = 0; m < NR_SSS_LENGTH; m++) {
((int16_t*)txdataF[aa])[2*(l*frame_parms->ofdm_symbol_size + k)] = (a * d_sss[m]) >> 15; ((int16_t*)txdataF[aa])[2*(l*frame_parms->ofdm_symbol_size + k)] = (a * d_sss[m]) >> 15;
k+=1; k++;
if (k >= frame_parms->ofdm_symbol_size) { if (k >= frame_parms->ofdm_symbol_size)
k++; //skip DC
k-=frame_parms->ofdm_symbol_size; k-=frame_parms->ofdm_symbol_size;
}
} }
} }
#ifdef NR_SSS_DEBUG #ifdef NR_SSS_DEBUG
......
...@@ -169,6 +169,14 @@ static inline void* malloc16_clear( size_t size ) ...@@ -169,6 +169,14 @@ static inline void* malloc16_clear( size_t size )
#define nr_subframe_t lte_subframe_t #define nr_subframe_t lte_subframe_t
typedef enum{
nr_ssb_type_A = 0,
nr_ssb_type_B,
nr_ssb_type_C,
nr_ssb_type_D,
nr_ssb_type_E
} nr_ssb_type_e;
typedef struct { typedef struct {
/// EUTRA Band /// EUTRA Band
uint8_t eutra_band; uint8_t eutra_band;
...@@ -204,8 +212,11 @@ typedef struct { ...@@ -204,8 +212,11 @@ typedef struct {
uint32_t samples_per_subframe_wCP; uint32_t samples_per_subframe_wCP;
/// Number of samples in a radio frame without CP /// Number of samples in a radio frame without CP
uint32_t samples_per_frame_wCP; uint32_t samples_per_frame_wCP;
//SSB related params
/// Start in Subcarrier index of the SSB block /// Start in Subcarrier index of the SSB block
uint16_t ssb_start_subcarrier; uint16_t ssb_start_subcarrier;
nr_ssb_type_e ssb_type;
} NR_DL_FRAME_PARMS; } NR_DL_FRAME_PARMS;
struct PHY_VARS_gNB_s; struct PHY_VARS_gNB_s;
......
...@@ -40,42 +40,3 @@ nr_subframe_t nr_subframe_select(nfapi_config_request_t *cfg,unsigned char subfr ...@@ -40,42 +40,3 @@ nr_subframe_t nr_subframe_select(nfapi_config_request_t *cfg,unsigned char subfr
return(SF_DL); return(SF_DL);
} }
// First possible symbol is used with n=0
int nr_get_ssb_start_symbol(nfapi_config_request_t *cfg, NR_DL_FRAME_PARMS *fp)
{
int mu = cfg->subframe_config.numerology_index_mu.value;
int symbol = 0;
switch(mu) {
case NR_MU_0:
symbol = 2;
break;
case NR_MU_1: // case B
symbol = 4;
break;
case NR_MU_3:
symbol = 4;
break;
case NR_MU_4:
symbol = 8;
break;
default:
AssertFatal(0==1, "Invalid numerology index %d for the synchronization block\n", mu);
}
if (cfg->sch_config.half_frame_index.value)
symbol += (5 * fp->symbols_per_slot * fp->slots_per_subframe);
return symbol;
}
void nr_set_ssb_first_subcarrier(nfapi_config_request_t *cfg, NR_DL_FRAME_PARMS *fp)
{
int start_rb = cfg->sch_config.n_ssb_crb.value / pow(2,cfg->subframe_config.numerology_index_mu.value);
fp->ssb_start_subcarrier = 12 * start_rb + cfg->sch_config.ssb_subcarrier_offset.value;
}
...@@ -39,6 +39,79 @@ ...@@ -39,6 +39,79 @@
#endif #endif
extern uint8_t nfapi_mode; extern uint8_t nfapi_mode;
/*
int return_ssb_type(nfapi_config_request_t *cfg)
{
int mu = cfg->subframe_config.numerology_index_mu.value;
nr_numerology_index_e ssb_type;
switch(mu) {
case NR_MU_0:
ssb_type = nr_ssb_type_A;
break;
case NR_MU_1:
ssb_type = nr_ssb_type_B;
break;
case NR_MU_3:
ssb_type = nr_ssb_type_D;
break;
case NR_MU_4:
ssb_type = nr_ssb_type_E;
break;
default:
AssertFatal(0==1, "Invalid numerology index %d for the synchronization block\n", mu);
}
LOG_D(PHY, "SSB type %d\n", ssb_type);
return ssb_type;
}*/
// First SSB starting symbol candidate is used and type B is chosen for 30kHz SCS
int nr_get_ssb_start_symbol(nfapi_config_request_t *cfg, NR_DL_FRAME_PARMS *fp)
{
int mu = cfg->subframe_config.numerology_index_mu.value;
int symbol = 0;
switch(mu) {
case NR_MU_0:
symbol = 2;
break;
case NR_MU_1: // case B
symbol = 4;
break;
case NR_MU_3:
symbol = 4;
break;
case NR_MU_4:
symbol = 8;
break;
default:
AssertFatal(0==1, "Invalid numerology index %d for the synchronization block\n", mu);
}
if (cfg->sch_config.half_frame_index.value)
symbol += (5 * fp->symbols_per_slot * fp->slots_per_subframe);
return symbol;
}
void nr_set_ssb_first_subcarrier(nfapi_config_request_t *cfg, NR_DL_FRAME_PARMS *fp)
{
int start_rb = cfg->sch_config.n_ssb_crb.value / pow(2,cfg->subframe_config.numerology_index_mu.value);
fp->ssb_start_subcarrier = 12 * start_rb + cfg->sch_config.ssb_subcarrier_offset.value;
LOG_D(PHY, "SSB first subcarrier %d\n", fp->ssb_start_subcarrier);
}
void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int subframe) { void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int subframe) {
......
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