Skip to content

Commit dee933f

Browse files
committedFeb 14, 2015
normalise the wavelet in Cd calc
I was using the form for the wavelet given in table 1 of TC98 and not the normalised form given in equation 6 (to give unit energy). This goes some way to fixing github issue #1.
1 parent 0286c3f commit dee933f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎wavelets/transform.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,6 @@ def compute_Cdelta(self):
497497

498498
real_sum = np.sum(W_d.real / s ** .5)
499499
C_d = real_sum * (dj * dt ** .5 / Y_00)
500-
# TODO: coming out as 0.26 for morlet
501500
return C_d
502501

503502
@property
@@ -506,12 +505,13 @@ def wavelet_transform_delta(self):
506505
507506
Returns an array of the transform computed over the scales.
508507
"""
509-
Y_ = self.wavelet.frequency # wavelet as f(w_k, s)
508+
Y_0 = self.wavelet.frequency # wavelet as f(w_k, s)
510509

511510
WK, S = np.meshgrid(self.w_k(), self.scales)
512511

513512
# compute Y_ over all s, w_k and sum over k
514-
W_d = (1 / self.N) * np.sum(Y_(WK, S), axis=1)
513+
norm = (2 * np.pi * S / self.dt) ** .5 # normalisation factor with dt=1
514+
W_d = (1 / self.N) * np.sum(norm * Y_0(WK, S), axis=1)
515515

516516
# N.B This W_d is 1D (defined only at n=0)
517517
return W_d

0 commit comments

Comments
 (0)
Failed to load comments.