-
Notifications
You must be signed in to change notification settings - Fork 38
/
ECGHRT.cpp
42 lines (36 loc) · 848 Bytes
/
ECGHRT.cpp
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
#include "ECGHRT.h"
ECGHRT::ECGHRT (void) : rr(), ts(), SLENGTH(26),ALL_SIGNALS_LENGTH(1),x1_to(7) {
straightSignal = new double[SLENGTH];
avgSignal = new double[SLENGTH];
for(int j = 0; j < SLENGTH; j++)
{
avgSignal[j] = 0.0;
straightSignal[j] = 0.0;
}
}
ECGHRT::~ECGHRT (void) { }
void ECGHRT::setAllSignalsSize(int size)
{
ALL_SIGNALS_LENGTH = size;
allSignals = new double*[ALL_SIGNALS_LENGTH];
for(int i = 0; i < ALL_SIGNALS_LENGTH; i++)
{
allSignals[i] = new double[SLENGTH];
for(int j = 0; j < SLENGTH; j++)
{
allSignals[i][j]=0.0;
}
}
}
double ECGHRT::getMaxValue()
{
double maxx = allSignals[0][0];
for(int i = 0; i < ALL_SIGNALS_LENGTH; i++)
{
for(int j = 0; j < SLENGTH; j++)
{
if(allSignals[i][j] > maxx) maxx= allSignals[i][j];
}
}
return maxx;
}