# Convolution of Signal with a Wavelet

I know that the complex wavelet transform is given by $$\int_{-\infty}^{\infty}f(x)\psi^*_{s,u}(x)\,dx$$ where $f$ is the signal, $\psi_{s,u}(x)=\frac{1}{\sqrt{s}}\psi(\frac{x-u}{s})$ is the wavelet. and $^*$ denotes the complex conjugate operation.

If I have the wavelet $\psi_{s,u}$, which is represented by psi in MATLAB, and I want to compute the above integral. Which command should I use for computation in MATLAB?

conv(f,psi) or conv(f,conj(psi))?

since conj computes the complex conjugate of a vector? Thanks in advance!

The complex conjugate is applied in the frequency domain, which corresponds to flipping the signal backwards in the time domain. When you have $$f(x)\psi^*_{s,u}(x)$$ this is a multiplication in the frequency domain. Multiplication becomes convolution in the time domain. So you should use conv(f,fliplr(psi))

• The question is in the "Time Domain" not Frequency Domain. The conjugation in this case is the definition of Inner Product. Have a look on my answer. – Royi Aug 26 '18 at 6:36

The Conjugation is part of the definition of the Convolution as an Inner Product operation.
So you wrote the operation correctly.

Usually people uses "Real" Wavelets hence no need for that.

Anyhow, the definition is an inner product (Projecting the function onto the base of the wavelets) and it requires the conjugation operation.

• conv(f,psi) or conv(f,conj(psi))? – benxyzzy Sep 14 '18 at 15:03
• @benxyzzy, What do you mean? Do you have a case where f or psi is complex? – Royi Sep 14 '18 at 17:49
• Yes, real signal f but complex Morlet psi, as produced by cmorwavf(). Both are 1D over time. – benxyzzy Sep 15 '18 at 16:24

At least with MATLAB it seems you can simply run conv(signal, wavelet), which 'flips' the wavelet for you - compare xcorr(). Flipping in time is part of the definition of convolution (as previous responses have noted), and therefore implemented within MATLAB's function.

So for real signal and wavelet in time, conv(signal, fliplr(wavelet)) == xcorr(signal, wavelet). For real signals and complex wavelet however, conv(signal, conj(fliplr(cwavelet))) == xcorr(signal, cwavelet). By comparing convolution with cross-correlation in this way, the involvement of flipping and complex conjugation becomes apparent.

MATLAB say so themselves (wrt circular convolution) here: https://uk.mathworks.com/help/signal/ref/cconv.html#buzbj12