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
alex037yang
OpenXG-RAN
Commits
49e26c7c
Commit
49e26c7c
authored
Aug 24, 2018
by
Florian Kaltenberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding llr clipping + other bugfixes
parent
c2450fad
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
+18
-7
openair1/PHY/CODING/TESTBENCH/ldpctest.c
openair1/PHY/CODING/TESTBENCH/ldpctest.c
+15
-4
openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder.c
openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder.c
+3
-3
No files found.
openair1/PHY/CODING/TESTBENCH/ldpctest.c
View file @
49e26c7c
...
...
@@ -91,6 +91,7 @@ int test_ldpc(short No_iteration,
//Table of possible lifting sizes
short
lift_size
[
51
]
=
{
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
18
,
20
,
22
,
24
,
26
,
28
,
30
,
32
,
36
,
40
,
44
,
48
,
52
,
56
,
60
,
64
,
72
,
80
,
88
,
96
,
104
,
112
,
120
,
128
,
144
,
160
,
176
,
192
,
208
,
224
,
240
,
256
,
288
,
320
,
352
,
384
};
int
n_segments
=
8
;
int
N
;
//length encoded block
t_nrLDPC_dec_params
decParams
;
int
n_iter
;
...
...
@@ -165,7 +166,12 @@ int test_ldpc(short No_iteration,
}
}
printf
(
"ldpc_test: block_length %d, BG %d, Zc %d, Kb %d
\n
"
,
block_length
,
BG
,
Zc
,
Kb
);
if
(
BG
==
1
)
N
=
66
*
Zc
;
else
if
(
BG
==
2
)
N
=
50
*
Zc
;
printf
(
"ldpc_test: block_length %d, BG %d, Zc %d, Kb %d, N %d
\n
"
,
block_length
,
BG
,
Zc
,
Kb
,
N
);
no_punctured_columns
=
(
int
)((
nrows
-
2
)
*
Zc
+
block_length
-
block_length
*
(
1
/
((
float
)
nom_rate
/
(
float
)
denom_rate
)))
/
Zc
;
// printf("puncture:%d\n",no_punctured_columns);
removed_bit
=
(
nrows
-
no_punctured_columns
-
2
)
*
Zc
+
block_length
-
(
int
)(
block_length
/
((
float
)
nom_rate
/
(
float
)
denom_rate
));
...
...
@@ -219,8 +225,13 @@ int test_ldpc(short No_iteration,
modulated_input
[
i
]
=-
1
/
sqrt
(
2
);
channel_output
[
i
]
=
modulated_input
[
i
]
+
gaussdouble
(
0
.
0
,
1
.
0
)
*
1
/
sqrt
(
2
*
SNR
);
channel_output_fixed
[
i
]
=
(
char
)
((
channel_output
[
i
]
*
128
)
<
0
?
(
channel_output
[
i
]
*
128
-
0
.
5
)
:
(
channel_output
[
i
]
*
128
+
0
.
5
));
//fixed point 9-7
//printf("llr[%d]=%d\n",i,channel_output_fixed[i]);
if
(
channel_output
[
i
]
>
1
.
0
)
channel_output_fixed
[
i
]
=
127
;
else
if
(
channel_output
[
i
]
<-
1
.
0
)
channel_output_fixed
[
i
]
=-
128
;
else
channel_output_fixed
[
i
]
=
(
char
)
((
channel_output
[
i
]
*
128
)
<
0
?
(
channel_output
[
i
]
*
128
-
0
.
5
)
:
(
channel_output
[
i
]
*
128
+
0
.
5
));
//fixed point 9-7
//printf("llr[%d]=%d (%f)\n",i,channel_output_fixed[i],channel_output[i]);
}
/*
...
...
@@ -239,7 +250,7 @@ int test_ldpc(short No_iteration,
// decoder supports BG2, Z=128 & 256
//estimated_output=ldpc_decoder(channel_output_fixed, block_length, No_iteration, (double)((float)nom_rate/(float)denom_rate));
nrLDPC_decoder
(
&
decParams
,
channel_output_fixed
,
estimated_output
,
NULL
);
n
_iter
=
n
rLDPC_decoder
(
&
decParams
,
channel_output_fixed
,
estimated_output
,
NULL
);
//for (i=(Kb+nrows) * Zc-5;i<(Kb+nrows) * Zc;i++)
// printf("esimated_output[%d]=%d\n",i,esimated_output[i]);
...
...
openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder.c
View file @
49e26c7c
...
...
@@ -50,14 +50,14 @@ int encode_parity_check_part_orig(unsigned char *c,unsigned char *d, short BG,sh
int
i1
,
i2
,
i3
,
i4
,
i5
,
temp_prime
;
unsigned
char
channel_temp
,
temp
;
//
if (BG==1)
if
(
BG
==
1
)
{
no_shift_values
=
(
short
*
)
no_shift_values_BG1
;
pointer_shift_values
=
(
short
*
)
pointer_shift_values_BG1
;
nrows
=
46
;
//parity check bits
ncols
=
22
;
//info bits
}
/*
else if (BG==2)
else
if
(
BG
==
2
)
{
no_shift_values
=
(
short
*
)
no_shift_values_BG2
;
pointer_shift_values
=
(
short
*
)
pointer_shift_values_BG2
;
...
...
@@ -68,7 +68,7 @@ int encode_parity_check_part_orig(unsigned char *c,unsigned char *d, short BG,sh
printf
(
"problem with BG
\n
"
);
return
(
-
1
);
}
*/
no_punctured_columns
=
(
int
)((
nrows
-
2
)
*
Zc
+
block_length
-
block_length
*
3
)
/
Zc
;
...
...
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