#!/usr/bin/env python # coding: utf-8 # ## How pyreaper works # In[1]: get_ipython().run_line_magic('pylab', 'inline') rcParams["figure.figsize"] = (16, 4) # In[2]: import pysptk import pyreaper from scipy.io import wavfile from IPython.display import Audio # In[3]: fs, x = wavfile.read(pysptk.util.example_audio_file()) plot(x) Audio(x, rate=fs) # In[4]: pm_times, pm, f0_times, f0, corr = pyreaper.reaper(x, fs) # In[5]: plot(pm_times, pm, linewidth=3, color="red", label="Pitch mark") legend(fontsize=15) # In[6]: plot(f0_times, f0, linewidth=3, color="green", label="F0 contour") legend(fontsize=15) # In[7]: plot(f0_times, corr, linewidth=3, color="blue", label="Correlations") legend(fontsize=15) # In[ ]: