asteroid-team / torch-audiomentations

Fast audio data augmentation in PyTorch. Inspired by audiomentations. Useful for deep learning.
MIT License
928 stars 87 forks source link

Noise gate augmentation #142

Open shahules786 opened 2 years ago

shahules786 commented 2 years ago

Implemented spectral gating based on https://timsainburg.com/noise-reduction-python.html Can you check this and let me know what you think? @iver56 I will implement the tests after the review if that's fine.

shahules786 commented 2 years ago

Thanks for the initiative! It would be nice if you could add it to the demo script as well, so we can listen to what it sounds like :)

Done.

iver56 commented 2 years ago

I listened to an output from the demo script now, and I can hear a buzzy sound that was somehow added to my original sound. I did not expect this. Maybe something is wrong with the implementation? I can also see it in the spectrogram: spectralgating

I expected something more like this:

spectralgating-expected

(I created this "expected" example with Audacity's built-in noise reduction plugin)

Here are the 3 wavs that I compared in those two spectrogram gifs: spectral_gating_sounds.zip