Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Encoder HIDScope MODSERIAL mbed QEI biquadFilter
Revision 32:97cf6cb8d054, committed 2015-10-14
- Comitter:
- bscheltinga
- Date:
- Wed Oct 14 14:13:52 2015 +0000
- Parent:
- 27:85e5d36bb6c5
- Child:
- 36:f29a36683b1a
- Commit message:
- Zelfde script: biquads verandert, nieuwe van online biquad calculator
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Oct 13 12:31:55 2015 +0000 +++ b/main.cpp Wed Oct 14 14:13:52 2015 +0000 @@ -19,19 +19,20 @@ // [BIQUAD FILTERS] // int Fs = 512; // sampling frequency -const double low_b1 = 1.480219865318266e-04; //filter coefficients -const double low_b2 = 2.960439730636533e-04; -const double low_b3 = 1.480219865318266e-04; -const double low_a2 = -1.965293372622690e+00; // a1 is normalized to 1 -const double low_a3 = 9.658854605688177e-01; -const double high_b1 = 8.047897937631126e-01; -const double high_b2 = -1.609579587526225e+00; -const double high_b3 = 8.047897937631126e-01; -const double high_a2 = -1.571102440190402e+00; // a1 is normalized to 1 -const double high_a3 = 6.480567348620491e-01; +const double low_b0 = 0.05892937945281792 +const double low_b1 = 0.11785875890563584 +const double low_b2 = 0.05892937945281792 +const double low_a1 = -1.205716572226748 +const double low_a2 = 0.44143409003801976 // VIA online biquad calculator Lowpas 520-48-0.7071-6 -biquadFilter highpass1(high_a2, high_a3, high_b1, high_b2, high_b3); -biquadFilter lowpass1(low_a2, low_a3, low_b1, low_b2, low_b3); +const double high_b0 = 0.6389437261127494 +const double high_b1 = -1.2778874522254988 +const double high_b2 = 0.6389437261127494 +const double high_a1 = -1.1429772843080923 +const double high_a2 = 0.41279762014290533 // VIA online biquad calculator Highpas 520-52-0.7071-6 + +biquadFilter highpass1(high_a1, high_a2, high_b0, high_b1, high_b2); +biquadFilter lowpass1(low_a1, low_a2, low_b0, low_b1, low_b2); AnalogIn input1(A0); // declaring the 4 inputs