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:
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.