Re: Locating harmonic peaks and valleys for vowel quality estimations

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
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:
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
phone +31-20-5252385

Join to automatically receive all group messages.