39 DCfilter(
float pole):acc(0),prev_x(0),prev_y(0)
41 A = (int)(32768.0*(1.0 - pole));
70 acc += ((long)(x-prev_x)<<16)>>1;
72 acc -= (long)A*prev_y;
73 prev_y = (acc>>16)<<1;
74 if (acc & 32784) prev_y += 1;
88 #endif // #ifndef DCFILTER_H
DCfilter(float pole)
Instantiate a DC-blocking filter.
int next(int x)
Filter the incoming value and return the result.
A DC-blocking filter useful for highlighting changes in control signals.