nickgeoca / cwt-tensorflow

Continuous wavelet transform (CWT) in tensorflow
Apache License 2.0
54 stars 15 forks source link

Wavelet might be reversed from convolution #1

Closed nickgeoca closed 7 years ago

nickgeoca commented 7 years ago

Trying to figure this out, but it looks like a convolution flips the kernel around. If this is the case, then this lib has a bug. It should flip the kernel around before it passes it to the convolution function, so it ends up correct. This did not appear as a bug because the Ricker wavelet is symmetric. I would like confirmation from a math guy.

The convolution is "t-b", while the CWT is "b-t". Note, this is confusing, but the "t" variable in the convolution is the "b" variable in the CWT.

Convolution equation CWT equation

nickgeoca commented 7 years ago

Also this..

Convolution kernel "g" flipped in upper left:

nickgeoca commented 7 years ago

Fixed - https://github.com/nickgeoca/cwt-tensorflow/blob/master/cwt.py#L83