From c4d9a027a5a0df365c84beffbeaa56304d563500 Mon Sep 17 00:00:00 2001 From: Rob van Son Date: Tue, 6 Dec 2016 15:58:57 +0100 Subject: [PATCH] Rebuild creaky voice detector for third tones, first working version --- ToneProt/SGC_ToneProt.praat | 7 ++++--- ToneProt/ToneRecognition.praat | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ToneProt/SGC_ToneProt.praat b/ToneProt/SGC_ToneProt.praat index db4e34d..8fc686a 100644 --- a/ToneProt/SGC_ToneProt.praat +++ b/ToneProt/SGC_ToneProt.praat @@ -243,7 +243,8 @@ procedure sgc_ToneProt sgc_ToneProt.currentSound$ sgc_ToneProt.pinyin$ sgc_ToneP plus .dtw9 Remove - toneProt.creackyThree /= .lowPresent + # Weigh creacky voice by number of syllables + toneProt.creackyThree /= toneScript.syllableCount endif # Clean up @@ -643,7 +644,7 @@ procedure createJitterShimmerContour .sound # Create pointprocess select .sound - .pointProc = To PointProcess (periodic, cc): 60, 350 + .pointProc = noprogress To PointProcess (periodic, cc): 60, 350 .dT = 0.01 .w_half = 0.075/2 @@ -684,7 +685,7 @@ procedure createShimmerCPPcontour .sound # Create pointprocess select .sound - .pointProc = To PointProcess (periodic, cc): 60, 350 + .pointProc = noprogress To PointProcess (periodic, cc): 60, 350 .dT = 0.01 .w_half = 0.075/2 diff --git a/ToneProt/ToneRecognition.praat b/ToneProt/ToneRecognition.praat index c73ab3c..7941b82 100644 --- a/ToneProt/ToneRecognition.praat +++ b/ToneProt/ToneRecognition.praat @@ -80,6 +80,7 @@ procedure FreeToneRecognition .pinyin$ .test_word$ .exclude$ .upperRegister .fre select Table ToneList .inFile$ = Get value... '.i' Word # Broken third tones are still third tones + # Creaky voice reduces 3rd tone distances if (.exclude$ = "" or rindex_regex(.inFile$, .exclude$) <= 0) and rindex_regex(.inFile$, "[\d]") > 0 referenceName$ = .inFile$ @@ -95,6 +96,10 @@ procedure FreeToneRecognition .pinyin$ .test_word$ .exclude$ .upperRegister .fre .sumSqrDistance = .sumSqrDistance + distance^2 .inFile$ = replace$(.inFile$, "9", "3", 0) + # Creaky voice in 3rd tone is a bonus, maximal 1/2*distance + if toneProt.creackyThree + distance /= toneProt.creackyThree + 1 + endif if .pinyin$ = .inFile$ .correctDistance = distance endif -- 2.11.4.GIT