-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
Hi, Thank for the really nice filter implementation.
But I see two issues on the convolution in firFilter.js:
- the buffer is initialized in line 36. The length is one too short.
For this reason the convolution in line 41-43 doesn't loop over the entire filter length, but one element less
This creates for filters with low order a gain which is significant smaller than 1.
SUGGEST: z = initZero(f.length) - Compliment for the logic how the index in line 42 is calculated. Very nice piece of code.
But instead of "+ cnt" the calculation should call the previous index, so "- cnt"
•this makes a different at the beginning, when the buffer is not completely filled yet.
•to avoid negative index at the beginning there is the need to add d.buf.length in the calculation.
SUGGEST: out += (f[cnt] * d.buf[(d.buf.length + d.pointer - cnt) % d.buf.length])
Can you please double-check?
Thanks
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels