1

By CWT, I mean the continuous wavelet transform. The usual padding schemes are zero padding, periodic padding, and decay padding.

If I adopt the periodic padding, can I avoid the edge effects for the periodic signal?

lennon310
  • 3,590
  • 19
  • 24
  • 27
Wang Yun
  • 124
  • 1
  • 13

1 Answers1

1

If I adopt the periodic padding, can I avoid the edge effects for the periodic signal?

Not necessarily. If your input length is N, then capturing every frequency from 0 to N//2 without boundary effects can require padding to up to 16*N.

That is the shortest length required for the largest scale wavelets to fully decay:

enter image description here

The top wavelet wraps on itself, which is a form of distortion, and changes convolution values. However, while it's still severe, periodic data indeed suffers the least from a lack of padding.

The minimal ideas with avoiding boundary effects is:

  1. Left shall not draw from right
  2. Wavelets fully decay
  3. (optional) Convolutions are energy-preserving

The advantage with zero padding is requiring the least padding of any padding to avoid boundary effects (unless other padding forms a periodic boundary); here I use a boxcar as wavelet to denote its decay bounds for clarity, and use zero padding for both cases:

enter image description here

The disadvantage is the greatest loss of energy of any padding; easy to see with x16 padding, only 1/16th of the largest wavelet will multiply with non-zero values. There are other pros/cons.

Lastly: not padding an exactly periodic input will spare all boundary effects if and only if the wavelet fully decays. In the general case, I recommend reflect padding: it can also be made periodic, without forming periodic's energy discontinuity for aperiodic inputs:

enter image description here

Further reading

  1. Pad logic + code
  2. Minimal center frequency (and what it means to "fully decay")
  3. Faster convolutions with large padding
OverLordGoldDragon
  • 8,912
  • 5
  • 23
  • 74