#### Locating harmonic peaks and valleys for vowel quality estimations

kyoon@...

Could anybody help me write a script to locate the harmonic peaks and
valleys of a spectrum object?
I need to get the frequency values (and their energy values) of
harmonic peaks and valleys to estimate vowel qualities following two
Korean coronal fricatives. Off the top of my head, it would be
possible to track the sign (plus or minus) of the slope of two
successive points (n - (n-1)) on a spectrum object, and if it reaches
zero (or a minus-signed slope value) after a series of plus-signed
slope values, then we know the spectral envelope has reaches its
first (or n_th) harmonic peak. If the slope value reaches zero (or a
plus-signed slope value) after a series of minus-signed values, then
we know it hit the harmonic valley frequency. By using branching
codes, one for harmonic peak frequency tracking and the other for
harmonic valley frequency tracking, one could get all the frequencies
of peaks and valleys. Does it make sense? The biggest problem for
me is how I can get access to each element of a spectrum object. I
could write an R script that will allow me to do the things that I
just described on a series of spectrum objects extracted using Praat,
but it appears, from Paul's response on my band energy question
earlier, that there is a way to access each element of a spectrum
object. Could Paul or anybody help me with this problem? I'd

Kyuchul Yoon
Linguistics Department
The Ohio State University
http://ling.ohio-state.edu/~kyoon/

Paul Boersma <paul.boersma@...>

Kyuchul Yoon wrote:

Could anybody help me write a script to locate the harmonic peaks and
valleys of a spectrum object?
The biggest problem for
me is how I can get access to each element of a spectrum object.
The Query submenu for a Spectrum object contains buttons labelled
"Get real value in bin..." and "Get imaginary value in bin...".

But the algorithm you describe is actually present in Praat, at least
for peaks. You select a Spectrum and choose "To Formant (peaks)...".
In order to get the valleys as well, you could proceed in the following
way:
1. Make every bin real-values by using the formula:
if row=1 then sqrt(self^2+self[2,col]^2) else 0 fi
2. Choose "To Formant (peaks)...". Should give the same result as before.
3. Invert the spectrum by using the formula:
1/(1+self)
This one is safe even if there are zeroes.
4. Choose "To Formant (peaks)..." again. Gives you the original valleys.

You can then query the resulting two Formant objects.

--

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