DrCoffey / DeepSqueak

DeepSqueak v3: Using Machine Vision to Accelerate Bioacoustics Research
BSD 3-Clause "New" or "Revised" License
373 stars 89 forks source link

Noise Bands #113

Closed ngnae closed 3 years ago

ngnae commented 3 years ago

Hi Dr. Coffey, I’ve been using DeepSqueak V3 for a few days, and it is has been very helpful. However, Ive encountered a slight issue with detecting calls; I have a few noise bands that DeepSqueak keeps detecting as calls. I got rid of the biggest noise band by adjusting the frequency threshold, but there are still a few smaller ones which interfere with the detection. I suspect these noise bands are a byproduct of the mic I use, the dodotronic ultramic. Is there any way to get around these noise bands without having to buy a higher quality mic?

DrCoffey commented 3 years ago

Ya, the Dodotronic mics are notorious for terrible noise bands. Sometimes you can hunt down the noise if it is external (like a fluorescent light or monitor or whatever). But sometimes the mics just have strange electrical noise you can't remove.

I think you can preprocess the recordings with a notch filter to cut out a very thin audio band. I think you can do it in audacity or in Matlab. In Matlab the code is something like this (say it is a 45kHz noise band).

[x, fs ]=audioread('audiofile.wav'); wo = 45000/(fs/2);
bw = wo/35; [b,a] = iirnotch(wo,bw); y = filter(b,a,x); audiowrite('filteredaudiofile.wav',y,fs);

https://www.mathworks.com/help/dsp/ref/iirnotch.html https://www.mathworks.com/help/matlab/ref/filter.html

In the long run I definately reccomend upgrading to something like the Pettersson M500-384 https://batsound.com/product/m500-384-usb-ultrasound-microphone/