summaryrefslogtreecommitdiff
path: root/src/components/heartrate/Biquad.h
blob: dc9b97f6b037a5f8ab829c276fbad9569b93f43c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once

namespace Pinetime {
  namespace Controllers {
    /// Direct Form II Biquad Filter
    class Biquad {
    public:
      Biquad(float b0, float  b1, float b2, float a1, float a2);
      float Step(float x);

    private:
      float b0;
      float b1;
      float b2;
      float a1;
      float a2;

      float v1 = 0.0f;
      float v2 = 0.0f;
    };
  }
}