feat: song: bass reg beat detector in slices

This commit is contained in:
2026-05-17 12:32:39 +02:00
parent ee5a1376ee
commit 71f1975a97
4 changed files with 175 additions and 6 deletions

View File

@@ -19,14 +19,19 @@ class Segmenter:
def __init__(self): pass
def get_segments(self, fs, guitar):
i_stxs = self.get_segment_boundaries(fs, guitar)
i_stxs = np.pad(i_stxs, (1, 0))
return i_stxs
def get_segment_boundaries(self, fs, guitar):
"""split the spectral power signal 'guitar' into stochastically similar segments."""
segment_ids = self.get_segments(fs, guitar)
segment_ids = self._get_segments(fs, guitar)
stxs = np.diff(segment_ids) != 0
i_stxs = np.where(stxs)[0]
return i_stxs
def get_segments(self, fs, guitar):
def _get_segments(self, fs, guitar):
"""split the spectral power signal 'guitar' into stochastically similar segments."""
seg_filt_win = int(self.seg_filt_win_sec / self.seg_win_step_sec)
seg_guitar_data = self._sig_stochastics(fs, guitar)