From 2675f0ef49584ceb03283430716e053fe0498a3a Mon Sep 17 00:00:00 2001 From: John Glover Date: Mon, 2 Jul 2012 20:42:47 +0100 Subject: [partial_tracking] Add C++ implemention of SMS partial tracking. Update libsms test data. --- tests/create_libsms_test_data.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'tests/create_libsms_test_data.py') 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) -- cgit v1.2.3