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
wangwenhui
OpenXG-RAN
Commits
6d8aa8d6
Commit
6d8aa8d6
authored
Apr 23, 2020
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added 3-bit payload for pucch0 to nr_pucchsim, fixed SNR scaling for pucch2
parent
35b04083
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
openair1/SIMULATION/NR_PHY/pucchsim.c
openair1/SIMULATION/NR_PHY/pucchsim.c
+13
-5
No files found.
openair1/SIMULATION/NR_PHY/pucchsim.c
View file @
6d8aa8d6
...
@@ -104,6 +104,7 @@ int main(int argc, char **argv)
...
@@ -104,6 +104,7 @@ int main(int argc, char **argv)
NR_DL_FRAME_PARMS
*
frame_parms
;
NR_DL_FRAME_PARMS
*
frame_parms
;
//unsigned char frame_type = 0;
//unsigned char frame_type = 0;
int
loglvl
=
OAILOG_WARNING
;
int
loglvl
=
OAILOG_WARNING
;
int
sr_flag
=
0
;
cpuf
=
get_cpu_freq_GHz
();
cpuf
=
get_cpu_freq_GHz
();
...
@@ -114,7 +115,7 @@ int main(int argc, char **argv)
...
@@ -114,7 +115,7 @@ int main(int argc, char **argv)
randominit
(
0
);
randominit
(
0
);
logInit
();
logInit
();
while
((
c
=
getopt
(
argc
,
argv
,
"f:hA:f:g:i:I:P:B:b:T:m:n:r:o:s:S:x:y:z:N:F:GR:IL:q:"
))
!=
-
1
)
{
while
((
c
=
getopt
(
argc
,
argv
,
"f:hA:f:g:i:I:P:B:b:T:m:n:r:o:s:S:x:y:z:N:F:GR:IL:q:
c
"
))
!=
-
1
)
{
switch
(
c
)
{
switch
(
c
)
{
case
'f'
:
case
'f'
:
//write_output_file=1;
//write_output_file=1;
...
@@ -275,6 +276,9 @@ int main(int argc, char **argv)
...
@@ -275,6 +276,9 @@ int main(int argc, char **argv)
case
'b'
:
case
'b'
:
nr_bit
=
atoi
(
optarg
);
nr_bit
=
atoi
(
optarg
);
break
;
break
;
case
'c'
:
sr_flag
=
1
;
break
;
case
'B'
:
case
'B'
:
actual_payload
=
atoi
(
optarg
);
actual_payload
=
atoi
(
optarg
);
break
;
break
;
...
@@ -455,10 +459,13 @@ int main(int argc, char **argv)
...
@@ -455,10 +459,13 @@ int main(int argc, char **argv)
uint32_t
dmrs_scrambling_id
=
0
,
data_scrambling_id
=
0
;
uint32_t
dmrs_scrambling_id
=
0
,
data_scrambling_id
=
0
;
if
(
format
==
0
){
if
(
format
==
0
){
// for now we are not considering SR just HARQ-ACK
// for now we are not considering SR just HARQ-ACK
if
(
nr_bit
==
1
)
if
(
nr_bit
==
0
)
mcs
=
table1_mcs
[
0
];
else
if
(
nr_bit
==
1
)
mcs
=
table1_mcs
[
actual_payload
];
mcs
=
table1_mcs
[
actual_payload
];
else
if
(
nr_bit
==
2
)
else
if
(
nr_bit
==
2
)
mcs
=
table2_mcs
[
actual_payload
];
mcs
=
table2_mcs
[
actual_payload
];
else
AssertFatal
(
1
==
0
,
"Either nr_bit %d or sr_flag %d must be non-zero
\n
"
);
}
}
for
(
SNR
=
snr0
;
SNR
<=
snr1
;
SNR
=
SNR
+
1
){
for
(
SNR
=
snr0
;
SNR
<=
snr1
;
SNR
=
SNR
+
1
){
...
@@ -480,8 +487,9 @@ int main(int argc, char **argv)
...
@@ -480,8 +487,9 @@ int main(int argc, char **argv)
frame_parms
->
ofdm_symbol_size
);
frame_parms
->
ofdm_symbol_size
);
// printf("txlev %d (%d dB), offset %d\n",txlev,dB_fixed(txlev),startingSymbolIndex*frame_parms->ofdm_symbol_size);
// printf("txlev %d (%d dB), offset %d\n",txlev,dB_fixed(txlev),startingSymbolIndex*frame_parms->ofdm_symbol_size);
// note : this scaling is for 1 PRB, to be updated for PUCCH 2
// note : this scaling
sigma2_dB
=
10
*
log10
((
double
)
txlev
*
UE
->
frame_parms
.
ofdm_symbol_size
/
12
)
-
SNR
;
int
nb_re
=
(
format
==
0
||
format
==
1
)
?
12
:
12
*
nrofPRB
;
sigma2_dB
=
10
*
log10
((
double
)
txlev
*
UE
->
frame_parms
.
ofdm_symbol_size
/
nb_re
)
-
SNR
;
sigma2
=
pow
(
10
,
sigma2_dB
/
10
);
sigma2
=
pow
(
10
,
sigma2_dB
/
10
);
for
(
i
=
startingSymbolIndex
*
frame_parms
->
ofdm_symbol_size
;
i
<
(
startingSymbolIndex
+
1
)
*
frame_parms
->
ofdm_symbol_size
;
i
++
)
{
for
(
i
=
startingSymbolIndex
*
frame_parms
->
ofdm_symbol_size
;
i
<
(
startingSymbolIndex
+
1
)
*
frame_parms
->
ofdm_symbol_size
;
i
++
)
{
...
@@ -498,7 +506,7 @@ int main(int argc, char **argv)
...
@@ -498,7 +506,7 @@ int main(int argc, char **argv)
pucch_pdu
.
group_hop_flag
=
PUCCH_GroupHopping
&
1
;
pucch_pdu
.
group_hop_flag
=
PUCCH_GroupHopping
&
1
;
pucch_pdu
.
sequence_hop_flag
=
(
PUCCH_GroupHopping
>>
1
)
&
1
;
pucch_pdu
.
sequence_hop_flag
=
(
PUCCH_GroupHopping
>>
1
)
&
1
;
pucch_pdu
.
bit_len_harq
=
nr_bit
;
pucch_pdu
.
bit_len_harq
=
nr_bit
;
pucch_pdu
.
sr_flag
=
0
;
pucch_pdu
.
sr_flag
=
sr_flag
;
pucch_pdu
.
nr_of_symbols
=
nrofSymbols
;
pucch_pdu
.
nr_of_symbols
=
nrofSymbols
;
pucch_pdu
.
hopping_id
=
hopping_id
;
pucch_pdu
.
hopping_id
=
hopping_id
;
pucch_pdu
.
initial_cyclic_shift
=
0
;
pucch_pdu
.
initial_cyclic_shift
=
0
;
...
...
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