Commit 257de657 authored by Jaroslava Fiedlerova's avatar Jaroslava Fiedlerova

Merge remote-tracking branch 'origin/fix_db_fixed' into integration_2026_w10 (!3914)

Fix dB_fixed() function

- dB_fixed(0) returns 0 in develop branch;
- 0 in dB is -INF, but since we're dealing with integer variables, we'll put
  20*log10(2^-15) in the output of dB_fixed() function, instead of 0.
- make all users use signed variables
parents ef14a2b9 bc6963c5
...@@ -87,12 +87,12 @@ void lte_eNB_I0_measurements(PHY_VARS_eNB *eNB, ...@@ -87,12 +87,12 @@ void lte_eNB_I0_measurements(PHY_VARS_eNB *eNB,
measurements->n0_power[aarx] = ((k1*signal_energy(&common_vars->rxdata[aarx][(frame_parms->samples_per_tti<<1) -frame_parms->ofdm_symbol_size], measurements->n0_power[aarx] = ((k1*signal_energy(&common_vars->rxdata[aarx][(frame_parms->samples_per_tti<<1) -frame_parms->ofdm_symbol_size],
frame_parms->ofdm_symbol_size)) + k2*measurements->n0_power[aarx])>>10; frame_parms->ofdm_symbol_size)) + k2*measurements->n0_power[aarx])>>10;
//measurements->n0_power[aarx] = (measurements->n0_power[aarx]) * 12*frame_parms->N_RB_DL)/(frame_parms->ofdm_symbol_size); //measurements->n0_power[aarx] = (measurements->n0_power[aarx]) * 12*frame_parms->N_RB_DL)/(frame_parms->ofdm_symbol_size);
measurements->n0_power_dB[aarx] = (unsigned short) dB_fixed(measurements->n0_power[aarx]); measurements->n0_power_dB[aarx] = dB_fixed(measurements->n0_power[aarx]);
measurements->n0_power_tot += measurements->n0_power[aarx]; measurements->n0_power_tot += measurements->n0_power[aarx];
} }
measurements->n0_power_tot_dB = (unsigned short) dB_fixed(measurements->n0_power_tot); measurements->n0_power_tot_dB = dB_fixed(measurements->n0_power_tot);
measurements->n0_power_tot_dBm = measurements->n0_power_tot_dB - eNB->rx_total_gain_dB; measurements->n0_power_tot_dBm = measurements->n0_power_tot_dB - eNB->rx_total_gain_dB;
// printf("n0_power %d\n",measurements->n0_power_tot_dB); // printf("n0_power %d\n",measurements->n0_power_tot_dB);
...@@ -183,14 +183,14 @@ void lte_eNB_srs_measurements(PHY_VARS_eNB *eNB, ...@@ -183,14 +183,14 @@ void lte_eNB_srs_measurements(PHY_VARS_eNB *eNB,
measurements->rx_spatial_power[srs_id][0][aarx]<<=1; // because of noise only in odd samples measurements->rx_spatial_power[srs_id][0][aarx]<<=1; // because of noise only in odd samples
measurements->rx_spatial_power_dB[srs_id][0][aarx] = (unsigned short) dB_fixed(measurements->rx_spatial_power[srs_id][0][aarx]); measurements->rx_spatial_power_dB[srs_id][0][aarx] = dB_fixed(measurements->rx_spatial_power[srs_id][0][aarx]);
measurements->wideband_cqi[srs_id][aarx] = measurements->rx_spatial_power[srs_id][0][aarx]; measurements->wideband_cqi[srs_id][aarx] = measurements->rx_spatial_power[srs_id][0][aarx];
// measurements->rx_power[UE_id][aarx]/=frame_parms->nb_antennas_tx; // measurements->rx_power[UE_id][aarx]/=frame_parms->nb_antennas_tx;
measurements->wideband_cqi_dB[srs_id][aarx] = (unsigned short) dB_fixed(measurements->wideband_cqi[srs_id][aarx]); measurements->wideband_cqi_dB[srs_id][aarx] = dB_fixed(measurements->wideband_cqi[srs_id][aarx]);
rx_power += measurements->wideband_cqi[srs_id][aarx]; rx_power += measurements->wideband_cqi[srs_id][aarx];
// measurements->rx_avg_power_dB[UE_id] += measurements->rx_power_dB[UE_id][aarx]; // measurements->rx_avg_power_dB[UE_id] += measurements->rx_power_dB[UE_id][aarx];
} }
...@@ -206,7 +206,7 @@ void lte_eNB_srs_measurements(PHY_VARS_eNB *eNB, ...@@ -206,7 +206,7 @@ void lte_eNB_srs_measurements(PHY_VARS_eNB *eNB,
measurements->wideband_cqi_tot[srs_id] = dB_fixed2(rx_power,2*measurements->n0_power_tot); measurements->wideband_cqi_tot[srs_id] = dB_fixed2(rx_power,2*measurements->n0_power_tot);
// times 2 since we have noise only in the odd carriers of the srs comb // times 2 since we have noise only in the odd carriers of the srs comb
measurements->rx_rssi_dBm[srs_id] = (int32_t)dB_fixed(rx_power_avg_eNB[srs_id])-eNB->rx_total_gain_dB; measurements->rx_rssi_dBm[srs_id] = dB_fixed(rx_power_avg_eNB[srs_id])-eNB->rx_total_gain_dB;
......
...@@ -254,13 +254,13 @@ void ue_rrc_measurements(PHY_VARS_UE *ue, ...@@ -254,13 +254,13 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
// ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-64]*rxF_pss[-64])+((int32_t)rxF_pss[-63]*rxF_pss[-63])); // ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-64]*rxF_pss[-64])+((int32_t)rxF_pss[-63]*rxF_pss[-63]));
// printf("pssm32 %d\n",ue->measurements.n0_power[aarx]); // printf("pssm32 %d\n",ue->measurements.n0_power[aarx]);
ue->measurements.n0_power_dB[aarx] = (unsigned short) dB_fixed(ue->measurements.n0_power[aarx]/12); ue->measurements.n0_power_dB[aarx] = dB_fixed(ue->measurements.n0_power[aarx]/12);
ue->measurements.n0_power_tot /*+=*/ = ue->measurements.n0_power[aarx]; ue->measurements.n0_power_tot /*+=*/ = ue->measurements.n0_power[aarx];
} }
//LOG_I(PHY,"Subframe %d RRC UE MEAS Noise Level %d \n", subframe, ue->measurements.n0_power_tot); //LOG_I(PHY,"Subframe %d RRC UE MEAS Noise Level %d \n", subframe, ue->measurements.n0_power_tot);
ue->measurements.n0_power_tot_dB = (unsigned short) dB_fixed(ue->measurements.n0_power_tot/(12*aarx)); ue->measurements.n0_power_tot_dB = dB_fixed(ue->measurements.n0_power_tot/(12*aarx));
ue->measurements.n0_power_tot_dBm = ue->measurements.n0_power_tot_dB - ue->rx_total_gain_dB - dB_fixed(ue->frame_parms.ofdm_symbol_size); ue->measurements.n0_power_tot_dBm = ue->measurements.n0_power_tot_dB - ue->rx_total_gain_dB - dB_fixed(ue->frame_parms.ofdm_symbol_size);
} else { } else {
LOG_E(PHY, "Not yet implemented: noise power calculation when prefix length == EXTENDED\n"); LOG_E(PHY, "Not yet implemented: noise power calculation when prefix length == EXTENDED\n");
...@@ -311,11 +311,11 @@ void ue_rrc_measurements(PHY_VARS_UE *ue, ...@@ -311,11 +311,11 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-66]*rxF_pss[-66])+((int32_t)rxF_pss[-65]*rxF_pss[-65])); ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-66]*rxF_pss[-66])+((int32_t)rxF_pss[-65]*rxF_pss[-65]));
// ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-64]*rxF_pss[-64])+((int32_t)rxF_pss[-63]*rxF_pss[-63])); // ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-64]*rxF_pss[-64])+((int32_t)rxF_pss[-63]*rxF_pss[-63]));
// printf("pssm32 %d\n",ue->measurements.n0_power[aarx]); // printf("pssm32 %d\n",ue->measurements.n0_power[aarx]);
ue->measurements.n0_power_dB[aarx] = (unsigned short) dB_fixed(ue->measurements.n0_power[aarx]/12); ue->measurements.n0_power_dB[aarx] = dB_fixed(ue->measurements.n0_power[aarx]/12);
ue->measurements.n0_power_tot /*+=*/ = ue->measurements.n0_power[aarx]; ue->measurements.n0_power_tot /*+=*/ = ue->measurements.n0_power[aarx];
} }
ue->measurements.n0_power_tot_dB = (unsigned short) dB_fixed(ue->measurements.n0_power_tot/(12*aarx)); ue->measurements.n0_power_tot_dB = dB_fixed(ue->measurements.n0_power_tot/(12*aarx));
ue->measurements.n0_power_tot_dBm = ue->measurements.n0_power_tot_dB - ue->rx_total_gain_dB - dB_fixed(ue->frame_parms.ofdm_symbol_size); ue->measurements.n0_power_tot_dBm = ue->measurements.n0_power_tot_dB - ue->rx_total_gain_dB - dB_fixed(ue->frame_parms.ofdm_symbol_size);
//LOG_I(PHY,"Subframe %d RRC UE MEAS Noise Level %d \n", subframe, ue->measurements.n0_power_tot); //LOG_I(PHY,"Subframe %d RRC UE MEAS Noise Level %d \n", subframe, ue->measurements.n0_power_tot);
...@@ -1034,7 +1034,7 @@ void lte_ue_measurements(PHY_VARS_UE *ue, ...@@ -1034,7 +1034,7 @@ void lte_ue_measurements(PHY_VARS_UE *ue,
if (ue->measurements.rx_spatial_power[eNB_id][aatx][aarx]<0) if (ue->measurements.rx_spatial_power[eNB_id][aatx][aarx]<0)
ue->measurements.rx_spatial_power[eNB_id][aatx][aarx] = 0; //ue->measurements.n0_power[aarx]; ue->measurements.rx_spatial_power[eNB_id][aatx][aarx] = 0; //ue->measurements.n0_power[aarx];
ue->measurements.rx_spatial_power_dB[eNB_id][aatx][aarx] = (unsigned short) dB_fixed(ue->measurements.rx_spatial_power[eNB_id][aatx][aarx]); ue->measurements.rx_spatial_power_dB[eNB_id][aatx][aarx] = dB_fixed(ue->measurements.rx_spatial_power[eNB_id][aatx][aarx]);
if (aatx==0) if (aatx==0)
ue->measurements.rx_power[eNB_id][aarx] = ue->measurements.rx_spatial_power[eNB_id][aatx][aarx]; ue->measurements.rx_power[eNB_id][aarx] = ue->measurements.rx_spatial_power[eNB_id][aatx][aarx];
...@@ -1042,7 +1042,7 @@ void lte_ue_measurements(PHY_VARS_UE *ue, ...@@ -1042,7 +1042,7 @@ void lte_ue_measurements(PHY_VARS_UE *ue,
ue->measurements.rx_power[eNB_id][aarx] += ue->measurements.rx_spatial_power[eNB_id][aatx][aarx]; ue->measurements.rx_power[eNB_id][aarx] += ue->measurements.rx_spatial_power[eNB_id][aatx][aarx];
} //aatx } //aatx
ue->measurements.rx_power_dB[eNB_id][aarx] = (unsigned short) dB_fixed(ue->measurements.rx_power[eNB_id][aarx]); ue->measurements.rx_power_dB[eNB_id][aarx] = dB_fixed(ue->measurements.rx_power[eNB_id][aarx]);
if (aarx==0) if (aarx==0)
ue->measurements.rx_power_tot[eNB_id] = ue->measurements.rx_power[eNB_id][aarx]; ue->measurements.rx_power_tot[eNB_id] = ue->measurements.rx_power[eNB_id][aarx];
...@@ -1050,7 +1050,7 @@ void lte_ue_measurements(PHY_VARS_UE *ue, ...@@ -1050,7 +1050,7 @@ void lte_ue_measurements(PHY_VARS_UE *ue,
ue->measurements.rx_power_tot[eNB_id] += ue->measurements.rx_power[eNB_id][aarx]; ue->measurements.rx_power_tot[eNB_id] += ue->measurements.rx_power[eNB_id][aarx];
} //aarx } //aarx
ue->measurements.rx_power_tot_dB[eNB_id] = (unsigned short) dB_fixed(ue->measurements.rx_power_tot[eNB_id]); ue->measurements.rx_power_tot_dB[eNB_id] = dB_fixed(ue->measurements.rx_power_tot[eNB_id]);
} //eNB_id } //eNB_id
......
...@@ -48,7 +48,7 @@ void rx_prach0(PHY_VARS_eNB *eNB, ...@@ -48,7 +48,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
uint16_t *max_preamble, uint16_t *max_preamble,
uint16_t *max_preamble_energy, uint16_t *max_preamble_energy,
uint16_t *max_preamble_delay, uint16_t *max_preamble_delay,
uint16_t *avg_preamble_energy, int16_t *avg_preamble_energy,
uint16_t Nf, uint16_t Nf,
uint8_t tdd_mapindex, uint8_t tdd_mapindex,
uint8_t br_flag, uint8_t br_flag,
...@@ -639,7 +639,7 @@ void rx_prach(PHY_VARS_eNB *eNB, ...@@ -639,7 +639,7 @@ void rx_prach(PHY_VARS_eNB *eNB,
uint16_t *max_preamble, uint16_t *max_preamble,
uint16_t *max_preamble_energy, uint16_t *max_preamble_energy,
uint16_t *max_preamble_delay, uint16_t *max_preamble_delay,
uint16_t *avg_preamble_energy, int16_t *avg_preamble_energy,
uint16_t Nf, uint16_t Nf,
uint8_t tdd_mapindex, uint8_t tdd_mapindex,
uint8_t br_flag) { uint8_t br_flag) {
......
...@@ -593,7 +593,7 @@ void rx_prach(PHY_VARS_eNB *phy_vars_eNB,RU_t *ru, ...@@ -593,7 +593,7 @@ void rx_prach(PHY_VARS_eNB *phy_vars_eNB,RU_t *ru,
uint16_t *max_preamble, uint16_t *max_preamble,
uint16_t *max_preamble_energy, uint16_t *max_preamble_energy,
uint16_t *max_preamble_delay, uint16_t *max_preamble_delay,
uint16_t *avg_preamble_energy, int16_t *avg_preamble_energy,
uint16_t Nf, uint8_t tdd_mapindex, uint16_t Nf, uint8_t tdd_mapindex,
uint8_t br_flag uint8_t br_flag
); );
......
...@@ -1177,7 +1177,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB, ...@@ -1177,7 +1177,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
uint64_t decodedPayload[nb_symbols]; uint64_t decodedPayload[nb_symbols];
memset(decodedPayload,0,sizeof(decodedPayload)); memset(decodedPayload,0,sizeof(decodedPayload));
uint8_t corr_dB; int8_t corr_dB;
int decoderState = 2; int decoderState = 2;
if (pucch2_levdB < gNB->measurements.n0_subband_power_avg_dB + (gNB->pucch0_thres / 10)) if (pucch2_levdB < gNB->measurements.n0_subband_power_avg_dB + (gNB->pucch0_thres / 10))
decoderState = 1; // assuming missed detection, only attempt to decode for polar case (with CRC) decoderState = 1; // assuming missed detection, only attempt to decode for polar case (with CRC)
......
...@@ -73,7 +73,7 @@ void nr_ue_measurements(PHY_VARS_NR_UE *ue, ...@@ -73,7 +73,7 @@ void nr_ue_measurements(PHY_VARS_NR_UE *ue,
cmax(frame_parms->nb_antennas_rx, 1), cmax(frame_parms->nb_antennas_rx, 1),
false); false);
allocCast3D(rx_spatial_power_dB, allocCast3D(rx_spatial_power_dB,
unsigned short, short,
ue->measurements.rx_spatial_power_dB, ue->measurements.rx_spatial_power_dB,
NUMBER_OF_CONNECTED_gNB_MAX, NUMBER_OF_CONNECTED_gNB_MAX,
cmax(frame_parms->nb_antenna_ports_gNB, 1), cmax(frame_parms->nb_antenna_ports_gNB, 1),
...@@ -90,12 +90,12 @@ void nr_ue_measurements(PHY_VARS_NR_UE *ue, ...@@ -90,12 +90,12 @@ void nr_ue_measurements(PHY_VARS_NR_UE *ue,
rx_spatial_power[gNB_id][aatx][aarx] = z; rx_spatial_power[gNB_id][aatx][aarx] = z;
if (rx_spatial_power[gNB_id][aatx][aarx] < 0) if (rx_spatial_power[gNB_id][aatx][aarx] < 0)
rx_spatial_power[gNB_id][aatx][aarx] = 0; rx_spatial_power[gNB_id][aatx][aarx] = 0;
rx_spatial_power_dB[gNB_id][aatx][aarx] = (unsigned short)dB_fixed(rx_spatial_power[gNB_id][aatx][aarx]); rx_spatial_power_dB[gNB_id][aatx][aarx] = dB_fixed(rx_spatial_power[gNB_id][aatx][aarx]);
rx_power += rx_spatial_power[gNB_id][aatx][aarx]; rx_power += rx_spatial_power[gNB_id][aatx][aarx];
} }
ue->measurements.rx_power_tot[gNB_id] += rx_power; ue->measurements.rx_power_tot[gNB_id] += rx_power;
} }
ue->measurements.rx_power_tot_dB[gNB_id] = (unsigned short) dB_fixed(ue->measurements.rx_power_tot[gNB_id]); ue->measurements.rx_power_tot_dB[gNB_id] = dB_fixed(ue->measurements.rx_power_tot[gNB_id]);
} }
// filter to remove jitter // filter to remove jitter
...@@ -555,7 +555,7 @@ void nr_ue_rrc_measurements(PHY_VARS_NR_UE *ue, ...@@ -555,7 +555,7 @@ void nr_ue_rrc_measurements(PHY_VARS_NR_UE *ue,
ue->measurements.n0_power_tot += n0_power; ue->measurements.n0_power_tot += n0_power;
} }
ue->measurements.n0_power_tot_dB = (unsigned short) dB_fixed(ue->measurements.n0_power_tot); ue->measurements.n0_power_tot_dB = dB_fixed(ue->measurements.n0_power_tot);
#ifdef DEBUG_MEAS_RRC #ifdef DEBUG_MEAS_RRC
const int psd_awgn = -174; const int psd_awgn = -174;
......
...@@ -581,7 +581,7 @@ int nr_csi_rs_pmi_estimation(const PHY_VARS_NR_UE *ue, ...@@ -581,7 +581,7 @@ int nr_csi_rs_pmi_estimation(const PHY_VARS_NR_UE *ue,
const int16_t log2_re, const int16_t log2_re,
uint8_t *i1, uint8_t *i1,
uint8_t *i2, uint8_t *i2,
uint32_t *precoded_sinr_dB) int32_t *precoded_sinr_dB)
{ {
const NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; const NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
...@@ -948,7 +948,7 @@ void nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, ...@@ -948,7 +948,7 @@ void nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue,
uint8_t i1[3] = {0}; uint8_t i1[3] = {0};
uint8_t i2[1] = {0}; uint8_t i2[1] = {0};
uint8_t cqi = 0; uint8_t cqi = 0;
uint32_t precoded_sinr_dB = 0; int32_t precoded_sinr_dB = 0;
// bit 3 in bitmap to indicate RI measurment // bit 3 in bitmap to indicate RI measurment
if (csirs_config_pdu->measurement_bitmap & 8) { if (csirs_config_pdu->measurement_bitmap & 8) {
nr_csi_rs_pmi_estimation(ue, nr_csi_rs_pmi_estimation(ue,
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include "tools_defs.h" #include "tools_defs.h"
// Approximate 10*log10(x) in fixed point : x = 0...(2^32)-1 // Approximate 10*log10(x) in fixed point : x = 0...(2^32)-1, where the output is truncated to 10*log10(2^30) = 90 dB
static const int8_t dB_table[256] = { static const int8_t dB_table[256] = {
0, 3, 5, 6, 7, 8, 8, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 0, 3, 5, 6, 7, 8, 8, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15,
...@@ -131,60 +131,60 @@ int16_t dB_fixed_x10(uint32_t x) { ...@@ -131,60 +131,60 @@ int16_t dB_fixed_x10(uint32_t x) {
int16_t dB_fixed_times10(uint32_t x) int16_t dB_fixed_times10(uint32_t x)
{ {
int16_t dB_power=0; int16_t dB_power = 0;
if (x==0) { if (x == 0) {
dB_power = 0; dB_power = -900; // 0 in dB is -INF, but since we're dealing with integer variables, we'll put 10*log10(2^-30) x 10 in the output
} else if ( (x&0xff000000) != 0 ) { } else if ((x & 0xff000000) != 0) {
dB_power = dB_table_times10[((x>>24)&255)-1]; dB_power = dB_table_times10[((x >> 24) & 255) - 1];
dB_power += 3*dB_table_times10[255]; dB_power += 3 * dB_table_times10[255];
} else if ( (x&0x00ff0000) != 0 ) { } else if ((x & 0x00ff0000) != 0) {
dB_power = dB_table_times10[((x>>16)&255)-1]; dB_power = dB_table_times10[((x >> 16) & 255) - 1];
dB_power += 2*dB_table_times10[255]; dB_power += 2 * dB_table_times10[255];
} else if ( (x&0x0000ff00) != 0 ) { } else if ((x & 0x0000ff00) != 0) {
dB_power = dB_table_times10[((x>>8)&255)-1]; dB_power = dB_table_times10[((x >> 8) & 255) - 1];
dB_power += dB_table_times10[255]; dB_power += dB_table_times10[255];
} else { } else {
dB_power = dB_table_times10[(x&255)-1]; dB_power = dB_table_times10[(x & 255) - 1];
} }
if (dB_power > 900) if (dB_power > 900)
return(900); return (900);
return dB_power; return dB_power;
} }
int8_t dB_fixed(uint32_t x) int8_t dB_fixed(uint32_t x)
{ {
int8_t dB_power=0; int8_t dB_power = 0;
if (x==0) { if (x == 0) {
dB_power = 0; dB_power = -90; // 0 in dB is -INF, but since we're dealing with integer variables, we'll put 10*log10(2^-30) in the output
} else if ( (x&0xff000000) != 0 ) { } else if ((x & 0xff000000) != 0) {
dB_power = dB_table[((x>>24)&255)-1]; dB_power = dB_table[((x >> 24) & 255) - 1];
dB_power += 3*dB_table[255]; dB_power += 3 * dB_table[255];
} else if ( (x&0x00ff0000) != 0 ) { } else if ((x & 0x00ff0000) != 0) {
dB_power = dB_table[((x>>16)&255)-1]; dB_power = dB_table[((x >> 16) & 255) - 1];
dB_power += 2*dB_table[255]; dB_power += 2 * dB_table[255];
} else if ( (x&0x0000ff00) != 0 ) { } else if ((x & 0x0000ff00) != 0) {
dB_power = dB_table[((x>>8)&255)-1]; dB_power = dB_table[((x >> 8) & 255) - 1];
dB_power += dB_table[255]; dB_power += dB_table[255];
} else { } else {
dB_power = dB_table[(x&255)-1]; dB_power = dB_table[(x & 255) - 1];
} }
if (dB_power > 90) if (dB_power > 90)
return(90); return (90);
return dB_power; return dB_power;
} }
int8_t dB_fixed64(uint64_t x)
uint8_t dB_fixed64(uint64_t x)
{ {
if ((x<(((uint64_t)1)<<32))) return(dB_fixed((uint32_t)x)); if ((x < (((uint64_t)1) << 32)))
else return(4*dB_table[255]+dB_fixed((uint32_t)(x>>32))); return (dB_fixed((uint32_t)x));
else
return (4 * dB_table[255] + dB_fixed((uint32_t)(x >> 32)));
} }
......
...@@ -961,7 +961,7 @@ uint32_t angle(struct complex16 perrror); ...@@ -961,7 +961,7 @@ uint32_t angle(struct complex16 perrror);
unsigned char factor2(unsigned int x); unsigned char factor2(unsigned int x);
int8_t dB_fixed(uint32_t x); int8_t dB_fixed(uint32_t x);
uint8_t dB_fixed64(uint64_t x); int8_t dB_fixed64(uint64_t x);
int8_t dB_fixed2(uint32_t x,uint32_t y); int8_t dB_fixed2(uint32_t x,uint32_t y);
int16_t dB_fixed_times10(uint32_t x); int16_t dB_fixed_times10(uint32_t x);
int16_t dB_fixed_x10(uint32_t x); int16_t dB_fixed_x10(uint32_t x);
......
...@@ -206,15 +206,15 @@ typedef struct { ...@@ -206,15 +206,15 @@ typedef struct {
//! estimated noise power (linear) //! estimated noise power (linear)
unsigned int n0_power[NB_ANTENNAS_RX]; unsigned int n0_power[NB_ANTENNAS_RX];
//! estimated noise power (dB) //! estimated noise power (dB)
unsigned short n0_power_dB[NB_ANTENNAS_RX]; short n0_power_dB[NB_ANTENNAS_RX];
//! total estimated noise power (linear) //! total estimated noise power (linear)
unsigned int n0_power_tot; unsigned int n0_power_tot;
//! total estimated noise power (dB) //! total estimated noise power (dB)
unsigned short n0_power_tot_dB; short n0_power_tot_dB;
//! average estimated noise power (linear) //! average estimated noise power (linear)
unsigned int n0_power_avg; unsigned int n0_power_avg;
//! average estimated noise power (dB) //! average estimated noise power (dB)
unsigned short n0_power_avg_dB; short n0_power_avg_dB;
//! total estimated noise power (dBm) //! total estimated noise power (dBm)
short n0_power_tot_dBm; short n0_power_tot_dBm;
...@@ -222,24 +222,24 @@ typedef struct { ...@@ -222,24 +222,24 @@ typedef struct {
//! estimated received spatial signal power (linear) //! estimated received spatial signal power (linear)
int rx_spatial_power[NUMBER_OF_CONNECTED_eNB_MAX][2][2]; int rx_spatial_power[NUMBER_OF_CONNECTED_eNB_MAX][2][2];
//! estimated received spatial signal power (dB) //! estimated received spatial signal power (dB)
unsigned short rx_spatial_power_dB[NUMBER_OF_CONNECTED_eNB_MAX][2][2]; short rx_spatial_power_dB[NUMBER_OF_CONNECTED_eNB_MAX][2][2];
/// estimated received signal power (sum over all TX antennas) /// estimated received signal power (sum over all TX antennas)
//int wideband_cqi[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; //int wideband_cqi[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX];
int rx_power[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; int rx_power[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX];
/// estimated received signal power (sum over all TX antennas) /// estimated received signal power (sum over all TX antennas)
//int wideband_cqi_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; //int wideband_cqi_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX];
unsigned short rx_power_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; short rx_power_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX];
/// estimated received signal power (sum over all TX/RX antennas) /// estimated received signal power (sum over all TX/RX antennas)
int rx_power_tot[NUMBER_OF_CONNECTED_eNB_MAX]; //NEW int rx_power_tot[NUMBER_OF_CONNECTED_eNB_MAX]; //NEW
/// estimated received signal power (sum over all TX/RX antennas) /// estimated received signal power (sum over all TX/RX antennas)
unsigned short rx_power_tot_dB[NUMBER_OF_CONNECTED_eNB_MAX]; //NEW short rx_power_tot_dB[NUMBER_OF_CONNECTED_eNB_MAX]; //NEW
//! estimated received signal power (sum of all TX/RX antennas, time average) //! estimated received signal power (sum of all TX/RX antennas, time average)
int rx_power_avg[NUMBER_OF_CONNECTED_eNB_MAX]; int rx_power_avg[NUMBER_OF_CONNECTED_eNB_MAX];
//! estimated received signal power (sum of all TX/RX antennas, time average, in dB) //! estimated received signal power (sum of all TX/RX antennas, time average, in dB)
unsigned short rx_power_avg_dB[NUMBER_OF_CONNECTED_eNB_MAX]; short rx_power_avg_dB[NUMBER_OF_CONNECTED_eNB_MAX];
/// SINR (sum of all TX/RX antennas, in dB) /// SINR (sum of all TX/RX antennas, in dB)
int wideband_cqi_tot[NUMBER_OF_CONNECTED_eNB_MAX]; int wideband_cqi_tot[NUMBER_OF_CONNECTED_eNB_MAX];
......
...@@ -419,17 +419,17 @@ typedef struct { ...@@ -419,17 +419,17 @@ typedef struct {
//! estimated noise power (linear) //! estimated noise power (linear)
unsigned int n0_power[MAX_NUM_RU_PER_eNB]; unsigned int n0_power[MAX_NUM_RU_PER_eNB];
//! estimated noise power (dB) //! estimated noise power (dB)
unsigned short n0_power_dB[MAX_NUM_RU_PER_eNB]; short n0_power_dB[MAX_NUM_RU_PER_eNB];
//! total estimated noise power (linear) //! total estimated noise power (linear)
unsigned int n0_power_tot; unsigned int n0_power_tot;
//! estimated avg noise power (dB) //! estimated avg noise power (dB)
unsigned short n0_power_tot_dB; short n0_power_tot_dB;
//! estimated avg noise power (dB) //! estimated avg noise power (dB)
short n0_power_tot_dBm; short n0_power_tot_dBm;
//! estimated avg noise power per RB per RX ant (lin) //! estimated avg noise power per RB per RX ant (lin)
unsigned short n0_subband_power[MAX_NUM_RU_PER_eNB][100]; unsigned short n0_subband_power[MAX_NUM_RU_PER_eNB][100];
//! estimated avg noise power per RB per RX ant (dB) //! estimated avg noise power per RB per RX ant (dB)
unsigned short n0_subband_power_dB[MAX_NUM_RU_PER_eNB][100]; short n0_subband_power_dB[MAX_NUM_RU_PER_eNB][100];
//! estimated avg noise power per RB (dB) //! estimated avg noise power per RB (dB)
short n0_subband_power_tot_dB[100]; short n0_subband_power_tot_dB[100];
//! estimated avg noise power per RB (dBm) //! estimated avg noise power per RB (dBm)
...@@ -440,7 +440,7 @@ typedef struct { ...@@ -440,7 +440,7 @@ typedef struct {
//! estimated received spatial signal power (linear) //! estimated received spatial signal power (linear)
unsigned int rx_spatial_power[NUMBER_OF_SRS_MAX][2][2]; unsigned int rx_spatial_power[NUMBER_OF_SRS_MAX][2][2];
//! estimated received spatial signal power (dB) //! estimated received spatial signal power (dB)
unsigned short rx_spatial_power_dB[NUMBER_OF_SRS_MAX][2][2]; short rx_spatial_power_dB[NUMBER_OF_SRS_MAX][2][2];
//! estimated rssi (dBm) //! estimated rssi (dBm)
short rx_rssi_dBm[NUMBER_OF_SRS_MAX]; short rx_rssi_dBm[NUMBER_OF_SRS_MAX];
//! estimated correlation (wideband linear) between spatial channels (computed in dlsch_demodulation) //! estimated correlation (wideband linear) between spatial channels (computed in dlsch_demodulation)
...@@ -453,7 +453,7 @@ typedef struct { ...@@ -453,7 +453,7 @@ typedef struct {
/// Wideband CQI in dB (= SINR dB) /// Wideband CQI in dB (= SINR dB)
int wideband_cqi_dB[NUMBER_OF_SRS_MAX][MAX_NUM_RU_PER_eNB]; int wideband_cqi_dB[NUMBER_OF_SRS_MAX][MAX_NUM_RU_PER_eNB];
/// Wideband CQI (sum of all RX antennas, in dB) /// Wideband CQI (sum of all RX antennas, in dB)
char wideband_cqi_tot[NUMBER_OF_SRS_MAX]; int wideband_cqi_tot[NUMBER_OF_SRS_MAX];
/// Subband CQI per RX antenna and RB (= SINR) /// Subband CQI per RX antenna and RB (= SINR)
int subband_cqi[NUMBER_OF_SRS_MAX][MAX_NUM_RU_PER_eNB][100]; int subband_cqi[NUMBER_OF_SRS_MAX][MAX_NUM_RU_PER_eNB][100];
/// Total Subband CQI and RB (= SINR) /// Total Subband CQI and RB (= SINR)
......
...@@ -319,17 +319,17 @@ typedef struct { ...@@ -319,17 +319,17 @@ typedef struct {
//! estimated noise power (linear) //! estimated noise power (linear)
unsigned int n0_power[MAX_NUM_RU_PER_gNB]; unsigned int n0_power[MAX_NUM_RU_PER_gNB];
//! estimated noise power (dB) //! estimated noise power (dB)
unsigned int n0_power_dB[MAX_NUM_RU_PER_gNB]; int n0_power_dB[MAX_NUM_RU_PER_gNB];
//! total estimated noise power (linear) //! total estimated noise power (linear)
unsigned int n0_power_tot; unsigned int n0_power_tot;
//! estimated avg noise power (dB) //! estimated avg noise power (dB)
unsigned int n0_power_tot_dB; int n0_power_tot_dB;
//! estimated avg noise power per RB per RX ant (lin) //! estimated avg noise power per RB per RX ant (lin)
fourDimArray_t *n0_subband_power; fourDimArray_t *n0_subband_power;
//! estimated avg subband noise power (dB) //! estimated avg subband noise power (dB)
unsigned int n0_subband_power_avg_dB; int n0_subband_power_avg_dB;
//! estimated avg subband noise power per antenna (dB) //! estimated avg subband noise power per antenna (dB)
unsigned int n0_subband_power_avg_perANT_dB[MAX_ANT]; int n0_subband_power_avg_perANT_dB[MAX_ANT];
//! estimated avg noise power per RB (dB) //! estimated avg noise power per RB (dB)
int n0_subband_power_tot_dB[275]; int n0_subband_power_tot_dB[275];
/// PRACH background noise level /// PRACH background noise level
......
...@@ -140,11 +140,11 @@ typedef struct { ...@@ -140,11 +140,11 @@ typedef struct {
//! total estimated noise power (linear) //! total estimated noise power (linear)
unsigned int n0_power_tot; unsigned int n0_power_tot;
//! total estimated noise power (dB) //! total estimated noise power (dB)
unsigned short n0_power_tot_dB; short n0_power_tot_dB;
//! average estimated noise power (linear) //! average estimated noise power (linear)
unsigned int n0_power_avg; unsigned int n0_power_avg;
//! average estimated noise power (dB) //! average estimated noise power (dB)
unsigned short n0_power_avg_dB; short n0_power_avg_dB;
//! total estimated noise power (dBm) //! total estimated noise power (dBm)
short n0_power_tot_dBm; short n0_power_tot_dBm;
...@@ -157,12 +157,12 @@ typedef struct { ...@@ -157,12 +157,12 @@ typedef struct {
/// estimated received signal power (sum over all TX/RX antennas) /// estimated received signal power (sum over all TX/RX antennas)
int rx_power_tot[NUMBER_OF_CONNECTED_gNB_MAX]; //NEW int rx_power_tot[NUMBER_OF_CONNECTED_gNB_MAX]; //NEW
/// estimated received signal power (sum over all TX/RX antennas) /// estimated received signal power (sum over all TX/RX antennas)
unsigned short rx_power_tot_dB[NUMBER_OF_CONNECTED_gNB_MAX]; //NEW short rx_power_tot_dB[NUMBER_OF_CONNECTED_gNB_MAX]; //NEW
//! estimated received signal power (sum of all TX/RX antennas, time average) //! estimated received signal power (sum of all TX/RX antennas, time average)
int rx_power_avg[NUMBER_OF_CONNECTED_gNB_MAX]; int rx_power_avg[NUMBER_OF_CONNECTED_gNB_MAX];
//! estimated received signal power (sum of all TX/RX antennas, time average, in dB) //! estimated received signal power (sum of all TX/RX antennas, time average, in dB)
unsigned short rx_power_avg_dB[NUMBER_OF_CONNECTED_gNB_MAX]; short rx_power_avg_dB[NUMBER_OF_CONNECTED_gNB_MAX];
/// SINR (sum of all TX/RX antennas, in dB) /// SINR (sum of all TX/RX antennas, in dB)
int wideband_cqi_tot[NUMBER_OF_CONNECTED_gNB_MAX]; int wideband_cqi_tot[NUMBER_OF_CONNECTED_gNB_MAX];
......
...@@ -55,15 +55,15 @@ typedef struct { ...@@ -55,15 +55,15 @@ typedef struct {
//! estimated noise power (linear) //! estimated noise power (linear)
unsigned int n0_power[NB_ANTENNAS_RX]; unsigned int n0_power[NB_ANTENNAS_RX];
//! estimated noise power (dB) //! estimated noise power (dB)
unsigned short n0_power_dB[NB_ANTENNAS_RX]; short n0_power_dB[NB_ANTENNAS_RX];
//! total estimated noise power (linear) //! total estimated noise power (linear)
unsigned int n0_power_tot; unsigned int n0_power_tot;
//! total estimated noise power (dB) //! total estimated noise power (dB)
unsigned short n0_power_tot_dB; short n0_power_tot_dB;
//! average estimated noise power (linear) //! average estimated noise power (linear)
unsigned int n0_power_avg; unsigned int n0_power_avg;
//! average estimated noise power (dB) //! average estimated noise power (dB)
unsigned short n0_power_avg_dB; short n0_power_avg_dB;
//! total estimated noise power (dBm) //! total estimated noise power (dBm)
short n0_power_tot_dBm; short n0_power_tot_dBm;
...@@ -71,24 +71,24 @@ typedef struct { ...@@ -71,24 +71,24 @@ typedef struct {
//! estimated received spatial signal power (linear) //! estimated received spatial signal power (linear)
int rx_spatial_power[NUMBER_OF_CONNECTED_eNB_MAX][2][2]; int rx_spatial_power[NUMBER_OF_CONNECTED_eNB_MAX][2][2];
//! estimated received spatial signal power (dB) //! estimated received spatial signal power (dB)
unsigned short rx_spatial_power_dB[NUMBER_OF_CONNECTED_eNB_MAX][2][2]; short rx_spatial_power_dB[NUMBER_OF_CONNECTED_eNB_MAX][2][2];
/// estimated received signal power (sum over all TX antennas) /// estimated received signal power (sum over all TX antennas)
//int wideband_cqi[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; //int wideband_cqi[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX];
int rx_power[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; int rx_power[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX];
/// estimated received signal power (sum over all TX antennas) /// estimated received signal power (sum over all TX antennas)
//int wideband_cqi_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; //int wideband_cqi_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX];
unsigned short rx_power_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX]; short rx_power_dB[NUMBER_OF_CONNECTED_eNB_MAX][NB_ANTENNAS_RX];
/// estimated received signal power (sum over all TX/RX antennas) /// estimated received signal power (sum over all TX/RX antennas)
int rx_power_tot[NUMBER_OF_CONNECTED_eNB_MAX]; //NEW int rx_power_tot[NUMBER_OF_CONNECTED_eNB_MAX]; //NEW
/// estimated received signal power (sum over all TX/RX antennas) /// estimated received signal power (sum over all TX/RX antennas)
unsigned short rx_power_tot_dB[NUMBER_OF_CONNECTED_eNB_MAX]; //NEW short rx_power_tot_dB[NUMBER_OF_CONNECTED_eNB_MAX]; //NEW
//! estimated received signal power (sum of all TX/RX antennas, time average) //! estimated received signal power (sum of all TX/RX antennas, time average)
int rx_power_avg[NUMBER_OF_CONNECTED_eNB_MAX]; int rx_power_avg[NUMBER_OF_CONNECTED_eNB_MAX];
//! estimated received signal power (sum of all TX/RX antennas, time average, in dB) //! estimated received signal power (sum of all TX/RX antennas, time average, in dB)
unsigned short rx_power_avg_dB[NUMBER_OF_CONNECTED_eNB_MAX]; short rx_power_avg_dB[NUMBER_OF_CONNECTED_eNB_MAX];
/// SINR (sum of all TX/RX antennas, in dB) /// SINR (sum of all TX/RX antennas, in dB)
int wideband_cqi_tot[NUMBER_OF_CONNECTED_eNB_MAX]; int wideband_cqi_tot[NUMBER_OF_CONNECTED_eNB_MAX];
...@@ -141,17 +141,17 @@ typedef struct { ...@@ -141,17 +141,17 @@ typedef struct {
//! estimated noise power (linear) //! estimated noise power (linear)
unsigned int n0_power[NB_ANTENNAS_RX]; unsigned int n0_power[NB_ANTENNAS_RX];
//! estimated noise power (dB) //! estimated noise power (dB)
unsigned short n0_power_dB[NB_ANTENNAS_RX]; short n0_power_dB[NB_ANTENNAS_RX];
//! total estimated noise power (linear) //! total estimated noise power (linear)
unsigned int n0_power_tot; unsigned int n0_power_tot;
//! estimated avg noise power (dB) //! estimated avg noise power (dB)
unsigned short n0_power_tot_dB; short n0_power_tot_dB;
//! estimated avg noise power (dB) //! estimated avg noise power (dB)
short n0_power_tot_dBm; short n0_power_tot_dBm;
//! estimated avg noise power per RB per RX ant (lin) //! estimated avg noise power per RB per RX ant (lin)
unsigned short n0_subband_power[NB_ANTENNAS_RX][100]; unsigned short n0_subband_power[NB_ANTENNAS_RX][100];
//! estimated avg noise power per RB per RX ant (dB) //! estimated avg noise power per RB per RX ant (dB)
unsigned short n0_subband_power_dB[NB_ANTENNAS_RX][100]; short n0_subband_power_dB[NB_ANTENNAS_RX][100];
//! estimated avg noise power per RB (dB) //! estimated avg noise power per RB (dB)
short n0_subband_power_tot_dB[100]; short n0_subband_power_tot_dB[100];
//! estimated avg noise power per RB (dBm) //! estimated avg noise power per RB (dBm)
...@@ -160,7 +160,7 @@ typedef struct { ...@@ -160,7 +160,7 @@ typedef struct {
//! estimated received spatial signal power (linear) //! estimated received spatial signal power (linear)
unsigned int rx_spatial_power[NUMBER_OF_UE_MAX][2][2]; unsigned int rx_spatial_power[NUMBER_OF_UE_MAX][2][2];
//! estimated received spatial signal power (dB) //! estimated received spatial signal power (dB)
unsigned short rx_spatial_power_dB[NUMBER_OF_UE_MAX][2][2]; short rx_spatial_power_dB[NUMBER_OF_UE_MAX][2][2];
//! estimated rssi (dBm) //! estimated rssi (dBm)
short rx_rssi_dBm[NUMBER_OF_UE_MAX]; short rx_rssi_dBm[NUMBER_OF_UE_MAX];
//! estimated correlation (wideband linear) between spatial channels (computed in dlsch_demodulation) //! estimated correlation (wideband linear) between spatial channels (computed in dlsch_demodulation)
...@@ -173,7 +173,7 @@ typedef struct { ...@@ -173,7 +173,7 @@ typedef struct {
/// Wideband CQI in dB (= SINR dB) /// Wideband CQI in dB (= SINR dB)
int wideband_cqi_dB[NUMBER_OF_UE_MAX][NB_ANTENNAS_RX]; int wideband_cqi_dB[NUMBER_OF_UE_MAX][NB_ANTENNAS_RX];
/// Wideband CQI (sum of all RX antennas, in dB) /// Wideband CQI (sum of all RX antennas, in dB)
char wideband_cqi_tot[NUMBER_OF_UE_MAX]; int wideband_cqi_tot[NUMBER_OF_UE_MAX];
/// Subband CQI per RX antenna and RB (= SINR) /// Subband CQI per RX antenna and RB (= SINR)
int subband_cqi[NUMBER_OF_UE_MAX][NB_ANTENNAS_RX][100]; int subband_cqi[NUMBER_OF_UE_MAX][NB_ANTENNAS_RX][100];
/// Total Subband CQI and RB (= SINR) /// Total Subband CQI and RB (= SINR)
......
...@@ -47,11 +47,12 @@ ...@@ -47,11 +47,12 @@
extern int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind); extern int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind);
void prach_procedures(PHY_VARS_eNB *eNB, void prach_procedures(PHY_VARS_eNB *eNB, int br_flag)
int br_flag ) { {
uint16_t max_preamble[4]={0},max_preamble_energy[4]={0},max_preamble_delay[4]={0},avg_preamble_energy[4]={0}; uint16_t max_preamble[4] = {0}, max_preamble_energy[4] = {0}, max_preamble_delay[4] = {0};
int16_t avg_preamble_energy[4] = {0};
uint16_t i; uint16_t i;
int frame,subframe; int frame, subframe;
if (br_flag==1) { if (br_flag==1) {
subframe = eNB->proc.subframe_prach_br; subframe = eNB->proc.subframe_prach_br;
......
...@@ -520,7 +520,8 @@ int main(int argc, char **argv) { ...@@ -520,7 +520,8 @@ int main(int argc, char **argv) {
DCI_ALLOC_t da; DCI_ALLOC_t da;
DCI_ALLOC_t *dci_alloc = &da; DCI_ALLOC_t *dci_alloc = &da;
unsigned int coded_bits_per_codeword=0,nsymb; //,tbs=0; unsigned int coded_bits_per_codeword=0,nsymb; //,tbs=0;
unsigned int tx_lev=0,tx_lev_dB=0,trials; unsigned int tx_lev = 0, trials;
int tx_lev_dB = 0;
unsigned int errs[4],errs2[4],round_trials[4],dci_errors[4];//,num_layers; unsigned int errs[4],errs2[4],round_trials[4],dci_errors[4];//,num_layers;
memset(errs,0,4*sizeof(unsigned int)); memset(errs,0,4*sizeof(unsigned int));
memset(errs2,0,4*sizeof(unsigned int)); memset(errs2,0,4*sizeof(unsigned int));
...@@ -1494,7 +1495,7 @@ int main(int argc, char **argv) { ...@@ -1494,7 +1495,7 @@ int main(int argc, char **argv) {
eNB->frame_parms.samples_per_tti); eNB->frame_parms.samples_per_tti);
} }
tx_lev_dB = (unsigned int) dB_fixed(tx_lev); tx_lev_dB = dB_fixed(tx_lev);
if (n_frames==1) { if (n_frames==1) {
printf("tx_lev = %u (%u dB)\n",tx_lev,tx_lev_dB); printf("tx_lev = %u (%u dB)\n",tx_lev,tx_lev_dB);
......
...@@ -393,7 +393,7 @@ int main(int argc, char **argv) { ...@@ -393,7 +393,7 @@ int main(int argc, char **argv) {
subframe, subframe,
0); //Nf 0); //Nf
/* tx_lev_dB not used later, no need to set */ /* tx_lev_dB not used later, no need to set */
//tx_lev_dB = (unsigned int) dB_fixed(tx_lev); //tx_lev_dB = dB_fixed(tx_lev);
LOG_M("txsig0_new.m","txs0", &txdata[0][subframe*frame_parms->samples_per_tti],frame_parms->samples_per_tti,1,1); LOG_M("txsig0_new.m","txs0", &txdata[0][subframe*frame_parms->samples_per_tti],frame_parms->samples_per_tti,1,1);
//LOG_M("txsig1.m","txs1", txdata[1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1); //LOG_M("txsig1.m","txs1", txdata[1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
// multipath channel // multipath channel
......
...@@ -343,7 +343,8 @@ int main(int argc, char **argv) { ...@@ -343,7 +343,8 @@ int main(int argc, char **argv) {
unsigned short input_buffer_length; unsigned short input_buffer_length;
unsigned int ret; unsigned int ret;
unsigned int coded_bits_per_codeword,nsymb; unsigned int coded_bits_per_codeword,nsymb;
unsigned int tx_lev = 0, tx_lev_dB = 0, trials, errs[6] = {0}, round_trials[4] = {0}; unsigned int tx_lev = 0, trials, errs[6] = {0}, round_trials[4] = {0};
int tx_lev_dB = 0;
FILE *bler_fd=NULL; FILE *bler_fd=NULL;
char bler_fname[512]; char bler_fname[512];
FILE *time_meas_fd=NULL; FILE *time_meas_fd=NULL;
...@@ -894,7 +895,7 @@ int main(int argc, char **argv) { ...@@ -894,7 +895,7 @@ int main(int argc, char **argv) {
// LOG_M("txsig1.m","txs1", txdata[1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1); // LOG_M("txsig1.m","txs1", txdata[1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
tx_lev = signal_energy(&txdata[0][0], tx_lev = signal_energy(&txdata[0][0],
OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES); OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES);
tx_lev_dB = (unsigned int) dB_fixed(tx_lev); tx_lev_dB = dB_fixed(tx_lev);
} }
iter_trials=0; iter_trials=0;
......
...@@ -667,7 +667,7 @@ int main(int argc, char **argv){ ...@@ -667,7 +667,7 @@ int main(int argc, char **argv){
generate_nr_prach(UE, 0, frame, slot, tx); generate_nr_prach(UE, 0, frame, slot, tx);
/* tx_lev_dB not used later, no need to set */ /* tx_lev_dB not used later, no need to set */
//tx_lev_dB = (unsigned int) dB_fixed(tx_lev); //tx_lev_dB = dB_fixed(tx_lev);
#ifdef NR_PRACH_DEBUG #ifdef NR_PRACH_DEBUG
LOG_M("txsig0.m", "txs0", &txdata[0][subframe*frame_parms->samples_per_subframe], frame_parms->samples_per_subframe, 1, 1); LOG_M("txsig0.m", "txs0", &txdata[0][subframe*frame_parms->samples_per_subframe], frame_parms->samples_per_subframe, 1, 1);
......
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