def remove_repeat_test(n: int, threshold: float, silence_threshold: float = 0): frames_arr = tests.input_bulk(n) frames_before = np.reshape(frames_arr, [-1]) frames_after = dsp.remove_silence(frames_before, silence_threshold) frames_after = dsp.remove_repeat(frames_after, tests.config.framerate, 200, 5, max_correlation=threshold) tests.output(frames_before, frames_after)
def add_noise_test(): frames_before = tests.input_bulk(10) frames_after = augmentation.add_noise(frames_before) frames_before = np.reshape(frames_before, [-1]) frames_after = np.reshape(frames_after, [-1]) sg = dsp.make_spectrogram(frames_before, seg_length=tests.config.seg_length) tests.plot_matrix("Spectrogram before", sg) sg = dsp.make_spectrogram(frames_after, seg_length=tests.config.seg_length) tests.plot_matrix("Spectrogram after", sg) tests.output(frames_before, frames_after)
def remove_silence_test(n: int, threshold: float): frames_arr = tests.input_bulk(n) frames_before = np.reshape(frames_arr, [-1]) frames_after = dsp.remove_silence(frames_before, threshold) tests.output(frames_before, frames_after)