forked from jimstudt/ook-decoder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
datum.h
36 lines (27 loc) · 906 Bytes
/
datum.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef SAMPLES_IS_IN
#define SAMPLES_IS_IN
#include <complex.h>
// Datum keeps enough information to sum them up and still compute the standard deviation
struct datum {
unsigned n;
double sum;
double sumOfSquares;
double maximum;
double minimum;
};
// Datum keeps enough information to sum them up and still compute the standard deviation
struct cdatum {
unsigned n;
double complex sum;
double complex sumOfSquares;
double complex maximum;
double complex minimum;
};
void resetDatum(struct datum *d);
void resetCDatum(struct cdatum *d);
void addSample( struct datum *d, double v);
void addCSample( struct cdatum *d, double complex v);
void addCSampleMA( struct cdatum *d, double magnitude, double angle);
void dumpDatum( struct datum *d, const char *name, const char *units);
void dumpCDatum( struct cdatum *d, const char *name, const char *units);
#endif