Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openairinterface5G
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bin He
openairinterface5G
Commits
6d8aa8d6
Commit
6d8aa8d6
authored
4 years ago
by
knopp
Browse files
Options
Downloads
Patches
Plain Diff
added 3-bit payload for pucch0 to nr_pucchsim, fixed SNR scaling for pucch2
parent
35b04083
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openair1/SIMULATION/NR_PHY/pucchsim.c
+13
-5
13 additions, 5 deletions
openair1/SIMULATION/NR_PHY/pucchsim.c
with
13 additions
and
5 deletions
openair1/SIMULATION/NR_PHY/pucchsim.c
+
13
−
5
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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment