FIR-filter-Arduino-Library icon indicating copy to clipboard operation
FIR-filter-Arduino-Library copied to clipboard

Hi, i found a bug in your code

Open calderonf opened this issue 6 years ago • 1 comments

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.

calderonf avatar Oct 29 '18 00:10 calderonf

Oh cool, would you mind creating a pull request with this change? Then you get the credit for it as well.

sebnil avatar Feb 04 '19 23:02 sebnil