Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
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 UE
Commits
e6f96046
Commit
e6f96046
authored
Nov 11, 2021
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dlschsim fixed
parent
ac584855
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
13 deletions
+14
-13
openair1/SIMULATION/NR_PHY/dlschsim.c
openair1/SIMULATION/NR_PHY/dlschsim.c
+14
-13
No files found.
openair1/SIMULATION/NR_PHY/dlschsim.c
View file @
e6f96046
...
...
@@ -117,7 +117,8 @@ int main(int argc, char **argv)
uint8_t
mcs_table
=
0
;
double
DS_TDL
=
.
03
;
cpuf
=
get_cpu_freq_GHz
();
char
gNBthreads
[
128
]
=
"n"
;
if
(
load_configmodule
(
argc
,
argv
,
CONFIG_ENABLECMDLINEONLY
)
==
0
)
{
exit_fun
(
"[NR_DLSCHSIM] Error, configuration module init failed
\n
"
);
}
...
...
@@ -125,7 +126,7 @@ int main(int argc, char **argv)
//logInit();
randominit
(
0
);
while
((
c
=
getopt
(
argc
,
argv
,
"df:hpVg:i:j:n:l:m:r:s:S:y:z:M:N:F:R:P:L:"
))
!=
-
1
)
{
while
((
c
=
getopt
(
argc
,
argv
,
"df:hpVg:i:j:n:l:m:r:s:S:y:z:M:N:F:R:P:L:
X:
"
))
!=
-
1
)
{
switch
(
c
)
{
/*case 'f':
write_output_file = 1;
...
...
@@ -291,6 +292,11 @@ int main(int argc, char **argv)
nb_rb
=
atoi
(
optarg
);
break
;
case
'X'
:
strncpy
(
gNBthreads
,
optarg
,
sizeof
(
gNBthreads
));
gNBthreads
[
sizeof
(
gNBthreads
)
-
1
]
=
0
;
break
;
/*case 'x':
transmission_mode = atoi(optarg);
break;*/
...
...
@@ -349,6 +355,8 @@ int main(int argc, char **argv)
RC
.
gNB
=
(
PHY_VARS_gNB
**
)
malloc
(
sizeof
(
PHY_VARS_gNB
*
));
RC
.
gNB
[
0
]
=
malloc
(
sizeof
(
PHY_VARS_gNB
));
gNB
=
RC
.
gNB
[
0
];
gNB
->
threadPool
=
(
tpool_t
*
)
malloc
(
sizeof
(
tpool_t
));
initTpool
(
gNBthreads
,
gNB
->
threadPool
,
true
);
//gNB_config = &gNB->gNB_config;
frame_parms
=
&
gNB
->
frame_parms
;
//to be initialized I suppose (maybe not necessary for PBCH)
frame_parms
->
nb_antennas_tx
=
n_tx
;
...
...
@@ -465,7 +473,6 @@ int main(int argc, char **argv)
double
*
modulated_input
=
malloc16
(
sizeof
(
double
)
*
16
*
68
*
384
);
// [hna] 16 segments, 68*Zc
short
*
channel_output_fixed
=
malloc16
(
sizeof
(
short
)
*
16
*
68
*
384
);
short
*
channel_output_uncoded
=
malloc16
(
sizeof
(
unsigned
short
)
*
16
*
68
*
384
);
double
errors_bit_uncoded
=
0
;
//unsigned char *estimated_output;
unsigned
char
*
estimated_output_bit
;
unsigned
char
*
test_input_bit
;
...
...
@@ -514,7 +521,6 @@ int main(int argc, char **argv)
n_false_positive
=
0
;
for
(
trial
=
0
;
trial
<
n_trials
;
trial
++
)
{
errors_bit_uncoded
=
0
;
for
(
i
=
0
;
i
<
available_bits
;
i
++
)
{
#ifdef DEBUG_CODER
if
((
i
&
0xf
)
==
0
)
...
...
@@ -523,12 +529,12 @@ int main(int argc, char **argv)
//if (i<16)
// printf("encoder output f[%d] = %d\n",i,dlsch->harq_processes[0]->f[i]);
/*
if (
dlsch->harq_process.f
[i] == 0)
if
(
output
[
i
]
==
0
)
modulated_input
[
i
]
=
1
.
0
;
///sqrt(2); //QPSK
else
modulated_input
[
i
]
=
-
1
.
0
;
///sqrt(2);
*/
//if (i<16) printf("modulated_input[%d] = %d\n",i,modulated_input[i]);
//SNR =10;
SNR_lin
=
pow
(
10
,
SNR
/
10
.
0
);
...
...
@@ -546,19 +552,14 @@ int main(int argc, char **argv)
i,modulated_input[i],
i,channel_output_fixed[i]);
*/
//Uncoded BER
if
(
channel_output_fixed
[
i
]
<
0
)
channel_output_uncoded
[
i
]
=
1
;
//QPSK demod
else
channel_output_uncoded
[
i
]
=
0
;
/*
if (channel_output_uncoded[i] != dlsch->harq_process.f[i])
errors_bit_uncoded = errors_bit_uncoded + 1;
*/
}
//if (errors_bit_uncoded>10)
//printf("errors bits uncoded %f\n", errors_bit_uncoded);
#ifdef DEBUG_CODER
printf
(
"
\n
"
);
exit
(
-
1
);
...
...
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