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
wangjie
OpenXG-RAN
Commits
a611e0b9
Commit
a611e0b9
authored
Jun 14, 2018
by
martino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing of some errors
parent
92cdd224
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
9 deletions
+19
-9
openair1/PHY/CODING/TESTBENCH/polartest.c
openair1/PHY/CODING/TESTBENCH/polartest.c
+2
-1
openair1/PHY/CODING/crc_byte.c
openair1/PHY/CODING/crc_byte.c
+3
-4
openair1/PHY/CODING/nrPolar_init.c
openair1/PHY/CODING/nrPolar_init.c
+0
-1
openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
+10
-2
openair1/PHY/CODING/nrPolar_tools/nr_polar_kernal_operation.c
...air1/PHY/CODING/nrPolar_tools/nr_polar_kernal_operation.c
+4
-1
No files found.
openair1/PHY/CODING/TESTBENCH/polartest.c
View file @
a611e0b9
...
...
@@ -121,7 +121,8 @@ int main(int argc, char *argv[]) {
SNR_lin
=
pow
(
10
,
SNR
/
10
);
for
(
itr
=
1
;
itr
<=
iterations
;
itr
++
)
{
for
(
int
i
=
0
;
i
<
testLength
;
i
++
)
testInput
[
i
]
=
(
uint8_t
)
(
rand
()
%
2
);
for
(
int
i
=
0
;
i
<
testLength
;
i
++
)
testInput
[
i
]
=
(
uint8_t
)
(
rand
()
%
2
);
start_meas
(
&
timeEncoder
);
polar_encoder
(
testInput
,
encoderOutput
,
&
nrPolar_params
);
...
...
openair1/PHY/CODING/crc_byte.c
View file @
a611e0b9
...
...
@@ -255,7 +255,6 @@ void nr_crc_computation(uint8_t* input, uint8_t* output, uint16_t payloadBits, u
//create crc in byte
unsigned
int
mask2
=
0x80000000
;
//100...
output
=
(
uint8_t
*
)
malloc
(
sizeof
(
uint8_t
)
*
crcParityBits
);
for
(
uint8_t
ind
=
0
;
ind
<
crcParityBits
;
ind
++
)
{
...
...
openair1/PHY/CODING/nrPolar_init.c
View file @
a611e0b9
...
...
@@ -137,7 +137,6 @@ uint32_t poly24c = 0xB2B11700; //101100101011000100010111 -> D^24...
polarParams
->
crc256Table
=
malloc
(
sizeof
(
uint32_t
)
*
256
);
crcTable256Init
(
polarParams
->
crc_polynomial
,
polarParams
->
crc256Table
);
polarParams
->
Q_0_Nminus1
=
nr_polar_sequence_pattern
(
polarParams
->
n
);
polarParams
->
interleaving_pattern
=
malloc
(
sizeof
(
uint16_t
)
*
polarParams
->
K
);
...
...
openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
View file @
a611e0b9
...
...
@@ -37,9 +37,11 @@ void polar_encoder(
//nr_matrix_multiplication_uint8_t_1D_uint8_t_2D(input, polarParams->crc_generator_matrix,
// polarParams->nr_polar_crc, polarParams->payloadBits, polarParams->crcParityBits);
//for (uint8_t i = 0; i < polarParams->crcParityBits; i++) polarParams->nr_polar_crc[i] = (polarParams->nr_polar_crc[i] % 2);
// --- NEW ---
nr_crc_computation
(
input
,
polarParams
->
nr_polar_crc
,
polarParams
->
payloadBits
,
polarParams
->
crcParityBits
,
polarParams
->
crc256Table
);
//Attach CRC to the Transport Block. (a to b)
for
(
uint16_t
i
=
0
;
i
<
polarParams
->
payloadBits
;
i
++
)
polarParams
->
nr_polar_b
[
i
]
=
input
[
i
];
for
(
uint16_t
i
=
polarParams
->
payloadBits
;
i
<
polarParams
->
K
;
i
++
)
...
...
@@ -56,10 +58,16 @@ void polar_encoder(
// --- OLD ---
//nr_matrix_multiplication_uint8_t_1D_uint8_t_2D(polarParams->nr_polar_u, polarParams->G_N, polarParams->nr_polar_d, polarParams->N, polarParams->N);
//for (uint16_t i = 0; i < polarParams->N; i++) polarParams->nr_polar_d[i] = (polarParams->nr_polar_d[i] % 2);
//printf("\nd old: ");
//for (uint16_t i = 0; i < polarParams->N; i++)
//printf("%i ", polarParams->nr_polar_d[i]);
// --- NEW ---
nr_polar_kernal_operation
(
polarParams
->
nr_polar_u
,
polarParams
->
nr_polar_d
,
polarParams
->
N
);
for
(
uint16_t
i
=
0
;
i
<
polarParams
->
N
;
i
++
)
polarParams
->
nr_polar_d
[
i
]
=
(
polarParams
->
nr_polar_d
[
i
]
%
2
);
//printf("\nd new: ");
//for (uint16_t i = 0; i < polarParams->N; i++)
// printf("%i ", polarParams->nr_polar_d[i]);
//for (uint16_t i = 0; i < polarParams->N; i++) polarParams->nr_polar_d[i] = (polarParams->nr_polar_d[i] % 2);
//Rate matching
//Sub-block interleaving (d to y) and Bit selection (y to e)
...
...
openair1/PHY/CODING/nrPolar_tools/nr_polar_kernal_operation.c
View file @
a611e0b9
...
...
@@ -16,12 +16,15 @@ void nr_polar_kernal_operation(uint8_t *u, uint8_t *d, uint16_t N)
d
[
i
]
=
0
;
for
(
j
=
0
;
j
<
N
;
j
++
)
// ... looking at all the elements of u
{
d
[
i
]
=
d
[
i
]
||
(
(
!
(
j
-
i
))
|
(
!
i
)
)
*
u
[
j
];
//d[i]=d[i] || ( (!(j-i)) | (!i) )*u[j];
d
[
i
]
=
d
[
i
]
^
(
!
(
(
j
-
i
)
&
i
))
*
u
[
j
];
}
//d[i]=d[i]%2; // modulo 2
}
/*
__m256i maddReg, uReg, orReg;
__m512i maddRegConv;
...
...
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