converting Pa to dB in a spectrum object


Dear Praat creators and users,

How could I convert the energy unit of Pa(scal) to the
intensity unit dB for each bin of a spectrum object? There
is a query menu "Sound:Get intensity (dB)" for the whole
sound object, but there doesn't seem to be any way of
getting the intensity value for each bin of a spectrum
object. Could I apply a formula to a spectrum object? Then
could anybody tell me what the formula is?
Thank you very much.

Kyuchul Yoon
Linguistics Department
The Ohio State University

Paul Boersma <paul.boersma@...>

Kyuchul Yoon asked:
How could I convert the energy unit of Pa(scal) to the
intensity unit dB for each bin of a spectrum object?
The Spectrum object has values in Pascal/Hertz, not Pascal.
Pascal is the unit for air pressure, and appropriate for sound.

To compute something in dB, you first have to know a power
or a mean pressure.

To get the energy associated with a peak in a spectrum, one
cannot just take the bin that has the maximum value. One has
to integrate over the entire width of the peak. The values in a
Spectrum object are the real and imaginary values of the
complex-valued spectrum, so the first step is to square these
and sum them: re^2 + im^2. This gives a value in Pa^2/Hz^2.
You then integrate these values over the whole peak,
i.e. you sum all these squared values over the bins that fall within
the peak, and multiply by the bin width (which is the maximum
frequency in the Spectrum object divided by the number of bins
minus 1). Since the bin width is in Hertz, the result is a
quantity in Pa^2/Hz. This is equivalent with Pa^2.seconds,
i.e. the total energy in the peak.

Fortunately, you don't have to do all these computations yourself:
you can just use "Get band energy..." from the "Query" submenu.

To convert this to a power, you have to divide by the duration
of the original sound. You'll get a quantity in Pa^2, i.e.
Pascal-squared, and this is a good measure for the "power"
in the peak (for the actual power density in air, you divide by the
air density, which can be 1.14 kg/m^3, and by the sound
velocity, which can be 353 m/s, to obtain a quantity in Watt
per square metre).

If you take the square root of the "power", you'll get a quantity
in Pascal, which represents the root-mean-square air pressure.
This can be converted to dB:

rmsPressure_Pascal = sqrt (bandEnergy / duration)
intensity_dB = 20 * log10 (rmsPressure_Pascal / 2e-5)

This 0.00002 Pascal is considered to be the auditory threshold
for a sine wave with a frequency of 1000 Hz.

For a full understanding of this reasoning, one should know
something about mathematics (complex numbers, integration)
and physics (pressure, energy, power, densities),
which cannot be explained here.

Warning: the resulting values in dB only make sense if the
original Sound has been calibrated in Pascal, which is usually
not the case it the sound is the result of a recording.


Paul Boersma
Institute of Phonetic Sciences, University of Amsterdam
Herengracht 338, 1016CG Amsterdam, The Netherlands
phone +31-20-5252385