-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSine.cpp
More file actions
32 lines (24 loc) · 670 Bytes
/
Copy pathSine.cpp
File metadata and controls
32 lines (24 loc) · 670 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
#include "./TimeStamp.cpp"
#include "math.h"
#include <vector>
using namespace std;
class SineWave: public TimeStamp {
vector <float> createWave(float A, float f, float ph) {
TimeStamp timeStamp;
vector <float> stamp = timeStamp.getTimeStamp();
const int size = stamp.size();
sineWave[size];
for (int i = 0; i < size; i++) {
sineWave.push_back(A * sin(2 * M_PI * f * stamp[i] + ph));
}
return sineWave;
}
vector <float> sineWave;
public:
SineWave(float amplitude = 1,float frequency = 1000,float phase = 0) {
vector <float> sineWave = createWave(amplitude, frequency, phase);
}
vector <float> getWave() {
return sineWave;
}
};