A simple biquad filter

Dependents:   emgfilter includeair includeair Encodertest ... more

Revision:
0:ba910c57d594
Child:
1:11e0eb82cb18
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Biquad.h	Fri Oct 09 12:37:38 2015 +0000
@@ -0,0 +1,26 @@
+#ifndef _BIQUAD_H_
+#define _BIQUAD_H_
+
+#include "mbed.h"
+
+class Biquad
+{
+public:
+    ///Instantiate the biquad filter
+    Biquad(void);
+
+    /**Filters the given signal with the filter values
+    * @param u : float signal to filter
+    * @param &v1 : float variable to store previous values
+    * @param &v2 : float variable to store previous values
+    * @param a1 : float filter coefficient a1
+    * @param a1 : float filter coefficient a2
+    * @param a1 : float filter coefficient b0
+    * @param a1 : float filter coefficient b1
+    * @param a1 : float filter coefficient b2
+    * @return v : float filtered signal
+    */
+    double filter( double u, double &v1, double &v2, const double a1, const double a2,
+                   const double b0, const double b1, const double b2 );
+};
+#endif
\ No newline at end of file