12#include "Utility/dsp.h"
47 mode_ = FILTER_MODE_LOW_PASS;
51 inline void Reset() { state_ = 0.0f; }
59 freq = freq < 0.497f ? freq : 0.497f;
61 g_ = tanf(PI_F * freq);
62 gi_ = 1.f / (1.f + g_);
76 lp = (g_ * in + state_) * gi_;
77 state_ = g_ * (in - lp) + lp;
81 case FILTER_MODE_LOW_PASS:
return lp;
82 case FILTER_MODE_HIGH_PASS:
return in - lp;
One Pole Lowpass / Highpass Filter.
Definition onepole.h:27
FilterMode
Operational modes of the filter.
Definition onepole.h:38
float Process(float in)
Definition onepole.h:73
void Init()
Definition onepole.h:44
void ProcessBlock(float *in_out, size_t size)
Definition onepole.h:92
void Reset()
Definition onepole.h:51
void SetFilterMode(FilterMode mode)
Definition onepole.h:68
void SetFrequency(float freq)
Definition onepole.h:56
FIR Filter implementation, generic and ARM CMSIS DSP based.
Definition adenv.h:16