aboutsummaryrefslogtreecommitdiffstats
path: root/src/gen_source.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/gen_source.py')
-rw-r--r--src/gen_source.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gen_source.py b/src/gen_source.py
index 7620bc3..c8509ed 100644
--- a/src/gen_source.py
+++ b/src/gen_source.py
@@ -97,3 +97,9 @@ def gen_file_i(frequency_0, frequency_1, x1 = 0, x2 = 0, x3 = 0, x4 = 0, samp_ra
assert(np.isclose(a_load, two_tone).all()), "Inconsistent stored file"
return path
+
+def gen_sin(samples, oversampling, phi):
+ t = np.arange(samples, dtype=np.float)
+ sig = np.sin(((2*np.pi)/oversampling) * t - np.pi*phi/180.)
+ return sig
+