In [1]:
using REAPER
using PyPlot
In [2]:
x = int16(vec(readdlm(joinpath(Pkg.dir("REAPER"), "test", "test16k.txt"))))
fs = 16000
time_axis = [1:length(x)]/fs
figure(figsize=(12, 4), dpi=80, facecolor="w", edgecolor="k")
plot(time_axis, x, label="a speech signal")
xlim(time_axis[1], time_axis[end])
xlabel("Time [sec]")
legend()
Out[2]:
In [3]:
pm_times, pm, f0_times, f0, corr = reaper(x, fs);
In [4]:
figure(figsize=(12, 4), dpi=80, facecolor="w", edgecolor="k")
plot(pm_times, pm, label="Pitch mark", linewidth=2, color=:magenta)
xlabel("Time [sec]")
xlim(pm_times[1], pm_times[end])
ylim(-0.1, 1.1)
legend()
Out[4]:
In [5]:
figure(figsize=(12, 4), dpi=80, facecolor="w", edgecolor="k")
plot(f0_times, f0, label="F0 trajectory", linewidth=2, color=:green)
xlabel("Time [sec]")
xlim(f0_times[1], f0_times[end])
legend()
Out[5]:
In [6]:
figure(figsize=(12, 4), dpi=80, facecolor="w", edgecolor="k")
plot(f0_times, corr, label="Correlation function", linewidth=2, color=:purple)
xlabel("Time [sec]")
xlim(f0_times[1], f0_times[end])
legend()
Out[6]: