Browse Source

Filter: added reset method on vector filters

mission-4.1.18
Andrew Tridgell 9 years ago
parent
commit
5b7f2a3de3
  1. 5
      libraries/Filter/LowPassFilter2p.cpp
  2. 1
      libraries/Filter/LowPassFilter2p.h

5
libraries/Filter/LowPassFilter2p.cpp

@ -86,6 +86,11 @@ T LowPassFilter2p<T>::apply(const T &sample) {
return _filter.apply(sample, _params); return _filter.apply(sample, _params);
} }
template <class T>
void LowPassFilter2p<T>::reset(void) {
return _filter.reset();
}
/* /*
* Make an instances * Make an instances
* Otherwise we have to move the constructor implementations to the header file :P * Otherwise we have to move the constructor implementations to the header file :P

1
libraries/Filter/LowPassFilter2p.h

@ -62,6 +62,7 @@ public:
float get_cutoff_freq(void) const; float get_cutoff_freq(void) const;
float get_sample_freq(void) const; float get_sample_freq(void) const;
T apply(const T &sample); T apply(const T &sample);
void reset(void);
protected: protected:
struct DigitalBiquadFilter<T>::biquad_params _params; struct DigitalBiquadFilter<T>::biquad_params _params;

Loading…
Cancel
Save