Algebraic codebook decoding (not tested yet)