summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/create_libsms_test_data.py176
-rw-r--r--tests/libsms_test_data.json1
-rw-r--r--tests/test_partial_tracking.py83
-rw-r--r--tests/test_peak_detection.py127
4 files changed, 307 insertions, 80 deletions
diff --git a/tests/create_libsms_test_data.py b/tests/create_libsms_test_data.py
new file mode 100644
index 0000000..673eb2f
--- /dev/null
+++ b/tests/create_libsms_test_data.py
@@ -0,0 +1,176 @@
+import os
+import json
+import numpy as np
+import pysms
+import simpl
+
+float_precision = 5
+frame_size = 512
+hop_size = 512
+max_peaks = 10
+max_partials = 10
+num_frames = 30
+num_samples = num_frames * hop_size
+audio_path = os.path.join(
+ os.path.dirname(__file__), 'audio/flute.wav'
+)
+
+audio, sampling_rate = simpl.read_wav(audio_path)
+
+
+def _pysms_analysis_params(sampling_rate):
+ analysis_params = pysms.SMS_AnalParams()
+ pysms.sms_initAnalParams(analysis_params)
+ analysis_params.iSamplingRate = sampling_rate
+ analysis_params.iFrameRate = sampling_rate / hop_size
+ analysis_params.iWindowType = pysms.SMS_WIN_HAMMING
+ analysis_params.fHighestFreq = 20000
+ analysis_params.iFormat = pysms.SMS_FORMAT_HP
+ analysis_params.nTracks = max_peaks
+ analysis_params.peakParams.iMaxPeaks = max_peaks
+ analysis_params.nGuides = max_peaks
+ analysis_params.iMaxDelayFrames = 4
+ analysis_params.analDelay = 0
+ analysis_params.minGoodFrames = 1
+ analysis_params.iCleanTracks = 0
+ analysis_params.iStochasticType = pysms.SMS_STOC_NONE
+ analysis_params.preEmphasis = 0
+ return analysis_params
+
+
+def _size_next_read():
+ pysms.sms_init()
+ snd_header = pysms.SMS_SndHeader()
+
+ # Try to open the input file to fill snd_header
+ if(pysms.sms_openSF(audio_path, snd_header)):
+ raise NameError(
+ "error opening sound file: " + pysms.sms_errorString()
+ )
+
+ analysis_params = _pysms_analysis_params(sampling_rate)
+ analysis_params.iMaxDelayFrames = num_frames + 1
+ if pysms.sms_initAnalysis(analysis_params, snd_header) != 0:
+ raise Exception("Error allocating memory for analysis_params")
+ analysis_params.nFrames = num_frames
+ sms_header = pysms.SMS_Header()
+ pysms.sms_fillHeader(sms_header, analysis_params, "pysms")
+
+ sample_offset = 0
+ pysms_size_new_data = 0
+ current_frame = 0
+ next_read_sizes = []
+
+ while current_frame < num_frames:
+ next_read_sizes.append(analysis_params.sizeNextRead)
+ sample_offset += pysms_size_new_data
+ pysms_size_new_data = analysis_params.sizeNextRead
+
+ # convert frame to floats for libsms
+ frame = audio[sample_offset:sample_offset + pysms_size_new_data]
+ frame = np.array(frame, dtype=np.float32)
+ if len(frame) < pysms_size_new_data:
+ frame = np.hstack((
+ frame, np.zeros(pysms_size_new_data - len(frame),
+ dtype=np.float32)
+ ))
+
+ analysis_data = pysms.SMS_Data()
+ pysms.sms_allocFrameH(sms_header, analysis_data)
+ status = pysms.sms_analyze(frame, analysis_data, analysis_params)
+ # as the no. of frames of delay is > num_frames, sms_analyze should
+ # never get around to performing partial tracking, and so the
+ # return value should be 0
+ assert status == 0
+ pysms.sms_freeFrame(analysis_data)
+ current_frame += 1
+
+ pysms.sms_freeAnalysis(analysis_params)
+ pysms.sms_closeSF()
+ pysms.sms_free()
+
+ return next_read_sizes
+
+
+def _partial_tracking():
+ pysms.sms_init()
+ snd_header = pysms.SMS_SndHeader()
+
+ if(pysms.sms_openSF(audio_path, snd_header)):
+ raise NameError(pysms.sms_errorString())
+
+ analysis_params = _pysms_analysis_params(sampling_rate)
+ if pysms.sms_initAnalysis(analysis_params, snd_header) != 0:
+ raise Exception("Error allocating memory for analysis_params")
+ analysis_params.iSizeSound = num_samples
+ analysis_params.nFrames = num_frames
+ sms_header = pysms.SMS_Header()
+ pysms.sms_fillHeader(sms_header, analysis_params, "pysms")
+
+ sample_offset = 0
+ size_new_data = 0
+ current_frame = 0
+ sms_frames = []
+ do_analysis = True
+
+ while do_analysis and (current_frame < num_frames):
+ sample_offset += size_new_data
+ size_new_data = analysis_params.sizeNextRead
+
+ frame_audio = audio[sample_offset:sample_offset + size_new_data]
+ frame_audio = np.array(frame_audio, dtype=np.float32)
+ if len(frame_audio) < size_new_data:
+ frame_audio = np.hstack((
+ frame_audio, np.zeros(size_new_data - len(frame_audio),
+ dtype=np.float32)
+ ))
+
+ analysis_data = pysms.SMS_Data()
+ pysms.sms_allocFrameH(sms_header, analysis_data)
+ num_partials = analysis_data.nTracks
+ status = pysms.sms_analyze(frame_audio, analysis_data,
+ analysis_params)
+
+ 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
+
+ sms_frames.append(frame)
+ pysms.sms_freeFrame(analysis_data)
+
+ pysms.sms_freeAnalysis(analysis_params)
+ pysms.sms_closeSF()
+ pysms.sms_free()
+
+ return sms_frames
+
+
+if __name__ == '__main__':
+ size_next_read = _size_next_read()
+ partial_tracking = _partial_tracking()
+
+ test_data = {'size_next_read': size_next_read,
+ 'peak_detection': partial_tracking,
+ 'partial_tracking': partial_tracking}
+
+ test_data = json.dumps(test_data)
+ with open('libsms_test_data.json', 'w') as f:
+ f.write(test_data)
diff --git a/tests/libsms_test_data.json b/tests/libsms_test_data.json
new file mode 100644
index 0000000..4638540
--- /dev/null
+++ b/tests/libsms_test_data.json
@@ -0,0 +1 @@
+{"size_next_read": [772, 512, 407, 512, 617, 512, 512, 512, 579, 512, 445, 0, 409, 513, 511, 512, 511, 513, 512, 512, 514, 511, 513, 512, 511, 512, 512, 511, 512, 511], "peak_detection": [{"status": 0, "partials": []}, {"status": 0, "partials": []}, {"status": 0, "partials": []}, {"status": 1, "partials": [{"phase": -1.5218329429626465, "frequency": 100.73258972167969, "amplitude": 0.0016457486199215055, "n": 0}, {"phase": 1.858046293258667, "frequency": 243.24615478515625, "amplitude": 0.00036436086520552635, "n": 1}, {"phase": 0.9155674576759338, "frequency": 304.793701171875, "amplitude": 0.000369888060959056, "n": 2}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 3}, {"phase": -2.036984443664551, "frequency": 461.3448791503906, "amplitude": 0.009120681323111057, "n": 4}, {"phase": 0.6757333278656006, "frequency": 609.6725463867188, "amplitude": 0.00040287102456204593, "n": 5}, {"phase": 0.06312122941017151, "frequency": 683.1907958984375, "amplitude": 0.00019719431293196976, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.03679013252258301, "frequency": 913.8644409179688, "amplitude": 0.0009114847634918988, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": -0.2155233770608902, "frequency": 115.78681945800781, "amplitude": 0.004976073745638132, "n": 0}, {"phase": 0.7857973575592041, "frequency": 212.3479461669922, "amplitude": 0.0005394944455474615, "n": 1}, {"phase": 0.43096724152565, "frequency": 330.9963073730469, "amplitude": 0.00043986490345560014, "n": 2}, {"phase": 0.18935084342956543, "frequency": 459.54656982421875, "amplitude": 0.028698287904262543, "n": 3}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 4}, {"phase": -0.18114744126796722, "frequency": 592.76171875, "amplitude": 0.0005205203196965158, "n": 5}, {"phase": -0.11576556414365768, "frequency": 705.7318115234375, "amplitude": 0.00037194808828644454, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 0}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 1}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 2}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 3}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": -2.436938524246216, "frequency": 124.11214447021484, "amplitude": 0.0018324025440961123, "n": 0}, {"phase": -1.8343597650527954, "frequency": 248.21937561035156, "amplitude": 0.0006252293824218214, "n": 1}, {"phase": -2.1936912536621094, "frequency": 318.72418212890625, "amplitude": 0.0007571159512735903, "n": 2}, {"phase": -1.8397142887115479, "frequency": 462.2568359375, "amplitude": 0.042707204818725586, "n": 3}, {"phase": 0.09180212020874023, "frequency": 594.8583374023438, "amplitude": 0.00028530776035040617, "n": 4}, {"phase": -1.6031091213226318, "frequency": 674.3845825195312, "amplitude": 0.00030057248659431934, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 0}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 1}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 2}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 3}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 0.6263829469680786, "frequency": 92.08726501464844, "amplitude": 0.010394936427474022, "n": 0}, {"phase": -2.890075445175171, "frequency": 230.81016540527344, "amplitude": 0.0007398109883069992, "n": 1}, {"phase": -2.9184470176696777, "frequency": 285.40155029296875, "amplitude": 0.001019282266497612, "n": 2}, {"phase": -0.3646180331707001, "frequency": 378.82818603515625, "amplitude": 0.0003981963382102549, "n": 3}, {"phase": -2.755295515060425, "frequency": 472.2606201171875, "amplitude": 0.06210048869252205, "n": 4}, {"phase": 0.42760035395622253, "frequency": 630.3189086914062, "amplitude": 0.0004032925353385508, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 0.41747957468032837, "frequency": 74.75167846679688, "amplitude": 0.006390708964318037, "n": 0}, {"phase": -1.7258327007293701, "frequency": 202.01565551757812, "amplitude": 0.00041464800597168505, "n": 1}, {"phase": 1.0342711210250854, "frequency": 289.7947692871094, "amplitude": 0.0006108988891355693, "n": 2}, {"phase": -2.6540658473968506, "frequency": 373.0777893066406, "amplitude": 0.00040583775262348354, "n": 3}, {"phase": 0.41062188148498535, "frequency": 476.404052734375, "amplitude": 0.07739183306694031, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": -0.37799954414367676, "frequency": 92.05159759521484, "amplitude": 0.006338505540043116, "n": 0}, {"phase": 2.955967426300049, "frequency": 180.39451599121094, "amplitude": 0.000493450730573386, "n": 1}, {"phase": -2.2542808055877686, "frequency": 296.5419921875, "amplitude": 0.001013280008919537, "n": 2}, {"phase": -2.402564287185669, "frequency": 352.7033386230469, "amplitude": 0.0011287282686680555, "n": 3}, {"phase": -2.4045770168304443, "frequency": 480.5159912109375, "amplitude": 0.09716620296239853, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 0}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 1}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 2}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 3}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 3.358698606491089, "frequency": 287.8085632324219, "amplitude": 0.0007607066072523594, "n": 0}, {"phase": 3.0497491359710693, "frequency": 393.8978271484375, "amplitude": 0.0009673216263763607, "n": 1}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 2}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 3}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": -0.0996953547000885, "frequency": 337.6618347167969, "amplitude": 0.0008969056652858853, "n": 0}, {"phase": -2.8743772506713867, "frequency": 490.385009765625, "amplitude": 0.16342519223690033, "n": 1}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 2}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 3}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 1.5162179470062256, "frequency": 493.7783203125, "amplitude": 0.18236267566680908, "n": 0}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 1}, {"phase": 2.7920780181884766, "frequency": 1459.10595703125, "amplitude": 0.010043039917945862, "n": 2}, {"phase": -1.8929423093795776, "frequency": 1825.1878662109375, "amplitude": 0.0014485728461295366, "n": 3}, {"phase": 1.4831010103225708, "frequency": 2243.86083984375, "amplitude": 0.0009843469597399235, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": -0.25810667872428894, "frequency": 490.6530456542969, "amplitude": 0.19583655893802643, "n": 0}, {"phase": 3.0172178745269775, "frequency": 826.658203125, "amplitude": 0.0018610777333378792, "n": 1}, {"phase": -2.4321157932281494, "frequency": 1479.189208984375, "amplitude": 0.009552860632538795, "n": 2}, {"phase": 2.072129964828491, "frequency": 1882.10302734375, "amplitude": 0.001239586272276938, "n": 3}, {"phase": -0.9769026637077332, "frequency": 2274.908935546875, "amplitude": 0.0005000130040571094, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": -2.010890245437622, "frequency": 494.16632080078125, "amplitude": 0.21185295283794403, "n": 0}, {"phase": -0.33912360668182373, "frequency": 831.2891845703125, "amplitude": 0.0008668504888191819, "n": 1}, {"phase": -1.3411641120910645, "frequency": 1441.5911865234375, "amplitude": 0.01059680338948965, "n": 2}, {"phase": 1.4831539392471313, "frequency": 1832.207763671875, "amplitude": 0.0018819968681782484, "n": 3}, {"phase": 1.832819938659668, "frequency": 2388.154541015625, "amplitude": 0.0017332372954115272, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 2.574197769165039, "frequency": 493.4444885253906, "amplitude": 0.22622361779212952, "n": 0}, {"phase": -0.09333578497171402, "frequency": 833.7406616210938, "amplitude": 0.0027167005464434624, "n": 1}, {"phase": -0.06594473868608475, "frequency": 1494.726806640625, "amplitude": 0.010479222983121872, "n": 2}, {"phase": 1.4540678262710571, "frequency": 1975.8447265625, "amplitude": 0.0025465311482548714, "n": 3}, {"phase": 0.9925318360328674, "frequency": 2522.163330078125, "amplitude": 0.00119665393140167, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 0.9279290437698364, "frequency": 494.9176940917969, "amplitude": 0.23847775161266327, "n": 0}, {"phase": 3.09242582321167, "frequency": 834.36669921875, "amplitude": 0.001821412006393075, "n": 1}, {"phase": 1.4011684656143188, "frequency": 1447.673095703125, "amplitude": 0.011087390594184399, "n": 2}, {"phase": 1.1400275230407715, "frequency": 1971.3203125, "amplitude": 0.0034685712307691574, "n": 3}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": -0.7053161859512329, "frequency": 493.76544189453125, "amplitude": 0.2453899085521698, "n": 0}, {"phase": 2.8890421390533447, "frequency": 823.0301513671875, "amplitude": 0.0020111340563744307, "n": 1}, {"phase": 2.755056858062744, "frequency": 1506.1236572265625, "amplitude": 0.010518350638449192, "n": 2}, {"phase": 1.2446374893188477, "frequency": 1867.63671875, "amplitude": 0.0021037643309682608, "n": 3}, {"phase": 2.3499438762664795, "frequency": 2419.828369140625, "amplitude": 0.0015373376663774252, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": -2.3831357955932617, "frequency": 493.2837829589844, "amplitude": 0.24617530405521393, "n": 0}, {"phase": 3.5916762351989746, "frequency": 913.3516845703125, "amplitude": 0.0015236383769661188, "n": 1}, {"phase": -2.18123459815979, "frequency": 1445.7303466796875, "amplitude": 0.010679630562663078, "n": 2}, {"phase": 0.787388801574707, "frequency": 1853.712890625, "amplitude": 0.002142053795978427, "n": 3}, {"phase": -1.671762228012085, "frequency": 2256.114990234375, "amplitude": 0.0009574092109687626, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 2.1342616081237793, "frequency": 492.7712707519531, "amplitude": 0.23977790772914886, "n": 0}, {"phase": -1.0567866563796997, "frequency": 985.0550537109375, "amplitude": 0.0029439060017466545, "n": 1}, {"phase": -1.3413681983947754, "frequency": 1510.403564453125, "amplitude": 0.01030298974364996, "n": 2}, {"phase": -0.9809439778327942, "frequency": 1851.004638671875, "amplitude": 0.0021370809990912676, "n": 3}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 0.24285514652729034, "frequency": 488.39630126953125, "amplitude": 0.22042621672153473, "n": 0}, {"phase": 3.349154233932495, "frequency": 984.2421264648438, "amplitude": 0.0005122493603266776, "n": 1}, {"phase": -0.9429081082344055, "frequency": 1464.478271484375, "amplitude": 0.009150954894721508, "n": 2}, {"phase": -1.9485687017440796, "frequency": 1889.3599853515625, "amplitude": 0.0016511842841282487, "n": 3}, {"phase": 0.5079602003097534, "frequency": 2492.201904296875, "amplitude": 0.0011566559551283717, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": -1.794173240661621, "frequency": 489.84466552734375, "amplitude": 0.20130561292171478, "n": 0}, {"phase": 1.2867692708969116, "frequency": 974.027099609375, "amplitude": 0.002253413898870349, "n": 1}, {"phase": -0.9445229768753052, "frequency": 1432.6697998046875, "amplitude": 0.009495538659393787, "n": 2}, {"phase": 1.7371870279312134, "frequency": 1816.380859375, "amplitude": 0.001957331085577607, "n": 3}, {"phase": -2.414635419845581, "frequency": 2494.998046875, "amplitude": 0.0009349528700113297, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 2.387223243713379, "frequency": 487.30340576171875, "amplitude": 0.18822415173053741, "n": 0}, {"phase": -1.704833745956421, "frequency": 978.1591186523438, "amplitude": 0.001418386003933847, "n": 1}, {"phase": -0.9104847311973572, "frequency": 1490.896728515625, "amplitude": 0.009548594243824482, "n": 2}, {"phase": -0.6226575970649719, "frequency": 1845.4991455078125, "amplitude": 0.001392751932144165, "n": 3}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 0.27897411584854126, "frequency": 486.5024108886719, "amplitude": 0.18126538395881653, "n": 0}, {"phase": -2.4802908897399902, "frequency": 979.7081909179688, "amplitude": 0.001617054222151637, "n": 1}, {"phase": -0.9843209385871887, "frequency": 1469.2906494140625, "amplitude": 0.00913352519273758, "n": 2}, {"phase": -2.0374741554260254, "frequency": 1857.0706787109375, "amplitude": 0.0014013312757015228, "n": 3}, {"phase": 0.8346092104911804, "frequency": 2488.031982421875, "amplitude": 0.0010154490591958165, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": -1.8544561862945557, "frequency": 489.565185546875, "amplitude": 0.1803949773311615, "n": 0}, {"phase": 1.2225688695907593, "frequency": 975.7713012695312, "amplitude": 0.0016094709280878305, "n": 1}, {"phase": -1.0948880910873413, "frequency": 1434.8616943359375, "amplitude": 0.010347925126552582, "n": 2}, {"phase": 1.818347454071045, "frequency": 1824.523193359375, "amplitude": 0.0017804346280172467, "n": 3}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 2.3457303047180176, "frequency": 489.10955810546875, "amplitude": 0.18913815915584564, "n": 0}, {"phase": -0.8635183572769165, "frequency": 981.4453125, "amplitude": 0.0013043833896517754, "n": 1}, {"phase": -0.8202327489852905, "frequency": 1491.7320556640625, "amplitude": 0.010984547436237335, "n": 2}, {"phase": 0.9056487083435059, "frequency": 1960.374267578125, "amplitude": 0.0025972877629101276, "n": 3}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 0.3917562961578369, "frequency": 490.1195373535156, "amplitude": 0.21080993115901947, "n": 0}, {"phase": -2.7389485836029053, "frequency": 984.3159790039062, "amplitude": 0.0016420903848484159, "n": 1}, {"phase": -0.15491421520709991, "frequency": 1466.5438232421875, "amplitude": 0.010966124013066292, "n": 2}, {"phase": -0.5837928652763367, "frequency": 1966.979248046875, "amplitude": 0.0022031432017683983, "n": 3}, {"phase": 1.5796562433242798, "frequency": 2502.3037109375, "amplitude": 0.0012268278514966369, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": -1.4296653270721436, "frequency": 493.66259765625, "amplitude": 0.22996872663497925, "n": 0}, {"phase": 0.9027782082557678, "frequency": 982.565185546875, "amplitude": 0.002619418315589428, "n": 1}, {"phase": 0.9101056456565857, "frequency": 1503.9071044921875, "amplitude": 0.012615200132131577, "n": 2}, {"phase": -1.510783314704895, "frequency": 1960.2293701171875, "amplitude": 0.004438301548361778, "n": 3}, {"phase": -1.155306339263916, "frequency": 2514.180908203125, "amplitude": 0.0019122953526675701, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 3.1255486011505127, "frequency": 492.523193359375, "amplitude": 0.25985097885131836, "n": 0}, {"phase": 2.4602746963500977, "frequency": 953.165771484375, "amplitude": 0.0020260498858988285, "n": 1}, {"phase": 2.152769088745117, "frequency": 1474.9300537109375, "amplitude": 0.012118295766413212, "n": 2}, {"phase": -2.1123251914978027, "frequency": 1968.2491455078125, "amplitude": 0.0029052377212792635, "n": 3}, {"phase": -2.3247172832489014, "frequency": 2491.867919921875, "amplitude": 0.0015400664415210485, "n": 4}, {"phase": 0.20212508738040924, "frequency": 2970.754150390625, "amplitude": 0.0017581601860001683, "n": 5}, {"phase": -0.6958975195884705, "frequency": 3474.923583984375, "amplitude": 0.0007997068460099399, "n": 6}, {"phase": 0.8916994333267212, "frequency": 3996.45361328125, "amplitude": 0.0005458118976093829, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 1.5161924362182617, "frequency": 496.84063720703125, "amplitude": 0.29075556993484497, "n": 0}, {"phase": -1.260545253753662, "frequency": 986.8623046875, "amplitude": 0.006707065273076296, "n": 1}, {"phase": -2.3933377265930176, "frequency": 1514.660400390625, "amplitude": 0.013181174173951149, "n": 2}, {"phase": -1.7603288888931274, "frequency": 1852.6883544921875, "amplitude": 0.003278941847383976, "n": 3}, {"phase": 2.1199684143066406, "frequency": 2526.800537109375, "amplitude": 0.002444660058245063, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 0.002323830034583807, "frequency": 495.3105773925781, "amplitude": 0.31333592534065247, "n": 0}, {"phase": 2.4164018630981445, "frequency": 999.4593505859375, "amplitude": 0.005913994275033474, "n": 1}, {"phase": -0.5556617975234985, "frequency": 1477.2066650390625, "amplitude": 0.011695333756506443, "n": 2}, {"phase": -1.2950570583343506, "frequency": 1991.9361572265625, "amplitude": 0.003265390172600746, "n": 3}, {"phase": 1.6257044076919556, "frequency": 2488.353515625, "amplitude": 0.0017825424438342452, "n": 4}, {"phase": 0.9138443470001221, "frequency": 2981.054443359375, "amplitude": 0.002282859059050679, "n": 5}, {"phase": -3.0734243392944336, "frequency": 3510.631103515625, "amplitude": 0.0007770400843583047, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}], "partial_tracking": [{"status": 0, "partials": []}, {"status": 0, "partials": []}, {"status": 0, "partials": []}, {"status": 1, "partials": [{"phase": -1.5218329429626465, "frequency": 100.73258972167969, "amplitude": 0.0016457486199215055, "n": 0}, {"phase": 1.858046293258667, "frequency": 243.24615478515625, "amplitude": 0.00036436086520552635, "n": 1}, {"phase": 0.9155674576759338, "frequency": 304.793701171875, "amplitude": 0.000369888060959056, "n": 2}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 3}, {"phase": -2.036984443664551, "frequency": 461.3448791503906, "amplitude": 0.009120681323111057, "n": 4}, {"phase": 0.6757333278656006, "frequency": 609.6725463867188, "amplitude": 0.00040287102456204593, "n": 5}, {"phase": 0.06312122941017151, "frequency": 683.1907958984375, "amplitude": 0.00019719431293196976, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.03679013252258301, "frequency": 913.8644409179688, "amplitude": 0.0009114847634918988, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": -0.2155233770608902, "frequency": 115.78681945800781, "amplitude": 0.004976073745638132, "n": 0}, {"phase": 0.7857973575592041, "frequency": 212.3479461669922, "amplitude": 0.0005394944455474615, "n": 1}, {"phase": 0.43096724152565, "frequency": 330.9963073730469, "amplitude": 0.00043986490345560014, "n": 2}, {"phase": 0.18935084342956543, "frequency": 459.54656982421875, "amplitude": 0.028698287904262543, "n": 3}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 4}, {"phase": -0.18114744126796722, "frequency": 592.76171875, "amplitude": 0.0005205203196965158, "n": 5}, {"phase": -0.11576556414365768, "frequency": 705.7318115234375, "amplitude": 0.00037194808828644454, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 0}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 1}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 2}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 3}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": -2.436938524246216, "frequency": 124.11214447021484, "amplitude": 0.0018324025440961123, "n": 0}, {"phase": -1.8343597650527954, "frequency": 248.21937561035156, "amplitude": 0.0006252293824218214, "n": 1}, {"phase": -2.1936912536621094, "frequency": 318.72418212890625, "amplitude": 0.0007571159512735903, "n": 2}, {"phase": -1.8397142887115479, "frequency": 462.2568359375, "amplitude": 0.042707204818725586, "n": 3}, {"phase": 0.09180212020874023, "frequency": 594.8583374023438, "amplitude": 0.00028530776035040617, "n": 4}, {"phase": -1.6031091213226318, "frequency": 674.3845825195312, "amplitude": 0.00030057248659431934, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 0}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 1}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 2}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 3}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 0.6263829469680786, "frequency": 92.08726501464844, "amplitude": 0.010394936427474022, "n": 0}, {"phase": -2.890075445175171, "frequency": 230.81016540527344, "amplitude": 0.0007398109883069992, "n": 1}, {"phase": -2.9184470176696777, "frequency": 285.40155029296875, "amplitude": 0.001019282266497612, "n": 2}, {"phase": -0.3646180331707001, "frequency": 378.82818603515625, "amplitude": 0.0003981963382102549, "n": 3}, {"phase": -2.755295515060425, "frequency": 472.2606201171875, "amplitude": 0.06210048869252205, "n": 4}, {"phase": 0.42760035395622253, "frequency": 630.3189086914062, "amplitude": 0.0004032925353385508, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 0.41747957468032837, "frequency": 74.75167846679688, "amplitude": 0.006390708964318037, "n": 0}, {"phase": -1.7258327007293701, "frequency": 202.01565551757812, "amplitude": 0.00041464800597168505, "n": 1}, {"phase": 1.0342711210250854, "frequency": 289.7947692871094, "amplitude": 0.0006108988891355693, "n": 2}, {"phase": -2.6540658473968506, "frequency": 373.0777893066406, "amplitude": 0.00040583775262348354, "n": 3}, {"phase": 0.41062188148498535, "frequency": 476.404052734375, "amplitude": 0.07739183306694031, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": -0.37799954414367676, "frequency": 92.05159759521484, "amplitude": 0.006338505540043116, "n": 0}, {"phase": 2.955967426300049, "frequency": 180.39451599121094, "amplitude": 0.000493450730573386, "n": 1}, {"phase": -2.2542808055877686, "frequency": 296.5419921875, "amplitude": 0.001013280008919537, "n": 2}, {"phase": -2.402564287185669, "frequency": 352.7033386230469, "amplitude": 0.0011287282686680555, "n": 3}, {"phase": -2.4045770168304443, "frequency": 480.5159912109375, "amplitude": 0.09716620296239853, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 0}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 1}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 2}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 3}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 3.358698606491089, "frequency": 287.8085632324219, "amplitude": 0.0007607066072523594, "n": 0}, {"phase": 3.0497491359710693, "frequency": 393.8978271484375, "amplitude": 0.0009673216263763607, "n": 1}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 2}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 3}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": -0.0996953547000885, "frequency": 337.6618347167969, "amplitude": 0.0008969056652858853, "n": 0}, {"phase": -2.8743772506713867, "frequency": 490.385009765625, "amplitude": 0.16342519223690033, "n": 1}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 2}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 3}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 1.5162179470062256, "frequency": 493.7783203125, "amplitude": 0.18236267566680908, "n": 0}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 1}, {"phase": 2.7920780181884766, "frequency": 1459.10595703125, "amplitude": 0.010043039917945862, "n": 2}, {"phase": -1.8929423093795776, "frequency": 1825.1878662109375, "amplitude": 0.0014485728461295366, "n": 3}, {"phase": 1.4831010103225708, "frequency": 2243.86083984375, "amplitude": 0.0009843469597399235, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": -0.25810667872428894, "frequency": 490.6530456542969, "amplitude": 0.19583655893802643, "n": 0}, {"phase": 3.0172178745269775, "frequency": 826.658203125, "amplitude": 0.0018610777333378792, "n": 1}, {"phase": -2.4321157932281494, "frequency": 1479.189208984375, "amplitude": 0.009552860632538795, "n": 2}, {"phase": 2.072129964828491, "frequency": 1882.10302734375, "amplitude": 0.001239586272276938, "n": 3}, {"phase": -0.9769026637077332, "frequency": 2274.908935546875, "amplitude": 0.0005000130040571094, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": -2.010890245437622, "frequency": 494.16632080078125, "amplitude": 0.21185295283794403, "n": 0}, {"phase": -0.33912360668182373, "frequency": 831.2891845703125, "amplitude": 0.0008668504888191819, "n": 1}, {"phase": -1.3411641120910645, "frequency": 1441.5911865234375, "amplitude": 0.01059680338948965, "n": 2}, {"phase": 1.4831539392471313, "frequency": 1832.207763671875, "amplitude": 0.0018819968681782484, "n": 3}, {"phase": 1.832819938659668, "frequency": 2388.154541015625, "amplitude": 0.0017332372954115272, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 2.574197769165039, "frequency": 493.4444885253906, "amplitude": 0.22622361779212952, "n": 0}, {"phase": -0.09333578497171402, "frequency": 833.7406616210938, "amplitude": 0.0027167005464434624, "n": 1}, {"phase": -0.06594473868608475, "frequency": 1494.726806640625, "amplitude": 0.010479222983121872, "n": 2}, {"phase": 1.4540678262710571, "frequency": 1975.8447265625, "amplitude": 0.0025465311482548714, "n": 3}, {"phase": 0.9925318360328674, "frequency": 2522.163330078125, "amplitude": 0.00119665393140167, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 0.9279290437698364, "frequency": 494.9176940917969, "amplitude": 0.23847775161266327, "n": 0}, {"phase": 3.09242582321167, "frequency": 834.36669921875, "amplitude": 0.001821412006393075, "n": 1}, {"phase": 1.4011684656143188, "frequency": 1447.673095703125, "amplitude": 0.011087390594184399, "n": 2}, {"phase": 1.1400275230407715, "frequency": 1971.3203125, "amplitude": 0.0034685712307691574, "n": 3}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": -0.7053161859512329, "frequency": 493.76544189453125, "amplitude": 0.2453899085521698, "n": 0}, {"phase": 2.8890421390533447, "frequency": 823.0301513671875, "amplitude": 0.0020111340563744307, "n": 1}, {"phase": 2.755056858062744, "frequency": 1506.1236572265625, "amplitude": 0.010518350638449192, "n": 2}, {"phase": 1.2446374893188477, "frequency": 1867.63671875, "amplitude": 0.0021037643309682608, "n": 3}, {"phase": 2.3499438762664795, "frequency": 2419.828369140625, "amplitude": 0.0015373376663774252, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": -2.3831357955932617, "frequency": 493.2837829589844, "amplitude": 0.24617530405521393, "n": 0}, {"phase": 3.5916762351989746, "frequency": 913.3516845703125, "amplitude": 0.0015236383769661188, "n": 1}, {"phase": -2.18123459815979, "frequency": 1445.7303466796875, "amplitude": 0.010679630562663078, "n": 2}, {"phase": 0.787388801574707, "frequency": 1853.712890625, "amplitude": 0.002142053795978427, "n": 3}, {"phase": -1.671762228012085, "frequency": 2256.114990234375, "amplitude": 0.0009574092109687626, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 2.1342616081237793, "frequency": 492.7712707519531, "amplitude": 0.23977790772914886, "n": 0}, {"phase": -1.0567866563796997, "frequency": 985.0550537109375, "amplitude": 0.0029439060017466545, "n": 1}, {"phase": -1.3413681983947754, "frequency": 1510.403564453125, "amplitude": 0.01030298974364996, "n": 2}, {"phase": -0.9809439778327942, "frequency": 1851.004638671875, "amplitude": 0.0021370809990912676, "n": 3}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 0.24285514652729034, "frequency": 488.39630126953125, "amplitude": 0.22042621672153473, "n": 0}, {"phase": 3.349154233932495, "frequency": 984.2421264648438, "amplitude": 0.0005122493603266776, "n": 1}, {"phase": -0.9429081082344055, "frequency": 1464.478271484375, "amplitude": 0.009150954894721508, "n": 2}, {"phase": -1.9485687017440796, "frequency": 1889.3599853515625, "amplitude": 0.0016511842841282487, "n": 3}, {"phase": 0.5079602003097534, "frequency": 2492.201904296875, "amplitude": 0.0011566559551283717, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": -1.794173240661621, "frequency": 489.84466552734375, "amplitude": 0.20130561292171478, "n": 0}, {"phase": 1.2867692708969116, "frequency": 974.027099609375, "amplitude": 0.002253413898870349, "n": 1}, {"phase": -0.9445229768753052, "frequency": 1432.6697998046875, "amplitude": 0.009495538659393787, "n": 2}, {"phase": 1.7371870279312134, "frequency": 1816.380859375, "amplitude": 0.001957331085577607, "n": 3}, {"phase": -2.414635419845581, "frequency": 2494.998046875, "amplitude": 0.0009349528700113297, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 2.387223243713379, "frequency": 487.30340576171875, "amplitude": 0.18822415173053741, "n": 0}, {"phase": -1.704833745956421, "frequency": 978.1591186523438, "amplitude": 0.001418386003933847, "n": 1}, {"phase": -0.9104847311973572, "frequency": 1490.896728515625, "amplitude": 0.009548594243824482, "n": 2}, {"phase": -0.6226575970649719, "frequency": 1845.4991455078125, "amplitude": 0.001392751932144165, "n": 3}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 0.27897411584854126, "frequency": 486.5024108886719, "amplitude": 0.18126538395881653, "n": 0}, {"phase": -2.4802908897399902, "frequency": 979.7081909179688, "amplitude": 0.001617054222151637, "n": 1}, {"phase": -0.9843209385871887, "frequency": 1469.2906494140625, "amplitude": 0.00913352519273758, "n": 2}, {"phase": -2.0374741554260254, "frequency": 1857.0706787109375, "amplitude": 0.0014013312757015228, "n": 3}, {"phase": 0.8346092104911804, "frequency": 2488.031982421875, "amplitude": 0.0010154490591958165, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": -1.8544561862945557, "frequency": 489.565185546875, "amplitude": 0.1803949773311615, "n": 0}, {"phase": 1.2225688695907593, "frequency": 975.7713012695312, "amplitude": 0.0016094709280878305, "n": 1}, {"phase": -1.0948880910873413, "frequency": 1434.8616943359375, "amplitude": 0.010347925126552582, "n": 2}, {"phase": 1.818347454071045, "frequency": 1824.523193359375, "amplitude": 0.0017804346280172467, "n": 3}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 2.3457303047180176, "frequency": 489.10955810546875, "amplitude": 0.18913815915584564, "n": 0}, {"phase": -0.8635183572769165, "frequency": 981.4453125, "amplitude": 0.0013043833896517754, "n": 1}, {"phase": -0.8202327489852905, "frequency": 1491.7320556640625, "amplitude": 0.010984547436237335, "n": 2}, {"phase": 0.9056487083435059, "frequency": 1960.374267578125, "amplitude": 0.0025972877629101276, "n": 3}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 0.3917562961578369, "frequency": 490.1195373535156, "amplitude": 0.21080993115901947, "n": 0}, {"phase": -2.7389485836029053, "frequency": 984.3159790039062, "amplitude": 0.0016420903848484159, "n": 1}, {"phase": -0.15491421520709991, "frequency": 1466.5438232421875, "amplitude": 0.010966124013066292, "n": 2}, {"phase": -0.5837928652763367, "frequency": 1966.979248046875, "amplitude": 0.0022031432017683983, "n": 3}, {"phase": 1.5796562433242798, "frequency": 2502.3037109375, "amplitude": 0.0012268278514966369, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": -1.4296653270721436, "frequency": 493.66259765625, "amplitude": 0.22996872663497925, "n": 0}, {"phase": 0.9027782082557678, "frequency": 982.565185546875, "amplitude": 0.002619418315589428, "n": 1}, {"phase": 0.9101056456565857, "frequency": 1503.9071044921875, "amplitude": 0.012615200132131577, "n": 2}, {"phase": -1.510783314704895, "frequency": 1960.2293701171875, "amplitude": 0.004438301548361778, "n": 3}, {"phase": -1.155306339263916, "frequency": 2514.180908203125, "amplitude": 0.0019122953526675701, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 3.1255486011505127, "frequency": 492.523193359375, "amplitude": 0.25985097885131836, "n": 0}, {"phase": 2.4602746963500977, "frequency": 953.165771484375, "amplitude": 0.0020260498858988285, "n": 1}, {"phase": 2.152769088745117, "frequency": 1474.9300537109375, "amplitude": 0.012118295766413212, "n": 2}, {"phase": -2.1123251914978027, "frequency": 1968.2491455078125, "amplitude": 0.0029052377212792635, "n": 3}, {"phase": -2.3247172832489014, "frequency": 2491.867919921875, "amplitude": 0.0015400664415210485, "n": 4}, {"phase": 0.20212508738040924, "frequency": 2970.754150390625, "amplitude": 0.0017581601860001683, "n": 5}, {"phase": -0.6958975195884705, "frequency": 3474.923583984375, "amplitude": 0.0007997068460099399, "n": 6}, {"phase": 0.8916994333267212, "frequency": 3996.45361328125, "amplitude": 0.0005458118976093829, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 1.5161924362182617, "frequency": 496.84063720703125, "amplitude": 0.29075556993484497, "n": 0}, {"phase": -1.260545253753662, "frequency": 986.8623046875, "amplitude": 0.006707065273076296, "n": 1}, {"phase": -2.3933377265930176, "frequency": 1514.660400390625, "amplitude": 0.013181174173951149, "n": 2}, {"phase": -1.7603288888931274, "frequency": 1852.6883544921875, "amplitude": 0.003278941847383976, "n": 3}, {"phase": 2.1199684143066406, "frequency": 2526.800537109375, "amplitude": 0.002444660058245063, "n": 4}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 5}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}, {"status": 1, "partials": [{"phase": 0.002323830034583807, "frequency": 495.3105773925781, "amplitude": 0.31333592534065247, "n": 0}, {"phase": 2.4164018630981445, "frequency": 999.4593505859375, "amplitude": 0.005913994275033474, "n": 1}, {"phase": -0.5556617975234985, "frequency": 1477.2066650390625, "amplitude": 0.011695333756506443, "n": 2}, {"phase": -1.2950570583343506, "frequency": 1991.9361572265625, "amplitude": 0.003265390172600746, "n": 3}, {"phase": 1.6257044076919556, "frequency": 2488.353515625, "amplitude": 0.0017825424438342452, "n": 4}, {"phase": 0.9138443470001221, "frequency": 2981.054443359375, "amplitude": 0.002282859059050679, "n": 5}, {"phase": -3.0734243392944336, "frequency": 3510.631103515625, "amplitude": 0.0007770400843583047, "n": 6}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 7}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 8}, {"phase": 0.0, "frequency": 0.0, "amplitude": 0.0, "n": 9}]}]} \ No newline at end of file
diff --git a/tests/test_partial_tracking.py b/tests/test_partial_tracking.py
index 004ded7..fb87da9 100644
--- a/tests/test_partial_tracking.py
+++ b/tests/test_partial_tracking.py
@@ -1,29 +1,104 @@
import os
+import json
import numpy as np
from nose.tools import assert_almost_equals
import simpl
import simpl.peak_detection as peak_detection
import simpl.partial_tracking as partial_tracking
+PeakDetection = peak_detection.PeakDetection
+SMSPeakDetection = peak_detection.SMSPeakDetection
+PartialTracking = partial_tracking.PartialTracking
+SMSPartialTracking = partial_tracking.SMSPartialTracking
+
float_precision = 5
frame_size = 512
hop_size = 512
+max_peaks = 10
+max_partials = 10
+num_frames = 30
+num_samples = num_frames * hop_size
audio_path = os.path.join(
os.path.dirname(__file__), 'audio/flute.wav'
)
+libsms_test_data_path = os.path.join(
+ os.path.dirname(__file__), 'libsms_test_data.json'
+)
+
+
+def _load_libsms_test_data():
+ test_data = None
+ with open(libsms_test_data_path, 'r') as f:
+ test_data = json.loads(f.read())
+ return test_data
class TestPartialTracking(object):
@classmethod
def setup_class(cls):
cls.audio = simpl.read_wav(audio_path)[0]
+ cls.audio = cls.audio[0:num_samples]
- def test_partial_tracking(self):
- pd = peak_detection.PeakDetection()
+ def test_basic(self):
+ pd = PeakDetection()
+ pd.hop_size = hop_size
frames = pd.find_peaks(self.audio)
- pt = partial_tracking.PartialTracking()
+ pt = PartialTracking()
frames = pt.find_partials(frames)
+ print 'frames: %d (expected: %d)' %\
+ (len(frames), len(self.audio) / hop_size)
assert len(frames) == len(self.audio) / hop_size
- assert len(frames[0].partials) == 100
+
+ assert len(frames[0].partials) == 0
+ assert frames[0].max_partials == 100
+
+
+class TestSMSPartialTracking(object):
+ @classmethod
+ def setup_class(cls):
+ cls.audio = simpl.read_wav(audio_path)[0]
+ cls.audio = cls.audio[0:num_samples]
+ cls.test_data = _load_libsms_test_data()
+
+ def test_basic(self):
+ pd = SMSPeakDetection()
+ pd.hop_size = hop_size
+ pd.max_peaks = max_peaks
+ pd.static_frame_size = True
+ frames = pd.find_peaks(self.audio)
+
+ pt = SMSPartialTracking()
+ pt.max_partials = max_partials
+ frames = pt.find_partials(frames)
+
+ print 'frames: %d (expected: %d)' %\
+ (len(frames), len(self.audio) / hop_size)
+ assert len(frames) == len(self.audio) / hop_size
+
+ assert len(frames[0].partials) == 0
+ assert frames[0].max_partials == max_partials
+
+ def test_partial_tracking(self):
+ pd = SMSPeakDetection()
+ pd.max_peaks = max_peaks
+ pd.hop_size = hop_size
+ peaks = pd.find_peaks(self.audio)
+ pt = SMSPartialTracking()
+ pt.max_partials = max_partials
+ frames = pt.find_partials(peaks)
+
+ # make sure each partial is the same
+ # for i in range(len(sms_frames)):
+ # assert len(sms_frames[i].partials) == len(simpl_frames[i].partials)
+ # for p in range(len(sms_frames[i].partials)):
+ # assert_almost_equals(sms_frames[i].partials[p].amplitude,
+ # simpl_frames[i].partials[p].amplitude,
+ # float_precision)
+ # assert_almost_equals(sms_frames[i].partials[p].frequency,
+ # simpl_frames[i].partials[p].frequency,
+ # float_precision)
+ # assert_almost_equals(sms_frames[i].partials[p].phase,
+ # simpl_frames[i].partials[p].phase,
+ # float_precision)
diff --git a/tests/test_peak_detection.py b/tests/test_peak_detection.py
index 6d623b6..84505b7 100644
--- a/tests/test_peak_detection.py
+++ b/tests/test_peak_detection.py
@@ -1,7 +1,5 @@
import os
-import numpy as np
-from nose.tools import assert_almost_equals
-import pysms
+import json
import simpl
import simpl.peak_detection as peak_detection
@@ -18,6 +16,16 @@ num_samples = num_frames * hop_size
audio_path = os.path.join(
os.path.dirname(__file__), 'audio/flute.wav'
)
+test_data_path = os.path.join(
+ os.path.dirname(__file__), 'libsms_test_data.json'
+)
+
+
+def _load_libsms_test_data():
+ test_data = None
+ with open(test_data_path, 'r') as f:
+ test_data = json.loads(f.read())
+ return test_data
class TestPeakDetection(object):
@@ -25,91 +33,37 @@ class TestPeakDetection(object):
def setup_class(cls):
cls.audio = simpl.read_wav(audio_path)[0]
- def test_peak_detection(self):
+ def test_basic(self):
pd = PeakDetection()
+ pd.max_peaks = max_peaks
pd.find_peaks(self.audio)
assert len(pd.frames) == len(self.audio) / hop_size
assert len(pd.frames[0].peaks) == 0
+ assert pd.frames[0].max_peaks == max_peaks
class TestSMSPeakDetection(object):
- def _pysms_analysis_params(self, sampling_rate):
- analysis_params = pysms.SMS_AnalParams()
- pysms.sms_initAnalParams(analysis_params)
- analysis_params.iSamplingRate = sampling_rate
- analysis_params.iFrameRate = sampling_rate / hop_size
- analysis_params.iWindowType = pysms.SMS_WIN_HAMMING
- analysis_params.fDefaultFundamental = 100
- analysis_params.fHighestFreq = 20000
- analysis_params.iFormat = pysms.SMS_FORMAT_HP
- analysis_params.nTracks = max_peaks
- analysis_params.peakParams.iMaxPeaks = max_peaks
- analysis_params.nGuides = max_peaks
- analysis_params.iMaxDelayFrames = 4
- analysis_params.analDelay = 0
- analysis_params.minGoodFrames = 1
- analysis_params.iCleanTracks = 0
- analysis_params.iStochasticType = pysms.SMS_STOC_NONE
- analysis_params.preEmphasis = 0
- return analysis_params
+ @classmethod
+ def setup_class(cls):
+ cls.audio = simpl.read_wav(audio_path)[0]
+ cls.test_data = _load_libsms_test_data()
+
+ def test_basic(self):
+ pd = SMSPeakDetection()
+ pd.hop_size = hop_size
+ pd.static_frame_size = True
+ pd.find_peaks(self.audio)
+
+ assert len(pd.frames) == len(self.audio) / hop_size
+ assert len(pd.frames[0].peaks)
def test_size_next_read(self):
"""
- test_size_next_read
- Make sure PeakDetection is calculating the correct value for the
+ Make sure SMSPeakDetection is calculating the correct value for the
size of the next frame.
"""
audio, sampling_rate = simpl.read_wav(audio_path)
- pysms.sms_init()
- snd_header = pysms.SMS_SndHeader()
-
- # Try to open the input file to fill snd_header
- if(pysms.sms_openSF(audio_path, snd_header)):
- raise NameError(
- "error opening sound file: " + pysms.sms_errorString()
- )
-
- analysis_params = self._pysms_analysis_params(sampling_rate)
- analysis_params.iMaxDelayFrames = num_frames + 1
- if pysms.sms_initAnalysis(analysis_params, snd_header) != 0:
- raise Exception("Error allocating memory for analysis_params")
- analysis_params.nFrames = num_frames
- sms_header = pysms.SMS_Header()
- pysms.sms_fillHeader(sms_header, analysis_params, "pysms")
-
- sample_offset = 0
- pysms_size_new_data = 0
- current_frame = 0
- sms_next_read_sizes = []
-
- while current_frame < num_frames:
- sms_next_read_sizes.append(analysis_params.sizeNextRead)
- sample_offset += pysms_size_new_data
- pysms_size_new_data = analysis_params.sizeNextRead
-
- # convert frame to floats for libsms
- frame = audio[sample_offset:sample_offset + pysms_size_new_data]
- frame = np.array(frame, dtype=np.float32)
- if len(frame) < pysms_size_new_data:
- frame = np.hstack((
- frame, np.zeros(pysms_size_new_data - len(frame),
- dtype=np.float32)
- ))
-
- analysis_data = pysms.SMS_Data()
- pysms.sms_allocFrameH(sms_header, analysis_data)
- status = pysms.sms_analyze(frame, analysis_data, analysis_params)
- # as the no. of frames of delay is > num_frames, sms_analyze should
- # never get around to performing partial tracking, and so the
- # return value should be 0
- assert status == 0
- pysms.sms_freeFrame(analysis_data)
- current_frame += 1
-
- pysms.sms_freeAnalysis(analysis_params)
- pysms.sms_closeSF()
- pysms.sms_free()
pd = SMSPeakDetection()
pd.hop_size = hop_size
@@ -117,13 +71,34 @@ class TestSMSPeakDetection(object):
current_frame = 0
sample_offset = 0
+ next_read_sizes = self.test_data['size_next_read']
+
while current_frame < num_frames:
pd.frame_size = pd.next_frame_size()
- assert sms_next_read_sizes[current_frame] == pd.frame_size,\
- (sms_next_read_sizes[current_frame], pd.frame_size)
+ assert next_read_sizes[current_frame] == pd.frame_size,\
+ (next_read_sizes[current_frame], pd.frame_size)
frame = simpl.Frame()
frame.size = pd.frame_size
frame.audio = audio[sample_offset:sample_offset + pd.frame_size]
pd.find_peaks_in_frame(frame)
sample_offset += pd.frame_size
current_frame += 1
+
+ def test_peak_detection(self):
+ audio, sampling_rate = simpl.read_wav(audio_path)
+
+ pd = SMSPeakDetection()
+ pd.max_peaks = max_peaks
+ pd.hop_size = hop_size
+ frames = pd.find_peaks(audio[0:num_samples])
+
+ sms_frames = self.test_data['peak_detection']
+ sms_frames = [f for f in sms_frames if f['status'] != 0]
+
+ print 'frames: %d (expected: %d)' % (len(frames), len(sms_frames))
+ assert len(sms_frames) == len(frames)
+
+ for frame in frames:
+ assert frame.num_peaks <= max_peaks
+ max_amp = max([p.amplitude for p in frame.peaks])
+ assert max_amp