added vocal tremor

This commit is contained in:
Vidya Koesmahargyo
2020-11-18 23:33:30 -05:00
parent 82f2830a47
commit f9f5b4ec5f
9 changed files with 663 additions and 105 deletions

View File

@@ -1,9 +1,9 @@
derive_feature:
#DBM Feature Group
FEATURE_GROUP: ['FAC_ASYM', 'FAC_AU', 'FAC_EXP', 'FAC_LMK', 'ACO_INT', 'ACO_FF', 'ACO_HNR', 'ACO_GNE', 'ACO_FM',
'ACO_JITTER','ACO_SHIMMER', 'ACO_PAUSE', 'ACO_VFS', 'ACO_MFCC', 'MOV_HM', 'MOV_HP', 'EYE_BLINK']
FEATURE_GROUP: ['FAC_ASYM', 'FAC_AU', 'FAC_EXP', 'FAC_LMK', 'ACO_INT', 'ACO_FF', 'ACO_HNR', 'ACO_GNE', 'ACO_FM',
'ACO_JITTER','ACO_SHIMMER', 'ACO_PAUSE', 'ACO_VFS', 'ACO_MFCC', 'MOV_HM', 'MOV_HP', 'EYE_BLINK', 'MOV_VT']
#Feature group output file extensions
FAC_ASYM_LOC: _facasym
FAC_AU_LOC: _facau
@@ -22,31 +22,33 @@ derive_feature:
MOV_HM_LOC: _headmov
MOV_HP_LOC: _headpose
EYE_BLINK_LOC: _eyeblinks
MOV_VT_LOC: _vtremor
#Facial category feature group
FAC_ASYM: ['fac_AsymMaskMouth', 'fac_AsymMaskEyebrow', 'fac_AsymMaskEye', 'fac_AsymMaskCom']
FAC_AU: ['fac_AU01int', 'fac_AU02int', 'fac_AU04int', 'fac_AU05int', 'fac_AU06int', 'fac_AU07int', 'fac_AU09int',
'fac_AU10int', 'fac_AU12int', 'fac_AU14int', 'fac_AU15int', 'fac_AU17int', 'fac_AU20int', 'fac_AU23int',
'fac_AU25int', 'fac_AU26int', 'fac_AU45int', 'fac_AU01pres', 'fac_AU02pres', 'fac_AU04pres', 'fac_AU05pres',
'fac_AU06pres', 'fac_AU07pres', 'fac_AU09pres', 'fac_AU10pres', 'fac_AU12pres', 'fac_AU14pres', 'fac_AU15pres',
FAC_AU: ['fac_AU01int', 'fac_AU02int', 'fac_AU04int', 'fac_AU05int', 'fac_AU06int', 'fac_AU07int', 'fac_AU09int',
'fac_AU10int', 'fac_AU12int', 'fac_AU14int', 'fac_AU15int', 'fac_AU17int', 'fac_AU20int', 'fac_AU23int',
'fac_AU25int', 'fac_AU26int', 'fac_AU45int', 'fac_AU01pres', 'fac_AU02pres', 'fac_AU04pres', 'fac_AU05pres',
'fac_AU06pres', 'fac_AU07pres', 'fac_AU09pres', 'fac_AU10pres', 'fac_AU12pres', 'fac_AU14pres', 'fac_AU15pres',
'fac_AU17pres', 'fac_AU20pres', 'fac_AU23pres', 'fac_AU25pres', 'fac_AU26pres', 'fac_AU28pres', 'fac_AU45pres']
FAC_EXP: ['hap_exp', 'sad_exp', 'sur_exp', 'fea_exp', 'ang_exp', 'dis_exp', 'con_exp', 'happ_occ', 'sad_occ',
'sur_occ', 'fea_occ', 'ang_occ', 'dis_occ', 'con_occ', 'pos_exp', 'neg_exp', 'com_exp', 'hap_exp_full',
'sad_exp_full', 'sur_exp_full','fea_exp_full', 'ang_exp_full', 'dis_exp_full', 'con_exp_full', 'pos_exp_full',
'neg_exp_full', 'com_exp_full']
FAC_LMK: ['fac_LMK00disp', 'fac_LMK01disp', 'fac_LMK02disp', 'fac_LMK03disp', 'fac_LMK04disp',
'fac_LMK05disp', 'fac_LMK06disp', 'fac_LMK07disp', 'fac_LMK08disp', 'fac_LMK09disp', 'fac_LMK10disp',
'fac_LMK11disp', 'fac_LMK12disp', 'fac_LMK13disp', 'fac_LMK14disp', 'fac_LMK15disp', 'fac_LMK16disp',
'fac_LMK17disp', 'fac_LMK18disp', 'fac_LMK19disp', 'fac_LMK20disp', 'fac_LMK21disp', 'fac_LMK22disp',
'fac_LMK23disp', 'fac_LMK24disp', 'fac_LMK25disp', 'fac_LMK26disp', 'fac_LMK27disp', 'fac_LMK28disp',
'fac_LMK29disp', 'fac_LMK30disp', 'fac_LMK31disp', 'fac_LMK32disp', 'fac_LMK33disp', 'fac_LMK34disp',
'fac_LMK35disp', 'fac_LMK36disp', 'fac_LMK37disp', 'fac_LMK38disp', 'fac_LMK39disp', 'fac_LMK40disp',
'fac_LMK41disp', 'fac_LMK42disp', 'fac_LMK43disp', 'fac_LMK44disp', 'fac_LMK45disp', 'fac_LMK46disp',
'fac_LMK47disp', 'fac_LMK48disp', 'fac_LMK49disp', 'fac_LMK50disp', 'fac_LMK51disp', 'fac_LMK52disp',
'fac_LMK53disp', 'fac_LMK54disp', 'fac_LMK55disp', 'fac_LMK56disp', 'fac_LMK57disp', 'fac_LMK58disp',
'fac_LMK59disp', 'fac_LMK60disp', 'fac_LMK61disp', 'fac_LMK62disp', 'fac_LMK63disp', 'fac_LMK64disp',
FAC_LMK: ['fac_LMK00disp', 'fac_LMK01disp', 'fac_LMK02disp', 'fac_LMK03disp', 'fac_LMK04disp',
'fac_LMK05disp', 'fac_LMK06disp', 'fac_LMK07disp', 'fac_LMK08disp', 'fac_LMK09disp', 'fac_LMK10disp',
'fac_LMK11disp', 'fac_LMK12disp', 'fac_LMK13disp', 'fac_LMK14disp', 'fac_LMK15disp', 'fac_LMK16disp',
'fac_LMK17disp', 'fac_LMK18disp', 'fac_LMK19disp', 'fac_LMK20disp', 'fac_LMK21disp', 'fac_LMK22disp',
'fac_LMK23disp', 'fac_LMK24disp', 'fac_LMK25disp', 'fac_LMK26disp', 'fac_LMK27disp', 'fac_LMK28disp',
'fac_LMK29disp', 'fac_LMK30disp', 'fac_LMK31disp', 'fac_LMK32disp', 'fac_LMK33disp', 'fac_LMK34disp',
'fac_LMK35disp', 'fac_LMK36disp', 'fac_LMK37disp', 'fac_LMK38disp', 'fac_LMK39disp', 'fac_LMK40disp',
'fac_LMK41disp', 'fac_LMK42disp', 'fac_LMK43disp', 'fac_LMK44disp', 'fac_LMK45disp', 'fac_LMK46disp',
'fac_LMK47disp', 'fac_LMK48disp', 'fac_LMK49disp', 'fac_LMK50disp', 'fac_LMK51disp', 'fac_LMK52disp',
'fac_LMK53disp', 'fac_LMK54disp', 'fac_LMK55disp', 'fac_LMK56disp', 'fac_LMK57disp', 'fac_LMK58disp',
'fac_LMK59disp', 'fac_LMK60disp', 'fac_LMK61disp', 'fac_LMK62disp', 'fac_LMK63disp', 'fac_LMK64disp',
'fac_LMK65disp', 'fac_LMK66disp', 'fac_LMK67disp']
#Acoustic category feature group
ACO_INT: ['aco_int']
ACO_FF: ['aco_ff']
@@ -59,19 +61,21 @@ derive_feature:
ACO_VFS: ['aco_voicePct']
ACO_MFCC: ['aco_mfcc1','aco_mfcc2','aco_mfcc3','aco_mfcc4','aco_mfcc5','aco_mfcc6','aco_mfcc7','aco_mfcc8','aco_mfcc9',
'aco_mfcc10','aco_mfcc11','aco_mfcc12']
#Movement category feature group
MOV_HM: ['head_vel']
MOV_HP: ['mov_Hpose_Dist','mov_Hpose_Pitch','mov_Hpose_Yaw','mov_Hpose_Roll']
EYE_BLINK: ['mov_blink_ear', 'vid_dur', 'mov_blinkdur']
MOV_VT: ['mov_freq_trem_freq', 'mov_freq_trem_index', 'mov_freq_trem_pindex', 'mov_amp_trem_freq',
'mov_amp_trem_index', 'mov_amp_trem_pindex']
#Calculation for variables
# Facial Asymmetry
fac_AsymMaskMouth: ['mean', 'std']
fac_AsymMaskEyebrow: ['mean', 'std']
fac_AsymMaskEye: ['mean', 'std']
fac_AsymMaskCom: ['mean', 'std']
#Facial Action Unit
fac_AU01int: ['mean', 'std']
fac_AU02int: ['mean', 'std']
@@ -103,12 +107,12 @@ derive_feature:
fac_AU15pres: ['pct']
fac_AU17pres: ['pct']
fac_AU20pres: ['pct']
fac_AU23pres: ['pct']
fac_AU23pres: ['pct']
fac_AU25pres: ['pct']
fac_AU26pres: ['pct']
fac_AU28pres: ['pct']
fac_AU45pres: ['pct']
#Facial Expressivity
hap_exp: ['mean', 'std']
sad_exp: ['mean', 'std']
@@ -129,7 +133,7 @@ derive_feature:
neu_exp: ['mean', 'std', 'pct']
com_exp: ['mean', 'std', 'pct']
hap_exp_full: ['mean', 'std']
sad_exp_full: ['mean', 'std']
sad_exp_full: ['mean', 'std']
sur_exp_full: ['mean', 'std']
fea_exp_full: ['mean', 'std']
ang_exp_full: ['mean', 'std']
@@ -139,7 +143,7 @@ derive_feature:
neg_exp_full: ['mean', 'std']
neu_exp_full: ['mean', 'std']
com_exp_full: ['mean', 'std']
#Facial Landmarks
fac_LMK00disp: ['mean', 'std']
fac_LMK01disp: ['mean', 'std']
@@ -151,7 +155,7 @@ derive_feature:
fac_LMK07disp: ['mean', 'std']
fac_LMK08disp: ['mean', 'std']
fac_LMK09disp: ['mean', 'std']
fac_LMK10disp: ['mean', 'std']
fac_LMK10disp: ['mean', 'std']
fac_LMK11disp: ['mean', 'std']
fac_LMK12disp: ['mean', 'std']
fac_LMK13disp: ['mean', 'std']
@@ -163,22 +167,22 @@ derive_feature:
fac_LMK19disp: ['mean', 'std']
fac_LMK20disp: ['mean', 'std']
fac_LMK21disp: ['mean', 'std']
fac_LMK22disp: ['mean', 'std']
fac_LMK22disp: ['mean', 'std']
fac_LMK23disp: ['mean', 'std']
fac_LMK24disp: ['mean', 'std']
fac_LMK25disp: ['mean', 'std']
fac_LMK26disp: ['mean', 'std']
fac_LMK27disp: ['mean', 'std']
fac_LMK28disp: ['mean', 'std']
fac_LMK29disp: ['mean', 'std']
fac_LMK29disp: ['mean', 'std']
fac_LMK30disp: ['mean', 'std']
fac_LMK31disp: ['mean', 'std']
fac_LMK32disp: ['mean', 'std']
fac_LMK33disp: ['mean', 'std']
fac_LMK34disp: ['mean', 'std']
fac_LMK34disp: ['mean', 'std']
fac_LMK35disp: ['mean', 'std']
fac_LMK36disp: ['mean', 'std']
fac_LMK37disp: ['mean', 'std']
fac_LMK37disp: ['mean', 'std']
fac_LMK38disp: ['mean', 'std']
fac_LMK39disp: ['mean', 'std']
fac_LMK40disp: ['mean', 'std']
@@ -193,7 +197,7 @@ derive_feature:
fac_LMK49disp: ['mean', 'std']
fac_LMK50disp: ['mean', 'std']
fac_LMK51disp: ['mean', 'std']
fac_LMK52disp: ['mean', 'std']
fac_LMK52disp: ['mean', 'std']
fac_LMK53disp: ['mean', 'std']
fac_LMK54disp: ['mean', 'std']
fac_LMK55disp: ['mean', 'std']
@@ -209,7 +213,7 @@ derive_feature:
fac_LMK65disp: ['mean', 'std']
fac_LMK66disp: ['mean', 'std']
fac_LMK67disp: ['mean', 'std']
#Acoustic feature
aco_int: ['mean', 'std', 'range']
aco_ff: ['mean', 'std', 'range']
@@ -238,7 +242,7 @@ derive_feature:
aco_mfcc10: ['mean']
aco_mfcc11: ['mean']
aco_mfcc12: ['mean']
#Movement feature
head_vel: ['mean', 'std']
mov_Hpose_Dist: ['mean', 'std']
@@ -248,3 +252,9 @@ derive_feature:
mov_blink_ear: ['mean', 'std']
vid_dur: ['count']
mov_blinkdur: ['mean', 'std']
mov_freq_trem_freq: ['mean']
mov_freq_trem_index: ['mean']
mov_freq_trem_pindex: ['mean']
mov_amp_trem_freq: ['mean']
mov_amp_trem_index: ['mean']
mov_amp_trem_pindex: ['mean']

View File

@@ -1,11 +1,11 @@
raw_feature:
#error reason
error_reason: error_reason
#Output range
mov_headvel_start: 0
mov_headvel_end: 200
#Facial markers
hap_exp: fac_hapintsoft
sad_exp: fac_sadintsoft
@@ -38,13 +38,13 @@ raw_feature:
neu_exp_full: neu_exp_full
cai_exp_full: cai_exp_full
com_exp_full: fac_cominthard
#Facial asymmetry
fac_AsymMaskMouth: fac_asymmaskmouth
fac_AsymMaskEye: fac_asymmaskeye
fac_AsymMaskEyebrow: fac_asymmaskeyebrow
fac_AsymMaskCom: fac_asymmaskcom
#Facial landmark
fac_LMK00disp: fac_LMK00disp
fac_LMK01disp: fac_LMK01disp
@@ -114,7 +114,7 @@ raw_feature:
fac_LMK65disp: fac_LMK65disp
fac_LMK66disp: fac_LMK66disp
fac_LMK67disp: fac_LMK67disp
#Facial action unit
fac_AU01int: fac_AU01int
fac_AU02int: fac_AU02int
@@ -151,7 +151,7 @@ raw_feature:
fac_AU26pres: fac_AU26pres
fac_AU28pres: fac_AU28pres
fac_AU45pres: fac_AU45pres
#Verbal markers
aco_int: aco_int
aco_ff: aco_ff
@@ -184,7 +184,7 @@ raw_feature:
aco_speakingtime: aco_speakingtime
aco_numpauses: aco_numpauses
aco_pausefrac: aco_pausefrac
#Movement markers
head_vel: mov_headvel
mov_blink_ear: mov_blink_ear
@@ -196,3 +196,18 @@ raw_feature:
mov_Hpose_Yaw: mov_hposeyaw
mov_Hpose_Roll: mov_hposeroll
mov_Hpose_Dist: mov_hposedist
mov_freq_trem_freq: mov_freqtremfreq
mov_freq_trem_index: mov_freqtremindex
mov_freq_trem_pindex: mov_freqtrempindex
mov_amp_trem_freq: mov_amptremfreq
mov_amp_trem_index: mov_amptremindex
mov_amp_trem_pindex: mov_amptrempindex
fac_tremor_median_5: fac_tremor_median_5
fac_tremor_median_12: fac_tremor_median_12
fac_tremor_median_8: fac_tremor_median_8
fac_tremor_median_48: fac_tremor_median_48
fac_tremor_median_54: fac_tremor_median_54
fac_tremor_median_28: fac_tremor_median_28
fac_tremor_median_51: fac_tremor_median_51
fac_tremor_median_66: fac_tremor_median_66
fac_tremor_median_57: fac_tremor_median_57

View File

@@ -0,0 +1,422 @@
######################################
# Global Settings
######################################
sourcedirec$ = "./"; directory of sounds to be analyzed
minPi = 60; minimal Pitch [Hz]
maxPi = 350; maximal Pitch [Hz]
ts = 0.015; analysis time step [s]
tremthresh = 0.15; minimal autocorr.-coefficient to assume "tremor"
minTr = 1.5; minimal tremor frequency [Hz]
maxTr = 15; maximal tremor frequency [Hz]
######################################
# Sound (.wav) in, results (.txt) out
######################################
# record/load and select the sound to be analyzed!!!
info$ = Info
name$ = extractWord$(info$, "Object name: ")
slength = Get total duration
call ftrem
call atrem
echo
...{"FTrF": 'ftrf:2#', "ATrF":'atrf:2',"FTrI":'ftri:3',"ATrI":'atri:3',"FTrP":'ftrp:3',"ATrP":'atrp:3'}
######################################
# Frequency Tremor Analysis
######################################
procedure ftrem
To Pitch (cc)... ts minPi 15 yes 0.03 0.3 0.01 0.35 0.14 maxPi
#Edit
#pause
# because PRAAT only runs "Subtract linear fit" if the last frame is "voiceless" (!?):
# numberOfFrames+1 (1)
numberOfFrames = Get number of frames
x1 = Get time from frame number... 1
am_F0 = Get mean... 0 0 Hertz
Create Matrix... ftrem_0 0 slength numberOfFrames+1 ts x1 1 1 1 1 1 0
for i from 1 to numberOfFrames
select Pitch 'name$'
f0 = Get value in frame... i Hertz
select Matrix ftrem_0
# write zeros to matrix where frames are voiceless
if f0 = undefined
Set value... 1 i 0
else
Set value... 1 i f0
endif
endfor
# remove the linear F0 trend (F0 declination)
To Pitch
Subtract linear fit... Hertz
Rename... ftrem_0_lin
# undo (1)
Create Matrix... ftrem 0 slength numberOfFrames ts x1 1 1 1 1 1 0
for i from 1 to numberOfFrames
select Pitch ftrem_0_lin
f0 = Get value in frame... i Hertz
select Matrix ftrem
# write zeros to matrix where frames are voiceless
if f0 = undefined
Set value... 1 i 0
else
Set value... 1 i f0
endif
endfor
To Pitch
# normalize F0-contour by mean F0
select Matrix ftrem
Formula... (self-am_F0)/am_F0
# since zeros in the Matrix (unvoiced frames) become normalized to -1 but
# unvoiced frames should be zero (if anything)
# write zeros to matrix where frames are voiceless
for i from 1 to numberOfFrames
select Pitch ftrem
f0 = Get value in frame... i Hertz
if f0 = undefined
select Matrix ftrem
Set value... 1 i 0
endif
endfor
# to calculate autocorrelation (cc-method):
select Matrix ftrem
To Sound (slice)... 1
# calculate Frequency of Frequency Tremor [Hz]
To Pitch (cc)... slength minTr 15 yes 0.01 tremthresh 0.01 0.35 0.14 maxTr
Rename... ftrem_norm
ftrf = Get mean... 0 0 Hertz
# calculate Intensity Index of Frequency Tremor [%]
select Sound ftrem
plus Pitch ftrem_norm
To PointProcess (peaks)... yes no
Rename... Maxima
numberofMaxPoints = Get number of points
ftri_max = 0
noFMax = 0
for iPoint from 1 to numberofMaxPoints
select PointProcess Maxima
ti = Get time from index... iPoint
select Sound ftrem
ftri_Point = Get value at time... Average ti Sinc70
if ftri_Point = undefined
ftri_Point = 0
noFMax += 1
endif
ftri_max += abs(ftri_Point)
endfor
select Sound ftrem
plus PointProcess Maxima
#Edit
#pause
# ftri_max:= (mean) procentual deviation of F0-maxima from mean F0 at ftrf
numberofMaxima = numberofMaxPoints - noFMax
ftri_max = 100 * ftri_max/numberofMaxima
select Sound ftrem
plus Pitch ftrem_norm
To PointProcess (peaks)... no yes
Rename... Minima
numberofMinPoints = Get number of points
ftri_min = 0
noFMin = 0
for iPoint from 1 to numberofMinPoints
select PointProcess Minima
ti = Get time from index... iPoint
select Sound ftrem
ftri_Point = Get value at time... Average ti Sinc70
if ftri_Point = undefined
ftri_Point = 0
noFMin += 1
endif
ftri_min += abs(ftri_Point)
endfor
select Sound ftrem
plus PointProcess Minima
#Edit
#pause
# ftri_min:= (mean) procentual deviation of F0-minima from mean F0 at ftrf
numberofMinima = numberofMinPoints - noFMin
ftri_min = 100 * ftri_min/numberofMinima
ftri = (ftri_max + ftri_min) / 2
ftrp = ftri * ftrf/(ftrf+1)
# uncomment to inspect frequnecy tremor objects:
# pause
select Pitch ftrem
# uncomment if only frequency tremor is to be analyzed:
# plus Pitch 'name$'
plus Matrix ftrem_0
plus Pitch ftrem_0
plus Pitch ftrem_0_lin
plus Matrix ftrem
plus Sound ftrem
plus Pitch ftrem_norm
plus PointProcess Maxima
plus PointProcess Minima
Remove
endproc
######################################
# Amplitude Tremor Analysis
######################################
procedure atrem
select Sound 'name$'
# uncomment if only amplitude tremor is to be analyzed:
# To Pitch (cc)... ts minPi 15 yes 0.03 0.3 0.01 0.35 0.14 maxPi
# select Sound 'name$'
plus Pitch 'name$'
To PointProcess (cc)
select Sound 'name$'
plus PointProcess 'name$'_'name$'
# amplitudes are integrals of intensity over periods -- not intensity maxima
To AmplitudeTier (period)... 0 0 0.0001 0.02 1.7
#Edit
#pause
# from here on out: prepare to autocorrelate AmplitudeTier-data
# sample AmplitudeTier at (constant) rate ts
numbOfAmpPoints = Get number of points
first_ampP = Get time from index... 1
last_ampP = Get time from index... numbOfAmpPoints
# to be able to -- automatically -- read Amp. values...
Down to TableOfReal
select Pitch 'name$'
frameNo1 = Get frame number from time... first_ampP
hiframe1 = ceiling(frameNo1)
t_hiframe1 = Get time from frame number... hiframe1
frameNoN = Get frame number from time... last_ampP
loframeN = floor(frameNoN)
# number of Amp. points if (re-)sampled at ts
numbOfPoints_neu = loframeN - hiframe1 + 1
# to enable autocorrelation of the Amp.-contour: ->Matrix->Sound
Create Matrix... atrem_nlc 0 slength numbOfPoints_neu+1 ts t_hiframe1 1 1 1 1 1 2
# get the mean of the amplitude contour in time windows of constant duration
for point_neu from 1 to numbOfPoints_neu
t = (point_neu-1) * ts + t_hiframe1
tl = t - ts/2
tu = t + ts/2
select AmplitudeTier 'name$'_'name$'_'name$'
loil = Get low index from time... tl
hiil = Get high index from time... tl
loiu = Get low index from time... tu
hiiu = Get high index from time... tu
select TableOfReal 'name$'_'name$'_'name$'
if loil = 0
lotl = 0; time before the first amp. point
druck_lol = Get value... hiil 2; amplitude value before the first amp. point
else
lotl = Get value... loil 1; time value of Amp.Point before tl in the PointProcess [s]
druck_lol = Get value... loil 2; amplitude value before tl in the PointProcess [Pa, ranged from 0 to 1]
endif
hitl = Get value... hiil 1
druck_hil = Get value... hiil 2; amplitude value after tl in the PointProcess
lotu = Get value... loiu 1
druck_lou = Get value... loiu 2; amplitude value before tu in the PointProcess
if hiiu = numbOfAmpPoints + 1
hitu = slength; time after the last amp. point
druck_hiu = Get value... hiil 2; amplitude value after the last amp. point
else
hitu = Get value... hiiu 1; time value after tu in the PointProcess
druck_hiu = Get value... hiiu 2; amplitude value after tu in the PointProcess
endif
nPinter = loiu - loil; = hiiu - hiil; number of amp.-points between tl and tu
if nPinter > 0
itinter = 0
tinter = 0
druck_tin = 0
deltat = 0
for iinter from 1 to nPinter
hilft = itinter
itinter = Get value... loil+iinter 1
idruck_tin = Get value... loil+iinter 2
ideltat = itinter - hilft
druck_tin += idruck_tin * ideltat
tinter += itinter
deltat += ideltat
endfor
tin = tinter/nPinter
druck_tin = druck_tin/deltat
endif
druck_tl = ((hitl-tl)*druck_lol + (tl-lotl)*druck_hil) / (hitl-lotl)
druck_tu = ((hitu-tu)*druck_lou + (tu-lotu)*druck_hiu) / (hitu-lotu)
if nPinter = 0; loil = loiu; hiil = hiiu
druck_mean = (druck_tl + druck_tu) / 2
else
druck_mean = ((tin-tl)*(druck_tl + druck_tin)/2 + (tu-tin)*(druck_tin + druck_tu)/2) / (tu-tl)
endif
select Matrix atrem_nlc
Set value... 1 point_neu druck_mean
endfor
To Pitch
am_Int = Get mean... 0 0 Hertz
# because PRAAT classifies frequencies in Pitch objects <=0 as "voiceless" and
# therefore parts with extreme INTENSITIES would be considered as "voiceless"
# (irrelevant) after "Subtract linear fit" (1)
# "1" is added to the original Pa-values (ranged from 0 to 1)
select Matrix atrem_nlc
Formula... self+1
# because PRAAT only runs "Subtract linear fit" if the last frame is "voiceless"...?(2)
Set value... 1 numbOfPoints_neu+1 0
# remove the linear amp.-trend (amplitude declination)
#Formula... self*1000; better for viewing
To Pitch
Rename... hilf_lincorr
Subtract linear fit... Hertz
Rename... atrem
# undo (1)...
To Matrix
Formula... self-1
# normalize Amp. contour by mean Amp.
Formula... (self-am_Int)/am_Int
# remove last frame, undo (2)
Create Matrix... atrem_besser 0 slength numbOfPoints_neu ts t_hiframe1 1 1 1 1 1 0
for point_neu from 1 to numbOfPoints_neu
select Matrix atrem
spring = Get value in cell... 1 point_neu
select Matrix atrem_besser
Set value... 1 point_neu spring
endfor
# to calculate autocorrelation (cc-method)
To Sound (slice)... 1
# calculate Frequency of Ampitude Tremor [Hz]
To Pitch (cc)... slength minTr 15 yes 0.01 tremthresh 0.01 0.35 0.14 maxTr
Rename... atrem_norm
atrf = Get mean... 0 0 Hertz
# calculate Intensity Index of Amplitude Tremor [%]
select Sound atrem_besser
plus Pitch atrem_norm
To PointProcess (peaks)... yes no
Rename... Maxima
numberofMaxPoints = Get number of points
atri_max = 0
noAMax = 0
for iPoint from 1 to numberofMaxPoints
select PointProcess Maxima
ti = Get time from index... iPoint
select Sound atrem_besser
atri_Point = Get value at time... 0 ti Sinc70
if atri_Point = undefined
atri_Point = 0
noAMax += 1
endif
atri_max += abs(atri_Point)
endfor
select Sound atrem_besser
plus PointProcess Maxima
#Edit
#pause
# atri_max:= (mean) procentual deviation of Amp. maxima from mean Amp.[Pa] at atrf
numberofMaxima = numberofMaxPoints - noAMax
atri_max = 100 * atri_max / numberofMaxima
select Sound atrem_besser
plus Pitch atrem_norm
To PointProcess (peaks)... no yes
Rename... Minima
numberofMinPoints = Get number of points
atri_min = 0
noAMin = 0
for iPoint from 1 to numberofMinPoints
select PointProcess Minima
ti = Get time from index... iPoint
select Sound atrem_besser
atri_Point = Get value at time... 0 ti Sinc70
if atri_Point = undefined
atri_Point = 0
noAMin += 1
endif
atri_min += abs(atri_Point)
endfor
select Sound atrem_besser
plus PointProcess Minima
#Edit
#pause
# atri_min:= (mean) procentual deviation of Amp. minima from mean Amp.[Pa] at atrf
numberofMinima = numberofMinPoints - noAMin
atri_min = 100 * atri_min / numberofMinima
atri = (atri_max + atri_min) / 2
atrp = atri * atrf/(atrf+1)
# uncomment to inspect amplitude tremor objects:
# pause
select Pitch 'name$'
plus PointProcess 'name$'_'name$'
plus AmplitudeTier 'name$'_'name$'_'name$'
plus TableOfReal 'name$'_'name$'_'name$'
plus Matrix atrem_nlc
plus Pitch atrem_nlc
plus Pitch hilf_lincorr
plus Pitch atrem
plus Matrix atrem
plus Matrix atrem_besser
plus Sound atrem_besser
plus Pitch atrem_norm
plus PointProcess Maxima
plus PointProcess Minima
Remove
endproc