-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathHRTAnalyzer.h
60 lines (47 loc) · 3.46 KB
/
HRTAnalyzer.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#pragma once
//#define USE_MOCKED_INTERVALS_SIGNAL
//#define USE_MOCKED_QRS_CLASSIFICATION
#include "ModulesInterfaces.h"
#include "ECGHRT.h"
#include "ECGSignal.h"
#include "QRSClass.h"
#include "matrix/Matrix.h"
using namespace std;
// testowe
static double RRtest[] = {800,1425, 810, 800,1050, 800, 800, 800, 800, 800, 610, 960, 775, 777, 780, 785, 795, 797,790, 790, 795, 800, 810, 800, 810, 800, 810, 800, 810, 800, 800, 800, 800,
600, 950, 820, 780, 782, 810, 840, 870, 900, 790, 790, 792, 795, 795, 797, 800, 800, 805, 800, 800, 805, 800, 800, 800, 600, 685, 800, 825, 800, 825,
800, 825, 825, 825, 800, 800, 800, 800, 605, 930, 825, 788, 775, 795, 800, 800, 800, 800, 800, 805, 805, 805, 800, 809, 800, 805, 800, 805, 800, 805, 800, 825, 800,
825, 800, 825, 880, 825, 800, 825, 800, 825, 800, 825, 1000, 800, 1025, 800, 800, 1050, 800, 800, 800, 800, 800, 530, 1100, 775, 777,780, 785, 795, 797,790, 790, 795,
800, 810, 800, 810, 800, 810, 800, 810, 800, 800, 800, 805, 800, 805, 800, 805, 800, 800, 805, 795, 805, 805, 825, 800, 800, 800, 800, 600, 950, 800, 865, 800, 825, 800,
825, 299, 800, 825, 800, 825, 800, 825, 850, 800, 825, 800, 800, 825, 610, 695, 775, 777, 780, 785, 795, 797, 790, 790, 795, 800, 810, 800, 810, 800, 810, 800, 810, 800, 800,
800, 805, 800, 805, 800, 805, 800, 805, 800, 825, 800, 825, 800, 825, 800, 825, 800, 825, 390, 825, 800, 825, 800, 825, 800, 825, 900, 800, 925, 800, 800, 1050,
800, 600, 950, 800, 825, 800, 825, 800, 825, 850, 800, 825, 800, 825, 800, 825, 850, 800, 825, 850, 825, 875, 825, 800, 600, 970, 775, 777, 780, 785, 795, 797, 790,
790, 795, 800, 810, 800, 810, 800, 810, 800, 810, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 825, 800, 825, 850, 800, 825, 800, 825, 800, 825, 850, 800, 825, 800, 800,
825, 600, 585, 800, 825, 800, 825, 800, 825, 825, 825, 650, 1000,782, 779, 777, 780, 785, 795, 797, 790, 790, 795, 860, 810, 800, 810, 800, 820, 800, 810, 800, 800, 800, 800, 808,
809, 810, 800, 825, 800, 825, 800, 825, 800, 825, 800, 825, 800, 825, 800, 825, 800, 825, 800, 825, 800, 825, 800, 825, 800, 825, 800, 825, 390, 825, 800, 825, 800,
825, 800, 700, 700, 700, 709, 700, 700, 825, 810, 810, 600, 800};
/**
* @class Class for parameters created in HRV1 module
*/
class HRTAnalyzer : public HRTModule {
public:
HRTAnalyzer();
~HRTAnalyzer();
void runModule(const ECGRs &, const ECGWaves &, const QRSClass &, const ECGInfo &, ECGHRT &);
void run(ECGHRT &);
void setParams(ParametersTypes &);
private:
double* RRs;
//"produkcja" sygna³u z Rpeakami zgodnego z QRSami znalezionymi przez Waves
//taka synchronizacja zosta³a wprowadzona by unikn¹æ niezgodnoœci z QRSClass, które korzysta z Waves, a nie RPeaks
void syncRPeaksAndWaves(double * , const ECGRs &, const ECGWaves &, const ECGInfo &);
void calculateHrtParams(double *signal, const QRSClass & qrsclass, int size, ECGHRT &);
vector<int> findVpcOnsets(double *signal, const QRSClass & qrsclass, int size);
double* calculateAvgTach(double *signal, vector<int> vpc_list);
// wyliczenie TO
// Wzi¹³em nadal tê metodê, w której najpierw liczy siê wszystkie TO, a nastêpnie ich œredni¹
double calculateTO(double * signal, int size, vector<int> vpc_list);
//alternatywna metoda wylicznia TO (na uœrednionym tachogramie)
//double calculateTO_2(double * signal, int size, double* avgTach);
void calculateTS(double * signal, int size, vector<int> vpc_list, double* avgTach, double to, ECGHRT&);
};