r9y9 / pyreaper

A python wrapper for REAPER
http://pyreaper.readthedocs.io/en/latest/
Other
78 stars 16 forks source link

Small differences between pyreaper and original REAPER #1

Closed terriyu closed 6 years ago

terriyu commented 6 years ago

Hi, I ran pyreaper and the original Google REAPER on some wav files. The F0 results are very similar, but there are a few small differences even though I think I am using the same parameters. Do you know why there are differences?

For pyreaper, I'm running the following commands in my Python script:

from scipy.io import wavfile from pyreaper import reaper fs, y = wavfile.read('my-wavfile.wav') pm_times, pm, F0_times, F0, corr = reaper(y, fs, minf0=40.0, maxf0=500.0, do_high_pass=True, do_hilbert_transform=False, inter_pulse=0.01, frame_period=0.001)

For Google's original REAPER, I'm running this on the command line:

$ ./reaper -i my-wavfile.wav -f f0.txt -p pitchmarks.txt -c corr.txt -s -e 0.001 -x 500.0 -m 40.0 -u 0.01 -a

terriyu commented 6 years ago

Here are some plots showing the differences. Blue circles are from Google's REAPER and red dots are from pyreaper. I've only plotted valid frequencies (frequencies of -1 are invalid).

beijing_f3_50_a beijing_m5_17_c cant_f6_40_b cant_f6_95_b hmong_f4_18_b hmong_f4_24_d hmong_m6_24_c

r9y9 commented 6 years ago

REAPER's -s option means suppress applying high pass filter, so in pyreaper you need to set do_high_pass=False. With this change I can get np.allclose(f0s_by_pyreaper, f0s_by_reaper) == True with a speech sample. Let me know if it solve your issue.

terriyu commented 6 years ago

Yes, that fixes it. Thank you!