aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/sca/test_align.py
diff options
context:
space:
mode:
authorJ08nY2020-03-04 00:04:53 +0100
committerJ08nY2020-03-04 00:04:53 +0100
commita97f49ebe3c8e28d2a9ba76711555a3378b62341 (patch)
treed6064aec39573ad9e83607dbed5873d7872aed21 /test/sca/test_align.py
parentdeca0e3d89ff4483dd6b6b4ad99b3400145bee5b (diff)
downloadpyecsca-a97f49ebe3c8e28d2a9ba76711555a3378b62341.tar.gz
pyecsca-a97f49ebe3c8e28d2a9ba76711555a3378b62341.tar.zst
pyecsca-a97f49ebe3c8e28d2a9ba76711555a3378b62341.zip
Fix some type issues.
Diffstat (limited to 'test/sca/test_align.py')
-rw-r--r--test/sca/test_align.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/test/sca/test_align.py b/test/sca/test_align.py
index 57f7119..96cc458 100644
--- a/test/sca/test_align.py
+++ b/test/sca/test_align.py
@@ -12,9 +12,9 @@ class AlignTests(TestCase):
first_arr = np.array([10, 64, 120, 64, 10, 10, 10, 10, 10], dtype=np.dtype("i1"))
second_arr = np.array([10, 10, 10, 10, 50, 80, 50, 20, 10], dtype=np.dtype("i1"))
third_arr = np.array([70, 30, 42, 35, 28, 21, 15, 10, 5], dtype=np.dtype("i1"))
- a = Trace(None, None, first_arr)
- b = Trace(None, None, second_arr)
- c = Trace(None, None, third_arr)
+ a = Trace(first_arr, None, None)
+ b = Trace(second_arr, None, None)
+ c = Trace(third_arr, None, None)
result = align_correlation(a, b, c, reference_offset=1, reference_length=3, max_offset=4, min_correlation=0.65)
self.assertIsNotNone(result)
self.assertEqual(len(result), 2)
@@ -36,16 +36,16 @@ class AlignTests(TestCase):
def test_peak_align(self):
first_arr = np.array([10, 64, 14, 120, 15, 30, 10, 15, 20, 15, 15, 10, 10], dtype=np.dtype("i1"))
second_arr = np.array([10, 10, 10, 10, 90, 40, 50, 20, 10, 17, 16, 10, 10], dtype=np.dtype("i1"))
- a = Trace(None, None, first_arr)
- b = Trace(None, None, second_arr)
+ a = Trace(first_arr, None, None)
+ b = Trace(second_arr, None, None)
result = align_peaks(a, b, reference_offset=2, reference_length=5, max_offset=3)
self.assertEqual(np.argmax(result[0].samples), np.argmax(result[1].samples))
def test_sad_align(self):
first_arr = np.array([10, 64, 14, 120, 15, 30, 10, 15, 20, 15, 15, 10, 10], dtype=np.dtype("i1"))
second_arr = np.array([10, 10, 10, 10, 90, 40, 50, 20, 10, 17, 16, 10, 10], dtype=np.dtype("i1"))
- a = Trace(None, None, first_arr)
- b = Trace(None, None, second_arr)
+ a = Trace(first_arr, None, None)
+ b = Trace(second_arr, None, None)
result = align_sad(a, b, reference_offset=2, reference_length=5, max_offset=3)
self.assertEqual(len(result), 2)
@@ -53,9 +53,9 @@ class AlignTests(TestCase):
first_arr = np.array([10, 64, 14, 120, 15, 30, 10, 15, 20, 15, 15, 10, 10, 8, 10, 12, 10, 13, 9], dtype=np.dtype("i1"))
second_arr = np.array([10, 10, 10, 10, 60, 40, 90, 20, 10, 17, 16, 10, 10, 10, 10, 10, 17, 12, 10], dtype=np.dtype("i1"))
third_arr = np.array([10, 30, 20, 21, 15, 8, 10, 37, 21, 77, 20, 28, 25, 10, 9, 10, 15, 9, 10], dtype=np.dtype("i1"))
- a = Trace(None, None, first_arr)
- b = Trace(None, None, second_arr)
- c = Trace(None, None, third_arr)
+ a = Trace(first_arr, None, None)
+ b = Trace(second_arr, None, None)
+ c = Trace(third_arr, None, None)
result = align_dtw_scale(a, b, c)
self.assertEqual(np.argmax(result[0].samples), np.argmax(result[1].samples))
@@ -66,9 +66,9 @@ class AlignTests(TestCase):
first_arr = np.array([10, 64, 14, 120, 15, 30, 10, 15, 20, 15, 15, 10, 10, 8, 10, 12, 10, 13, 9], dtype=np.dtype("i1"))
second_arr = np.array([10, 10, 10, 10, 60, 40, 90, 20, 10, 17, 16, 10, 10, 10, 10, 10, 17, 12, 10], dtype=np.dtype("i1"))
third_arr = np.array([10, 30, 20, 21, 15, 8, 10, 47, 21, 77, 20, 28, 25, 10, 9, 10, 15, 9, 10], dtype=np.dtype("i1"))
- a = Trace(None, None, first_arr)
- b = Trace(None, None, second_arr)
- c = Trace(None, None, third_arr)
+ a = Trace(first_arr, None, None)
+ b = Trace(second_arr, None, None)
+ c = Trace(third_arr, None, None)
result = align_dtw(a, b, c)
self.assertEqual(np.argmax(result[0].samples), np.argmax(result[1].samples))