1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file PHY/NR_TRANSPORT/nr_sch_dmrs.c
* \brief
* \author
* \date
* \version
* \company Eurecom
* \email:
* \note
* \warning
*/
#include "nr_sch_dmrs.h"
/*Table 7.4.1.1.2-1 and 7.4.1.1.2-2 38211 Columns: ap - CDM group - Delta - Wf(0) - Wf(1) - Wt(0) - Wt(1)*/
int8_t pdsch_dmrs_1[8][7] = {{0,0,0,1,1,1,1},
{1,0,0,1,-1,1,1},
{2,1,1,1,1,,1,1},
{3,1,1,1,-1,1,1},
{4,0,0,1,1,1,-1},
{5,0,0,1,-1,1,-1},
{6,1,1,1,1,1,-1},
{7,1,1,1,-1,1,-1}};
int8_t pdsch_dmrs_2[12][7] = {{0,0,0,1,1,1,1},
{1,0,0,1,-1,1,1},
{2,1,2,1,1,1,1},
{3,1,2,1,-1,1,1},
{4,2,4,1,1,1,1},
{5,2,4,1,-1,1,1},
{6,0,0,1,1,1,-1},
{7,0,0,1,-1,1,-1},
{8,1,2,1,1,1,-1},
{9,1,2,1,-1,1,-1},
{10,2,4,1,1,1,-1},
{11,2,4,1,-1,1,-1}};
static inline void *get_l_prime(uint8_t n_symbs) {
uint8_t *l_prime;
for (int i=0; i<nsymbs; i++)
*(l_prime+i) = i;
return l_prime;
}
static inline void *get_antenna_ports(uint8_t n_symbs, uint8_t config) {
uint8_t *ap;
if (config == NFAPI_NR_DMRS_TYPE1)
for (int i=0; i<(4+4*(n_symbs-1); i++)
*(ap+i) = i;
else
for (int i=0; i<(7+4*(n_symbs-1); i++)
*(ap+i) = i;
return ap;
}
int8_t *get_Wt(uint8_t ap, uint8_t config) {
int8_t *Wt;
for (int i=0; i<2; i++)
*(Wt+i)=(config==NFAPI_NR_DMRS_TYPE1)?(pdsch_dmrs_1[ap][3+i]):(pdsch_dmrs_2[ap][3+i]);
return Wt;
}
int8_t *get_Wf(uint8_t ap, uint8_t config) {
int8_t *Wf;
for (int i=0; i<2; i++)
*(Wf+i)=(config==NFAPI_NR_DMRS_TYPE1)?(pdsch_dmrs_1[ap][5+i]):(pdsch_dmrs_2[ap][5+i]);
return Wf;
}
uint8_t get_delta(uint8_t ap, uint8_t config) {
return ((config==NFAPI_NR_DMRS_TYPE1)?(pdsch_dmrs_1[ap][2]):(pdsch_dmrs_2[ap][2]));
}
uint8_t *get_l0(uint8_t config, uint8_t dmrs_typeA_position) {
return ((config==NFAPI_NR_DMRS_TYPE1)?dmrs_typeA_position:0);
}