Usually, in speech recognition, the techniques that are used are based on the linear prediction model (Fant, 1960).

Parallel to this, the human speech production mechanism causes energy to drop across frequencies resulting in less information in the acoustic model. Especially, higher frequencies will have less energy compared to the lower ones, thus, getting poor results with the linear prediction model.

To cope with this, a high pass filter is applied on the signal in order to enhance these components and obtain a much evenly distributed spectrum. This is called the pre-emphasizing step.

I am working with Essentia (essentia.upf.edu) a library for audio analysis. I am using a pre-emphasize filter which is given by:

$x′(t)=x(t)−\alpha\times x(t−1)$

I construct a filter with the following parameters:

  • numerator = [1 0]
  • denominator = [1, $\alpha$], where $\alpha$ = 0.97

which correspond to the parameters of the transfer function in the Z domain of the above filter.

The following figure shows the spectrum of an audio frame (512 samples) and its filtered version.

Spectrum and its filtered version

I have two questions:

  • I am not seeing much enhancement in the high frequency components of the filtered spectrum, so is it looking like an expected result of this step (pre-emphasizing)?
  • How can I find an optimal cut-off frequency to design a more accurate filter? Is there, for example, a more robust pre-emphasizing technique that readjust the value of the cut-off frequency according to the frequency distribution of the given spectrum?

Here is the source code:

import essentia.standard as std

loader = std.MonoLoader(filename='../../data/audio.wav')
audio = loader()
f = std.FrameGenerator(audio, frameSize=512, hopSize=128, startFromZero=True)
s = std.Spectrum()
w = std.Windowing(type='hann')

specs = []
for frame in f:

filter = filter = std.IIR(denominator=[1, 0.97], numerator=[1, 0])

plot(specs[100], label="spectrum")
plot(filter(specs[100]), label="filtered spectrum")
legend(loc=1, borderaxespad=0.)
  • $\begingroup$ Looks to me like you're getting plenty of enhancement in the high frequencies. Try replotting on a log scale. $\endgroup$ – Dave Kielpinski Sep 8 '17 at 19:24
  • $\begingroup$ A discrete-time pre-emphasis filter is usually defined by the input/output relation $y[n]=x[n]-\alpha x[n-1]$, so your numerator coefficients are $[1,-\alpha]$, and your denominator is 1 (so it's a non-recursive filter). $\endgroup$ – Matt L. Sep 8 '17 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.