Filtre passe bas simple
Revision 3:79a6e3d33887, committed 2016-02-17
- Comitter:
- garivetm
- Date:
- Wed Feb 17 10:13:07 2016 +0000
- Parent:
- 2:46a658fe2f70
- Commit message:
- Bug correction in filtre formula
Changed in this revision
FiltrePB.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/FiltrePB.cpp Mon Feb 15 17:19:56 2016 +0000 +++ b/FiltrePB.cpp Wed Feb 17 10:13:07 2016 +0000 @@ -7,11 +7,11 @@ vep_m=vsp_m=vs_m=0.0; tau_m=1.0/(fc_m*2*3.1415); //calcul de la constante de temps a_m=1.0/(1+(2*tau_m/Ts_m)); //calcul du coefficient a du filtre - b_m=(1-(2*tau_m/Ts_m))*a_m; //calcul du coefficient b du filtre + b_m=(1.0-(2*tau_m/Ts_m))*a_m; //calcul du coefficient b du filtre } float FiltrePB::compute(float ve){ - vs_m=a_m*ve+a_m*vep_m+b_m*vsp_m; + vs_m=a_m*ve+a_m*vep_m-b_m*vsp_m; vep_m=ve; vsp_m=vs_m; return vs_m;