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.
Diff: main.cpp
- Revision:
- 2:1d29b91bc46a
- Parent:
- 1:f32f8eac8af1
- Child:
- 3:7cb317c00afb
diff -r f32f8eac8af1 -r 1d29b91bc46a main.cpp
--- a/main.cpp Mon Oct 26 14:45:46 2015 +0000
+++ b/main.cpp Mon Oct 26 15:00:52 2015 +0000
@@ -21,7 +21,7 @@
double filter_right;
//general biquad filter that can be called in all the filter functions
-double biquad(double u, double &v1, double &v2, const double a1,
+double biquad(double u, double v1, double v2, const double a1,
const double a2, const double b0, const double b1, const double b2)
{
double v = u - a1*v1 - a2*v2;
@@ -90,7 +90,7 @@
//highpass
-double highpass_filter(double input, double &v1, double &v2)
+double highpass_filter(double input, double v1, double v2)
{
double y1 = biquad(input, v1, v2, highp1_a1, highp1_a2, highp1_b0, highp1_b1, highp1_b2);
double y2 = biquad(y1, v1, v2, highp2_a1, highp2_a2, highp2_b0, highp2_b1, highp2_b2);
@@ -109,7 +109,7 @@
//lowpass
-double lowpass_filter(double y3, double &v1, double &v2)
+double lowpass_filter(double y3, double v1, double v2)
{
double y4 = biquad(y3, v1, v2, lowp1_a1, lowp1_a2, lowp1_b0, lowp1_b1, lowp1_b2);
double y5 = biquad(y4, v1, v2, lowp2_a1, lowp2_a2, lowp2_b0, lowp2_b1, lowp2_b2);
@@ -118,7 +118,7 @@
return filtered_signal;
}
-double filter(double input, double &v1, double &v2)
+double filter(double input, double v1, double v2)
{
/* function passes the input through the three filters
returns the final output value as filtered sample