wavelet matrix rank select