Acoustic shock is reduced by attenuating an input signal based on tones
detected through frequency domain analysis. The spectrum of the input
signal is obtained. A relative energy signal includes a plurality of
relative energy elements, each representing the relative energy in a
corresponding frequency bin of the input signal spectrum. A difference
signal includes a plurality of difference elements, each representing a
difference between a corresponding frequency bin value and an adjacent
frequency bin value. A plurality of detection signals are determined,
each detecting the presence of a sound element in the input signal based
on at least one of the relative energy signal and the difference signal.
The detection signals are combined to produce an attenuation signal for
attenuating the input signal.