-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patht_window_stack.h
More file actions
51 lines (36 loc) · 979 Bytes
/
t_window_stack.h
File metadata and controls
51 lines (36 loc) · 979 Bytes
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
* t_window_stack.h
*
* Created on: 17.10.2013
* Author: pantec
*/
#ifndef T_WINDOW_STACK_H_
#define T_WINDOW_STACK_H_
#include "tns_util/t_floating_avg.h"
//_________________________________________________________
//
class t_window_stack : public t_average {
public:
t_window_stack() {
V = NULL;
};
virtual ~t_window_stack() {
if (V != NULL) {
delete V;
}
V = NULL;
len = 0;
};
int len,idx,cnt; // TODO: cnt already protected member
double *V;
double Sum; // TODO: Sum already protected member
void Init(int length);
void ZeroIt(void); // clears the array
double Get(int n); // return nth array value
double Get(double I); // return interpolated
double Value(void); // return average
double Info(void); // return information according to Shannon
virtual void Add(double v); // take the next value into the window and calculate average
virtual void Reset(void); // reset ranges
};
#endif /* T_WINDOW_STACK_H_ */