diff options
author | John Glover <j@johnglover.net> | 2012-07-10 23:42:10 +0100 |
---|---|---|
committer | John Glover <j@johnglover.net> | 2012-07-10 23:42:10 +0100 |
commit | 3be57fb63ea0653af664dc55ff7a95738b1a2333 (patch) | |
tree | 9da849bf60dcd1ec344081035891cdf7501e0be9 /tests | |
parent | e539ccf6c01dc5f19f2aa34180f418e92da269b6 (diff) | |
download | simpl-3be57fb63ea0653af664dc55ff7a95738b1a2333.tar.gz simpl-3be57fb63ea0653af664dc55ff7a95738b1a2333.tar.bz2 simpl-3be57fb63ea0653af664dc55ff7a95738b1a2333.zip |
[residual] Update residual so that it just requires
a frame of audio (calculates harmonic component
itself).
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_residual.py | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/tests/test_residual.py b/tests/test_residual.py index e3992a8..006c77a 100644 --- a/tests/test_residual.py +++ b/tests/test_residual.py @@ -75,23 +75,9 @@ class TestSMSResidual(object): assert len(residual_audio) def test_residual_synthesis(self): - pd = SMSPeakDetection() - pd.max_peaks = max_peaks - pd.hop_size = hop_size - frames = pd.find_peaks(self.audio) - - pt = SMSPartialTracking() - pt.max_partials = max_partials - frames = pt.find_partials(frames) - - synth = SMSSynthesis() - synth.hop_size = hop_size - synth.max_partials = max_partials - simpl_harmonic = synth.synth(frames) - res = SMSResidual() res.hop_size = hop_size - simpl_residual = res.synth(simpl_harmonic, self.audio) + simpl_residual = res.synth(self.audio) sms_residual, sampling_rate = simpl.read_wav( libsms_residual_synthesis_path @@ -99,10 +85,10 @@ class TestSMSResidual(object): assert len(simpl_residual) == len(sms_residual) - # import matplotlib.pyplot as plt - # plt.plot(simpl_residual) - # plt.plot(sms_residual) - # plt.show() + import matplotlib.pyplot as plt + plt.plot(simpl_residual) + plt.plot(sms_residual) + plt.show() for i in range(len(simpl_residual)): assert_almost_equals(simpl_residual[i], sms_residual[i], |