Topics

Intensity measures

rachel@...
 

Hi all,
I have speech data from 7-9 year old children whose loudness I want
to measure. I've gotten the max Intensity, but was hoping to collect
several relative maxima per sound file (each file is a short multi-
word utterance, usually about 1.4 seconds of speech).
The best (but still not so great) solutions I could come up with were:
- divide the file into a number of segments, let's say 3 if I wanted
three maxima, and ask for max Intens on each segment. advantage is
that it's easy to program, disadvantage is that it's
linguistically/acoustically ignorant, so doesn't really get me the
three highest values...
- phonetically label the files, then take a max for each vowel.
advantage is that it'd be lovely clean linguistically informed data,
disadvantage is that I have so much data, transcribing it would take
prohibitively long.
- hand-gather data. again, I'm looking to automate this because of
the size of the data set.

So, I'm looking for some clever way in Praat to get not only the
highest Intensity value, but the two runners-up as well...? Any
suggestions/thoughts on the matter would be very welcome!

Thanks,
Rachel Coulston
rachel@...

Paul Boersma <paul.boersma@...>
 

This has the disadvantage that it would pick up every local maximum so
it would probably be a good idea to smooth the intensity curve first.
No need, though, to do the Intensity-Matrix-Pitch conversion hack.
The intensity contour will be rather smooth if you decrease the minimum
pitch parameter, i.e. instead of

To Intensity... 50 0
you just do

To Intensity... 10 0.01

This gives a really smooth intensity curve (640-ms Kaiser-20 window,
6 dB length 230 ms) in 10-ms steps.

--

Paul Boersma
Institute of Phonetic Sciences, University of Amsterdam
Herengracht 338, 1016CG Amsterdam, The Netherlands
http://www.fon.hum.uva.nl/paul/
phone +31-20-5252385

Daniel Hirst <daniel.hirst@...>
 

Rachel,

You could use a simple script like this to pick up the local maxima of
the intensity curve:
(assuming that a sound is selected)

###########
To Intensity... 50 0
clearinfo
nframes = Get number of frames
last_value = 0
current_value = Get value in frame... 1

for i from 2 to nframes
next_value = Get value in frame... 'i'
if (current_value > next_value) and (current_value > last_value)
secs = Get time from frame... 'i'-1
printline 'secs''tab$''current_value'
endif
last_value = current_value
current_value = next_value
endfor

if current_value > last_value
secs = Get time from frame... 'i'-1
printline 'secs''tab$''current_value'
endif
###########

And you will have a list of time values in seconds and correponding
intensity peaks in the info window.

This has the disadvantage that it would pick up every local maximum so
it would probably be a good idea to smooth the intensity curve first.
Rather than write a new script to do that you could make use of the fact
that there is a built-in function in Praat to smooth F0 curves so you
could add (just after To Intensity... 50):

#########
Down to Matrix
To Pitch
Smooth... 10
To Matrix
To Intensity
##########


and you would then get smoothed peaks. You might want to experiment with
different values for smoothing.

If you really only want the top three values it would be or course very
simple to add that to the script but it would probably be a good idea to
expermiment a little with this script first before reducing your data
too much.

best of luck

Daniel

---------------------------------------------------------------
Laboratoire Parole et Langage, CNRS, Universit de Provence

Equipe Prosodie et Reprsentation Formelle du Langage
29 Avenue Schuman, 13621 Aix-en-Provence cedex 1 FRANCE
tel:+33 4 4295 3628 secr:+33 4 4295 3634 fax: +33 4 4259 5096
web: http://www.lpl.univ-aix.fr/~hirst
---------------------------------------------------------------
If (you are interested in Speech Prosody) {
subscribe to the SProSIG list;
} # http://www.egroups.com/group/sprosig/
---------------------------------------------------------------

Paul Boersma <paul.boersma@...>
 

Rachel Coulston wrote:
So, I'm looking for some clever way in Praat to get not only the
highest Intensity value, but the two runners-up as well...? Any
suggestions/thoughts on the matter would be very welcome!
Daniel Hirst's solution has the disadvantage that the time resolution
equals the time step in the intensity analysis. Parabolic interpolation
improves the time accuracy by a factor of a hundred or so.

In Praat 3.9.34, therefore, I created a button labelled

To IntensityTier (peaks)

which is visible if you select an Intensity object. This gives you the
locations and heights of the local maxima in the intensity contour.
You can convert this IntensityTier into a TableOfReal,
which you can sort by the second column (i.e. the intensity values in dB).
If you draw this TableOfReal to the Picture window,
you will see the three highest values at the bottom.
To automatize, with nicely formatted output and with protection against
cases with fewer than three peaks, use the following script:

# First select a Sound.
# Then compute a smooth intensity contour in steps of 0.01 seconds:
To Intensity... 10 0.01
# Then find the peaks:
To IntensityTier (peaks)
# Convert to a table with time-intensity pairs:
Down to TableOfReal
# Sort by intensity:
Sort by column... 2 1
# Get the three highest values:
numberOfPeaks = Get number of rows
# Report the result:
echo The highest intensity peaks:
if numberOfPeaks >= 1
peak = Get value... numberOfPeaks 2
time = Get value... numberOfPeaks 1
printline Highest peak: 'peak:3' dB at 'time:6' seconds
endif
if numberOfPeaks >= 2
peak = Get value... numberOfPeaks-1 2
time = Get value... numberOfPeaks-1 1
printline Second highest peak: 'peak:3' dB at 'time:6' seconds
endif
if numberOfPeaks >= 3
peak = Get value... numberOfPeaks-2 2
time = Get value... numberOfPeaks-2 1
printline Third highest peak: 'peak:3' dB at 'time:6' seconds
endif
--

Paul Boersma
Institute of Phonetic Sciences, University of Amsterdam
Herengracht 338, 1016CG Amsterdam, The Netherlands
http://www.fon.hum.uva.nl/paul/
phone +31-20-5252385