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
canghaiwuhen
OpenXG-RAN
Commits
586e279d
Commit
586e279d
authored
Feb 07, 2018
by
Florian Kaltenberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding ldpctest and ldpc_generate_coefficient from feature_ldpc_coding
parent
73c4672c
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
125 additions
and
96 deletions
+125
-96
openair1/PHY/CODING/TESTBENCH/ldpctest.c
openair1/PHY/CODING/TESTBENCH/ldpctest.c
+16
-17
openair1/PHY/CODING/ldpc_generate_coefficient.c
openair1/PHY/CODING/ldpc_generate_coefficient.c
+109
-79
No files found.
openair1/PHY/CODING/TESTBENCH/ldpctest.c
View file @
586e279d
...
@@ -142,12 +142,12 @@ int test_ldpc(short No_iteration,
...
@@ -142,12 +142,12 @@ int test_ldpc(short No_iteration,
if
(
lift_size
[
i1
]
>=
(
double
)
block_length
/
Kb
)
if
(
lift_size
[
i1
]
>=
(
double
)
block_length
/
Kb
)
{
{
Zc
=
lift_size
[
i1
];
Zc
=
lift_size
[
i1
];
//
printf("%d\n",Zc);
//printf("%d\n",Zc);
break
;
break
;
}
}
}
}
printf
(
"BG %d, Zc %d, Kb %d
\n
"
,
BG
,
Zc
,
Kb
);
printf
(
"
ldpc_test:
BG %d, Zc %d, Kb %d
\n
"
,
BG
,
Zc
,
Kb
);
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
));
...
@@ -160,28 +160,25 @@ int test_ldpc(short No_iteration,
...
@@ -160,28 +160,25 @@ int test_ldpc(short No_iteration,
//// encoder
//// encoder
start_meas
(
&
time
);
start_meas
(
&
time
);
if
(
BG
==
1
)
//if (BG==1)
ldpc_encoder
(
test_input
,
channel_input
,
block_length
,
nom_rate
,
denom_rate
);
//
ldpc_encoder(test_input, channel_input,block_length,nom_rate,denom_rate);
else
//
else
ldpc_encoder_orig
(
test_input
,
channel_input
,
block_length
,
nom_rate
,
denom_rate
,
0
);
ldpc_encoder_orig
(
test_input
,
channel_input
,
block_length
,
nom_rate
,
denom_rate
,
0
);
stop_meas
(
&
time
);
stop_meas
(
&
time
);
start_meas
(
&
time_optim
);
start_meas
(
&
time_optim
);
if
(
BG
==
1
)
{
ldpc_encoder_optim
(
test_input
,
channel_input_optim
,
block_length
,
nom_rate
,
denom_rate
,
&
tinput
,
&
tprep
,
&
tparity
,
&
toutput
);
ldpc_encoder_optim
(
test_input
,
channel_input_optim
,
block_length
,
nom_rate
,
denom_rate
,
&
tinput
,
&
tprep
,
&
tparity
,
&
toutput
);
}
stop_meas
(
&
time_optim
);
stop_meas
(
&
time_optim
);
if
(
ntrials
==
1
)
for
(
i
=
0
;
i
<
block_length
+
(
nrows
-
no_punctured_columns
)
*
Zc
-
removed_bit
;
i
++
)
for
(
i
=
0
;
i
<
block_length
+
(
nrows
-
no_punctured_columns
)
*
Zc
-
removed_bit
;
i
++
)
if
(
channel_input
[
i
]
!=
channel_input_optim
[
i
])
printf
(
"differ in pos %d (%d,%d)
\n
"
,
i
,
if
(
channel_input
[
i
]
!=
channel_input_optim
[
i
])
printf
(
"differ in pos %d (%d,%d)
\n
"
,
i
,
channel_input
[
i
],
channel_input
[
i
],
channel_input_optim
[
i
]);
channel_input_optim
[
i
]);
//print_meas_now(&time, "", stdout);
//print_meas_now(&time, "", stdout);
//for (i=0;i<25344
;i++)
// for (i=0;i<6400
;i++)
//printf("channel_input[%d]=%d\n",i,channel_input[i]);
//printf("channel_input[%d]=%d\n",i,channel_input[i]);
//printf("%d ",channel_input[i]);
//printf("%d ",channel_input[i]);
if
((
BG
==
2
)
&&
(
Zc
==
128
||
Zc
==
256
))
if
((
BG
==
2
)
&&
(
Zc
==
128
||
Zc
==
256
))
...
@@ -253,7 +250,7 @@ int test_ldpc(short No_iteration,
...
@@ -253,7 +250,7 @@ int test_ldpc(short No_iteration,
int
main
(
int
argc
,
char
*
argv
[])
int
main
(
int
argc
,
char
*
argv
[])
{
{
unsigned
int
errors
,
crc_misses
;
unsigned
int
errors
,
crc_misses
;
short
block_length
=
22
*
384
;
// decoder supports length: 1201 -> 1280, 2401 -> 2560
short
block_length
=
576
;
// decoder supports length: 1201 -> 1280, 2401 -> 2560
short
No_iteration
=
25
;
short
No_iteration
=
25
;
//double rate=0.333;
//double rate=0.333;
int
nom_rate
=
1
;
int
nom_rate
=
1
;
...
@@ -262,7 +259,9 @@ int main(int argc, char *argv[])
...
@@ -262,7 +259,9 @@ int main(int argc, char *argv[])
unsigned
char
qbits
=
4
;
unsigned
char
qbits
=
4
;
unsigned
int
decoded_errors
[
100
];
// initiate the size of matrix equivalent to size of SNR
unsigned
int
decoded_errors
[
100
];
// initiate the size of matrix equivalent to size of SNR
int
c
,
i
=
0
;
int
c
,
i
=
0
;
int
n_trials
=
1
;
int
n_trials
=
1
;
randominit
(
0
);
randominit
(
0
);
while
((
c
=
getopt
(
argc
,
argv
,
"q:r:s:l:n:"
))
!=
-
1
)
while
((
c
=
getopt
(
argc
,
argv
,
"q:r:s:l:n:"
))
!=
-
1
)
...
...
openair1/PHY/CODING/ldpc_generate_coefficient.c
View file @
586e279d
This diff is collapsed.
Click to expand it.
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