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
zzha zzha
OpenXG-RAN
Commits
98ed514c
Commit
98ed514c
authored
May 09, 2023
by
Roberto Louro Magueta
Committed by
rmagueta
Jul 03, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implementation for de-interleaving of coded bits
parent
e5825139
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
18 deletions
+71
-18
openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c
openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c
+1
-1
openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
+5
-4
openair1/PHY/CODING/nrPolar_tools/nr_polar_procedures.c
openair1/PHY/CODING/nrPolar_tools/nr_polar_procedures.c
+65
-13
No files found.
openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c
View file @
98ed514c
...
...
@@ -612,7 +612,7 @@ uint32_t polar_decoder_int16(int16_t *input,
{
t_nrPolar_params
*
polarParams
=
nr_polar_params
(
messageType
,
messageLength
,
aggregation_level
,
true
);
int16_t
d_tilde
[
polarParams
->
N
];
// = malloc(sizeof(double) * polarParams->N);
nr_polar_rate_matching_int16
(
input
,
d_tilde
,
polarParams
->
rate_matching_pattern
,
polarParams
->
K
,
polarParams
->
N
,
polarParams
->
encoderLength
);
nr_polar_rate_matching_int16
(
input
,
d_tilde
,
polarParams
->
rate_matching_pattern
,
polarParams
->
K
,
polarParams
->
N
,
polarParams
->
encoderLength
,
polarParams
->
i_bil
);
for
(
int
i
=
0
;
i
<
polarParams
->
N
;
i
++
)
{
if
(
d_tilde
[
i
]
<-
128
)
d_tilde
[
i
]
=-
128
;
...
...
openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
View file @
98ed514c
...
...
@@ -238,10 +238,11 @@ void nr_polar_rate_matching(double *input,
void
nr_polar_rate_matching_int16
(
int16_t
*
input
,
int16_t
*
output
,
uint16_t
*
rmp
,
uint16_t
K
,
uint16_t
N
,
uint16_t
E
);
const
uint16_t
*
rmp
,
const
uint16_t
K
,
const
uint16_t
N
,
const
uint16_t
E
,
const
uint8_t
i_bil
);
void
nr_polar_interleaving_pattern
(
uint16_t
K
,
uint8_t
I_IL
,
...
...
openair1/PHY/CODING/nrPolar_tools/nr_polar_procedures.c
View file @
98ed514c
...
...
@@ -325,23 +325,75 @@ void nr_polar_rate_matching(double *input,
}
}
/*
* De-interleaving of coded bits implementation
* TS 138.212: Section 5.4.1.3 - Interleaving of coded bits
*/
void
nr_polar_rm_deinterleaving_cb
(
const
int16_t
*
in
,
int16_t
*
out
,
const
uint16_t
E
)
{
int
T
=
ceil
((
sqrt
(
8
*
E
+
1
)
-
1
)
/
2
);
int
v_tab
[
T
][
T
];
int
k
=
0
;
for
(
int
i
=
0
;
i
<
T
;
i
++
)
{
memset
(
v_tab
[
i
],
0
,
T
*
sizeof
(
int
));
for
(
int
j
=
0
;
j
<
T
-
i
;
j
++
)
{
if
(
k
<
E
)
{
v_tab
[
i
][
j
]
=
k
+
1
;
}
k
++
;
}
}
int
v
[
T
][
T
];
k
=
0
;
for
(
int
j
=
0
;
j
<
T
;
j
++
)
{
for
(
int
i
=
0
;
i
<
T
-
j
;
i
++
)
{
if
(
k
<
E
&&
v_tab
[
i
][
j
]
!=
0
)
{
v
[
i
][
j
]
=
in
[
E
-
1
-
k
];
k
++
;
}
else
{
v
[
i
][
j
]
=
INT_MAX
;
}
}
}
k
=
0
;
memset
(
out
,
0
,
E
*
sizeof
(
int16_t
));
for
(
int
i
=
0
;
i
<
T
;
i
++
)
{
for
(
int
j
=
0
;
j
<
T
-
i
;
j
++
)
{
if
(
v
[
i
][
j
]
!=
INT_MAX
)
{
out
[
E
-
1
-
k
]
=
v
[
i
][
j
];
k
++
;
}
}
}
}
void
nr_polar_rate_matching_int16
(
int16_t
*
input
,
int16_t
*
output
,
uint16_t
*
rmp
,
uint16_t
K
,
uint16_t
N
,
uint16_t
E
)
const
uint16_t
*
rmp
,
const
uint16_t
K
,
const
uint16_t
N
,
const
uint16_t
E
,
const
uint8_t
i_bil
)
{
if
(
E
>=
N
)
{
//repetition
memset
((
void
*
)
output
,
0
,
N
*
sizeof
(
int16_t
));
for
(
int
i
=
0
;
i
<=
E
-
1
;
i
++
)
output
[
rmp
[
i
]]
+=
input
[
i
];
}
else
{
if
(
(
K
/
(
double
)
E
)
<=
(
7
.
0
/
16
)
)
memset
((
void
*
)
output
,
0
,
N
*
sizeof
(
int16_t
));
//puncturing
else
{
//shortening
for
(
int
i
=
0
;
i
<=
N
-
1
;
i
++
)
output
[
i
]
=
32767
;
//instead of INFINITY, to prevent [-Woverflow]
if
(
i_bil
==
1
)
{
nr_polar_rm_deinterleaving_cb
(
input
,
input
,
E
);
}
for
(
int
i
=
0
;
i
<=
E
-
1
;
i
++
)
output
[
rmp
[
i
]]
=
input
[
i
];
if
(
E
>=
N
)
{
// repetition
memset
((
void
*
)
output
,
0
,
N
*
sizeof
(
int16_t
));
for
(
int
i
=
0
;
i
<=
E
-
1
;
i
++
)
output
[
rmp
[
i
]]
+=
input
[
i
];
}
else
{
if
((
K
/
(
double
)
E
)
<=
(
7
.
0
/
16
))
memset
((
void
*
)
output
,
0
,
N
*
sizeof
(
int16_t
));
// puncturing
else
{
// shortening
for
(
int
i
=
0
;
i
<=
N
-
1
;
i
++
)
output
[
i
]
=
32767
;
// instead of INFINITY, to prevent [-Woverflow]
}
for
(
int
i
=
0
;
i
<=
E
-
1
;
i
++
)
output
[
rmp
[
i
]]
=
input
[
i
];
}
}
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