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
d6b7b6b9
Commit
d6b7b6b9
authored
May 23, 2023
by
rmagueta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Q_PC_N computation for n_pc_wm = 0
parent
98ed514c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
42 deletions
+56
-42
openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
+4
-2
openair1/PHY/CODING/nrPolar_tools/nr_polar_procedures.c
openair1/PHY/CODING/nrPolar_tools/nr_polar_procedures.c
+48
-39
openair1/PHY/CODING/nr_polar_init.c
openair1/PHY/CODING/nr_polar_init.c
+4
-1
No files found.
openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
View file @
d6b7b6b9
...
...
@@ -251,12 +251,14 @@ void nr_polar_interleaving_pattern(uint16_t K,
void
nr_polar_info_bit_pattern
(
uint8_t
*
ibp
,
int16_t
*
Q_I_N
,
int16_t
*
Q_F_N
,
uint16_t
*
J
,
int16_t
*
Q_PC_N
,
const
uint16_t
*
J
,
const
uint16_t
*
Q_0_Nminus1
,
uint16_t
K
,
uint16_t
N
,
uint16_t
E
,
uint8_t
n_PC
);
uint8_t
n_PC
,
uint8_t
n_pc_wm
);
void
nr_polar_info_bit_extraction
(
uint8_t
*
input
,
uint8_t
*
output
,
...
...
openair1/PHY/CODING/nrPolar_tools/nr_polar_procedures.c
View file @
d6b7b6b9
...
...
@@ -138,14 +138,16 @@ void nr_polar_channel_interleaver_pattern(uint16_t *cip,
void
nr_polar_info_bit_pattern
(
uint8_t
*
ibp
,
int16_t
*
Q_I_N
,
int16_t
*
Q_F_N
,
uint16_t
*
J
,
const
uint16_t
*
Q_0_Nminus1
,
uint16_t
K
,
uint16_t
N
,
uint16_t
E
,
uint8_t
n_PC
)
int16_t
*
Q_I_N
,
int16_t
*
Q_F_N
,
int16_t
*
Q_PC_N
,
const
uint16_t
*
J
,
const
uint16_t
*
Q_0_Nminus1
,
uint16_t
K
,
uint16_t
N
,
uint16_t
E
,
uint8_t
n_PC
,
uint8_t
n_pc_wm
)
{
int16_t
*
Q_Ftmp_N
=
malloc
(
sizeof
(
int16_t
)
*
(
N
+
1
));
// Last element shows the final
int16_t
*
Q_Itmp_N
=
malloc
(
sizeof
(
int16_t
)
*
(
N
+
1
));
// array index assigned a value.
...
...
@@ -159,44 +161,44 @@ void nr_polar_info_bit_pattern(uint8_t *ibp,
uint16_t
limit
,
ind
;
if
(
E
<
N
)
{
if
((
K
/
(
double
)
E
)
<=
(
7
.
0
/
16
))
{
//
puncturing
if
((
K
/
(
double
)
E
)
<=
(
7
.
0
/
16
))
{
//
puncturing
for
(
int
n
=
0
;
n
<=
N
-
E
-
1
;
n
++
)
{
ind
=
Q_Ftmp_N
[
N
]
+
1
;
Q_Ftmp_N
[
ind
]
=
J
[
n
];
Q_Ftmp_N
[
N
]
=
Q_Ftmp_N
[
N
]
+
1
;
ind
=
Q_Ftmp_N
[
N
]
+
1
;
Q_Ftmp_N
[
ind
]
=
J
[
n
];
Q_Ftmp_N
[
N
]
=
Q_Ftmp_N
[
N
]
+
1
;
}
if
((
E
/
(
double
)
N
)
>=
(
3
.
0
/
4
))
{
limit
=
ceil
((
double
)
(
3
*
N
-
2
*
E
)
/
4
);
for
(
int
n
=
0
;
n
<=
lim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;
n
++
)
{
flag
=
1
;
for
(
int
m
=
0
;
m
<=
Q_Ftmp_N
[
N
];
m
++
)
{
if
(
Q_0_Nminus1
[
n
]
==
Q_Ftmp_N
[
m
])
{
flag
=
0
;
break
;
flag
=
0
;
break
;
}
}
if
(
flag
)
{
...
...
@@ -205,19 +207,26 @@ void nr_polar_info_bit_pattern(uint8_t *ibp,
}
}
//Q_I_N comprises (K+n_PC) most reliable bit indices in Q_I,tmp_N
//
Q_I_N comprises (K+n_PC) most reliable bit indices in Q_I,tmp_N
for
(
int
n
=
0
;
n
<=
(
K
+
n_PC
)
-
1
;
n
++
)
{
ind
=
Q_Itmp_N
[
N
]
+
n
-
((
K
+
n_PC
)
-
1
);
Q_I_N
[
n
]
=
Q_Itmp_N
[
ind
];
}
//Q_F_N = Q_0_N-1 \ Q_I_N
if
(
n_PC
>
0
)
{
AssertFatal
(
n_pc_wm
==
0
,
"Q_PC_N computation for n_pc_wm = %i is not implemented yet!
\n
"
,
n_pc_wm
);
for
(
int
n
=
0
;
n
<
n_PC
-
n_pc_wm
;
n
++
)
{
Q_PC_N
[
n
]
=
Q_I_N
[
n
];
}
}
// Q_F_N = Q_0_N-1 \ Q_I_N
for
(
int
n
=
0
;
n
<=
N
-
1
;
n
++
)
{
flag
=
1
;
for
(
int
m
=
0
;
m
<=
(
K
+
n_PC
)
-
1
;
m
++
)
{
if
(
Q_0_Nminus1
[
n
]
==
Q_I_N
[
m
])
{
flag
=
0
;
break
;
flag
=
0
;
break
;
}
}
if
(
flag
)
{
...
...
@@ -226,14 +235,14 @@ void nr_polar_info_bit_pattern(uint8_t *ibp,
}
}
//Information Bit Pattern
//
Information Bit Pattern
for
(
int
n
=
0
;
n
<=
N
-
1
;
n
++
)
{
ibp
[
n
]
=
0
;
for
(
int
m
=
0
;
m
<=
(
K
+
n_PC
)
-
1
;
m
++
)
{
if
(
n
==
Q_I_N
[
m
])
{
ibp
[
n
]
=
1
;
break
;
ibp
[
n
]
=
1
;
break
;
}
}
}
...
...
openair1/PHY/CODING/nr_polar_init.c
View file @
d6b7b6b9
...
...
@@ -244,12 +244,15 @@ t_nrPolar_params *nr_polar_params(int8_t messageType, uint16_t messageLength, ui
nr_polar_info_bit_pattern
(
newPolarInitNode
->
information_bit_pattern
,
newPolarInitNode
->
Q_I_N
,
newPolarInitNode
->
Q_F_N
,
newPolarInitNode
->
Q_PC_N
,
J
,
newPolarInitNode
->
Q_0_Nminus1
,
newPolarInitNode
->
K
,
newPolarInitNode
->
N
,
newPolarInitNode
->
encoderLength
,
newPolarInitNode
->
n_pc
);
newPolarInitNode
->
n_pc
,
newPolarInitNode
->
n_pc_wm
);
// sort the Q_I_N array in ascending order (first K positions)
qsort
((
void
*
)
newPolarInitNode
->
Q_I_N
,
newPolarInitNode
->
K
,
sizeof
(
int16_t
),
intcmp
);
newPolarInitNode
->
channel_interleaver_pattern
=
malloc
(
sizeof
(
uint16_t
)
*
newPolarInitNode
->
encoderLength
);
...
...
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