Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lizhongxiao
OpenXG-RAN
Commits
97801299
Commit
97801299
authored
Feb 10, 2021
by
Thomas Schlichter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some whitespace fixes in openair1/PHY/MODULATION/nr_modulation.c
parent
14e84f87
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
143 additions
and
147 deletions
+143
-147
openair1/PHY/MODULATION/nr_modulation.c
openair1/PHY/MODULATION/nr_modulation.c
+143
-147
No files found.
openair1/PHY/MODULATION/nr_modulation.c
View file @
97801299
...
@@ -69,7 +69,6 @@ char nr_W_2l_2p[3][2][2] = {
...
@@ -69,7 +69,6 @@ char nr_W_2l_2p[3][2][2] = {
{{
'1'
,
'0'
},
{
'0'
,
'1'
}},
//pmi 0
{{
'1'
,
'0'
},
{
'0'
,
'1'
}},
//pmi 0
{{
'1'
,
'1'
},
{
'1'
,
'n'
}},
{{
'1'
,
'1'
},
{
'1'
,
'n'
}},
{{
'1'
,
'1'
},
{
'j'
,
'o'
}}
//pmi 2
{{
'1'
,
'1'
},
{
'j'
,
'o'
}}
//pmi 2
};
};
//Table 6.3.1.5-5 Precoding Matrix W 2 layers 4 antenna ports 'n' = -1 and 'o' = -j
//Table 6.3.1.5-5 Precoding Matrix W 2 layers 4 antenna ports 'n' = -1 and 'o' = -j
...
@@ -152,7 +151,7 @@ void nr_modulation(uint32_t *in,
...
@@ -152,7 +151,7 @@ void nr_modulation(uint32_t *in,
// the bits that are left out
// the bits that are left out
i
=
i
*
8
/
2
;
i
=
i
*
8
/
2
;
nr_mod_table32
=
(
int32_t
*
)
nr_qpsk_mod_table
;
nr_mod_table32
=
(
int32_t
*
)
nr_qpsk_mod_table
;
while
(
i
<
length
/
2
){
while
(
i
<
length
/
2
)
{
idx
=
((
in_bytes
[(
i
*
2
)
/
8
]
>>
((
i
*
2
)
&
0x7
))
&
mask
);
idx
=
((
in_bytes
[(
i
*
2
)
/
8
]
>>
((
i
*
2
)
&
0x7
))
&
mask
);
out32
[
i
]
=
nr_mod_table32
[
idx
];
out32
[
i
]
=
nr_mod_table32
[
idx
];
i
++
;
i
++
;
...
@@ -174,7 +173,7 @@ void nr_modulation(uint32_t *in,
...
@@ -174,7 +173,7 @@ void nr_modulation(uint32_t *in,
out64
[
i
]
=
nr_16qam_byte_mod_table
[
in_bytes
[
i
]];
out64
[
i
]
=
nr_16qam_byte_mod_table
[
in_bytes
[
i
]];
// the bits that are left out
// the bits that are left out
i
=
i
*
8
/
4
;
i
=
i
*
8
/
4
;
while
(
i
<
length
/
4
){
while
(
i
<
length
/
4
)
{
idx
=
((
in_bytes
[(
i
*
4
)
/
8
]
>>
((
i
*
4
)
&
0x7
))
&
mask
);
idx
=
((
in_bytes
[(
i
*
4
)
/
8
]
>>
((
i
*
4
)
&
0x7
))
&
mask
);
out32
[
i
]
=
nr_16qam_mod_table
[
idx
];
out32
[
i
]
=
nr_16qam_mod_table
[
idx
];
i
++
;
i
++
;
...
@@ -247,13 +246,13 @@ void nr_modulation(uint32_t *in,
...
@@ -247,13 +246,13 @@ void nr_modulation(uint32_t *in,
break
;
break
;
}
}
AssertFatal
(
false
,
"Invalid or unsupported modulation order %d
\n
"
,
mod_order
);
AssertFatal
(
false
,
"Invalid or unsupported modulation order %d
\n
"
,
mod_order
);
}
}
void
nr_layer_mapping
(
int16_t
**
mod_symbs
,
void
nr_layer_mapping
(
int16_t
**
mod_symbs
,
uint8_t
n_layers
,
uint8_t
n_layers
,
uint16_t
n_symbs
,
uint16_t
n_symbs
,
int16_t
**
tx_layers
)
{
int16_t
**
tx_layers
)
{
LOG_D
(
PHY
,
"Doing layer mapping for %d layers, %d symbols
\n
"
,
n_layers
,
n_symbs
);
LOG_D
(
PHY
,
"Doing layer mapping for %d layers, %d symbols
\n
"
,
n_layers
,
n_symbs
);
switch
(
n_layers
)
{
switch
(
n_layers
)
{
...
@@ -324,15 +323,15 @@ void nr_layer_mapping(int16_t **mod_symbs,
...
@@ -324,15 +323,15 @@ void nr_layer_mapping(int16_t **mod_symbs,
void
nr_ue_layer_mapping
(
NR_UE_ULSCH_t
**
ulsch_ue
,
void
nr_ue_layer_mapping
(
NR_UE_ULSCH_t
**
ulsch_ue
,
uint8_t
n_layers
,
uint8_t
n_layers
,
uint16_t
n_symbs
,
uint16_t
n_symbs
,
int16_t
**
tx_layers
)
{
int16_t
**
tx_layers
)
{
int16_t
*
mod_symbs
;
int16_t
*
mod_symbs
;
switch
(
n_layers
)
{
switch
(
n_layers
)
{
case
1
:
case
1
:
mod_symbs
=
(
int16_t
*
)
ulsch_ue
[
0
]
->
d_mod
;
mod_symbs
=
(
int16_t
*
)
ulsch_ue
[
0
]
->
d_mod
;
for
(
int
i
=
0
;
i
<
n_symbs
;
i
++
){
for
(
int
i
=
0
;
i
<
n_symbs
;
i
++
)
{
tx_layers
[
0
][
i
<<
1
]
=
(
mod_symbs
[
i
<<
1
]
*
AMP
)
>>
15
;
tx_layers
[
0
][
i
<<
1
]
=
(
mod_symbs
[
i
<<
1
]
*
AMP
)
>>
15
;
tx_layers
[
0
][(
i
<<
1
)
+
1
]
=
(
mod_symbs
[(
i
<<
1
)
+
1
]
*
AMP
)
>>
15
;
tx_layers
[
0
][(
i
<<
1
)
+
1
]
=
(
mod_symbs
[(
i
<<
1
)
+
1
]
*
AMP
)
>>
15
;
}
}
...
@@ -343,7 +342,7 @@ void nr_ue_layer_mapping(NR_UE_ULSCH_t **ulsch_ue,
...
@@ -343,7 +342,7 @@ void nr_ue_layer_mapping(NR_UE_ULSCH_t **ulsch_ue,
case
4
:
case
4
:
mod_symbs
=
(
int16_t
*
)
ulsch_ue
[
0
]
->
d_mod
;
mod_symbs
=
(
int16_t
*
)
ulsch_ue
[
0
]
->
d_mod
;
for
(
int
i
=
0
;
i
<
n_symbs
/
n_layers
;
i
++
){
for
(
int
i
=
0
;
i
<
n_symbs
/
n_layers
;
i
++
)
{
for
(
int
l
=
0
;
l
<
n_layers
;
l
++
)
{
for
(
int
l
=
0
;
l
<
n_layers
;
l
++
)
{
tx_layers
[
l
][
i
<<
1
]
=
(
mod_symbs
[(
n_layers
*
i
+
l
)
<<
1
]
*
AMP
)
>>
15
;
tx_layers
[
l
][
i
<<
1
]
=
(
mod_symbs
[(
n_layers
*
i
+
l
)
<<
1
]
*
AMP
)
>>
15
;
tx_layers
[
l
][(
i
<<
1
)
+
1
]
=
(
mod_symbs
[((
n_layers
*
i
+
l
)
<<
1
)
+
1
]
*
AMP
)
>>
15
;
tx_layers
[
l
][(
i
<<
1
)
+
1
]
=
(
mod_symbs
[((
n_layers
*
i
+
l
)
<<
1
)
+
1
]
*
AMP
)
>>
15
;
...
@@ -370,8 +369,7 @@ void nr_ue_layer_mapping(NR_UE_ULSCH_t **ulsch_ue,
...
@@ -370,8 +369,7 @@ void nr_ue_layer_mapping(NR_UE_ULSCH_t **ulsch_ue,
break
;
break
;
case
6
:
case
6
:
for
(
int
q
=
0
;
q
<
2
;
q
++
){
for
(
int
q
=
0
;
q
<
2
;
q
++
)
{
mod_symbs
=
(
int16_t
*
)
ulsch_ue
[
q
]
->
d_mod
;
mod_symbs
=
(
int16_t
*
)
ulsch_ue
[
q
]
->
d_mod
;
for
(
int
i
=
0
;
i
<
n_symbs
/
3
;
i
++
)
for
(
int
i
=
0
;
i
<
n_symbs
/
3
;
i
++
)
...
@@ -401,8 +399,7 @@ void nr_ue_layer_mapping(NR_UE_ULSCH_t **ulsch_ue,
...
@@ -401,8 +399,7 @@ void nr_ue_layer_mapping(NR_UE_ULSCH_t **ulsch_ue,
break
;
break
;
case
8
:
case
8
:
for
(
int
q
=
0
;
q
<
2
;
q
++
){
for
(
int
q
=
0
;
q
<
2
;
q
++
)
{
mod_symbs
=
(
int16_t
*
)
ulsch_ue
[
q
]
->
d_mod
;
mod_symbs
=
(
int16_t
*
)
ulsch_ue
[
q
]
->
d_mod
;
for
(
int
i
=
0
;
i
<
n_symbs
>>
2
;
i
++
)
for
(
int
i
=
0
;
i
<
n_symbs
>>
2
;
i
++
)
...
@@ -598,8 +595,8 @@ void nr_dft(int32_t *z, int32_t *d, uint32_t Msc_PUSCH)
...
@@ -598,8 +595,8 @@ void nr_dft(int32_t *z, int32_t *d, uint32_t Msc_PUSCH)
}
}
void
init_symbol_rotation
(
NR_DL_FRAME_PARMS
*
fp
,
uint64_t
CarrierFreq
)
{
void
init_symbol_rotation
(
NR_DL_FRAME_PARMS
*
fp
,
uint64_t
CarrierFreq
)
{
const
int
nsymb
=
fp
->
symbols_per_slot
*
fp
->
slots_per_frame
/
10
;
const
int
nsymb
=
fp
->
symbols_per_slot
*
fp
->
slots_per_frame
/
10
;
const
double
Tc
=
(
1
/
480e3
/
4096
);
const
double
Tc
=
(
1
/
480e3
/
4096
);
const
double
Nu
=
2048
*
64
*
(
1
/
(
float
)(
1
<<
fp
->
numerology_index
));
const
double
Nu
=
2048
*
64
*
(
1
/
(
float
)(
1
<<
fp
->
numerology_index
));
...
@@ -616,7 +613,8 @@ void init_symbol_rotation(NR_DL_FRAME_PARMS *fp,uint64_t CarrierFreq) {
...
@@ -616,7 +613,8 @@ void init_symbol_rotation(NR_DL_FRAME_PARMS *fp,uint64_t CarrierFreq) {
fp
->
symbol_rotation
[
1
]
=
(
int16_t
)
floor
(
exp_im
*
32767
);
fp
->
symbol_rotation
[
1
]
=
(
int16_t
)
floor
(
exp_im
*
32767
);
LOG_I
(
PHY
,
"Doing symbol rotation calculation for gNB TX/RX, f0 %f Hz, Nsymb %d
\n
"
,
f0
,
nsymb
);
LOG_I
(
PHY
,
"Doing symbol rotation calculation for gNB TX/RX, f0 %f Hz, Nsymb %d
\n
"
,
f0
,
nsymb
);
LOG_I
(
PHY
,
"Symbol rotation %d/%d => (%d,%d)
\n
"
,
0
,
nsymb
,
fp
->
symbol_rotation
[
0
],
fp
->
symbol_rotation
[
1
]);
LOG_I
(
PHY
,
"Symbol rotation %d/%d => (%d,%d)
\n
"
,
0
,
nsymb
,
fp
->
symbol_rotation
[
0
],
fp
->
symbol_rotation
[
1
]);
for
(
int
l
=
1
;
l
<
nsymb
;
l
++
)
{
for
(
int
l
=
1
;
l
<
nsymb
;
l
++
)
{
if
(
l
==
(
7
*
(
1
<<
fp
->
numerology_index
)))
Ncp
=
Ncp0
;
if
(
l
==
(
7
*
(
1
<<
fp
->
numerology_index
)))
Ncp
=
Ncp0
;
else
Ncp
=
Ncp1
;
else
Ncp
=
Ncp1
;
tl
+=
(
Nu
+
Ncpm1
)
*
Tc
;
tl
+=
(
Nu
+
Ncpm1
)
*
Tc
;
...
@@ -625,8 +623,7 @@ void init_symbol_rotation(NR_DL_FRAME_PARMS *fp,uint64_t CarrierFreq) {
...
@@ -625,8 +623,7 @@ void init_symbol_rotation(NR_DL_FRAME_PARMS *fp,uint64_t CarrierFreq) {
exp_im
=
sin
(
-
poff
);
exp_im
=
sin
(
-
poff
);
fp
->
symbol_rotation
[
l
<<
1
]
=
(
int16_t
)
floor
(
exp_re
*
32767
);
fp
->
symbol_rotation
[
l
<<
1
]
=
(
int16_t
)
floor
(
exp_re
*
32767
);
fp
->
symbol_rotation
[
1
+
(
l
<<
1
)]
=
(
int16_t
)
floor
(
exp_im
*
32767
);
fp
->
symbol_rotation
[
1
+
(
l
<<
1
)]
=
(
int16_t
)
floor
(
exp_im
*
32767
);
LOG_I
(
PHY
,
"Symbol rotation %d/%d => tl %f (%d,%d) (%f)
\n
"
,
l
,
nsymb
,
tl
,
fp
->
symbol_rotation
[
l
<<
1
],
fp
->
symbol_rotation
[
1
+
(
l
<<
1
)],
LOG_I
(
PHY
,
"Symbol rotation %d/%d => tl %f (%d,%d) (%f)
\n
"
,
l
,
nsymb
,
tl
,
fp
->
symbol_rotation
[
l
<<
1
],
fp
->
symbol_rotation
[
1
+
(
l
<<
1
)],
(
poff
/
2
/
M_PI
)
-
floor
(
poff
/
2
/
M_PI
));
(
poff
/
2
/
M_PI
)
-
floor
(
poff
/
2
/
M_PI
));
Ncpm1
=
Ncp
;
Ncpm1
=
Ncp
;
}
}
}
}
...
@@ -634,13 +631,12 @@ void init_symbol_rotation(NR_DL_FRAME_PARMS *fp,uint64_t CarrierFreq) {
...
@@ -634,13 +631,12 @@ void init_symbol_rotation(NR_DL_FRAME_PARMS *fp,uint64_t CarrierFreq) {
int
nr_layer_precoder
(
int16_t
**
datatx_F_precoding
,
char
*
prec_matrix
,
uint8_t
n_layers
,
int32_t
re_offset
)
int
nr_layer_precoder
(
int16_t
**
datatx_F_precoding
,
char
*
prec_matrix
,
uint8_t
n_layers
,
int32_t
re_offset
)
{
{
int32_t
precodatatx_F
=
0
;
int32_t
precodatatx_F
=
0
;
for
(
int
al
=
0
;
al
<
n_layers
;
al
++
){
for
(
int
al
=
0
;
al
<
n_layers
;
al
++
)
{
int16_t
antenna_re
=
datatx_F_precoding
[
al
][
re_offset
<<
1
];
int16_t
antenna_re
=
datatx_F_precoding
[
al
][
re_offset
<<
1
];
int16_t
antenna_im
=
datatx_F_precoding
[
al
][(
re_offset
<<
1
)
+
1
];
int16_t
antenna_im
=
datatx_F_precoding
[
al
][(
re_offset
<<
1
)
+
1
];
switch
(
prec_matrix
[
al
])
{
switch
(
prec_matrix
[
al
])
{
case
'0'
:
//multiply by zero
case
'0'
:
//multiply by zero
break
;
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment