From 3371cb1f0a183e8d4e4eafb8869b3e3a6efa3062 Mon Sep 17 00:00:00 2001 From: mhostetter Date: Wed, 2 Aug 2023 22:59:09 -0400 Subject: [PATCH] Add unit tests for shifted Zadoff-Chu --- tests/sequences/test_zadoff_chu.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/sequences/test_zadoff_chu.py b/tests/sequences/test_zadoff_chu.py index 2d27b3f90..8394dad47 100644 --- a/tests/sequences/test_zadoff_chu.py +++ b/tests/sequences/test_zadoff_chu.py @@ -314,3 +314,13 @@ def test_25_11(): ] ) np.testing.assert_array_almost_equal(seq, seq_truth) + + +def test_shift(): + x = sdr.zadoff_chu(13, 3) + x_shift = sdr.zadoff_chu(13, 3, shift=1) + + # The shifted version should be a cyclic shift of the original sequence multiplied by a complex value + y = np.roll(x, -1) / x_shift + y /= y[0] + np.testing.assert_array_almost_equal(y, 1)