Skip to content

Commit

Permalink
Add unit tests for Integrator
Browse files Browse the repository at this point in the history
  • Loading branch information
mhostetter committed Nov 12, 2023
1 parent 3d716fa commit 13e842b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/dsp/test_integrator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import numpy as np

import sdr


def test_gaussian():
fir = sdr.Integrator()
x = sdr.gaussian(0.3, 5, 10)
y = fir(x)

y_truth = np.cumsum(x)

assert np.allclose(y, y_truth)


def test_raised_cosine():
fir = sdr.Integrator()
x = sdr.root_raised_cosine(0.1, 8, 10)
y = fir(x)

y_truth = np.cumsum(x)

assert np.allclose(y, y_truth)

0 comments on commit 13e842b

Please sign in to comment.