|
|
@ -72,7 +72,6 @@ int srslte_predecoding_single_sse(cf_t* y[SRSLTE_MAX_PORTS],
|
|
|
|
float scaling,
|
|
|
|
float scaling,
|
|
|
|
float noise_estimate)
|
|
|
|
float noise_estimate)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
float* xPtr = (float*)x;
|
|
|
|
float* xPtr = (float*)x;
|
|
|
|
const float* hPtr1 = (const float*)h[0];
|
|
|
|
const float* hPtr1 = (const float*)h[0];
|
|
|
|
const float* yPtr1 = (const float*)y[0];
|
|
|
|
const float* yPtr1 = (const float*)y[0];
|
|
|
@ -179,7 +178,6 @@ int srslte_predecoding_single_avx(cf_t* y[SRSLTE_MAX_PORTS],
|
|
|
|
float scaling,
|
|
|
|
float scaling,
|
|
|
|
float noise_estimate)
|
|
|
|
float noise_estimate)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
float* xPtr = (float*)x;
|
|
|
|
float* xPtr = (float*)x;
|
|
|
|
const float* hPtr1 = (const float*)h[0];
|
|
|
|
const float* hPtr1 = (const float*)h[0];
|
|
|
|
const float* yPtr1 = (const float*)y[0];
|
|
|
|
const float* yPtr1 = (const float*)y[0];
|
|
|
@ -355,7 +353,6 @@ int srslte_predecoding_single(cf_t* y_,
|
|
|
|
float scaling,
|
|
|
|
float scaling,
|
|
|
|
float noise_estimate)
|
|
|
|
float noise_estimate)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
cf_t* y[SRSLTE_MAX_PORTS];
|
|
|
|
cf_t* y[SRSLTE_MAX_PORTS];
|
|
|
|
cf_t* h[SRSLTE_MAX_PORTS];
|
|
|
|
cf_t* h[SRSLTE_MAX_PORTS];
|
|
|
|
y[0] = y_;
|
|
|
|
y[0] = y_;
|
|
|
@ -491,7 +488,7 @@ int srslte_predecoding_diversity_gen_(cf_t* y[SRSLTE_MAX_PORTS],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return i;
|
|
|
|
return i;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ERROR("Number of ports must be 2 or 4 for transmit diversity (nof_ports=%d)\n", nof_ports);
|
|
|
|
ERROR("Number of ports must be 2 or 4 for transmit diversity (nof_ports=%d)", nof_ports);
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -536,7 +533,6 @@ int srslte_predecoding_diversity2_sse(cf_t* y[SRSLTE_MAX_PORTS],
|
|
|
|
__m128 x0, x1;
|
|
|
|
__m128 x0, x1;
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < nof_symbols / 4; i++) {
|
|
|
|
for (int i = 0; i < nof_symbols / 4; i++) {
|
|
|
|
|
|
|
|
|
|
|
|
h0Val_00 = _mm_load_ps(h0Ptr0);
|
|
|
|
h0Val_00 = _mm_load_ps(h0Ptr0);
|
|
|
|
h0Ptr0 += 4;
|
|
|
|
h0Ptr0 += 4;
|
|
|
|
h0Val_10 = _mm_load_ps(h0Ptr0);
|
|
|
|
h0Val_10 = _mm_load_ps(h0Ptr0);
|
|
|
@ -767,7 +763,7 @@ int srslte_predecoding_diversity_csi(cf_t* y[SRSLTE_MAX_PORTS],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return i;
|
|
|
|
return i;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ERROR("Number of ports must be 2 or 4 for transmit diversity (nof_ports=%d)\n", nof_ports);
|
|
|
|
ERROR("Number of ports must be 2 or 4 for transmit diversity (nof_ports=%d)", nof_ports);
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -804,11 +800,9 @@ int srslte_precoding_mimo_2x2_gen(cf_t W[2][2],
|
|
|
|
float scaling,
|
|
|
|
float scaling,
|
|
|
|
float noise_estimate)
|
|
|
|
float noise_estimate)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
cf_t G[2][2], Gx[2][2];
|
|
|
|
cf_t G[2][2], Gx[2][2];
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < nof_symbols; i++) {
|
|
|
|
for (int i = 0; i < nof_symbols; i++) {
|
|
|
|
|
|
|
|
|
|
|
|
// G=H*W
|
|
|
|
// G=H*W
|
|
|
|
G[0][0] = h[0][0][i] * W[0][0] + h[0][1][i] * W[1][0];
|
|
|
|
G[0][0] = h[0][0][i] * W[0][0] + h[0][1][i] * W[1][0];
|
|
|
|
G[0][1] = h[0][0][i] * W[1][0] + h[0][1][i] * W[1][1];
|
|
|
|
G[0][1] = h[0][0][i] * W[1][0] + h[0][1][i] * W[1][1];
|
|
|
@ -823,7 +817,7 @@ int srslte_precoding_mimo_2x2_gen(cf_t W[2][2],
|
|
|
|
Gx[1][1] = conjf(G[1][1]);
|
|
|
|
Gx[1][1] = conjf(G[1][1]);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// MMSE equalizer: Gx = (G'G+I)
|
|
|
|
// MMSE equalizer: Gx = (G'G+I)
|
|
|
|
ERROR("MMSE MIMO decoder not implemented\n");
|
|
|
|
ERROR("MMSE MIMO decoder not implemented");
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -894,7 +888,6 @@ static int srslte_predecoding_ccd_2x2_zf_csi(cf_t* y[SRSLTE_MAX_PORTS],
|
|
|
|
|
|
|
|
|
|
|
|
cf_t h00, h01, h10, h11, det;
|
|
|
|
cf_t h00, h01, h10, h11, det;
|
|
|
|
for (; i < nof_symbols; i++) {
|
|
|
|
for (; i < nof_symbols; i++) {
|
|
|
|
|
|
|
|
|
|
|
|
// Even precoder
|
|
|
|
// Even precoder
|
|
|
|
h00 = +h[0][0][i] + h[1][0][i];
|
|
|
|
h00 = +h[0][0][i] + h[1][0][i];
|
|
|
|
h10 = +h[0][1][i] + h[1][1][i];
|
|
|
|
h10 = +h[0][1][i] + h[1][1][i];
|
|
|
@ -982,7 +975,6 @@ static int srslte_predecoding_ccd_2x2_zf(cf_t* y[SRSLTE_MAX_PORTS],
|
|
|
|
|
|
|
|
|
|
|
|
cf_t h00, h01, h10, h11, det;
|
|
|
|
cf_t h00, h01, h10, h11, det;
|
|
|
|
for (; i < nof_symbols; i++) {
|
|
|
|
for (; i < nof_symbols; i++) {
|
|
|
|
|
|
|
|
|
|
|
|
// Even precoder
|
|
|
|
// Even precoder
|
|
|
|
h00 = +h[0][0][i] + h[1][0][i];
|
|
|
|
h00 = +h[0][0][i] + h[1][0][i];
|
|
|
|
h10 = +h[0][1][i] + h[1][1][i];
|
|
|
|
h10 = +h[0][1][i] + h[1][1][i];
|
|
|
@ -1028,13 +1020,13 @@ static int srslte_predecoding_ccd_zf(cf_t* y[SRSLTE_MAX_PORTS],
|
|
|
|
return srslte_predecoding_ccd_2x2_zf(y, h, x, nof_symbols, scaling);
|
|
|
|
return srslte_predecoding_ccd_2x2_zf(y, h, x, nof_symbols, scaling);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ERROR("Error predecoding CCD: Invalid number of layers %d\n", nof_layers);
|
|
|
|
ERROR("Error predecoding CCD: Invalid number of layers %d", nof_layers);
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (nof_ports == 4) {
|
|
|
|
} else if (nof_ports == 4) {
|
|
|
|
ERROR("Error predecoding CCD: Only 2 ports supported\n");
|
|
|
|
ERROR("Error predecoding CCD: Only 2 ports supported");
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ERROR("Error predecoding CCD: Invalid combination of ports %d and rx antennax %d\n", nof_ports, nof_rxant);
|
|
|
|
ERROR("Error predecoding CCD: Invalid combination of ports %d and rx antennax %d", nof_ports, nof_rxant);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1099,7 +1091,6 @@ static int srslte_predecoding_ccd_2x2_mmse_csi(cf_t* y[SRSLTE_MAX_PORTS],
|
|
|
|
|
|
|
|
|
|
|
|
cf_t h00, h01, h10, h11;
|
|
|
|
cf_t h00, h01, h10, h11;
|
|
|
|
for (; i < nof_symbols; i++) {
|
|
|
|
for (; i < nof_symbols; i++) {
|
|
|
|
|
|
|
|
|
|
|
|
// Even precoder
|
|
|
|
// Even precoder
|
|
|
|
h00 = +h[0][0][i] + h[1][0][i];
|
|
|
|
h00 = +h[0][0][i] + h[1][0][i];
|
|
|
|
h10 = +h[0][1][i] + h[1][1][i];
|
|
|
|
h10 = +h[0][1][i] + h[1][1][i];
|
|
|
@ -1174,7 +1165,6 @@ static int srslte_predecoding_ccd_2x2_mmse(cf_t* y[SRSLTE_MAX_PORTS],
|
|
|
|
|
|
|
|
|
|
|
|
cf_t h00, h01, h10, h11;
|
|
|
|
cf_t h00, h01, h10, h11;
|
|
|
|
for (; i < nof_symbols; i++) {
|
|
|
|
for (; i < nof_symbols; i++) {
|
|
|
|
|
|
|
|
|
|
|
|
// Even precoder
|
|
|
|
// Even precoder
|
|
|
|
h00 = +h[0][0][i] + h[1][0][i];
|
|
|
|
h00 = +h[0][0][i] + h[1][0][i];
|
|
|
|
h10 = +h[0][1][i] + h[1][1][i];
|
|
|
|
h10 = +h[0][1][i] + h[1][1][i];
|
|
|
@ -1213,13 +1203,13 @@ int srslte_predecoding_ccd_mmse(cf_t* y[SRSLTE_MAX_PORTS],
|
|
|
|
return srslte_predecoding_ccd_2x2_mmse(y, h, x, nof_symbols, scaling, noise_estimate);
|
|
|
|
return srslte_predecoding_ccd_2x2_mmse(y, h, x, nof_symbols, scaling, noise_estimate);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ERROR("Error predecoding CCD: Invalid number of layers %d\n", nof_layers);
|
|
|
|
ERROR("Error predecoding CCD: Invalid number of layers %d", nof_layers);
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (nof_ports == 4) {
|
|
|
|
} else if (nof_ports == 4) {
|
|
|
|
ERROR("Error predecoding CCD: Only 2 ports supported\n");
|
|
|
|
ERROR("Error predecoding CCD: Only 2 ports supported");
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ERROR("Error predecoding CCD: Invalid combination of ports %d and rx antennax %d\n", nof_ports, nof_rxant);
|
|
|
|
ERROR("Error predecoding CCD: Invalid combination of ports %d and rx antennax %d", nof_ports, nof_rxant);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1276,7 +1266,7 @@ static int srslte_predecoding_multiplex_2x2_zf_csi(cf_t* y[SRSLTE_MAX_PORTS],
|
|
|
|
h11 = srslte_simd_cf_sub(h01i, srslte_simd_cf_mulj(h11i));
|
|
|
|
h11 = srslte_simd_cf_sub(h01i, srslte_simd_cf_mulj(h11i));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
ERROR("Wrong codebook_idx=%d\n", codebook_idx);
|
|
|
|
ERROR("Wrong codebook_idx=%d", codebook_idx);
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1318,7 +1308,7 @@ static int srslte_predecoding_multiplex_2x2_zf_csi(cf_t* y[SRSLTE_MAX_PORTS],
|
|
|
|
h11 = h[0][1][i] - _Complex_I * h[1][1][i];
|
|
|
|
h11 = h[0][1][i] - _Complex_I * h[1][1][i];
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
ERROR("Wrong codebook_idx=%d\n", codebook_idx);
|
|
|
|
ERROR("Wrong codebook_idx=%d", codebook_idx);
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1386,7 +1376,7 @@ static int srslte_predecoding_multiplex_2x2_zf(cf_t* y[SRSLTE_MAX_PORTS],
|
|
|
|
h11 = srslte_simd_cf_sub(h01i, srslte_simd_cf_mulj(h11i));
|
|
|
|
h11 = srslte_simd_cf_sub(h01i, srslte_simd_cf_mulj(h11i));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
ERROR("Wrong codebook_idx=%d\n", codebook_idx);
|
|
|
|
ERROR("Wrong codebook_idx=%d", codebook_idx);
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1425,7 +1415,7 @@ static int srslte_predecoding_multiplex_2x2_zf(cf_t* y[SRSLTE_MAX_PORTS],
|
|
|
|
h11 = h[0][1][i] - _Complex_I * h[1][1][i];
|
|
|
|
h11 = h[0][1][i] - _Complex_I * h[1][1][i];
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
ERROR("Wrong codebook_idx=%d\n", codebook_idx);
|
|
|
|
ERROR("Wrong codebook_idx=%d", codebook_idx);
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1488,7 +1478,7 @@ static int srslte_predecoding_multiplex_2x2_mmse_csi(cf_t* y[SRSLTE_MAX_PORTS],
|
|
|
|
h11 = srslte_simd_cf_sub(h01i, srslte_simd_cf_mulj(h11i));
|
|
|
|
h11 = srslte_simd_cf_sub(h01i, srslte_simd_cf_mulj(h11i));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
ERROR("Wrong codebook_idx=%d\n", codebook_idx);
|
|
|
|
ERROR("Wrong codebook_idx=%d", codebook_idx);
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1530,7 +1520,7 @@ static int srslte_predecoding_multiplex_2x2_mmse_csi(cf_t* y[SRSLTE_MAX_PORTS],
|
|
|
|
h11 = h[0][1][i] - _Complex_I * h[1][1][i];
|
|
|
|
h11 = h[0][1][i] - _Complex_I * h[1][1][i];
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
ERROR("Wrong codebook_idx=%d\n", codebook_idx);
|
|
|
|
ERROR("Wrong codebook_idx=%d", codebook_idx);
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1592,7 +1582,7 @@ static int srslte_predecoding_multiplex_2x2_mmse(cf_t* y[SRSLTE_MAX_PORTS],
|
|
|
|
h11 = srslte_simd_cf_sub(h01i, srslte_simd_cf_mulj(h11i));
|
|
|
|
h11 = srslte_simd_cf_sub(h01i, srslte_simd_cf_mulj(h11i));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
ERROR("Wrong codebook_idx=%d\n", codebook_idx);
|
|
|
|
ERROR("Wrong codebook_idx=%d", codebook_idx);
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1631,7 +1621,7 @@ static int srslte_predecoding_multiplex_2x2_mmse(cf_t* y[SRSLTE_MAX_PORTS],
|
|
|
|
h11 = h[0][1][i] - _Complex_I * h[1][1][i];
|
|
|
|
h11 = h[0][1][i] - _Complex_I * h[1][1][i];
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
ERROR("Wrong codebook_idx=%d\n", codebook_idx);
|
|
|
|
ERROR("Wrong codebook_idx=%d", codebook_idx);
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1678,7 +1668,7 @@ static int srslte_predecoding_multiplex_2x1_mrc(cf_t* y[SRSLTE_MAX_PORTS],
|
|
|
|
hx = srslte_simd_cf_sub(h0xi, srslte_simd_cf_mulj(h1xi));
|
|
|
|
hx = srslte_simd_cf_sub(h0xi, srslte_simd_cf_mulj(h1xi));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
ERROR("Wrong codebook_idx=%d\n", codebook_idx);
|
|
|
|
ERROR("Wrong codebook_idx=%d", codebook_idx);
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1713,7 +1703,7 @@ static int srslte_predecoding_multiplex_2x1_mrc(cf_t* y[SRSLTE_MAX_PORTS],
|
|
|
|
h1 = h[0][1][i] - _Complex_I * h[1][1][i];
|
|
|
|
h1 = h[0][1][i] - _Complex_I * h[1][1][i];
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
ERROR("Wrong codebook_idx=%d\n", codebook_idx);
|
|
|
|
ERROR("Wrong codebook_idx=%d", codebook_idx);
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1763,7 +1753,7 @@ static int srslte_predecoding_multiplex_2x1_mrc_csi(cf_t* y[SRSLTE_MAX_PORTS],
|
|
|
|
hx = srslte_simd_cf_sub(h0xi, srslte_simd_cf_mulj(h1xi));
|
|
|
|
hx = srslte_simd_cf_sub(h0xi, srslte_simd_cf_mulj(h1xi));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
ERROR("Wrong codebook_idx=%d\n", codebook_idx);
|
|
|
|
ERROR("Wrong codebook_idx=%d", codebook_idx);
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1799,7 +1789,7 @@ static int srslte_predecoding_multiplex_2x1_mrc_csi(cf_t* y[SRSLTE_MAX_PORTS],
|
|
|
|
h1 = h[0][1][i] - _Complex_I * h[1][1][i];
|
|
|
|
h1 = h[0][1][i] - _Complex_I * h[1][1][i];
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
ERROR("Wrong codebook_idx=%d\n", codebook_idx);
|
|
|
|
ERROR("Wrong codebook_idx=%d", codebook_idx);
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1853,7 +1843,7 @@ static int srslte_predecoding_multiplex(cf_t* y[SRSLTE_MAX_PORTS],
|
|
|
|
} else if (nof_ports == 4) {
|
|
|
|
} else if (nof_ports == 4) {
|
|
|
|
ERROR("Error predecoding multiplex: not implemented for %d Tx ports", nof_ports);
|
|
|
|
ERROR("Error predecoding multiplex: not implemented for %d Tx ports", nof_ports);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ERROR("Error predecoding multiplex: Invalid combination of ports %d and rx antennas %d\n", nof_ports, nof_rxant);
|
|
|
|
ERROR("Error predecoding multiplex: Invalid combination of ports %d and rx antennas %d", nof_ports, nof_rxant);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1877,13 +1867,12 @@ int srslte_predecoding_type(cf_t* y[SRSLTE_MAX_PORTS],
|
|
|
|
float scaling,
|
|
|
|
float scaling,
|
|
|
|
float noise_estimate)
|
|
|
|
float noise_estimate)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
if (nof_ports > SRSLTE_MAX_PORTS) {
|
|
|
|
if (nof_ports > SRSLTE_MAX_PORTS) {
|
|
|
|
ERROR("Maximum number of ports is %d (nof_ports=%d)\n", SRSLTE_MAX_PORTS, nof_ports);
|
|
|
|
ERROR("Maximum number of ports is %d (nof_ports=%d)", SRSLTE_MAX_PORTS, nof_ports);
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (nof_layers > SRSLTE_MAX_LAYERS) {
|
|
|
|
if (nof_layers > SRSLTE_MAX_LAYERS) {
|
|
|
|
ERROR("Maximum number of layers is %d (nof_layers=%d)\n", SRSLTE_MAX_LAYERS, nof_layers);
|
|
|
|
ERROR("Maximum number of layers is %d (nof_layers=%d)", SRSLTE_MAX_LAYERS, nof_layers);
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1898,7 +1887,7 @@ int srslte_predecoding_type(cf_t* y[SRSLTE_MAX_PORTS],
|
|
|
|
y, h, x, csi, nof_rxant, nof_ports, nof_layers, nof_symbols, scaling, noise_estimate);
|
|
|
|
y, h, x, csi, nof_rxant, nof_ports, nof_layers, nof_symbols, scaling, noise_estimate);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ERROR("Invalid number of layers %d\n", nof_layers);
|
|
|
|
ERROR("Invalid number of layers %d", nof_layers);
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
@ -1906,7 +1895,7 @@ int srslte_predecoding_type(cf_t* y[SRSLTE_MAX_PORTS],
|
|
|
|
if (nof_ports == 1 && nof_layers == 1) {
|
|
|
|
if (nof_ports == 1 && nof_layers == 1) {
|
|
|
|
return srslte_predecoding_single_multi(y, h[0], x[0], csi, nof_rxant, nof_symbols, scaling, noise_estimate);
|
|
|
|
return srslte_predecoding_single_multi(y, h[0], x[0], csi, nof_rxant, nof_symbols, scaling, noise_estimate);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ERROR("Number of ports and layers must be 1 for transmission on single antenna ports (%d, %d)\n",
|
|
|
|
ERROR("Number of ports and layers must be 1 for transmission on single antenna ports (%d, %d)",
|
|
|
|
nof_ports,
|
|
|
|
nof_ports,
|
|
|
|
nof_layers);
|
|
|
|
nof_layers);
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
@ -1915,14 +1904,14 @@ int srslte_predecoding_type(cf_t* y[SRSLTE_MAX_PORTS],
|
|
|
|
if (nof_ports == nof_layers) {
|
|
|
|
if (nof_ports == nof_layers) {
|
|
|
|
return srslte_predecoding_diversity_multi(y, h, x, csi, nof_rxant, nof_ports, nof_symbols, scaling);
|
|
|
|
return srslte_predecoding_diversity_multi(y, h, x, csi, nof_rxant, nof_ports, nof_symbols, scaling);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ERROR("Error number of layers must equal number of ports in transmit diversity\n");
|
|
|
|
ERROR("Error number of layers must equal number of ports in transmit diversity");
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case SRSLTE_TXSCHEME_SPATIALMUX:
|
|
|
|
case SRSLTE_TXSCHEME_SPATIALMUX:
|
|
|
|
return srslte_predecoding_multiplex(
|
|
|
|
return srslte_predecoding_multiplex(
|
|
|
|
y, h, x, csi, nof_rxant, nof_ports, nof_layers, codebook_idx, nof_symbols, scaling, noise_estimate);
|
|
|
|
y, h, x, csi, nof_rxant, nof_ports, nof_layers, codebook_idx, nof_symbols, scaling, noise_estimate);
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
ERROR("Invalid Txscheme=%d\n", type);
|
|
|
|
ERROR("Invalid Txscheme=%d", type);
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1988,7 +1977,7 @@ int srslte_precoding_diversity(cf_t* x[SRSLTE_MAX_LAYERS],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 4 * i;
|
|
|
|
return 4 * i;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ERROR("Number of ports must be 2 or 4 for transmit diversity (nof_ports=%d)\n", nof_ports);
|
|
|
|
ERROR("Number of ports must be 2 or 4 for transmit diversity (nof_ports=%d)", nof_ports);
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2065,7 +2054,7 @@ int srslte_precoding_cdd(cf_t* x[SRSLTE_MAX_LAYERS],
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (nof_ports == 2) {
|
|
|
|
if (nof_ports == 2) {
|
|
|
|
if (nof_layers != 2) {
|
|
|
|
if (nof_layers != 2) {
|
|
|
|
ERROR("Invalid number of layers %d for 2 ports\n", nof_layers);
|
|
|
|
ERROR("Invalid number of layers %d for 2 ports", nof_layers);
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#ifdef LV_HAVE_AVX
|
|
|
|
#ifdef LV_HAVE_AVX
|
|
|
@ -2078,10 +2067,10 @@ int srslte_precoding_cdd(cf_t* x[SRSLTE_MAX_LAYERS],
|
|
|
|
#endif /* LV_HAVE_SSE */
|
|
|
|
#endif /* LV_HAVE_SSE */
|
|
|
|
#endif /* LV_HAVE_AVX */
|
|
|
|
#endif /* LV_HAVE_AVX */
|
|
|
|
} else if (nof_ports == 4) {
|
|
|
|
} else if (nof_ports == 4) {
|
|
|
|
ERROR("Not implemented\n");
|
|
|
|
ERROR("Not implemented");
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ERROR("Number of ports must be 2 or 4 for transmit diversity (nof_ports=%d)\n", nof_ports);
|
|
|
|
ERROR("Number of ports must be 2 or 4 for transmit diversity (nof_ports=%d)", nof_ports);
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2116,7 +2105,7 @@ int srslte_precoding_multiplex(cf_t* x[SRSLTE_MAX_LAYERS],
|
|
|
|
srslte_vec_sc_prod_ccc(x[0], -_Complex_I * scaling, y[1], nof_symbols);
|
|
|
|
srslte_vec_sc_prod_ccc(x[0], -_Complex_I * scaling, y[1], nof_symbols);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
ERROR("Invalid multiplex combination: codebook_idx=%d, nof_layers=%d, nof_ports=%d\n",
|
|
|
|
ERROR("Invalid multiplex combination: codebook_idx=%d, nof_layers=%d, nof_ports=%d",
|
|
|
|
codebook_idx,
|
|
|
|
codebook_idx,
|
|
|
|
nof_layers,
|
|
|
|
nof_layers,
|
|
|
|
nof_ports);
|
|
|
|
nof_ports);
|
|
|
@ -2197,7 +2186,7 @@ int srslte_precoding_multiplex(cf_t* x[SRSLTE_MAX_LAYERS],
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
case 3:
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
ERROR("Invalid multiplex combination: codebook_idx=%d, nof_layers=%d, nof_ports=%d\n",
|
|
|
|
ERROR("Invalid multiplex combination: codebook_idx=%d, nof_layers=%d, nof_ports=%d",
|
|
|
|
codebook_idx,
|
|
|
|
codebook_idx,
|
|
|
|
nof_layers,
|
|
|
|
nof_layers,
|
|
|
|
nof_ports);
|
|
|
|
nof_ports);
|
|
|
@ -2222,13 +2211,12 @@ int srslte_precoding_type(cf_t* x[SRSLTE_MAX_LAYERS],
|
|
|
|
float scaling,
|
|
|
|
float scaling,
|
|
|
|
srslte_tx_scheme_t type)
|
|
|
|
srslte_tx_scheme_t type)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
if (nof_ports > SRSLTE_MAX_PORTS) {
|
|
|
|
if (nof_ports > SRSLTE_MAX_PORTS) {
|
|
|
|
ERROR("Maximum number of ports is %d (nof_ports=%d)\n", SRSLTE_MAX_PORTS, nof_ports);
|
|
|
|
ERROR("Maximum number of ports is %d (nof_ports=%d)", SRSLTE_MAX_PORTS, nof_ports);
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (nof_layers > SRSLTE_MAX_LAYERS) {
|
|
|
|
if (nof_layers > SRSLTE_MAX_LAYERS) {
|
|
|
|
ERROR("Maximum number of layers is %d (nof_layers=%d)\n", SRSLTE_MAX_LAYERS, nof_layers);
|
|
|
|
ERROR("Maximum number of layers is %d (nof_layers=%d)", SRSLTE_MAX_LAYERS, nof_layers);
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2239,7 +2227,7 @@ int srslte_precoding_type(cf_t* x[SRSLTE_MAX_LAYERS],
|
|
|
|
if (nof_ports == 1 && nof_layers == 1) {
|
|
|
|
if (nof_ports == 1 && nof_layers == 1) {
|
|
|
|
return srslte_precoding_single(x[0], y[0], nof_symbols, scaling);
|
|
|
|
return srslte_precoding_single(x[0], y[0], nof_symbols, scaling);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ERROR("Number of ports and layers must be 1 for transmission on single antenna ports\n");
|
|
|
|
ERROR("Number of ports and layers must be 1 for transmission on single antenna ports");
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -2247,7 +2235,7 @@ int srslte_precoding_type(cf_t* x[SRSLTE_MAX_LAYERS],
|
|
|
|
if (nof_ports == nof_layers) {
|
|
|
|
if (nof_ports == nof_layers) {
|
|
|
|
return srslte_precoding_diversity(x, y, nof_ports, nof_symbols, scaling);
|
|
|
|
return srslte_precoding_diversity(x, y, nof_ports, nof_symbols, scaling);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ERROR("Error number of layers must equal number of ports in transmit diversity\n");
|
|
|
|
ERROR("Error number of layers must equal number of ports in transmit diversity");
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case SRSLTE_TXSCHEME_SPATIALMUX:
|
|
|
|
case SRSLTE_TXSCHEME_SPATIALMUX:
|
|
|
@ -2267,7 +2255,6 @@ int srslte_precoding_pmi_select_1l_gen(cf_t* h[SRSLTE_MAX_PORTS][SRSLTE_MAX_
|
|
|
|
uint32_t* pmi,
|
|
|
|
uint32_t* pmi,
|
|
|
|
float sinr_list[SRSLTE_MAX_CODEBOOKS])
|
|
|
|
float sinr_list[SRSLTE_MAX_CODEBOOKS])
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
#define SQRT1_2 ((float)M_SQRT1_2)
|
|
|
|
#define SQRT1_2 ((float)M_SQRT1_2)
|
|
|
|
float max_sinr = 0.0;
|
|
|
|
float max_sinr = 0.0;
|
|
|
|
uint32_t i, count;
|
|
|
|
uint32_t i, count;
|
|
|
@ -2482,7 +2469,7 @@ int srslte_precoding_pmi_select_1l(cf_t* h[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORT
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
ret = srslte_precoding_pmi_select_1l_gen(h, nof_symbols, noise_estimate, pmi, sinr_list);
|
|
|
|
ret = srslte_precoding_pmi_select_1l_gen(h, nof_symbols, noise_estimate, pmi, sinr_list);
|
|
|
|
#endif /* SRSLTE_SIMD_CF_SIZE != 0 */
|
|
|
|
#endif /* SRSLTE_SIMD_CF_SIZE != 0 */
|
|
|
|
INFO("Precoder PMI Select for 1 layer SINR=[%.1fdB; %.1fdB; %.1fdB; %.1fdB] PMI=%d\n",
|
|
|
|
INFO("Precoder PMI Select for 1 layer SINR=[%.1fdB; %.1fdB; %.1fdB; %.1fdB] PMI=%d",
|
|
|
|
srslte_convert_power_to_dB(sinr_list[0]),
|
|
|
|
srslte_convert_power_to_dB(sinr_list[0]),
|
|
|
|
srslte_convert_power_to_dB(sinr_list[1]),
|
|
|
|
srslte_convert_power_to_dB(sinr_list[1]),
|
|
|
|
srslte_convert_power_to_dB(sinr_list[2]),
|
|
|
|
srslte_convert_power_to_dB(sinr_list[2]),
|
|
|
@ -2498,7 +2485,6 @@ int srslte_precoding_pmi_select_2l_gen(cf_t* h[SRSLTE_MAX_PORTS][SRSLTE_MAX_
|
|
|
|
uint32_t* pmi,
|
|
|
|
uint32_t* pmi,
|
|
|
|
float sinr_list[SRSLTE_MAX_CODEBOOKS])
|
|
|
|
float sinr_list[SRSLTE_MAX_CODEBOOKS])
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
float max_sinr = 0.0;
|
|
|
|
float max_sinr = 0.0;
|
|
|
|
uint32_t i, count;
|
|
|
|
uint32_t i, count;
|
|
|
|
|
|
|
|
|
|
|
@ -2758,7 +2744,6 @@ int srslte_precoding_pmi_select_2l(cf_t* h[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORT
|
|
|
|
uint32_t* pmi,
|
|
|
|
uint32_t* pmi,
|
|
|
|
float sinr_list[SRSLTE_MAX_CODEBOOKS])
|
|
|
|
float sinr_list[SRSLTE_MAX_CODEBOOKS])
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
int ret;
|
|
|
|
int ret;
|
|
|
|
#if SRSLTE_SIMD_CF_SIZE != 0
|
|
|
|
#if SRSLTE_SIMD_CF_SIZE != 0
|
|
|
|
ret = srslte_precoding_pmi_select_2l_simd(h, nof_symbols, noise_estimate, pmi, sinr_list);
|
|
|
|
ret = srslte_precoding_pmi_select_2l_simd(h, nof_symbols, noise_estimate, pmi, sinr_list);
|
|
|
@ -2766,7 +2751,7 @@ int srslte_precoding_pmi_select_2l(cf_t* h[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORT
|
|
|
|
ret = srslte_precoding_pmi_select_2l_gen(h, nof_symbols, noise_estimate, pmi, sinr_list);
|
|
|
|
ret = srslte_precoding_pmi_select_2l_gen(h, nof_symbols, noise_estimate, pmi, sinr_list);
|
|
|
|
#endif /* SRSLTE_SIMD_CF_SIZE != 0 */
|
|
|
|
#endif /* SRSLTE_SIMD_CF_SIZE != 0 */
|
|
|
|
|
|
|
|
|
|
|
|
INFO("Precoder PMI Select for 2 layers SINR=[%.1fdB; %.1fdB] PMI=%d\n",
|
|
|
|
INFO("Precoder PMI Select for 2 layers SINR=[%.1fdB; %.1fdB] PMI=%d",
|
|
|
|
srslte_convert_power_to_dB(sinr_list[0]),
|
|
|
|
srslte_convert_power_to_dB(sinr_list[0]),
|
|
|
|
srslte_convert_power_to_dB(sinr_list[1]),
|
|
|
|
srslte_convert_power_to_dB(sinr_list[1]),
|
|
|
|
*pmi);
|
|
|
|
*pmi);
|
|
|
@ -2839,7 +2824,7 @@ int srslte_precoding_cn(cf_t* h[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS],
|
|
|
|
*cn = srslte_precoding_2x2_cn_gen(h, nof_symbols);
|
|
|
|
*cn = srslte_precoding_2x2_cn_gen(h, nof_symbols);
|
|
|
|
return SRSLTE_SUCCESS;
|
|
|
|
return SRSLTE_SUCCESS;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ERROR("MIMO Condition Number calculation not implemented for %d×%d\n", nof_tx_antennas, nof_rx_antennas);
|
|
|
|
ERROR("MIMO Condition Number calculation not implemented for %d×%d", nof_tx_antennas, nof_rx_antennas);
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
return SRSLTE_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|