FIR-filter-Arduino-Library
FIR-filter-Arduino-Library copied to clipboard
Hi, i found a bug in your code
please change the lines from FIR-filter-Arduino-Library/src/FIR.cpp lines 40 and 41 from
for (int i=0; i<FILTERTAPS; i++) { // we step through the array
out += coef[i] * values[(i + k) % FILTERTAPS]; // ... and add and multiply each value to accumulate the output
to
for (int i=1; i<=FILTERTAPS; i++) { // we step through the array
out += coef[i-1] * values[(i + k) % FILTERTAPS]; // ... and add and multiply each value to accumulate the output
you can easily check that your code doesn't work by checking an impulse response.
Oh cool, would you mind creating a pull request with this change? Then you get the credit for it as well.