Skip to content

Commit

Permalink
Fixed FIR_filter.apply() indexing bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fadijerji committed Jul 14, 2023
1 parent e3929ca commit c7c4ac0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/fir_filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ void cl_FIR::apply(std::complex <double>* in, std::complex <double>* out, int nI
}
}

if(i>(int)(filter_nTaps-1)/2 && i<nItems)
if(i>=((int)(filter_nTaps-1)/2) && i<(nItems+(int)(filter_nTaps-1)/2))
{
out[i].real(acc_r);
out[i].imag(acc_im);
out[i-(int)(filter_nTaps-1)/2].real(acc_r);
out[i-(int)(filter_nTaps-1)/2].imag(acc_im);
}
}
}
Expand Down

0 comments on commit c7c4ac0

Please sign in to comment.