santiagobarreda / FastTrack

A Praat plugin for fast, accurate, (nearly) automatic formant-tracking
MIT License
60 stars 14 forks source link

Handle TG intervals out of sound time domain #16

Closed djvill closed 3 years ago

djvill commented 3 years ago

Let's say a.textgrid is 4 seconds long, with a vowel at 3.5-3.6 seconds, but a.wav is just 3 seconds long. Fast Track will treat this null token as if it's non-null, which creates problems down the line (when trying to get a linear regression from the null Formant object). It looks like Fast Track already has a notation for null tokens (-- output files), so this could be used here.

santiagobarreda commented 3 years ago

So basically, the textgrid says there is a vowel there but there is not actually because the sound is too short? Would this happen as a result of an error or is there some other reason for this? Would it work if the extractor checked the length of the recording and stopped when the sound length was reached? At the moment I believe it just loops through intervals and performs no check, and the assumptions is that sound files and textgrids match in length.

djvill commented 3 years ago

Yes, and this could easily happen for a number of reasons; here are two examples from a recent project (where I was handed the sounds/TGs so I didn't have control over the whole data pipeline).

  1. The TG and sound were originally the same duration, but somewhere along the way all the TG intervals got shifted earlier by a constant amount. To compensate, the same amount of time was chopped off the start of the sound (and never added to the end).

  2. The TG was for a very long interview, and somewhere along the way the sound file got split in half (and I didn't have the second half). So the TG extended for an hour beyond where the sound ended.

On Fri, Aug 20, 2021 at 2:43 PM Santiago Barreda @.***> wrote:

So basically, the textgrid says there is a vowel there but there is not actually because the sound is too short? Would this happen as a result of an error or is there some other reason for this? Would it work if the extractor checked the length of the recording and stopped when the sound length was reached? At the moment I believe it just loops through intervals and performs no check, and the assumptions is that sound files and textgrids match in length.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/santiagobarreda/FastTrack/issues/16#issuecomment-902885543, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFI34QR3ZRUYRMK3U72IJODT52O3BANCNFSM5CQZPBZQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

santiagobarreda commented 3 years ago

Ok the extract vowel function now checks the sound duration and only analyzes vowels that end before the duration of the sound file. I tested it on a simple case and it seems to be working.