16 #include "mozzi_fixmath.h"
59 long out = ((((((long)in - (last_out>>8)) * a))>>8) + last_out);
96 unsigned int last_out;
115 uint8_t
next(uint8_t in)
117 unsigned int out = (((((int)in - (last_out>>8)) * a)) + last_out);
119 return (uint8_t)(out>>8);
172 int8_t
next(int8_t in)
174 int out = (((((int)in - (last_out>>8)) * a)) + last_out);
176 return (int8_t)(out>>8);
229 float out = last_out + a * (in - last_out);
void setSmoothness(float smoothness)
Sets how much smoothing the filter will apply to its input.
Smooth(float smoothness)
Constructor.
Q0n8 float_to_Q0n8(float a)
Convert float to Q0n8 fix.
uint16_t Q0n16
unsigned fractional number using 16 fractional bits, represents 0.0 to 0.999
A simple infinite impulse response low pass filter for smoothing control or audio signals...
T operator()(T n)
Filters the input and returns the filtered value.
Q0n16 float_to_Q0n16(float a)
Convert float to Q0n16 fix.
T next(T in)
Filters the input and returns the filtered value.
uint8_t Q0n8
unsigned fractional number using 8 fractional bits, represents 0.0 to 0.996