This code seems to be incorrect in more than one way.
A digital filter is usually represented by filter coefficients, which are a constant , a filter of the history of the internal state (since in most cases the output depends on the history) and the filter topology , which is the arithmetic used to calculate the output based on input and filter (coeffs + state history). In most cases, and, of course, when filtering audio data, you expect to get 0 on the output if you feed 0 to the input.
Problems in the code you are attached to:
In each processing method call, the filter coefficients are changed :
es-> f1p0 + = (es-> lf * (sample-es-> f1p0)) + vsa;
The input pattern is usually multiplied by the filter coefficients, and not added to them. This makes no physical sense - the pattern and filter coefficients do not even have the same physical units.
- If you feed 0, you will not get 0 in the output, just some values ββthat don't make any sense.
I suggest you look for another code - another option debugs it, and it will be harder.
In addition, it will be useful for you to read about digital filters:
http://en.wikipedia.org/wiki/Digital_filter
https://ccrma.stanford.edu/~jos/filters/
Itamar katz
source share