40 DCfilter(
float pole):acc(0),prev_x(0),prev_y(0)
42 A = (int)(32768.0*(1.0 - pole));
71 acc += ((long)(x-prev_x)<<16)>>1;
73 acc -= (long)A*prev_y;
74 prev_y = (acc>>16)<<1;
75 if (acc & 32784) prev_y += 1;
A DC-blocking filter useful for highlighting changes in control signals.
DCfilter(float pole)
Instantiate a DC-blocking filter.
int next(int x)
Filter the incoming value and return the result.