Skip to content

Commit

Permalink
Loosen test tolerances
Browse files Browse the repository at this point in the history
  • Loading branch information
mhostetter committed May 27, 2024
1 parent 5e0f0d9 commit 58197d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests/measurements/test_rms_bandwidth.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def test_psk_rect():
s = rng.integers(0, psk.order, 1_000)
x = psk.modulate(s)
b_rms = sdr.rms_bandwidth(x, sample_rate=psk.sps)
assert b_rms == pytest.approx(0.7461700620944993)
assert b_rms == pytest.approx(0.7461700620944993, rel=1e-3)


def test_psk_srrc():
Expand All @@ -19,4 +19,4 @@ def test_psk_srrc():
s = rng.integers(0, psk.order, 1_000)
x = psk.modulate(s)
b_rms = sdr.rms_bandwidth(x, sample_rate=psk.sps)
assert b_rms == pytest.approx(0.2900015177082325)
assert b_rms == pytest.approx(0.2900015177082325, rel=1e-3)
6 changes: 3 additions & 3 deletions tests/measurements/test_rms_integration_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def test_psk_rect():
s = rng.integers(0, psk.order, 1_000) # Signal is 1000 seconds long
x = psk.modulate(s)
t_rms = sdr.rms_integration_time(x, sample_rate=psk.sps)
assert t_rms == pytest.approx(288.672247843467)
assert t_rms == pytest.approx(288.672247843467, 1e-3)


def test_psk_srrc():
Expand All @@ -19,7 +19,7 @@ def test_psk_srrc():
s = rng.integers(0, psk.order, 1_000) # Signal is 1000 seconds long
x = psk.modulate(s)
t_rms = sdr.rms_integration_time(x, sample_rate=psk.sps)
assert t_rms == pytest.approx(288.66026000704875)
assert t_rms == pytest.approx(288.66026000704875, 1e-3)


def test_psk_srrc_parabolic():
Expand All @@ -30,4 +30,4 @@ def test_psk_srrc_parabolic():
y = x * np.linspace(-1, 1, len(x)) ** 2 # Parabolic pulse shape
y *= np.sqrt(sdr.energy(x) / sdr.energy(y)) # Normalize energy
t_rms = sdr.rms_integration_time(y, sample_rate=psk.sps)
assert t_rms == pytest.approx(422.61669635555705)
assert t_rms == pytest.approx(422.61669635555705, 1e-3)

0 comments on commit 58197d9

Please sign in to comment.