diff options
author | John Glover <j@johnglover.net> | 2012-07-02 20:42:47 +0100 |
---|---|---|
committer | John Glover <j@johnglover.net> | 2012-07-02 20:42:47 +0100 |
commit | 2675f0ef49584ceb03283430716e053fe0498a3a (patch) | |
tree | 05d4088fe3e7550a9bc8041f4f7839ad21ccd92a /tests/create_libsms_test_data.py | |
parent | 9312f0a18a208c4dde6c400b1e08b678648be588 (diff) | |
download | simpl-2675f0ef49584ceb03283430716e053fe0498a3a.tar.gz simpl-2675f0ef49584ceb03283430716e053fe0498a3a.tar.bz2 simpl-2675f0ef49584ceb03283430716e053fe0498a3a.zip |
[partial_tracking] Add C++ implemention of SMS partial tracking.
Update libsms test data.
Diffstat (limited to 'tests/create_libsms_test_data.py')
-rw-r--r-- | tests/create_libsms_test_data.py | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/tests/create_libsms_test_data.py b/tests/create_libsms_test_data.py index 673eb2f..4adf6f3 100644 --- a/tests/create_libsms_test_data.py +++ b/tests/create_libsms_test_data.py @@ -131,28 +131,30 @@ def _partial_tracking(): status = pysms.sms_analyze(frame_audio, analysis_data, analysis_params) + sms_freqs = np.zeros(num_partials, dtype=np.float32) + sms_amps = np.zeros(num_partials, dtype=np.float32) + sms_phases = np.zeros(num_partials, dtype=np.float32) + frame = {'status': status} frame['partials'] = [] if status == 1: - sms_freqs = np.zeros(num_partials, dtype=np.float32) - sms_amps = np.zeros(num_partials, dtype=np.float32) - sms_phases = np.zeros(num_partials, dtype=np.float32) analysis_data.getSinFreq(sms_freqs) analysis_data.getSinAmp(sms_amps) analysis_data.getSinPhase(sms_phases) - for i in range(num_partials): - frame['partials'].append({ - 'n': i, - 'amplitude': float(sms_amps[i]), - 'frequency': float(sms_freqs[i]), - 'phase': float(sms_phases[i]) - }) current_frame += 1 if status == -1: do_analysis = False + for i in range(num_partials): + frame['partials'].append({ + 'n': i, + 'amplitude': float(sms_amps[i]), + 'frequency': float(sms_freqs[i]), + 'phase': float(sms_phases[i]) + }) + sms_frames.append(frame) pysms.sms_freeFrame(analysis_data) |