diff options
author | John Glover <j@johnglover.net> | 2012-03-22 22:46:30 +0000 |
---|---|---|
committer | John Glover <j@johnglover.net> | 2012-03-22 22:46:30 +0000 |
commit | 2d6b45e5e5b080d9b4f527734e7f3ae5fb1bf6f4 (patch) | |
tree | e6874ace59d1f00ff45c2bc7ca2799ca29608c1d /tests/test_base.py | |
parent | d9a7ad89d8a7554898eedbd72113eb7e461906ae (diff) | |
download | simpl-2d6b45e5e5b080d9b4f527734e7f3ae5fb1bf6f4.tar.gz simpl-2d6b45e5e5b080d9b4f527734e7f3ae5fb1bf6f4.tar.bz2 simpl-2d6b45e5e5b080d9b4f527734e7f3ae5fb1bf6f4.zip |
[base] updating Cython Frame and PeakDetection classes
Diffstat (limited to 'tests/test_base.py')
-rw-r--r-- | tests/test_base.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/test_base.py b/tests/test_base.py index 4dac897..f9807ef 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -24,8 +24,26 @@ class TestFrame(object): f.synth_residual = a assert np.all(f.synth_residual == a) - def test_peak(self): + def test_peaks(self): p = base.Peak() p.amplitude = 0.5 p.frequency = 220.0 p.phase = 0.0 + + f = base.Frame() + assert f.num_peaks == 0 + assert f.max_peaks > 0 + f.add_peak(p) + + assert f.num_peaks == 1 + assert f.peak(0).amplitude == p.amplitude + assert f.peaks[0].amplitude == p.amplitude + + f.clear_peaks() + assert f.num_peaks == 0 + + +class TestPeakDetection(object): + def test_peak_detection(self): + pd = base.PeakDetection() + print pd |