max.level(n, L, boundary="periodic", base=2, decimate=T)
Otherwise (decimate=T), if the boundary rule is "periodic", max.level is computed as the largest value of m such that n/2^m is an integer greater than or equal to L.
If the boundary rule is "interval", max.level is computed as the largest value of m such that n/2^m is an integer greater than or equal to 3L-2.
and if any other boundary rule is chosen ("zero", "polynomial", "reflection", or "infinite"), max.level is computed as max.level = max( 0, log(n/L)+1 ) where log is base 2.
For cosine packet analysis, the max.level is computed by max.level(n, 4).