voicesauce / opensauce-python

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

Doubling of data point at edges of TextGrid intervals #21

Closed terriyu closed 7 years ago

terriyu commented 7 years ago

VoiceSauce and OpenSauce have a strange behavior when processing files using TextGrids. At the edge of a TextGrid interval, where the label switches, the data point is calculated twice.

For example:

Filename Label seg_Start seg_End t_ms snackF0 beijing_f3_50_a.wav C1 0.766 0.866 865.000 211.009 beijing_f3_50_a.wav C1 0.766 0.866 866.000 210.769 beijing_f3_50_a.wav V1 0.866 1.074 866.000 210.769 beijing_f3_50_a.wav V1 0.866 1.074 867.000 210.632

Notice that the data point for t = 866 ms is repeated twice, each with a different label C1 and V1. The values calculated are the same for both entries with t = 866 ms, but it's strange that it's repeated twice with different labels.

terriyu commented 7 years ago

We make it a command line option where or not to double the interval end point. The command line option --include-interval-endpoint includes the upper end point, i.e. [a, b]. Conversely, the command line option --exclude-interval-endpoint excludes the upper end point, i.e. [a, b). Using the option --include-interval-endpoint emulates the VoiceSauce behavior of doubling the interval end point. If you want to emulate VoiceSauce when using TextGrid intervals, use the command line options --use-textgrid --time-starts-at-zero --include-interval-endpoint. Currently, we set the OpenSauce default to --exclude-interval-endpoint, so there is no doubling. 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