From ea934695d10c165b37099c70255927d5165bddf0 Mon Sep 17 00:00:00 2001 From: andreas128 Date: Tue, 16 May 2017 22:32:07 +0100 Subject: Fix lag calculator and add test --- src/gen_source.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/gen_source.py') 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 + -- cgit v1.2.3