Bela
Real-time, ultra-low-latency audio and sensor processing system for BeagleBone Black
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
OnePole.h
1 /*
2  * Adapted from: http://www.earlevel.com/main/2012/12/15/a-one-pole-filter/
3  *
4  * by: Ad├ín L. Benito
5  * on: November 2018
6  * original code by Nigel Redmon
7  *
8  */
9 #pragma once
10 
11 class OnePole
12 {
13 public:
14  typedef enum {
15  LOWPASS,
16  HIGHPASS,
17  } Type;
18  OnePole();
19  OnePole(float cutoff, float samplingRate, Type type = LOWPASS);
20  int setup(float cutoff, float samplingRate, Type type = LOWPASS);
21  void setFilter(float cutoff, Type type = LOWPASS);
22  float process(float input);
23 private:
24  float _samplingRate;
25  int _type;
26  float a0, b1, ym1;
27  void setFc(float cutoff);
28 };
Definition: OnePole.h:11