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
promise
OpenXG-RAN
Commits
0e550ff2
Commit
0e550ff2
authored
Jan 28, 2020
by
Francesco Mani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix for pucch0 resource allocation
parent
b2765ac2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
41 deletions
+14
-41
openair1/PHY/NR_TRANSPORT/pucch_rx.c
openair1/PHY/NR_TRANSPORT/pucch_rx.c
+8
-19
openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c
openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c
+5
-22
openair1/SIMULATION/NR_PHY/pucchsim.c
openair1/SIMULATION/NR_PHY/pucchsim.c
+1
-0
No files found.
openair1/PHY/NR_TRANSPORT/pucch_rx.c
View file @
0e550ff2
...
...
@@ -107,26 +107,13 @@ void nr_decode_pucch0( int32_t **rxdataF,
*/
uint32_t
re_offset
=
0
;
for
(
l
=
0
;
l
<
nrofSymbols
;
l
++
)
{
if
((
startingPRB
<
(
frame_parms
->
N_RB_DL
>>
1
))
&&
((
frame_parms
->
N_RB_DL
&
1
)
==
0
))
{
// if number RBs in bandwidth is even and current PRB is lower band
re_offset
=
((
l
+
startingSymbolIndex
)
*
frame_parms
->
ofdm_symbol_size
)
+
(
12
*
startingPRB
)
+
frame_parms
->
first_carrier_offset
;
}
if
((
startingPRB
>=
(
frame_parms
->
N_RB_DL
>>
1
))
&&
((
frame_parms
->
N_RB_DL
&
1
)
==
0
))
{
// if number RBs in bandwidth is even and current PRB is upper band
re_offset
=
((
l
+
startingSymbolIndex
)
*
frame_parms
->
ofdm_symbol_size
)
+
(
12
*
(
startingPRB
-
(
frame_parms
->
N_RB_DL
>>
1
)));
}
if
((
startingPRB
<
(
frame_parms
->
N_RB_DL
>>
1
))
&&
((
frame_parms
->
N_RB_DL
&
1
)
==
1
))
{
// if number RBs in bandwidth is odd and current PRB is lower band
re_offset
=
((
l
+
startingSymbolIndex
)
*
frame_parms
->
ofdm_symbol_size
)
+
(
12
*
startingPRB
)
+
frame_parms
->
first_carrier_offset
;
}
if
((
startingPRB
>
(
frame_parms
->
N_RB_DL
>>
1
))
&&
((
frame_parms
->
N_RB_DL
&
1
)
==
1
))
{
// if number RBs in bandwidth is odd and current PRB is upper band
re_offset
=
((
l
+
startingSymbolIndex
)
*
frame_parms
->
ofdm_symbol_size
)
+
(
12
*
(
startingPRB
-
(
frame_parms
->
N_RB_DL
>>
1
)))
+
6
;
}
if
((
startingPRB
==
(
frame_parms
->
N_RB_DL
>>
1
))
&&
((
frame_parms
->
N_RB_DL
&
1
)
==
1
))
{
// if number RBs in bandwidth is odd and current PRB contains DC
re_offset
=
((
l
+
startingSymbolIndex
)
*
frame_parms
->
ofdm_symbol_size
)
+
(
12
*
startingPRB
)
+
frame_parms
->
first_carrier_offset
;
}
re_offset
=
((
l
+
startingSymbolIndex
)
*
frame_parms
->
ofdm_symbol_size
)
+
(
12
*
startingPRB
)
+
frame_parms
->
first_carrier_offset
;
if
(
re_offset
>=
frame_parms
->
ofdm_symbol_size
)
re_offset
-=
frame_parms
->
ofdm_symbol_size
;
for
(
n
=
0
;
n
<
12
;
n
++
){
if
((
n
==
6
)
&&
(
startingPRB
==
(
frame_parms
->
N_RB_DL
>>
1
))
&&
((
frame_parms
->
N_RB_DL
&
1
)
==
1
))
{
// if number RBs in bandwidth is odd and current PRB contains DC, we need to recalculate the offset when n=6 (for second half PRB)
re_offset
=
((
l
+
startingSymbolIndex
)
*
frame_parms
->
ofdm_symbol_size
);
}
r_re
[(
12
*
l
)
+
n
]
=
((
int16_t
*
)
&
rxdataF
[
0
][
re_offset
])[
0
];
r_im
[(
12
*
l
)
+
n
]
=
((
int16_t
*
)
&
rxdataF
[
0
][
re_offset
])[
1
];
#ifdef DEBUG_NR_PUCCH_RX
...
...
@@ -135,6 +122,8 @@ void nr_decode_pucch0( int32_t **rxdataF,
l
,
n
,((
int16_t
*
)
&
rxdataF
[
0
][
re_offset
])[
0
],((
int16_t
*
)
&
rxdataF
[
0
][
re_offset
])[
1
]);
#endif
re_offset
++
;
if
(
re_offset
>=
frame_parms
->
ofdm_symbol_size
)
re_offset
-=
frame_parms
->
ofdm_symbol_size
;
}
}
double
corr
[
nr_sequences
],
corr_re
[
nr_sequences
],
corr_im
[
nr_sequences
];
...
...
openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c
View file @
0e550ff2
...
...
@@ -268,32 +268,13 @@ void nr_generate_pucch0(PHY_VARS_NR_UE *ue,
uint32_t
re_offset
=
0
;
for
(
int
l
=
0
;
l
<
nrofSymbols
;
l
++
)
{
if
((
startingPRB
<
(
frame_parms
->
N_RB_DL
>>
1
))
&&
((
frame_parms
->
N_RB_DL
&
1
)
==
0
))
{
// if number RBs in bandwidth is even and current PRB is lower band
re_offset
=
((
l
+
startingSymbolIndex
)
*
frame_parms
->
ofdm_symbol_size
)
+
(
12
*
startingPRB
)
+
frame_parms
->
first_carrier_offset
;
}
if
((
startingPRB
>=
(
frame_parms
->
N_RB_DL
>>
1
))
&&
((
frame_parms
->
N_RB_DL
&
1
)
==
0
))
{
// if number RBs in bandwidth is even and current PRB is upper band
re_offset
=
((
l
+
startingSymbolIndex
)
*
frame_parms
->
ofdm_symbol_size
)
+
(
12
*
(
startingPRB
-
(
frame_parms
->
N_RB_DL
>>
1
)));
}
if
((
startingPRB
<
(
frame_parms
->
N_RB_DL
>>
1
))
&&
((
frame_parms
->
N_RB_DL
&
1
)
==
1
))
{
// if number RBs in bandwidth is odd and current PRB is lower band
re_offset
=
((
l
+
startingSymbolIndex
)
*
frame_parms
->
ofdm_symbol_size
)
+
(
12
*
startingPRB
)
+
frame_parms
->
first_carrier_offset
;
}
if
((
startingPRB
>
(
frame_parms
->
N_RB_DL
>>
1
))
&&
((
frame_parms
->
N_RB_DL
&
1
)
==
1
))
{
// if number RBs in bandwidth is odd and current PRB is upper band
re_offset
=
((
l
+
startingSymbolIndex
)
*
frame_parms
->
ofdm_symbol_size
)
+
(
12
*
(
startingPRB
-
(
frame_parms
->
N_RB_DL
>>
1
)))
+
6
;
}
if
((
startingPRB
==
(
frame_parms
->
N_RB_DL
>>
1
))
&&
((
frame_parms
->
N_RB_DL
&
1
)
==
1
))
{
// if number RBs in bandwidth is odd and current PRB contains DC
re_offset
=
((
l
+
startingSymbolIndex
)
*
frame_parms
->
ofdm_symbol_size
)
+
(
12
*
startingPRB
)
+
frame_parms
->
first_carrier_offset
;
}
re_offset
=
((
l
+
startingSymbolIndex
)
*
frame_parms
->
ofdm_symbol_size
)
+
(
12
*
startingPRB
)
+
frame_parms
->
first_carrier_offset
;
if
(
re_offset
>=
frame_parms
->
ofdm_symbol_size
)
re_offset
-=
frame_parms
->
ofdm_symbol_size
;
//txptr = &txdataF[0][re_offset];
for
(
int
n
=
0
;
n
<
12
;
n
++
)
{
if
((
n
==
6
)
&&
(
startingPRB
==
(
frame_parms
->
N_RB_DL
>>
1
))
&&
((
frame_parms
->
N_RB_DL
&
1
)
==
1
))
{
// if number RBs in bandwidth is odd and current PRB contains DC, we need to recalculate the offset when n=6 (for second half PRB)
re_offset
=
((
l
+
startingSymbolIndex
)
*
frame_parms
->
ofdm_symbol_size
);
}
((
int16_t
*
)
&
txdataF
[
0
][
re_offset
])[
0
]
=
(
int16_t
)(((
int32_t
)(
amp
)
*
x_n_re
[(
12
*
l
)
+
n
])
>>
15
);
((
int16_t
*
)
&
txdataF
[
0
][
re_offset
])[
1
]
=
(
int16_t
)(((
int32_t
)(
amp
)
*
x_n_im
[(
12
*
l
)
+
n
])
>>
15
);
...
...
@@ -306,6 +287,8 @@ void nr_generate_pucch0(PHY_VARS_NR_UE *ue,
l
,
n
,((
int16_t
*
)
&
txdataF
[
0
][
re_offset
])[
0
],((
int16_t
*
)
&
txdataF
[
0
][
re_offset
])[
1
]);
#endif
re_offset
++
;
if
(
re_offset
>=
frame_parms
->
ofdm_symbol_size
)
re_offset
-=
frame_parms
->
ofdm_symbol_size
;
}
}
}
...
...
openair1/SIMULATION/NR_PHY/pucchsim.c
View file @
0e550ff2
...
...
@@ -495,6 +495,7 @@ int main(int argc, char **argv)
}
n_errors
=
((
actual_payload
^
payload_received
)
&
1
)
+
(((
actual_payload
^
payload_received
)
&
2
)
>>
1
)
+
(((
actual_payload
^
payload_received
)
&
4
)
>>
2
)
+
n_errors
;
}
printf
(
"Decoded payload is %ld
\n
"
,
payload_received
);
printf
(
"SNR=%f, n_trials=%d, n_bit_errors=%d
\n
"
,
SNR
,
n_trials
,
n_errors
);
if
((
float
)
ack_nack_errors
/
(
float
)(
nr_bit
*
n_trials
)
<=
target_error_rate
){
printf
(
"PUCCH test OK
\n
"
);
...
...
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