Debian Codegraph @

docs/manual/Voice_6__Automating_voice_analysis_with_a_script.html

raw
1 <html><head><meta name="robots" content="index,follow"><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
2 <title>Voice 6. Automating voice analysis with a script</title>
3 <style>
4 td { padding-left: 5pt; padding-right: 5pt; }
5 th { padding-left: 5pt; padding-right: 5pt; }
6 code { white-space: pre-wrap; }
7 dd { white-space: pre-wrap; }
8 </style>
9 </head><body bgcolor="#FFFFFF">
10
11 <table border=0 cellpadding=0 cellspacing=0><tr><td bgcolor="#CCCC00"><table border=4 cellpadding=9><tr><td align=middle bgcolor="#000000"><font face="Palatino,Times" size=6 color="#999900"><b>
12 Voice 6. Automating voice analysis with a script
13 </b></font></table></table>
14 <p>In a Praat script you usually do not want to raise a Sound window. Instead, you probably want to work with objects in the Objects window only. This page tells you how to do that for voice analysis.</p>
15 <h2>1. Creating the pulses in the Objects window</h2>
16 <p>The pulses you see as blue lines are a <a href="PointProcess.html">PointProcess</a> object. You can see this if you choose <b>Extract visible pulses</b> from the <b>Pulses</b> menu in the Sound window: a PointProcess object will appear in the list.</p>
17 <p>You can also create a PointProcess in the Objects window directly. To do this, select a Sound and choose <a href="Sound__To_PointProcess__periodic__cc____.html">Sound: To PointProcess (periodic, cc)...</a> from the <b>Periodicity</b> menu.</p>
18 <p>You can also do this in two steps. First you create a Pitch with <a href="Sound__To_Pitch__raw_autocorrelation____.html">Sound: To Pitch (raw autocorrelation)...</a> or <a href="Sound__To_Pitch__raw_cross-correlation____.html">Sound: To Pitch (raw cross-correlation)...</a>. Then you select the resulting Pitch <i>together</i> with the original Sound and choose <a href="Sound___Pitch__To_PointProcess__cc_.html">Sound & Pitch: To PointProcess (cc)</a>.</p>
19 <p>Since the direct method of <a href="Sound__To_PointProcess__periodic__cc____.html">Sound: To PointProcess (periodic, cc)...</a> actually uses the AC method for computing the Pitch (which is optimal for intonation analysis), you may prefer the two-step version if your goal is to do voice analysis. In that case, you use <a href="Sound__To_Pitch__raw_cc____.html">Sound: To Pitch (raw cc)...</a> as the first step, and <a href="Sound___Pitch__To_PointProcess__cc_.html">Sound & Pitch: To PointProcess (cc)</a> as the second step. This is also how the Sound window does it: if you choose <b>Optimize for voice analysis</b> in the <a href="Pitch_settings___.html">Pitch settings</a>, Praat uses <a href="Sound__To_Pitch__raw_cc____.html">Sound: To Pitch (raw cc)...</a> for pitch analysis.</p>
20 <p>What you should <i>not</i> do if you want to perform voice analysis is to create the PointProcess by selecting a Pitch only and then choosing <a href="Pitch__To_PointProcess.html">Pitch: To PointProcess</a>. In that way, the resulting pulses would not be aligned to the periods in the Sound.</p>
21 <h2>2. Measuring jitter from a script</h2>
22 <p>Once you have a PointProcess that represents the periods in the Sound, you can select it and choose some <b>Get jitter</b> commands from the <a href="Query_submenu.html">Query submenu</a>.</p>
23 <h2>3. Measuring shimmer from a script</h2>
24 <p>Once you have a PointProcess that represents the periods in the Sound, you can select it together with the Sound, then choose some <b>Get shimmer</b> commands from the <a href="Query_submenu.html">Query submenu</a>.</p>
25 <h2>4. Getting the whole voice report from a script</h2>
26 <p>If you select the Sound, the Pitch, and the PointProcess together (all three), there will be a button that says <b>Voice report...</b>. If you press it, the voice report will be written to the Info window. This is identical to the voice report in the Sound window, although you will have to specify the time range by manually typing it.</p>
27 <p>In a script, you can get the jitter and shimmer from the voice report by doing something like:</p>
28 <code> voiceReport$ = <b>Voice report:</b> 0, 0, 75, 500, 1.3, 1.6, 0.03, 0.45<br></code>
29 <code> jitter = <a href="_extractNumber_.html">extractNumber</a> (voiceReport$, “Jitter (local): ”)<br></code>
30 <code> shimmer = <a href="_extractNumber_.html">extractNumber</a> (voiceReport$, “Shimmer (local): ”)<br></code>
31 <code> <a href="_writeInfoLine_.html">writeInfoLine</a>: “Jitter = ”, percent$ (jitter, 3), “, shimmer = ”, <a href="_percent-S_.html">percent$</a> (shimmer, 3)<br></code>
32 <h2>5. Disadvantage of automating voice analysis</h2>
33 <p>In all the commands mentioned above, you have to guess the time range, and you would usually supply &#8220;0.0&#8221; and &#8220;0.0&#8221;, in which case you will get the average jitter and shimmer for the whole sound. This may include parts of the sound that you are often not interested in, such as false starts. You do not have these problems when asking for a voice report in the sound window, because there you would make an explicit time selection by hand after judging what part of the sound is relevant.</p>
34 <h3>Links to this page</h3>
35 <ul>
36 <li><a href="Voice.html">Voice</a>
37 <li><a href="Voice_2__Jitter.html">Voice 2. Jitter</a>
38 </ul>
39 <hr>
40 <address>
41 <p>© Paul Boersma 2005,2006,2014,2022,2023,2025</p>
42 </address>
43 </body>
44 </html>