When computing the discrete wavelets up to a given scale
we use the inverse wavelet transform to do this. However, to
generate a wavelet within the range of a wavelet decomposition
you have to use more scales in the inverse wavelet transform
than first requested. This is because wavelet coefficients at
the coarsest scales are associated with wavelets whose support
is greater than the whole extent of the series. Hence, you
have to have a larger wavelet transform, with more levels, insert
a coefficient mid-level to generate a discrete wavelet whose
support lies entirely within the extent of the series. This
function figures out what the extra number of levels should be.