A method of searching a signed codebook to quantize a vector includes
weighting a shape codevector in a set of shape codevectors with a
weighting function for a Weighted Mean Square Error (WMSE) criteria, to
produce a weighted shape codevector. The method further includes
correlating the weighted shape codevector with the vector to produce a
weighted correlation term. The method also includes determining, based on
a sign of the weighted correlation term, a preferred one of a positive
and a negative signed codevector associated with the shape codevector.
The method further includes determining whether one of the signed
codevectors does not belong to an illegal space defining illegal vectors.