Skip to content

Commit f36fd89

Browse files
authored
Update QuickStats.cpp
1 parent 326e523 commit f36fd89

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

QuickStats.cpp

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* QuickStats.cpp version 1.2.3 - Library for quick descriptive statistics of an array samples[] of size m
22
* Created by David Dubins, January 10th, 2016.
3-
* Last updated: 28-Dec-21.
3+
* Last updated: 01-Apr-25.
44
* Released into the public domain.
55
* Requires Arduino 1.6.6 or greater.
66
* https://github.com/dndubins/QuickStats/
@@ -78,6 +78,15 @@ float QuickStats::CV(float samples[],int m) //Coefficient of variation (%RSD, o
7878
return 100.0*sd/avg;
7979
}
8080

81+
float QuickStats::SNR(float samples[],int m) //Signal-to-noise ratio
82+
{
83+
float avg=0.0;
84+
float sd=0.0;
85+
avg=average(samples,m);
86+
sd=stdev(samples,m);
87+
return avg/sd;
88+
}
89+
8190
void QuickStats::bubbleSort(float A[],int len)
8291
{
8392
unsigned long newn;

0 commit comments

Comments
 (0)