common channel level function
This commit is contained in:
@@ -54,6 +54,13 @@ void freq2time(uint16_t ofdm_symbol_size, int16_t *freq_signal, int16_t *time_si
|
||||
void nr_est_delay(int ofdm_symbol_size, const c16_t *ls_est, c16_t *ch_estimates_time, delay_t *delay);
|
||||
unsigned int nr_get_tx_amp(int power_dBm, int power_max_dBm, int total_nb_rb, int nb_rb);
|
||||
void nr_fo_compensation(double fo_Hz, int samples_per_ms, int sample_offset, const c16_t *rxdata_in, c16_t *rxdata_out, int size);
|
||||
void nr_channel_level(const int symbol,
|
||||
const int size_est,
|
||||
const c16_t ch_estimates_ext[][size_est],
|
||||
const int nb_rx,
|
||||
const int Nl,
|
||||
int32_t avg[nb_rx * Nl],
|
||||
const uint32_t len);
|
||||
void nr_generate_csi_rs(const NR_DL_FRAME_PARMS *frame_parms,
|
||||
const csi_mapping_parms_t *phy_csi_parms,
|
||||
const int16_t amp,
|
||||
|
||||
@@ -420,6 +420,28 @@ unsigned int nr_get_tx_amp(int power_dBm, int power_max_dBm, int total_nb_rb, in
|
||||
return (0);
|
||||
}
|
||||
|
||||
// compute average channel_level on each antenna
|
||||
void nr_channel_level(const int symbol,
|
||||
const int size_est,
|
||||
const c16_t ch_estimates_ext[][size_est],
|
||||
const int nb_rx,
|
||||
const int Nl,
|
||||
int32_t avg[nb_rx * Nl],
|
||||
const uint32_t len)
|
||||
{
|
||||
int16_t x = factor2(len);
|
||||
int16_t y = len >> x;
|
||||
for (int aarx = 0; aarx < nb_rx; aarx++) {
|
||||
for (int l = 0; l < Nl; l++) {
|
||||
simde__m128i *ch128 = (simde__m128i *)&ch_estimates_ext[l * nb_rx + aarx][symbol * len];
|
||||
//compute average level
|
||||
avg[l * nb_rx + aarx] = simde_mm_average(ch128, len, x, y);
|
||||
LOG_D(PHY, "Channel level: %d\n", avg[l * nb_rx + aarx]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void nr_fo_compensation(double fo_Hz, int samples_per_ms, int sample_offset, const c16_t *rxdata_in, c16_t *rxdata_out, int size)
|
||||
{
|
||||
const double phase_inc = -fo_Hz / (samples_per_ms * 1000);
|
||||
|
||||
Reference in New Issue
Block a user