@@ -24,10 +24,9 @@ def next_fast_len(n):
2424 return 2 ** ceil (np .log2 (n ))
2525
2626
27- def cwt (data , scales , wavelet , sampling_period = 1. , method = 'conv' , axis = - 1 ):
27+ def cwt (data , scales , wavelet , sampling_period = 1. , method = 'conv' , axis = - 1 ,
28+ * , precision = 12 ):
2829 """
29- cwt(data, scales, wavelet)
30-
3130 One dimensional Continuous Wavelet Transform.
3231
3332 Parameters
@@ -60,6 +59,12 @@ def cwt(data, scales, wavelet, sampling_period=1., method='conv', axis=-1):
6059 axis: int, optional
6160 Axis over which to compute the CWT. If not given, the last axis is
6261 used.
62+ precision: int, optional
63+ Length of wavelet (``2 ** precision``) used to compute the CWT. Greater
64+ will increase resolution, especially for higher scales, but will
65+ compute a bit slower. Too low will distort coefficients and their
66+ norms, with a zipper-like effect. The default is 12, it's recommended
67+ to use >=12.
6368
6469 Returns
6570 -------
@@ -116,7 +121,7 @@ def cwt(data, scales, wavelet, sampling_period=1., method='conv', axis=-1):
116121
117122 dt_out = dt_cplx if wavelet .complex_cwt else dt
118123 out = np .empty ((np .size (scales ),) + data .shape , dtype = dt_out )
119- precision = 10
124+
120125 int_psi , x = integrate_wavelet (wavelet , precision = precision )
121126 int_psi = np .conj (int_psi ) if wavelet .complex_cwt else int_psi
122127
0 commit comments