This paper describes a quantitative model for signal processing in the auditory system. The model combines a series of preprocessing stages with an optimal detector as the decision device. The present paper gives a description of the various preprocessing stages and of the implementation of the optimal detector. The output of the preprocessing stages is a time-varying activity pattern to which "internal noise" is added. In the decision process, a stored temporal representation of the signal to be detected (template) is compared with the actual activity pattern. The comparison amounts to calculating the correlation between the two temporal patterns and is comparable to a "matched filtering" process. The detector itself derives the template at the beginning of each simulated threshold measurement from a suprathreshold value of the stimulus. The model allows one to estimate thresholds with the same signals and psychophysical procedures as those used in actual experiments. In the accompanying paper [Dau et al., J. Acoust. Soc. Am. 99, 3623-3631 (1996)] data obtained for human observers are compared with the optimal-detector model for various masking conditions.