BiQuadfilter
Dependencies: HIDScope biquadFilter mbed
Diff: main.cpp
- Revision:
- 0:e8a91f8d53ce
- Child:
- 1:fb8d21c27ce0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Oct 10 14:06:18 2016 +0000 @@ -0,0 +1,23 @@ +#include "mbed.h" + +//Ticker definiëren, variabelen voor opslag, input en output +Ticker biquadTicker; +double v1=0,v2=0,u=0,y=0; +const double a1=1.2,a2=2.3,b0=1.2,b1=2.2,b2=0.3; + +//Implementeren van de functie +void computeBiquad(){ + double v=u-a1*v1-a2*v2; + y=b0*v+b1*v1+b2*v2; + v2=v1; + v1=v; + } + + +int main() +{ + biquadTicker.attach(&computeBiquad, 0.01f); //frequentie van 100 HZ + while(1){ + } + } +} \ No newline at end of file