timsainb / noisereduce

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

Frequency shift after noiseReduction #51

Open jlmarrugom opened 2 years ago

jlmarrugom commented 2 years ago

Hi, I've been using the noise reduction algorithm to standardize the noise before input the signal into a deep learning model. The issue I found while doing the noise reduction is a slightly frequency shift to lower values on the signal.

Original: image

Reduced noise: image

The shift becomes evident when looking the colors near the 4096 frequencies on the mel spectogram.

My Question is, How can I avoid this shift to lower frequencies? (It happens when reducing Stationary or Non-stationary noise)

Thank you

timsainb commented 2 years ago

Hi Jose,

Thanks for pointing thiis out. I'll have to dig into the code to see where this is happening. Presumably either in inverting the STFT or in the loop of inverting the mel spectrogram back to a linear spectrogram, then back into the mel spectrogram. I'd guess it's the latter. I'm not looking at the code now but I believe I'm using librosa's build in mel fiilterbank and infersion functions.

On Sun, Sep 26, 2021 at 10:12 AM José Luis Marrugo Madrid < @.***> wrote:

Hi, I've been using the noise reduction algorithm to standardize the noise before input the signal into a deep learning model. The issue I found while doing the noise reduction is a slightly frequency shift to lower values on the signal.

Original: [image: image] https://user-images.githubusercontent.com/61395538/134817169-4006c491-9d04-4d21-bc64-e6404ad4d5d2.png

Reduced noise: [image: image] https://user-images.githubusercontent.com/61395538/134817207-06083160-6bf7-426f-b9a5-82ad81ea413f.png

The shift becomes evident when looking the colors near the 4096 frequencies on the mel spectogram.

My Question is, How can I avoid this shift to lower frequencies? (It happens when reducing Stationary or Non-stationary noise)

Thank you

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/timsainb/noisereduce/issues/51, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJYKBUV7YQW7LSOBMZBOGDUD5H7JANCNFSM5EY7OYQQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- Tim Sainburg https://timsainburg.com/ PhD Candidate Gentner Laboratory http://gentnerlab.ucsd.edu/ University of California, San Diego 814.574.7780, @.***