timsainb / noisereduce

Noise reduction in python using spectral gating (speech, bioacoustics, audio, time-domain signals)
MIT License
1.41k stars 230 forks source link

Feature Request or Advice #40

Open mcr-is opened 4 years ago

mcr-is commented 4 years ago

Do you have a method for creating a common background noise file? I have a bunch of wav files that I would like to extract the common background noise from them instead of guessing. If not have you thought about adding this into your package?

Thanks for any help. I'm not experienced at GitHub posting so I hope this is an ok way to send ideas or requests.

timsainb commented 4 years ago

You have a bunch of background noise files and you want to extract 'average' background noise statistics across those files? I don't have that implemented but it seems like a fine idea, but would require rewriting a bit of the code to implement.

In effect, you would want to have separate functions that compute statistics over each noise file. Then average them together. Then be able to pass the noise statistics directly into a noise_reduction function.

mcr-is commented 4 years ago

Yeah I think that sounds about right.

I was thinking of it as more of a synthetic background noise that is generated from the examples that I have currently and will get going forward. If I had a file like this then the common background sound would be removed like doing background subtraction in computer vision. I would need the ability to save the synthetic file so I could use it for my model building and and later inference. I tried reading all of my samples as numpy arrays and then stacking them into a pandas df to get a mean but that didn't work very well. I am by no way an expert in sound file processing which is why I wanted to reach out to you. I really really really like your noisereduce package and it was just what I needed for my project. Thanks for any assistance you can offer.