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.
Fork of SignalNumber2 by
Diff: signalnumber.cpp
- Revision:
- 3:f8d57796d69b
- Parent:
- 2:1a677b57ce81
- Child:
- 4:a79f9f3a9e40
--- a/signalnumber.cpp Wed Nov 01 13:42:01 2017 +0000
+++ b/signalnumber.cpp Wed Nov 01 14:11:14 2017 +0000
@@ -73,12 +73,12 @@
n is the amount of samples in the window
action is the amount of same mean values
*/
-int SignalNumber::getnumber(const int n, const int action, float input, float k){
- mean = getmean(n, input)*k;
+int SignalNumber::getnumber(const int n, const int action, float input){
+ mean = getmean(n, input);
//Check first case
if( mean < LeftFastmin ) {
if (count2 <action){
- mean = getmean(n, input)*k;
+ mean = getmean(n, input);
if(mean < LeftFastmin){
count2++;
}
@@ -95,7 +95,7 @@
//Check second case
else if(mean <= LeftFastmax and mean > LeftFastmin){
if (count2 <action){
- mean = getmean(n, input)*k;
+ mean = getmean(n, input);
if(mean <=LeftFastmax and mean>LeftFastmin){
count2++;
}
@@ -111,7 +111,7 @@
}
else if( mean <=LeftSlowmax and mean>LeftSlowmin) {
if (count2 <action){
- mean = getmean(n, input)*k;
+ mean = getmean(n, input);
if(mean <=LeftSlowmax and mean>LeftSlowmin){
count2++;
}
@@ -127,7 +127,7 @@
}
else if( mean <=RightSlowmax and mean>RightSlowmin) {
if (count2 <action){
- mean = getmean(n, input)*k;
+ mean = getmean(n, input);
if(mean <=RightSlowmax and mean>RightSlowmin){
count2++;
}
@@ -143,7 +143,7 @@
}
else if( mean <=RightFastmax and mean>RightFastmin ) {
if (count2 <action){
- mean = getmean(n, input)*k;
+ mean = getmean(n, input);
if(mean <=RightFastmax and mean>RightFastmin){
count2++;
}
@@ -166,13 +166,13 @@
// In progress
-int SignalNumber::getmode(const int n, const int action, float input, float k){
+int SignalNumber::getmode(const int n, const int action, float input){
int mode;
- mean = getmean(n, input)*k;
+ mean = getmean(n, input);
//Check first case
if( mean < LeftFastmin ) {
if (count2 <action){
- mean = getmean(n, input)*k;
+ mean = getmean(n, input);
if(mean < LeftFastmin){
count2++;
}
