|
|
|
@ -52,18 +52,30 @@ public:
@@ -52,18 +52,30 @@ public:
|
|
|
|
|
_delay_element_1 = _delay_element_2 = 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// change parameters
|
|
|
|
|
/**
|
|
|
|
|
* Change filter parameters |
|
|
|
|
*/ |
|
|
|
|
void set_cutoff_frequency(float sample_freq, float cutoff_freq); |
|
|
|
|
|
|
|
|
|
// apply - Add a new raw value to the filter
|
|
|
|
|
// and retrieve the filtered result
|
|
|
|
|
/**
|
|
|
|
|
* Add a new raw value to the filter |
|
|
|
|
* |
|
|
|
|
* @return retrieve the filtered result |
|
|
|
|
*/ |
|
|
|
|
float apply(float sample); |
|
|
|
|
|
|
|
|
|
// return the cutoff frequency
|
|
|
|
|
/**
|
|
|
|
|
* Return the cutoff frequency |
|
|
|
|
*/ |
|
|
|
|
float get_cutoff_freq(void) const { |
|
|
|
|
return _cutoff_freq; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Reset the filter state to this value |
|
|
|
|
*/ |
|
|
|
|
float reset(float sample); |
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
float _cutoff_freq;
|
|
|
|
|
float _a1; |
|
|
|
|