# FRICATIVE AMPLITUDES # reads annotated sound file, extracts RMS, Intensity and harmonicity # for a specified class of fricatives (specification in 'f$') # in a specified file #enter the name of the files to be searched #and the directory they are in name$ = "fricatives" dir$ = ".\home\sounds\" #enter the name of the fricative to be searched f$ = "z"; #enter the maximal number of repetitions of the fricatives #to be found in the file max_fricatives = 10 Read from file... 'dir$''name$'.wav Read from file... 'dir$''name$'.TextGrid select Sound 'name$' Create TableOfReal... 'name$' 'max_fricatives' 5 Set column label (index)... 1 rep Set column label (index)... 2 rms_fric Set column label (index)... 3 intensity Set column label (index)... 4 harmonicity Set column label (index)... 5 noise_intensity select TextGrid 'name$' n = Get number of intervals... 1 #number of fricatives found: rep = 1 for i from 1 to n select TextGrid 'name$' a$ = Get label of interval... 1 'i' #if the interval contains the pre-specified fricative if a$ = f$ t1 = Get starting point... 1 'i' t2 = Get end point... 1 'i' select Sound 'name$' #Get power fr = Get root-mean-square... 't1' 't2' Extract part... 't1' 't2' Rectangular 1 no Rename... temp int_dB = Get intensity (dB) #calculate intensity caused by vocal fold vibration To Harmonicity (cc)... 0.01 75 0.1 1 harm = Get mean... 0 0 select Sound temp plus Harmonicity temp Remove #calculate noise intensity following: #Kissine, Van de Velde, & van Hout (2003), Linguistics in the Netherlands, 93-104 noise_int = (10^('int_dB'/10))/(1 + 10^('harm'/10) ) noise_int = 10* log10('noise_int') select TableOfReal 'name$' Set row label (index)... 1 'name$' Set value... 'rep' 1 'rep' Set value... 'rep' 2 'fr' Set value... 'rep' 3 'int_dB' Set value... 'rep' 4 'harm' Set value... 'rep' 5 'noise_int' rep = rep + 1 endif endfor select TableOfReal 'name$' Write to text file... 'dir$''name$'.txt