Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions pywt/_cwt.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,13 @@ def cwt(data, scales, wavelet, sampling_period=1., method='conv', axis=-1):
data = data.reshape((-1, data.shape[-1]))

for i, scale in enumerate(scales):
step = x[1] - x[0]
j = np.arange(scale * (x[-1] - x[0]) + 1) / (scale * step)
j = j.astype(int) # floor
if j[-1] >= int_psi.size:
j = np.extract(j < int_psi.size, j)
int_psi_scale = int_psi[j][::-1]
# Determine scale-dependent sampling instants
step = 1.0 / scale
xs = np.arange(x[0], x[-1]+0.01*step, step)
if xs[-1] > x[-1]:
xs = xs[:-1]
# Approximate values by linear interpolation
int_psi_scale = np.interp(xs, x, int_psi)[::-1]

if method == 'conv':
if data.ndim == 1:
Expand Down