def mul_subbandwise(wavelet, scalars):
    """Multiply each subband of a wavelet by a scalar.

    Args:
        wavelet (Wavelet): a wavelet.
        scalars (list of float): list of scalars to multiply the wavelet. The length of scalars
            must match the number of wavelet subbands.

    Returns:
        result (Wavelet): scalars * wavelet subband-wise.
    """
    result = wavelet.copy()
    result.coeff[0] *= scalars[0]
    idx = 1
    for i in range(1, len(result.coeff)):
        for j in range(len(result.coeff[i])):
            result.coeff[i][j] *= scalars[idx]
            idx += 1
    return result