def compare_cwt():
"""Compare the output of Scipy's cwt (using direct convolution)
and my cwt (using fft convolution).
"""
cwt = scipy.signal.cwt
fft_cwt = wavelets.cwt
data = np.random.random(2000)
wave_anal = WaveletAnalysis(data, wavelet=wavelets.Ricker())
widths = wave_anal.scales[::-1]
morlet = scipy.signal.morlet
cwt = cwt(data, morlet, widths)
fft_cwt = fft_cwt(data, morlet, widths)
npt.assert_array_almost_equal(cwt, fft_cwt, decimal=13)
评论列表
文章目录