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: Phase_Finder.h
- Revision:
- 8:aaf5cde0aa0a
- Parent:
- 0:adae25491b93
- Child:
- 9:d86d73964999
diff -r 25dacf35f4c7 -r aaf5cde0aa0a Phase_Finder.h
--- a/Phase_Finder.h Wed Apr 27 17:11:16 2016 +0000
+++ b/Phase_Finder.h Wed Apr 27 20:12:55 2016 +0000
@@ -40,7 +40,13 @@
}
void Phase_Finder::est_Max(float samples1[]) {
-
+ float change = 0;
+
+ for (int i = 2; i < length - 1; i++) {
+ change = abs(samples1[i - 2] - samples1[i - 1]);
+ if (abs(samples1[i] - samples1[i-1]) > change*4.5)
+ samples1[i] = (samples1[i - 1] + samples1[i + 1]) / 2;
+ }
for (int j = 0; j<peaks; j++) {
float max = 0;