voicesauce / opensauce-python

Voice analysis software (Python port of VoiceSauce)
Apache License 2.0
53 stars 16 forks source link

Output has off-by-one-frameshift issue for time points #28

Closed terriyu closed 7 years ago

terriyu commented 7 years ago

When output is generated, the output file contains measurement numbers corresponding to each time point. The question is for each measurement vector, does the first element correspond to t=0 or does it correspond to t=first frameshift. Since we usually assume a frameshift of 1 ms, then the first element can either correspond to t=0 ms or t=1 ms. If we make the wrong choice, we get an off-by-one error when we index into the vector to obtain the measurement value corresponding to the time point.

terriyu commented 7 years ago

We make it a command line option, whether to start time from zero or to start it from the first frame shift. This is equivalent to whether you interpret time as being at the beginning or the end of the frame. The command line option to start time from zero is --time-starts-at-zero, whereas the option to start time at the first frame shift is --time-starts-at-frameshift. The OpenSauce default is to use --time-starts-at-zero. When dumping the whole file (no TextGrid), using --no-text-grid --time-starts-at-frameshift --exclude-interval-endpoint emulates VoiceSauce behavior. The command line options are addressed in commits https://github.com/voicesauce/opensauce-python/commit/0efe5ea2a74a358ece161abc02666b689859d8b4 and https://github.com/voicesauce/opensauce-python/commit/c94bd646b3505690e5ae1d9e1d27434872c18feb