Replies: 8 comments 28 replies
-
Hello, @srchild I had to do some googling to know more about your suggestion, as I'm not an audio-buff. Here are my normalization results per your links: After (with) normalization: Let me know if that is what you meant |
Beta Was this translation helpful? Give feedback.
-
Hi @srchild and @mcguirepr89 & gang I think normalization and/or other effects on the wav recording should be done post analysis, and that the user should have an option to save the audio file
@mcguirepr89 - this loops back to our previous chat about including "sound-system-setup" as a Database - doesnt have to be big, just "Microphone Type, Recording Alsa settings, saving format, saving ffmpeg settings ......." with date/time set and updated when reset? Your thinking? Best |
Beta Was this translation helpful? Give feedback.
-
Just spitballing ideas, |
Beta Was this translation helpful? Give feedback.
-
Got some birds today. I'm experimenting with NOT changing the noise profile every time, i.e. not trying to find only noise in a sound file which might contain a bird song. It doesn't seem to work having a noise profile which you never change. Here's my current changes. In scripts/server.py
and in scripts/extract_new_birdsounds.sh
If there are no detections, generate a new noise profile. Awaiting some actual birds now. I tried a highpass filter too, to diminish the low frequency alien warbles. I agree, the results were unimpressive. I also looked at some more exotic noise reduction tools, for example using machine learning methods. The ones I found are pretty big packages, and mostly focused on recognizing human speech, then removing everything else. This makes me think one could enhance the BirdNET-Analyzer package itself, to decrease the amplitude of the parts of a sound file which don't match what it identifies. That's a more involved undertaking. |
Beta Was this translation helpful? Give feedback.
-
You mean high-pass? |
Beta Was this translation helpful? Give feedback.
-
Should we expect to see this improvement in the current version? It's been several months, but I'm also having this issue with barely audible recordings. Are there instructions for a newbie that I can implement to improve audio quality? |
Beta Was this translation helpful? Give feedback.
-
I've made a substantial change to this experiment, which is yielding much better results for me. I gave up on using the sox noise reduction function, and wrote a small python script which uses the noisereduce python module. Homepage here. You'll have to do The script is simple:
and yields good noise reduction. A blue jay stopped by this afternoon. Showing the sound files in audacity: the first is the input, scaled up to be visible, the second is after noise reduction and a 1KHz highpass, and the third is birdnet's output after trimming to just the one call. And here are the individual sound files. Latest version of my changes: This can be cleaned up a bit to remove output of the working files, and probably move more processing into the python script, since it has the sound data open. But it looks very promising. No distortion like sox noisered was doing. |
Beta Was this translation helpful? Give feedback.
-
I’ve enabled that now
Simon
From: morrowwm ***@***.***>
Sent: Wednesday, June 12, 2024 7:53 PM
To: mcguirepr89/BirdNET-Pi ***@***.***>
Cc: srchild ***@***.***>; Mention ***@***.***>
Subject: Re: [mcguirepr89/BirdNET-Pi] Audio normalisation? (Discussion #253)
I've made a substantial change to this experiment, which is yielding much better results for me.
I gave up on using the sox noise reduction function, and wrote a small python script which uses the noisereduce python module <https://pypi.org/project/noisereduce/> . Homepage here <https://github.com/timsainb/noisereduce> . You'll have to do pip install noisereduce before using it.
The script is simple:
#!/user/bin/python
import sys
from scipy.io import wavfile
import noisereduce as nr
# load data
rate, data = wavfile.read(sys.argv[1])
# perform noise reduction
reduced_noise = nr.reduce_noise(y=data, sr=rate)
print("Completed noise reduction")
wavfile.write(sys.argv[2], rate, reduced_noise)
and yields good noise reduction. A blue jay stopped by this afternoon. Showing the sound files in audacity: the first is the input, scaled up to be visible, the second is after noise reduction and a 1KHz highpass, and the third is birdnet's output after trimming to just the one call.
image.png (view on web) <https://github.com/mcguirepr89/BirdNET-Pi/assets/11416685/71cbc292-b316-4e14-90f3-e0232f2fabaa>
And here are the individual sound files.
bluejay_soundfiles.zip.zip <https://github.com/user-attachments/files/15809571/bluejay_soundfiles.zip.zip>
Latest version of my changes:
birdnet_changes.zip <https://github.com/user-attachments/files/15809577/birdnet_changes.zip>
This can be cleaned up a bit to remove output of the working files, and probably move more processing into the python script, since it has the sound data open. But it looks very promising. No distortion like sox noisered was doing.
—
Reply to this email directly, view it on GitHub <#253 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AY4QMR35LFPOP4UN6ZHWI73ZHCKH7AVCNFSM5VK4UBZ2U5DIOJSWCZC7NNSXTOKENFZWG5LTONUW63SDN5WW2ZLOOQ5TSNZVGU2TEMQ> .
You are receiving this because you were mentioned. <https://github.com/notifications/beacon/AY4QMRY7PPGTV3EPG2JTPW3ZHCKH7A5CNFSM5VK4UBZ2YY3PNVWWK3TUL52HS4DFWFCGS43DOVZXG2LPNZBW63LNMVXHJKTDN5WW2ZLOORPWSZGOACKNXAQ.gif> Message ID: ***@***.*** ***@***.***> >
|
Beta Was this translation helpful? Give feedback.
-
{new user alert, I will probably make some silly comments/questions/requests!}
First, congratulations to Patrick McGuire and anyone else involved. This is a great idea and it installed and set up easily.
Audio levels seem really low on the archived clips, whether I listen on my PC or on my phone, and whether I listen to my own recordings or to virginia.birdnetpi.com or tyreso.birdnetpi.com
Perhaps the audio could be normalised before being saved?
On a quick browse of the source code I noticed that you use ffmpeg in birdnet_recording.sh. ffmpeg can be used to normalise audio e.g. see:
https://superuser.com/questions/323119/how-can-i-normalize-audio-using-ffmpeg
and
http://ffmpeg.org/ffmpeg-all.html#loudnorm
Here's a loudnorm recipe to test (I can't test it now - it is dark and there are no birds singing!)
http://johnriselvato.com/ffmpeg-how-to-normalize-audio/
Beta Was this translation helpful? Give feedback.
All reactions