#ifndef SAMPLEFILTER_H_ #define SAMPLEFILTER_H_
/*
FIR filter designed with http://t-filter.appspot.com
sampling frequency: 100000000 Hz
-
0 Hz - 25000000 Hz gain = 1 desired ripple = 5 dB actual ripple = 4.05286559576885 dB
-
30000000 Hz - 50000000 Hz gain = 0 desired attenuation = -40 dB actual attenuation = -40.25040789635525 dB
*/
#define SAMPLEFILTER_TAP_NUM 21
typedef struct { double history[SAMPLEFILTER_TAP_NUM]; unsigned int last_index; } SampleFilter;
void SampleFilter_init(SampleFilter* f); void SampleFilter_put(SampleFilter* f, double input); double SampleFilter_get(SampleFilter* f);
#endif