timsainb / vocalization-segmentation

Simple python algorithms for segmenting animal (songbird, mice) vocalizations into notes and syllables using Dynamic Thresholding and Continuity Filtering.
MIT License
26 stars 10 forks source link

Wrong onsets and offsets values in continuity_segmentation #5

Closed swasun closed 3 years ago

swasun commented 3 years ago

Hi,

I am using the function continuity_segmentation() to segment vocalizations. I tweaked the parameters in order to obtain what I want to segment, base on the visualization of plot_labelled_elements(). Now I am trying to extract the actual sounds, using the positions stored in onsets and offsets variables. However they seem to not have been updated according to all the parameters of continuity_segmentation(). Indeed, they are updated at https://github.com/timsainb/vocalization-segmentation/blob/9e98868234be331b43013ee275d24c2c2bb03fdf/vocalseg/continuity_filtering.py#L92, but not after the elements modifications, for example at https://github.com/timsainb/vocalization-segmentation/blob/9e98868234be331b43013ee275d24c2c2bb03fdf/vocalseg/continuity_filtering.py#L157 and https://github.com/timsainb/vocalization-segmentation/blob/9e98868234be331b43013ee275d24c2c2bb03fdf/vocalseg/continuity_filtering.py#L187.

timsainb commented 3 years ago

This should be fixed in the new commit https://github.com/timsainb/vocalization-segmentation/pull/6

swasun commented 3 years ago

It's working, thanks a lot!