Analysis-by-synthesis speech coders employ suitable weighting filters in order to perform noise shaping of the quantizing error in the output speech signal The subjective effect of quantizing noise can be reduced by modeling more precisely the "masking" phenomenon in the human auditory system. Starting from a simplified model of speech perception, we evaluated the "masking threshold", such that the noise frequency components below that threshold cannot be perceived by the human ear. As a second step, we substituted the weighting filter included in the excitation quantization loop of an analysis-by-synthesis scheme, with a filter having as frequency response the reciprocal of the masking threshold and a suitable phase. Informal listening tests demonstrated the ability of this model to substantially reduce the noise in the output speech, in spite of its simplicity.