diff options
author | andreas128 <Andreas> | 2017-05-16 22:32:07 +0100 |
---|---|---|
committer | andreas128 <Andreas> | 2017-05-16 22:32:07 +0100 |
commit | ea934695d10c165b37099c70255927d5165bddf0 (patch) | |
tree | ceec2c44bdf167abce0a8698b7d87208b4efe324 /src/gen_source.py | |
parent | 5ddca73652c9671b23eb096a18267e5dcce93a0c (diff) | |
download | ODR-StaticPrecorrection-ea934695d10c165b37099c70255927d5165bddf0.tar.gz ODR-StaticPrecorrection-ea934695d10c165b37099c70255927d5165bddf0.tar.bz2 ODR-StaticPrecorrection-ea934695d10c165b37099c70255927d5165bddf0.zip |
Fix lag calculator and add test
Diffstat (limited to 'src/gen_source.py')
-rw-r--r-- | src/gen_source.py | 6 |
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 + |