# wavelet transform boundary

I am doing 1D wavelet decomposition and I am particularly interested in parts at the border of the signal. These parts are affected by boundary effects. I know that some of the methods to extend the signal are periodic and reflexion, but none of these solutions are acceptable in my case. I would like to extend the signal by the value at the border (something a bit like zero padding, but with a non zero value)

Does something like this has already been tested for wavelets?

• There is no reason why it should not work. In contrast to symmetric or periodic extensions, the number of required coefficients around the bondaries will increase. – DaBler Dec 18 '16 at 19:38
• what do you mean by "the number of required coefficients around the bondaries will increase"? Do you think it is a good idea? – RockScience Dec 19 '16 at 2:37
• Consider, e.g., the discrete wavelet transform. When properly using the symmetric or periodic extensions, the number of coefficients required to reconstruct the signal is the same as the number of signal samples. In contrast to these extensions, when using the constant extension, the number of required coefficients around the boundaries slightly increases. – DaBler Dec 19 '16 at 21:30

To better extend the signal at the border, you can consider a constant extension: $[x_0,x_1,x_2]$ can be extended to the left (and similarly to the right) as $[x_0,x_0,x_0,x_1,x_2]$. However, this tends to break the slope, as it assumes a zero-derivative (flat signal).

A more advanced option resides in anti-symmetric extensions: they are sometimes called whole-sample or half-sample extensions, the two main options are:

$$[2x_0-x_2,2x_0-x_1,x_0,x_1,x_2]$$ and $$[2x_0-x_2,2x_0-x_1,x_0,x_0,x_1,x_2]$$ In other words, the average of the extreme points is $x_0$. This better respects derivatives in low noise conditions. Other types of extrapolation exist, more ad hoc (linear or parabolic fits), but may help. In the Matlab wavelet toolbox, Border Effects are described, and some Discrete wavelet transform extension modes are:

• 'asym' or 'asymh': Antisymmetric-padding (half-point): boundary value antisymmetric replication
• 'asymw': Antisymmetric-padding (whole-point): boundary value antisymmetric replication
• 'spd' or 'sp1': Smooth-padding of order 1 (first derivative interpolation at the edges)
• 'sp0': Smooth-padding of order 0 (constant extension at the edges)

As said by @DaBler, such extrapolations may require an increase in the transformed coefficients but:

• for mere processing, you can crop the extended parts afterward,
• there exists symmetric/antisymmetric filter-banks (e.g. $M$-band wavelets, $M >3$ and even) for which the extension can be made non-expansive.

Aside, if you really care about signals close to the border, you should take care of the sub-sampling, and possibly avoid it, as you cannot afford loosing samples. And more importantly, make sure that your wavelet is (close to) symmetric as well, unless you can lose the positive effect of your extension.

Finally, wavelets build on the interval adapt the wavelet size close to the border.