|
|
@ -24,10 +24,13 @@
|
|
|
|
#include "srsran/phy/utils/debug.h"
|
|
|
|
#include "srsran/phy/utils/debug.h"
|
|
|
|
#include "srsran/phy/utils/primes.h"
|
|
|
|
#include "srsran/phy/utils/primes.h"
|
|
|
|
#include "srsran/phy/utils/vector.h"
|
|
|
|
#include "srsran/phy/utils/vector.h"
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
#include <complex.h>
|
|
|
|
#include <complex.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define NOF_ZC_SEQ 30
|
|
|
|
|
|
|
|
|
|
|
|
// Phi values for M_sc=12 Table 5.5.1.2-1 in TS 36.211
|
|
|
|
// Phi values for M_sc=12 Table 5.5.1.2-1 in TS 36.211
|
|
|
|
static const float zc_sequence_lte_phi_M_sc_12[30][12] = {
|
|
|
|
static const float zc_sequence_lte_phi_M_sc_12[NOF_ZC_SEQ][12] = {
|
|
|
|
{-1, 1, 3, -3, 3, 3, 1, 1, 3, 1, -3, 3}, {1, 1, 3, 3, 3, -1, 1, -3, -3, 1, -3, 3},
|
|
|
|
{-1, 1, 3, -3, 3, 3, 1, 1, 3, 1, -3, 3}, {1, 1, 3, 3, 3, -1, 1, -3, -3, 1, -3, 3},
|
|
|
|
{1, 1, -3, -3, -3, -1, -3, -3, 1, -3, 1, -1}, {-1, 1, 1, 1, 1, -1, -3, -3, 1, -3, 3, -1},
|
|
|
|
{1, 1, -3, -3, -3, -1, -3, -3, 1, -3, 1, -1}, {-1, 1, 1, 1, 1, -1, -3, -3, 1, -3, 3, -1},
|
|
|
|
{-1, 3, 1, -1, 1, -1, -3, -1, 1, -1, 1, 3}, {1, -3, 3, -1, -1, 1, 1, -1, -1, 3, -3, 1},
|
|
|
|
{-1, 3, 1, -1, 1, -1, -3, -1, 1, -1, 1, 3}, {1, -3, 3, -1, -1, 1, 1, -1, -1, 3, -3, 1},
|
|
|
@ -45,7 +48,7 @@ static const float zc_sequence_lte_phi_M_sc_12[30][12] = {
|
|
|
|
{-1, 3, -3, 3, -1, 3, 3, -3, 3, 3, -1, -1}, {3, -3, -3, -1, -1, -3, -1, 3, -3, 3, 1, -1}};
|
|
|
|
{-1, 3, -3, 3, -1, 3, 3, -3, 3, 3, -1, -1}, {3, -3, -3, -1, -1, -3, -1, 3, -3, 3, 1, -1}};
|
|
|
|
|
|
|
|
|
|
|
|
// Phi values for M_sc=24 Table 5.5.1.2-2 in TS 36.211
|
|
|
|
// Phi values for M_sc=24 Table 5.5.1.2-2 in TS 36.211
|
|
|
|
static const float zc_sequence_lte_phi_M_sc_24[30][24] = {
|
|
|
|
static const float zc_sequence_lte_phi_M_sc_24[NOF_ZC_SEQ][24] = {
|
|
|
|
{-1, 3, 1, -3, 3, -1, 1, 3, -3, 3, 1, 3, -3, 3, 1, 1, -1, 1, 3, -3, 3, -3, -1, -3},
|
|
|
|
{-1, 3, 1, -3, 3, -1, 1, 3, -3, 3, 1, 3, -3, 3, 1, 1, -1, 1, 3, -3, 3, -3, -1, -3},
|
|
|
|
{-3, 3, -3, -3, -3, 1, -3, -3, 3, -1, 1, 1, 1, 3, 1, -1, 3, -3, -3, 1, 3, 1, 1, -3},
|
|
|
|
{-3, 3, -3, -3, -3, 1, -3, -3, 3, -1, 1, 1, 1, 3, 1, -1, 3, -3, -3, 1, 3, 1, 1, -3},
|
|
|
|
{3, -1, 3, 3, 1, 1, -3, 3, 3, 3, 3, 1, -1, 3, -1, 1, 1, -1, -3, -1, -1, 1, 3, 3},
|
|
|
|
{3, -1, 3, 3, 1, 1, -3, 3, 3, 3, 3, 1, -1, 3, -1, 1, 1, -1, -3, -1, -1, 1, 3, 3},
|
|
|
@ -78,7 +81,7 @@ static const float zc_sequence_lte_phi_M_sc_24[30][24] = {
|
|
|
|
{1, 1, -1, -1, -3, -1, 3, -1, 3, -1, 1, 3, 1, -1, 3, 1, 3, -3, -3, 1, -1, -1, 1, 3}};
|
|
|
|
{1, 1, -1, -1, -3, -1, 3, -1, 3, -1, 1, 3, 1, -1, 3, 1, 3, -3, -3, 1, -1, -1, 1, 3}};
|
|
|
|
|
|
|
|
|
|
|
|
// Phi values for M_sc=12 Table 5.2.2.2-1 in TS 38.211
|
|
|
|
// Phi values for M_sc=12 Table 5.2.2.2-1 in TS 38.211
|
|
|
|
static const float zc_sequence_nr_phi_M_sc_6[30][6] = {
|
|
|
|
static const float zc_sequence_nr_phi_M_sc_6[NOF_ZC_SEQ][6] = {
|
|
|
|
{-3, -1, 3, 3, -1, -3}, {-3, 3, -1, -1, 3, -3}, {-3, -3, -3, 3, 1, -3}, {1, 1, 1, 3, -1, -3},
|
|
|
|
{-3, -1, 3, 3, -1, -3}, {-3, 3, -1, -1, 3, -3}, {-3, -3, -3, 3, 1, -3}, {1, 1, 1, 3, -1, -3},
|
|
|
|
{1, 1, 1, -3, -1, 3}, {-3, 1, -1, -3, -3, -3}, {-3, 1, 3, -3, -3, -3}, {-3, -1, 1, -3, 1, -1},
|
|
|
|
{1, 1, 1, -3, -1, 3}, {-3, 1, -1, -3, -3, -3}, {-3, 1, 3, -3, -3, -3}, {-3, -1, 1, -3, 1, -1},
|
|
|
|
{-3, -1, -3, 1, -3, -3}, {-3, -3, 1, -3, 3, -3}, {-3, 1, 3, 1, -3, -3}, {-3, -1, -3, 1, 1, -3},
|
|
|
|
{-3, -1, -3, 1, -3, -3}, {-3, -3, 1, -3, 3, -3}, {-3, 1, 3, 1, -3, -3}, {-3, -1, -3, 1, 1, -3},
|
|
|
@ -89,7 +92,7 @@ static const float zc_sequence_nr_phi_M_sc_6[30][6] = {
|
|
|
|
{1, 1, -1, 3, -3, -1}, {1, 1, -3, 1, -1, -1}};
|
|
|
|
{1, 1, -1, 3, -3, -1}, {1, 1, -3, 1, -1, -1}};
|
|
|
|
|
|
|
|
|
|
|
|
// Phi values for M_sc=12 Table 5.2.2.2-2 in TS 38.211
|
|
|
|
// Phi values for M_sc=12 Table 5.2.2.2-2 in TS 38.211
|
|
|
|
static const float zc_sequence_nr_phi_M_sc_12[30][12] = {
|
|
|
|
static const float zc_sequence_nr_phi_M_sc_12[NOF_ZC_SEQ][12] = {
|
|
|
|
{-3, 1, -3, -3, -3, 3, -3, -1, 1, 1, 1, -3}, {-3, 3, 1, -3, 1, 3, -1, -1, 1, 3, 3, 3},
|
|
|
|
{-3, 1, -3, -3, -3, 3, -3, -1, 1, 1, 1, -3}, {-3, 3, 1, -3, 1, 3, -1, -1, 1, 3, 3, 3},
|
|
|
|
{-3, 3, 3, 1, -3, 3, -1, 1, 3, -3, 3, -3}, {-3, -3, -1, 3, 3, 3, -3, 3, -3, 1, -1, -3},
|
|
|
|
{-3, 3, 3, 1, -3, 3, -1, 1, 3, -3, 3, -3}, {-3, -3, -1, 3, 3, 3, -3, 3, -3, 1, -1, -3},
|
|
|
|
{-3, -1, -1, 1, 3, 1, 1, -1, 1, -1, -3, 1}, {-3, -3, 3, 1, -3, -3, -3, -1, 3, -1, 1, 3},
|
|
|
|
{-3, -1, -1, 1, 3, 1, 1, -1, 1, -1, -3, 1}, {-3, -3, 3, 1, -3, -3, -3, -1, 3, -1, 1, 3},
|
|
|
@ -107,7 +110,7 @@ static const float zc_sequence_nr_phi_M_sc_12[30][12] = {
|
|
|
|
{1, -1, 3, 1, 1, -1, -1, -1, 1, 3, -3, 1}, {-3, 3, -3, 3, -3, -3, 3, -1, -1, 1, 3, -3}};
|
|
|
|
{1, -1, 3, 1, 1, -1, -1, -1, 1, 3, -3, 1}, {-3, 3, -3, 3, -3, -3, 3, -1, -1, 1, 3, -3}};
|
|
|
|
|
|
|
|
|
|
|
|
// Phi values for M_sc=18 Table 5.2.2.2-3 in TS 38.211
|
|
|
|
// Phi values for M_sc=18 Table 5.2.2.2-3 in TS 38.211
|
|
|
|
static const float zc_sequence_nr_phi_M_sc_18[30][18] = {
|
|
|
|
static const float zc_sequence_nr_phi_M_sc_18[NOF_ZC_SEQ][18] = {
|
|
|
|
{-1, 3, -1, -3, 3, 1, -3, -1, 3, -3, -1, -1, 1, 1, 1, -1, -1, -1},
|
|
|
|
{-1, 3, -1, -3, 3, 1, -3, -1, 3, -3, -1, -1, 1, 1, 1, -1, -1, -1},
|
|
|
|
{3, -3, 3, -1, 1, 3, -3, -1, -3, -3, -1, -3, 3, 1, -1, 3, -3, 3},
|
|
|
|
{3, -3, 3, -1, 1, 3, -3, -1, -3, -3, -1, -3, 3, 1, -1, 3, -3, 3},
|
|
|
|
{-3, 3, 1, -1, -1, 3, -3, -1, 1, 1, 1, 1, 1, -1, 3, -1, -3, -1},
|
|
|
|
{-3, 3, 1, -1, -1, 3, -3, -1, 1, 1, 1, 1, 1, -1, 3, -1, -3, -1},
|
|
|
@ -140,7 +143,7 @@ static const float zc_sequence_nr_phi_M_sc_18[30][18] = {
|
|
|
|
{-3, 3, 1, -1, -1, -1, -1, 1, -1, 3, 3, -3, -1, 1, 3, -1, 3, -1}};
|
|
|
|
{-3, 3, 1, -1, -1, -1, -1, 1, -1, 3, 3, -3, -1, 1, 3, -1, 3, -1}};
|
|
|
|
|
|
|
|
|
|
|
|
// Phi values for M_sc=18 Table 5.2.2.2-3 in TS 38.211
|
|
|
|
// Phi values for M_sc=18 Table 5.2.2.2-3 in TS 38.211
|
|
|
|
static const float zc_sequence_nr_phi_M_sc_24[30][24] = {
|
|
|
|
static const float zc_sequence_nr_phi_M_sc_24[NOF_ZC_SEQ][24] = {
|
|
|
|
{-1, -3, 3, -1, 3, 1, 3, -1, 1, -3, -1, -3, -1, 1, 3, -3, -1, -3, 3, 3, 3, -3, -3, -3},
|
|
|
|
{-1, -3, 3, -1, 3, 1, 3, -1, 1, -3, -1, -3, -1, 1, 3, -3, -1, -3, 3, 3, 3, -3, -3, -3},
|
|
|
|
{-1, -3, 3, 1, 1, -3, 1, -3, -3, 1, -3, -1, -1, 3, -3, 3, 3, 3, -3, 1, 3, 3, -3, -3},
|
|
|
|
{-1, -3, 3, 1, 1, -3, 1, -3, -3, 1, -3, -1, -1, 3, -3, 3, 3, 3, -3, 1, 3, 3, -3, -3},
|
|
|
|
{-1, -3, -3, 1, -1, -1, -3, 1, 3, -1, -3, -1, -1, -3, 1, 1, 3, 1, -3, -1, -1, 3, -3, -3},
|
|
|
|
{-1, -3, -3, 1, -1, -1, -3, 1, 3, -1, -3, -1, -1, -3, 1, 1, 3, 1, -3, -1, -1, 3, -3, -3},
|
|
|
@ -174,31 +177,37 @@ static const float zc_sequence_nr_phi_M_sc_24[30][24] = {
|
|
|
|
|
|
|
|
|
|
|
|
static void zc_sequence_lte_r_uv_arg_1prb(uint32_t u, cf_t* tmp_arg)
|
|
|
|
static void zc_sequence_lte_r_uv_arg_1prb(uint32_t u, cf_t* tmp_arg)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
assert(u < NOF_ZC_SEQ);
|
|
|
|
srsran_vec_sc_prod_fcc(zc_sequence_lte_phi_M_sc_12[u], M_PI_4, tmp_arg, SRSRAN_NRE);
|
|
|
|
srsran_vec_sc_prod_fcc(zc_sequence_lte_phi_M_sc_12[u], M_PI_4, tmp_arg, SRSRAN_NRE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void zc_sequence_lte_r_uv_arg_2prb(uint32_t u, cf_t* tmp_arg)
|
|
|
|
static void zc_sequence_lte_r_uv_arg_2prb(uint32_t u, cf_t* tmp_arg)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
assert(u < NOF_ZC_SEQ);
|
|
|
|
srsran_vec_sc_prod_fcc(zc_sequence_lte_phi_M_sc_24[u], M_PI_4, tmp_arg, 2 * SRSRAN_NRE);
|
|
|
|
srsran_vec_sc_prod_fcc(zc_sequence_lte_phi_M_sc_24[u], M_PI_4, tmp_arg, 2 * SRSRAN_NRE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void zc_sequence_nr_r_uv_arg_0dot5prb(uint32_t u, cf_t* tmp_arg)
|
|
|
|
static void zc_sequence_nr_r_uv_arg_0dot5prb(uint32_t u, cf_t* tmp_arg)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
assert(u < NOF_ZC_SEQ);
|
|
|
|
srsran_vec_sc_prod_fcc(zc_sequence_nr_phi_M_sc_6[u], M_PI_4, tmp_arg, SRSRAN_NRE / 2);
|
|
|
|
srsran_vec_sc_prod_fcc(zc_sequence_nr_phi_M_sc_6[u], M_PI_4, tmp_arg, SRSRAN_NRE / 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void zc_sequence_nr_r_uv_arg_1prb(uint32_t u, cf_t* tmp_arg)
|
|
|
|
static void zc_sequence_nr_r_uv_arg_1prb(uint32_t u, cf_t* tmp_arg)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
assert(u < NOF_ZC_SEQ);
|
|
|
|
srsran_vec_sc_prod_fcc(zc_sequence_nr_phi_M_sc_12[u], M_PI_4, tmp_arg, SRSRAN_NRE);
|
|
|
|
srsran_vec_sc_prod_fcc(zc_sequence_nr_phi_M_sc_12[u], M_PI_4, tmp_arg, SRSRAN_NRE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void zc_sequence_nr_r_uv_arg_1dot5prb(uint32_t u, cf_t* tmp_arg)
|
|
|
|
static void zc_sequence_nr_r_uv_arg_1dot5prb(uint32_t u, cf_t* tmp_arg)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
assert(u < NOF_ZC_SEQ);
|
|
|
|
srsran_vec_sc_prod_fcc(zc_sequence_nr_phi_M_sc_18[u], M_PI_4, tmp_arg, (3 * SRSRAN_NRE) / 2);
|
|
|
|
srsran_vec_sc_prod_fcc(zc_sequence_nr_phi_M_sc_18[u], M_PI_4, tmp_arg, (3 * SRSRAN_NRE) / 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void zc_sequence_nr_r_uv_arg_2prb(uint32_t u, cf_t* tmp_arg)
|
|
|
|
static void zc_sequence_nr_r_uv_arg_2prb(uint32_t u, cf_t* tmp_arg)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
assert(u < NOF_ZC_SEQ);
|
|
|
|
srsran_vec_sc_prod_fcc(zc_sequence_nr_phi_M_sc_24[u], M_PI_4, tmp_arg, 2 * SRSRAN_NRE);
|
|
|
|
srsran_vec_sc_prod_fcc(zc_sequence_nr_phi_M_sc_24[u], M_PI_4, tmp_arg, 2 * SRSRAN_NRE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -270,7 +279,7 @@ static int zc_sequence_nr_r_uv_arg(uint32_t M_zc, uint32_t u, uint32_t v, cf_t*
|
|
|
|
static void zc_sequence_generate(uint32_t M_zc, float alpha, const cf_t* tmp_arg, cf_t* sequence)
|
|
|
|
static void zc_sequence_generate(uint32_t M_zc, float alpha, const cf_t* tmp_arg, cf_t* sequence)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (uint32_t i = 0; i < M_zc; i++) {
|
|
|
|
for (uint32_t i = 0; i < M_zc; i++) {
|
|
|
|
sequence[i] = cexpf(I * (tmp_arg[i] + alpha * (float)i));
|
|
|
|
sequence[i] = cexpf(I * (tmp_arg[i] + alpha * (cf_t)i));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|