The answer is wavelet design. In brief, sampling in frequency domain offers precise control over certain desired filtering properties and is often subject to less discretization error.
Discretization error: smoothness
Which is easier to misrepresent with uniform sampling?
Left is a Morlet of high center frequency, right its Fourier transform. We can imagine, a slight mis-step on left may severely misrepresent the waveform. To see this in action, we push the center frequency near Nyquist:
with black lines at sampling positions. Changing the positions a bit...
A drastic change. It's unlikely we'd spot the difference in sampling positions without close inspection; all that changed is endpoint=False -> True
. Alt perspective:
Filter control
Analyticity
Some applications demand strict analyticity (negative frequencies zero), and Morlet is pseudo-analytic: it leaks into negatives when near DC or Nyquist. A closed form time-domain expression for a strictly analytic Morlet wavelet does not exist; it is derived uniquely by setting negatives to zero and taking ifft
.
Sparsity, redundancy
A filterbank's redundancy is controlled by the overlap of its frequency-domain waveforms:
Left is low redundancy, right is high. Low redundancy is desired for classification, high for temporal localization. There's additionally an aggregate indicator of information flow in frequency domain that can inform filterbank corrections - Littlewood-Paley sum (see "Energy analysis" here).
There aren't such measures in time domain.
Inversion
There's no indication of whether the CWT will be invertible directly in time domain: we require that the filters tile the entire frequency axis. If some frequencies receive no coverage, they're lost completely.
Subsampling
Unaliased subsampling by a factor of k
requires that there are no non-zero
frequencies above 0.5/k
of sampling rate. Again no time-domain indication.
Disadvantage
For time-domain sampling, discretization error is greatest for highest frequencies - for freq-domain sampling, it's the reverse: we may end up with 1 sample to describe the entire wavelet, which is a common pitfall (it's a pure sine). Lower frequencies are better generated in time domain; further details here.
PyWavelets, Scipy
Have ill-designed filters; if we plot them in frequency domain, bandpassing near Nyquist leaks frequencies near DC, along other problems. I've not plotted them but this post proves it.
Update: revisiting this with more experience, I find that PyWavelets' wavelet generation is, put bluntly, catastrophic, and pywt.cwt
should be simply avoided. scipy
with morlet2
isn't terrible if we just want modulus and avoid frequencies near DC and Nyquist.
Alternative convolution?
Nothing such here; it's circular convolution. We guarantee equivalence with linear convolution by ensuring that "left doesn't draw from right", i.e. a wavelet's temporal support is sufficiently small (further discussion). Using boxcar for clarity to denote temporal support:
The reason for left-right padding is programming convenience; various non-zero schemes, like reflect
, are easier implemented. The resulting convolution is exactly the same as right padding, left padding, or any other arbitrary shift - it's inherent in circularity of DFT.
Why all same length?
Programmatic convenience and speed. However, latter can be greatly improved with overlap-add convolutions - at significant expense of former. Another reason is to have the same "reference frame" for designing frequency tiling - but the wavelets can be trimmed afterwards while preserving said tiling.