Applying an IIR Filter (JS)
const values = [ /* ... */ ];
const results = [ values[0] * (feedforward[0] * feedback[0]) ];
for (let i = 1; i < values.length; i += 1) {
results[i] = (values[i] * feedforward[0] * feedback[0])
- values[i - 1]
+ (results[i - 1] * feedforward[1] * feedback[1]);
}