# Why is CWT implemented with FFT convolution?

Instead of padding $$x_1[n]$$ and $$x_2[n]$$ then taking

$$\text{iDFT}(\text{DFT}(x_1[n])\cdot\text{DFT}(x_2[n])), \tag{1}$$

assuming we know $$x_1(t)$$ and $$x_2(t)$$, and their FT's, what if we do

$$\text{iDFT}(\mathcal{F}(x_1)[n]\cdot\mathcal{F}(x_2)[n])) ,\tag{2}$$

where $$n$$ is longer and result is then trimmed?

It's what's used in Synchrosqueezing Wavelet Transform (pg 11-A) to implement CWT, which I'm porting to Python from an open-sourced MATLAB repo.

The clear advantage is, we're directly sampling the continuous, "exact" FT instead of working with DFT's, so we start off a "step closer" to finish in convolution theorem. The problem is, what about aliasing? Zero-padding is there because it's circular convolution. Instead it uses extension padding, then trims whatever it pads post-iDFT.

Comparing it against direct convolution, it seems to fare same, better, or worse in CWT, depending on signal. But I have no idea what it's doing or why it works; what's going on? Is this some alternative convolution theorem?

Update: This seems to be a discretized convolution theorem relying on an analytic wavelet with tight frequency-domain support and entirely zero for half its spectrum. In fact, zero-padding on both sides (not just right) does work. Though I'm still not exactly sure how time-domain aliasing is eliminated or suppressed into negligibility.

Update 2: I have the complete answer, can share upon request.

• I have more implementation analysis but rather not scare away answers; whatever I have doesn't explain why any of it is done and how it achieves 'better' results. – OverLordGoldDragon Oct 12 '20 at 15:35
• well, normally, the accepted mathematics is that the Fourier Transform is bijective or one-to-one with no unmapped "holes". So knowing $x(t) \quad \forall t$ or knowing $X(f) \triangleq \mathscr{F} \{ x(t) \} \quad \forall f$ are either sufficient as a complete description. if you were specified both $x(t)$ and $X(f)$, they better be exactly consistent with each other, otherwise you will have more problems. – robert bristow-johnson Oct 12 '20 at 23:59
• May not be worth writing a Q&A on boundary stuff, so I went with the other one. This time I'm nowhere near an answer, and may just ditch looking as it's probably some advanced math derivations. Answers are welcome. – OverLordGoldDragon Oct 16 '20 at 1:49
• O, this whole zero-padding thing as about one thing. it's because of the inherent periodicity of the DFT in a world where life is not necessarily circular. it's about how to use this circular tool do a linear task. – robert bristow-johnson Oct 16 '20 at 4:04
• @robertbristow-johnson This doesn't really tell me much - I invoke zero padding for its similarities with this method which may hint at an answer. Both extend then trim, apparently interpolating input spectra in the process. – OverLordGoldDragon Oct 16 '20 at 20:47