Commit afde7f6c authored by francescomani's avatar francescomani

improvements in precoding initialization at MAC

parent 8f858af8
......@@ -827,18 +827,6 @@ void get_samplerate_and_bw(int mu,
}
}
void get_K1_K2(int N1, int N2, int *K1, int *K2)
{
// num of allowed k1 and k2 according to 5.2.2.2.1-3 and -4 in 38.214
if(N2 == N1 || N1 == 2)
*K1 = 2;
else if (N2 == 1)
*K1 = 5;
else
*K1 = 3;
*K2 = N2 > 1 ? 2 : 1;
}
// from start symbol index and nb or symbols to symbol occupation bitmap in a slot
uint16_t SL_to_bitmap(int startSymbolIndex, int nrOfSymbols) {
return ((1<<nrOfSymbols)-1)<<startSymbolIndex;
......
......@@ -188,7 +188,6 @@ int get_dmrs_port(int nl, uint16_t dmrs_ports);
uint16_t SL_to_bitmap(int startSymbolIndex, int nrOfSymbols);
int get_nb_periods_per_frame(uint8_t tdd_period);
long rrc_get_max_nr_csrs(const int max_rbs, long b_SRS);
void get_K1_K2(int N1, int N2, int *K1, int *K2);
bool compare_relative_ul_channel_bw(int nr_band, int scs, int nb_ul, frame_type_t frame_type);
int get_supported_bw_mhz(frequency_range_t frequency_range, int bw_index);
int get_supported_band_index(int scs, frequency_range_t freq_range, int n_rbs);
......
This diff is collapsed.
......@@ -223,21 +223,14 @@ uint16_t get_pm_index(const gNB_MAC_INST *nrmac,
int k1, k2;
get_k1_k2_indices(layers, N1, N2, i13, &k1, &k2); // get indices k1 and k2 for PHY matrix (not actual k1 and k2 values)
const int O2 = N2 == 1 ? 1 : 4;
int O1 = 4; //Horizontal beam oversampling = 4 for more than 2 antenna ports
int max_i2 = 0;
int lay_index = 0;
if (layers == 1) {
max_i2 = 4;
// computing precoding matrix index according to rule set in allocation function init_codebook_gNB
lay_index = i2 + (i12 * max_i2) + (i11 * max_i2 * N2 * O2);
}
else {
max_i2 = 2;
// num of allowed k1 and k2 according to 5.2.2.2.1-3 and -4 in 38.214
int K1, K2;
get_K1_K2(N1, N2, &K1, &K2);
// computing precoding matrix index according to rule set in allocation function init_codebook_gNB
lay_index = i2 + (k2 * max_i2) + (k1 * max_i2 * K2) + (i12 * max_i2 * K2 * K1) + (i11 * max_i2 * K2 * K1 * N2 * O2);
}
max_i2 = layers == 1 ? 4 : 2;
int K1, K2;
get_K1_K2(N1, N2, &K1, &K2, layers);
// computing precoding matrix index according to rule set in allocation function init_codebook_gNB
lay_index = i2 + (i11 * max_i2) + (i12 * max_i2 * N1 * O1) + (k1 * max_i2 * N1 * O1 * N2 * O2) + (k2 * max_i2 * N1 * O1 * N2 * O2 * K1);
return 1 + prev_layers_size + lay_index;
}
}
......
......@@ -36,6 +36,7 @@
#include "common/ngran_types.h"
void set_cset_offset(uint16_t);
void get_K1_K2(int N1, int N2, int *K1, int *K2, int layers);
void mac_top_init_gNB(ngran_node_t node_type,
NR_ServingCellConfigCommon_t *scc,
......
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