figure(4)
plot(t[N - 1:] - delay, filtered_x[N - 1:], 'g', linewidth=1)
peakind = find_peaks_cwt(filtered_x, arange(3, 20))
scatter([(t[i] - delay) for i in peakind], [filtered_x[i] for i in peakind],
    color='red')
for i in peakind:
    print(t[i] + delay)
xlabel('t')
grid(True)
show()
Improving wave detection algorithm