-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSignal.h
54 lines (40 loc) · 1.25 KB
/
Signal.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
#ifndef __SIGNAL_H__
#define __SIGNAL_H__
#include <string>
#include <iostream>
#include <fstream>
#include <vector>
#include <float.h>
#include <math.h>
#include <stdexcept>
using namespace std;
//Constructs a signal entity
class Signal
{
private:
//Represents the number of values for one signal in one line
const static int NUM_DATA_VALS = 17;
//Holds the final signal data, concatenated and normalized
vector<double> signalData;
//Normalizes the signal data
void normalize(vector< vector<double> >& data);
//Concatenates all the signal data, making the final single vector
void concatenate(vector< vector<double> >& data);
public:
//Default constructor
Signal(){};
//Given a filename, constructs a signal that is normalized and concatenated
//If file cannot be open, throws an invalid argument exception.
Signal(string filename);
//Copy constructor
Signal(const Signal& copy);
//Given two signals, determines if they are equal to each other.
bool operator==(const Signal& other) const;
//Given two signals, determines if they are not equal to each other.
bool operator!=(const Signal& other) const;
//Destructor
~Signal(){};
//Gives you the data for a given Signal
vector<double> getSignalData();
};
#endif