Skip to content

Commit 2e606dc

Browse files
committed
TST: take conjugate of precomputed Matlab results from R2012a
1 parent 3edf0d1 commit 2e606dc

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

pywt/tests/test_matlab_compatibility_cwt.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ def _check_accuracy(data, w, scales, coefs, wavelet, epsilon):
147147
# PyWavelets result
148148
coefs_pywt, freq = pywt.cwt(data, scales, w)
149149

150+
# coefs from Matlab are from R2012a which is missing the complex conjugate
151+
# as shown in Eq. 2 of Torrence and Compo. We take the complex conjugate of
152+
# the precomputed Matlab result to account for this.
153+
coefs = np.conj(coefs)
154+
150155
# calculate error measures
151156
err = coefs_pywt - coefs
152157
rms = np.real(np.sqrt(np.mean(np.conj(err) * err)))

0 commit comments

Comments
 (0)