Skip to main content

max_level

Function max_level 

Source
pub fn max_level(
    signal_len: usize,
    family: &WaveletFamily,
) -> Result<usize, FdarError>
Expand description

Maximum useful decomposition depth for a signal of length signal_len.

Returns floor(log2(signal_len / (filter_len - 1))), the deepest level at which the coarse approximation band still stays at least as long as the filter support — deeper decompositions would collapse a band below the filter length. For Haar (filter_len == 2) this is simply floor(log2(signal_len)).

§Errors

Returns FdarError::InvalidParameter if signal_len == 0, if family is an unsupported Daubechies order (surfaced via [filters::filter_bank]), or if the signal is too short to admit even a single useful level.