
A query to the selected Sound object.
This command becomes available in the Query submenu when you select one Sound. Like most query commands, it is greyed out if you select two Sounds or more.
If you execute this command, Praat should write the energy of the selected Sound (in the time interval you are asking for) into the Info window. If the unit of sound amplitude is Pa (Pascal), the unit of energy will be Pa^{2}·s.
The energy is defined as
∫_{t1}^{t2} x^{2}(t) dt 
where x(t) is the amplitude of the sound. For stereo sounds, it is
∫_{t1}^{t2} (x^{2}(t) + y^{2}(t))/2 dt 
where x(t) and y(t) are the two channels; this definition, which averages (rather than sums) over the channels, ensures that if you convert a mono sound to a stereo sound, the energy will stay the same.
For an interpretation of the energy as the sound energy in air, see Sound: Get energy in air. For the power, see Sound: Get power....
In Praat, a Sound is defined only at a finite number of time points, spaced evenly. For instance, a threeseconds long Sound with a sampling frequency of 10 kHz is defined at 30,000 time points, which usually (e.g. when you create the Sound with Create Sound from formula...) lie at 0.00005, 0.00015, 0.00025 ... 2.99975, 2.99985 and 2.99995 seconds. The simple way Praat looks at this is that the first sample is centred around 0.00005 seconds, and the amplitude of that sample (x_{1}) represents x(t) for t between 0 and 0.00010 seconds. Likewise, the second sample is centred around 0.00015 seconds but can be said to run from 0.00010 to 0.00020 seconds, and the 30,000th and last sample is centred around 2.99995 seconds and its amplitude (x_{30000}) represents all times between 2.99990 and 3.00000 seconds. This example sound x(t) is therefore defined for all times between 0 and 3 seconds, but is undefined before 0 seconds or after 3 seconds.
The energy of the whole example sound is therefore
∫_{0}^{3} x^{2}(t) dt 
and we approximate this as a sum over all 30,000 samples:
∑_{i=1}^{30000} x_{i}^{2} Δt_{i} 
where Δt_{i} is the duration of the ith sample, i.e. 0.0001 seconds for every sample.
Now consider what happens if we want to know the energy between t_{1} = 0.00013 and t_{2} = 0.00054 seconds. The first sample of the sound falls entirely outside this interval; 70 percent of the second sample falls within the interval, namely the part from 0.00013 to 0.00020 seconds; all of the third, fourth and fifth samples fall within the interval; and 40 percent of the sixth sample falls within the interval, namely the part from 0.00050 to 0.00054 seconds (note that the centre of this sixth sample, which is at 0.00055 seconds, even lies outside the interval). The energy is then
∑_{i=2}^{6} x_{i}^{2} Δt_{i} 
where Δt_{3} = Δt_{4} = Δt_{5} = 0.0001 seconds, but Δt_{2} is only 0.00007 seconds (namely the part of the second sample that falls between t_{1} and t_{2}), and Δt_{6} is only 0.00004 seconds (namely the part of the sixth sample that falls between t_{1} and t_{2}).
This way of integrating the squared signal (technically, a Riemann sum over a partition [of the interval from t_{1} to t_{2}] that is regular everywhere except at the edges and has central tags everywhere except at the edges) ensures that the result is a continuous function of t_{1} and t_{2}, i.e., a very small change in t_{1} or t_{2} can only lead to a very small change in the computed energy (instead, simply summing over all samples whose centre falls between t_{1} and t_{2} would result instead in a sudden jump in the computed energy whenever t_{1} or t_{2} crosses a sample centre, which would be unphysical behaviour and therefore not how Praat should behave).
If the sound is not defined everywhere between t_{1} and t_{2}, then the energy is not defined there either. Those times are skipped in the integral.
© Paul Boersma 20210719