Commit 86874047 authored by Roberto Louro Magueta's avatar Roberto Louro Magueta

Channel estimation, channel interpolation and SNR per RB computation based on...

Channel estimation, channel interpolation and SNR per RB computation based on SRS up to 4 antenna ports
parent 997d52b7
......@@ -625,18 +625,24 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
gNB->nr_srs_info[id]->snr_per_rb = (int8_t*)malloc16_clear(fp->N_RB_UL*sizeof(int8_t));
gNB->nr_srs_info[id]->snr = (int8_t*)malloc16_clear(sizeof(int8_t));
gNB->nr_srs_info[id]->srs_received_signal = (int32_t **)malloc16(Prx*sizeof(int32_t*));
gNB->nr_srs_info[id]->srs_ls_estimated_channel = (int32_t **)malloc16(Prx*sizeof(int32_t*));
gNB->nr_srs_info[id]->srs_estimated_channel_freq = (int32_t **)malloc16(Prx*sizeof(int32_t*));
gNB->nr_srs_info[id]->srs_estimated_channel_time = (int32_t **)malloc16(Prx*sizeof(int32_t*));
gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted = (int32_t **)malloc16(Prx*sizeof(int32_t*));
gNB->nr_srs_info[id]->srs_ls_estimated_channel = (int32_t ***)malloc16(Prx*sizeof(int32_t**));
gNB->nr_srs_info[id]->srs_estimated_channel_freq = (int32_t ***)malloc16(Prx*sizeof(int32_t**));
gNB->nr_srs_info[id]->srs_estimated_channel_time = (int32_t ***)malloc16(Prx*sizeof(int32_t**));
gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted = (int32_t ***)malloc16(Prx*sizeof(int32_t**));
for (i=0;i<Prx;i++){
gNB->nr_srs_info[id]->k_0_p[i] = (uint8_t*)malloc16_clear(MAX_NUM_NR_SRS_SYMBOLS*sizeof(uint8_t));
gNB->nr_srs_info[id]->srs_generated_signal[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
gNB->nr_srs_info[id]->srs_received_signal[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
gNB->nr_srs_info[id]->srs_ls_estimated_channel[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
gNB->nr_srs_info[id]->srs_estimated_channel_freq[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
gNB->nr_srs_info[id]->srs_estimated_channel_time[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
gNB->nr_srs_info[id]->srs_ls_estimated_channel[i] = (int32_t**)malloc16_clear(Prx*sizeof(int32_t*));
gNB->nr_srs_info[id]->srs_estimated_channel_freq[i] = (int32_t**)malloc16_clear(Prx*sizeof(int32_t*));
gNB->nr_srs_info[id]->srs_estimated_channel_time[i] = (int32_t**)malloc16_clear(Prx*sizeof(int32_t*));
gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted[i] = (int32_t**)malloc16_clear(Prx*sizeof(int32_t*));
for (int j = 0; j < Prx; j++) {
gNB->nr_srs_info[id]->srs_ls_estimated_channel[i][j] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
gNB->nr_srs_info[id]->srs_estimated_channel_freq[i][j] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
gNB->nr_srs_info[id]->srs_estimated_channel_time[i][j] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted[i][j] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
}
}
}
......
......@@ -345,22 +345,10 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
ue->nr_srs_info = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t));
ue->nr_srs_info->sc_list = (uint16_t *) malloc16_clear(6*fp->N_RB_UL*sizeof(uint16_t));
ue->nr_srs_info->k_0_p = (uint8_t**)malloc16_clear(fp->nb_antennas_rx*sizeof(uint8_t*));
ue->nr_srs_info->noise_power = (uint32_t*)malloc16_clear(sizeof(uint32_t));
ue->nr_srs_info->srs_received_signal = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
ue->nr_srs_info->srs_ls_estimated_channel = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
ue->nr_srs_info->srs_estimated_channel_freq = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
ue->nr_srs_info->srs_estimated_channel_time = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
ue->nr_srs_info->srs_estimated_channel_time_shifted = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
for (i=0; i<fp->nb_antennas_rx; i++) {
ue->nr_srs_info->k_0_p[i] = (uint8_t*)malloc16_clear(MAX_NUM_NR_SRS_SYMBOLS*sizeof(uint8_t));
ue->nr_srs_info->srs_received_signal[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
ue->nr_srs_info->srs_ls_estimated_channel[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
ue->nr_srs_info->srs_estimated_channel_freq[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
ue->nr_srs_info->srs_estimated_channel_time[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
ue->nr_srs_info->srs_estimated_channel_time_shifted[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
}
// RACH
prach_vars[gNB_id]->prachF = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) );
prach_vars[gNB_id]->prach = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) );
......
......@@ -71,11 +71,11 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB,
int slot,
nfapi_nr_srs_pdu_t *srs_pdu,
nr_srs_info_t *nr_srs_info,
int32_t *srs_generated_signal,
int32_t **srs_generated_signal,
int32_t **srs_received_signal,
int32_t **srs_estimated_channel_freq,
int32_t **srs_estimated_channel_time,
int32_t **srs_estimated_channel_time_shifted,
int32_t ***srs_estimated_channel_freq,
int32_t ***srs_estimated_channel_time,
int32_t ***srs_estimated_channel_time_shifted,
uint32_t *signal_power,
uint32_t *noise_power_per_rb,
uint32_t *noise_power,
......
......@@ -216,7 +216,7 @@ int generate_srs_nr(nfapi_nr_srs_pdu_t *srs_config_pdu,
uint8_t l0 = frame_parms->symbols_per_slot - 1 - l_offset; // Starting symbol position in the time domain
uint8_t n_SRS_cs_max = srs_max_number_cs[srs_config_pdu->comb_size];
uint16_t m_SRS_b = srs_bandwidth_config[C_SRS][B_SRS][0]; // Number of resource blocks
uint16_t M_sc_b_SRS = m_SRS_b * NR_NB_SC_PER_RB/K_TC; // Length of the SRS sequence
uint16_t M_sc_b_SRS = m_SRS_b * NR_NB_SC_PER_RB/K_TC; // Length of the SRS sequence
#ifdef SRS_DEBUG
LOG_I(NR_PHY,"Frame = %i, slot = %i\n", frame_number, slot_number);
......
......@@ -246,10 +246,10 @@ typedef struct {
uint8_t srs_generated_signal_bits;
int32_t **srs_generated_signal;
int32_t **srs_received_signal;
int32_t **srs_ls_estimated_channel;
int32_t **srs_estimated_channel_freq;
int32_t **srs_estimated_channel_time;
int32_t **srs_estimated_channel_time_shifted;
int32_t ***srs_ls_estimated_channel;
int32_t ***srs_estimated_channel_freq;
int32_t ***srs_estimated_channel_time;
int32_t ***srs_estimated_channel_time_shifted;
uint32_t *signal_power;
uint32_t *noise_power_per_rb;
uint32_t *noise_power;
......
......@@ -862,7 +862,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
nr_srs_channel_estimation(gNB,frame_rx,slot_rx,srs_pdu,
gNB->nr_srs_info[i],
gNB->nr_srs_info[i]->srs_generated_signal[0],
gNB->nr_srs_info[i]->srs_generated_signal,
gNB->nr_srs_info[i]->srs_received_signal,
gNB->nr_srs_info[i]->srs_estimated_channel_freq,
gNB->nr_srs_info[i]->srs_estimated_channel_time,
......@@ -874,10 +874,10 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
gNB->nr_srs_info[i]->snr);
T(T_GNB_PHY_UL_FREQ_CHANNEL_ESTIMATE, T_INT(0), T_INT(srs_pdu->rnti), T_INT(frame_rx), T_INT(0), T_INT(0),
T_BUFFER(gNB->nr_srs_info[i]->srs_estimated_channel_freq[0], gNB->frame_parms.ofdm_symbol_size*sizeof(int32_t)));
T_BUFFER(gNB->nr_srs_info[i]->srs_estimated_channel_freq[0][0], gNB->frame_parms.ofdm_symbol_size*sizeof(int32_t)));
T(T_GNB_PHY_UL_TIME_CHANNEL_ESTIMATE, T_INT(0), T_INT(srs_pdu->rnti), T_INT(frame_rx), T_INT(0), T_INT(0),
T_BUFFER(gNB->nr_srs_info[i]->srs_estimated_channel_time_shifted[0], gNB->frame_parms.ofdm_symbol_size*sizeof(int32_t)));
T_BUFFER(gNB->nr_srs_info[i]->srs_estimated_channel_time_shifted[0][0], gNB->frame_parms.ofdm_symbol_size*sizeof(int32_t)));
uint16_t num_srs = gNB->UL_INFO.srs_ind.number_of_pdus;
gNB->UL_INFO.srs_ind.pdu_list = &gNB->srs_pdu_list[0];
......@@ -885,7 +885,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
gNB->UL_INFO.srs_ind.slot = slot_rx;
gNB->srs_pdu_list[num_srs].handle = srs_pdu->handle;
gNB->srs_pdu_list[num_srs].rnti = srs_pdu->rnti;
gNB->srs_pdu_list[num_srs].timing_advance = nr_est_timing_advance_srs(&gNB->frame_parms, gNB->nr_srs_info[i]->srs_estimated_channel_time);
gNB->srs_pdu_list[num_srs].timing_advance = nr_est_timing_advance_srs(&gNB->frame_parms, gNB->nr_srs_info[i]->srs_estimated_channel_time[0]);
gNB->srs_pdu_list[num_srs].num_symbols = 1<<srs_pdu->num_symbols;
gNB->srs_pdu_list[num_srs].wide_band_snr = (*gNB->nr_srs_info[i]->snr + 64)<<1;
gNB->srs_pdu_list[num_srs].num_reported_symbols = 1<<srs_pdu->num_symbols;
......
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