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
714cdc09
Commit
714cdc09
authored
Aug 24, 2018
by
Florian Kaltenberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding llr clipping + other bugfixes
parent
90a468fa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
8 deletions
+19
-8
openair1/PHY/CODING/TESTBENCH/ldpctest.c
openair1/PHY/CODING/TESTBENCH/ldpctest.c
+16
-5
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 @
714cdc09
...
@@ -102,9 +102,10 @@ int test_ldpc(short No_iteration,
...
@@ -102,9 +102,10 @@ int test_ldpc(short No_iteration,
//Table of possible lifting sizes
//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
};
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_segments
=
8
;
int
N
;
//length encoded block
t_nrLDPC_dec_params
decParams
;
t_nrLDPC_dec_params
decParams
;
//
int n_iter;
int
n_iter
;
*
errors
=
0
;
*
errors
=
0
;
*
crc_misses
=
0
;
*
crc_misses
=
0
;
...
@@ -176,7 +177,12 @@ int test_ldpc(short No_iteration,
...
@@ -176,7 +177,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;
//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);
// 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));
//removed_bit=(nrows-no_punctured_columns-2) * Zc+block_length-(int)(block_length/((float)nom_rate/(float)denom_rate));
...
@@ -227,8 +233,13 @@ int test_ldpc(short No_iteration,
...
@@ -227,8 +233,13 @@ int test_ldpc(short No_iteration,
modulated_input
[
i
]
=-
1
/
sqrt
(
2
);
modulated_input
[
i
]
=-
1
/
sqrt
(
2
);
channel_output
[
i
]
=
modulated_input
[
i
]
+
gaussdouble
(
0
.
0
,
1
.
0
)
*
1
/
sqrt
(
2
*
SNR
);
channel_output
[
i
]
=
modulated_input
[
i
]
+
gaussdouble
(
0
.
0
,
1
.
0
)
*
1
/
sqrt
(
2
*
SNR
);
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
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]);
//printf("llr[%d]=%d
(%f)\n",i,channel_output_fixed[i],channel_output
[i]);
}
}
/*
/*
...
@@ -247,7 +258,7 @@ int test_ldpc(short No_iteration,
...
@@ -247,7 +258,7 @@ int test_ldpc(short No_iteration,
// decoder supports BG2, Z=128 & 256
// decoder supports BG2, Z=128 & 256
//estimated_output=ldpc_decoder(channel_output_fixed, block_length, No_iteration, (double)((float)nom_rate/(float)denom_rate));
//estimated_output=ldpc_decoder(channel_output_fixed, block_length, No_iteration, (double)((float)nom_rate/(float)denom_rate));
nrLDPC_decoder
(
&
decParams
,
(
int8_t
*
)
channel_output_fixed
,
(
int8_t
*
)
estimated_output
,
NULL
);
n
_iter
=
n
rLDPC_decoder
(
&
decParams
,
(
int8_t
*
)
channel_output_fixed
,
(
int8_t
*
)
estimated_output
,
NULL
);
//for (i=(Kb+nrows) * Zc-5;i<(Kb+nrows) * Zc;i++)
//for (i=(Kb+nrows) * Zc-5;i<(Kb+nrows) * Zc;i++)
// printf("esimated_output[%d]=%d\n",i,esimated_output[i]);
// printf("esimated_output[%d]=%d\n",i,esimated_output[i]);
...
...
openair1/PHY/CODING/nrLDPC_encoder/ldpc_encoder.c
View file @
714cdc09
...
@@ -50,14 +50,14 @@ int encode_parity_check_part_orig(unsigned char *c,unsigned char *d, short BG,sh
...
@@ -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
;
int
i1
,
i2
,
i3
,
i4
,
i5
,
temp_prime
;
unsigned
char
channel_temp
,
temp
;
unsigned
char
channel_temp
,
temp
;
//
if (BG==1)
if
(
BG
==
1
)
{
{
no_shift_values
=
(
short
*
)
no_shift_values_BG1
;
no_shift_values
=
(
short
*
)
no_shift_values_BG1
;
pointer_shift_values
=
(
short
*
)
pointer_shift_values_BG1
;
pointer_shift_values
=
(
short
*
)
pointer_shift_values_BG1
;
nrows
=
46
;
//parity check bits
nrows
=
46
;
//parity check bits
ncols
=
22
;
//info bits
ncols
=
22
;
//info bits
}
}
/*
else if (BG==2)
else
if
(
BG
==
2
)
{
{
no_shift_values
=
(
short
*
)
no_shift_values_BG2
;
no_shift_values
=
(
short
*
)
no_shift_values_BG2
;
pointer_shift_values
=
(
short
*
)
pointer_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
...
@@ -68,7 +68,7 @@ int encode_parity_check_part_orig(unsigned char *c,unsigned char *d, short BG,sh
printf
(
"problem with BG
\n
"
);
printf
(
"problem with BG
\n
"
);
return
(
-
1
);
return
(
-
1
);
}
}
*/
no_punctured_columns
=
(
int
)((
nrows
-
2
)
*
Zc
+
block_length
-
block_length
*
3
)
/
Zc
;
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