Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix bug in tail bit puncturing
The index used to access the puncturing pattern for tail bits must start
at 0.
  • Loading branch information
rear1019 committed Jan 8, 2018
1 parent bf575c7 commit 0cdcc19
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/punct_bb_impl.cc
Expand Up @@ -75,6 +75,7 @@ namespace gr {

for( int i = 0; i < n_vectors; i++)
{
int tail_index = 0;
for( int j = 0; j < d_vlen_in; j++)
{
//std::cout << "index j: " << j;
Expand All @@ -94,7 +95,7 @@ namespace gr {
else // tail bit puncturing
{
//std::cout << " tail biting. pp2[" << j % len_pp2 << "]=" << (int) d_pp2[(j + i*d_vlen_in) % len_pp2];
if(d_pp2[j % len_pp2]) // keep bit if the corresponding puncturing pattern entry is '1'
if(d_pp2[tail_index % len_pp2]) // keep bit if the corresponding puncturing pattern entry is '1'
{
//std::cout << "-> KEPT " << (int) in[j + i*d_vlen_in] << ".\n";
*out++ = in[j + i*d_vlen_in];
Expand All @@ -103,6 +104,7 @@ namespace gr {
{
//std::cout << "-> DROPPED " << (int) in[j + i*d_vlen_in] << ".\n";
}
++tail_index;
}
}
}
Expand Down

0 comments on commit 0cdcc19

Please sign in to comment.