summaryrefslogtreecommitdiff
path: root/daemon/src/Sinewave.h
diff options
context:
space:
mode:
authormarwik15 <marwik15@gmail.com>2022-05-02 13:19:13 +0200
committermarwik15 <marwik15@gmail.com>2022-05-02 13:19:13 +0200
commit2ef406196751a469323ed622312df2e7e7b1834b (patch)
tree1c75c8715c7c4e5e61a9f78099c543369e36d01b /daemon/src/Sinewave.h
parentd417394ae791e9972fede0665587aa612f93bca0 (diff)
downloadhwd-2ef406196751a469323ed622312df2e7e7b1834b.zip
hwd-2ef406196751a469323ed622312df2e7e7b1834b.tar.gz
hwd-2ef406196751a469323ed622312df2e7e7b1834b.tar.bz2
Sine wave changes after CR
Diffstat (limited to 'daemon/src/Sinewave.h')
-rw-r--r--daemon/src/Sinewave.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/daemon/src/Sinewave.h b/daemon/src/Sinewave.h
index d8988ad..d5be732 100644
--- a/daemon/src/Sinewave.h
+++ b/daemon/src/Sinewave.h
@@ -1,12 +1,13 @@
#pragma once
-#include <string>
-#include <math.h>
+#include <cmath>
#include <chrono>
#include "Assembly.h"
-class Sinewave {
+class Sinewave
+{
+ using clock = std::chrono::high_resolution_clock;
public:
Sinewave();
@@ -21,13 +22,12 @@ public:
double get_frequency() const;
double get_phase() const;
+ double get_point() const;
+
private:
- std::chrono::time_point<std::chrono::high_resolution_clock> m_start_time, m_current_time;
- std::chrono::duration<double> m_duration_time;
+ const std::chrono::high_resolution_clock::time_point m_start_time;
double m_amplitude;
double m_frequency;
double m_phase;
-
- double get_point();
};