Commit 724e155a authored by Roberto Louro Magueta's avatar Roberto Louro Magueta

Move UL delta computation for a function

parent 927e2195
......@@ -76,10 +76,6 @@ void freq2time(uint16_t ofdm_symbol_size,
}
}
// Table 6.4.1.1.3-1/2 from TS 38.211
const uint16_t delta1[8] = {0, 0, 1, 1, 0, 0, 1, 1};
const uint16_t delta2[12] = {0, 0, 2, 2, 4, 4, 0, 0, 2, 2, 4, 4};
int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
unsigned char Ns,
unsigned short p,
......@@ -211,20 +207,17 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
#endif
// Based on Table 6.4.1.1.3-1/2 from TS 38.211
int delta = 0;
//int deltas[3] = {0};
//int n_delta = 0;
/*int deltas[3] = {0};
int n_delta = 0;
if (pusch_pdu->dmrs_config_type == pusch_dmrs_type1) {
delta = delta1[p];
/*if (pusch_pdu->nrOfLayers <= 2) {
if (pusch_pdu->nrOfLayers <= 2) {
n_delta = 1;
} else {
n_delta = 2;
deltas[1] = 1;
}*/
}
} else {
delta = delta2[p];
/*if (pusch_pdu->nrOfLayers <= 2) {
if (pusch_pdu->nrOfLayers <= 2) {
n_delta = 1;
} else if (pusch_pdu->nrOfLayers <= 4) {
n_delta = 2;
......@@ -233,8 +226,8 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
n_delta = 3;
deltas[1] = 2;
deltas[2] = 4;
}*/
}
}*/
for (aarx=0; aarx<gNB->frame_parms.nb_antennas_rx; aarx++) {
......@@ -260,6 +253,8 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
// For configuration type 1: k = 4*n + 2*k' + delta,
// where k' is 0 or 1, and delta is in Table 6.4.1.1.3-1 from TS 38.211
int delta = nr_pusch_dmrs_delta(pusch_dmrs_type1, p);
pilot_cnt = 0;
for (int n = 0; n < 3*nb_rb_pusch; n++) {
for (int k_line = 0; k_line <= 1; k_line++) {
......
......@@ -40,8 +40,10 @@
#include "PHY/defs_gNB.h"
// Table 6.4.1.1.3-1/2 from TS 38.211
int delta1[8] = {0, 0, 1, 1, 0, 0, 1, 1};
int wf1[8][2] = {{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1}};
int wt1[8][2] = {{1,1},{1,1},{1,1},{1,1},{1,-1},{1,-1},{1,-1},{1,-1}};
int delta2[12] = {0, 0, 2, 2, 4, 4, 0, 0, 2, 2, 4, 4};
int wf2[12][2] = {{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1}};
int wt2[12][2] = {{1,1},{1,1},{1,1},{1,1},{1,1},{1,1},{1,-1},{1,-1},{1,-1},{1,-1},{1,-1},{1,-1}};
......@@ -49,6 +51,13 @@ int wt2[12][2] = {{1,1},{1,1},{1,1},{1,1},{1,1},{1,1},{1,-1},{1,-1},{1,-1},{1,-1
short nr_rx_mod_table[14] = {0,0,23170,-23170,-23170,23170,23170,-23170,23170,23170,-23170,-23170,-23170,23170};
short nr_rx_nmod_table[14] = {0,0,-23170,23170,23170,-23170,-23170,23170,-23170,-23170,23170,23170,23170,-23170};
int nr_pusch_dmrs_delta(uint8_t dmrs_config_type, unsigned short p) {
if (dmrs_config_type == pusch_dmrs_type1) {
return delta1[p];
} else {
return delta2[p];
}
}
int nr_pusch_dmrs_rx(PHY_VARS_gNB *gNB,
unsigned int Ns,
......
......@@ -42,6 +42,8 @@ void nr_init_csi_rs(PHY_VARS_gNB* gNB, uint32_t Nid);
void nr_gold_pusch(PHY_VARS_gNB* gNB, int nscid, uint32_t nid);
int nr_pusch_dmrs_delta(uint8_t dmrs_config_type, unsigned short p);
int nr_pusch_dmrs_rx(PHY_VARS_gNB *gNB,
unsigned int Ns,
unsigned int *nr_gold_pusch,
......
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