BiQuadfilter
Dependencies: HIDScope biquadFilter mbed
main.cpp
- Committer:
- 11i
- Date:
- 2016-10-10
- Revision:
- 0:e8a91f8d53ce
- Child:
- 1:fb8d21c27ce0
File content as of revision 0:e8a91f8d53ce:
#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){ } } }