rdz-oss / BattyBirdNET-Pi

A realtime acoustic bat & bird classification system for the Raspberry Pi 4/5 built on BattyBirdNET-Analyzer.
Other
34 stars 2 forks source link

Change spectrogram Y axis to hide blank areas #48

Closed max-mapper closed 1 week ago

max-mapper commented 2 weeks ago

I was noticing my spectrograms looked like this out of the box:

Screenshot_20240369

My mic is the WAEM2 which has a 256k sample rate, but I am apparently only getting data in the 25khz range, does that seem right?

Changing $SAMPLING_RATE here to the string 50k (freq * 2) results in this chart which looks much better for me:

Screenshot_20240370

max-mapper commented 2 weeks ago

Also, I'm dubious about the 95% confirdence Greater mastiff bat in the first screenshot. I think it's California Towhee triggering it. Looking at the spectrograms of the two species it seems like their calls are quite similar:

Screenshot_20240371

rdz-oss commented 1 week ago

Hi @max-mapper your first screenshot indicates that the microphone has not been recognized correctly.

max-mapper commented 1 week ago

Ah! Ok let me check. It is purchased a few months ago, the USB-C model. lsusb shows:

Bus 001 Device 004: ID 2926:4544 Wildlife Acoustics, Inc. USB Echo Meter Touch 2

I believe it's on the latest firmware

max-mapper commented 1 week ago

I tried changing the sound card to dsnoop:CARD=U2,DEV=0 but then arecord -f S16_LE -c1 -r256000 -t wav --max-file-time 9 -D dsnoop:CARD=U2,DEV=0 --use-strftime /home/bat/BirdSongs/%B-%Y/%d-%A/%F-birdnet-%H:%M:%S.wav errors with arecord: set_params:1358: "Channels count non available".

I have this entry in arecord -L:

dsnoop:CARD=U2,DEV=0
    USB Echo Meter Touch 2, USB Audio
    Direct sample snooping device

I also have this configuration as per the readme:

battybirdnet:~/BirdNET-Pi$ cat /proc/asound/cards
 0 [Headphones     ]: bcm2835_headpho - bcm2835 Headphones
                      bcm2835 Headphones
 1 [vc4hdmi0       ]: vc4-hdmi - vc4-hdmi-0
                      vc4-hdmi-0
 2 [vc4hdmi1       ]: vc4-hdmi - vc4-hdmi-1
                      vc4-hdmi-1
 3 [U2             ]: USB-Audio - USB Echo Meter Touch 2
                      Wildlife Acoustics, Inc. USB Echo Meter Touch 2 at usb-0000:01:00.0-1.1.1, full
battybirdnet:~/BirdNET-Pi$ cat /etc/asound.conf
defaults.pcm.card 3
defaults.ctl.card 3
max-mapper commented 1 week ago

Ok I think I got it working... thanks to this comment https://gist.github.com/rnagarajanmca/63badce0fe0e2ad126041c7c139970ea?permalink_comment_id=5064806#gistcomment-5064806

Screenshot_20240375

What I did was run:

$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 2: U2 [USB Echo Meter Touch 2], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

And then in the advanced config I entered hw:2

max-mapper commented 1 week ago

@rdz-oss On second thought, I am still getting a lot of false positives. Looking at my spectogram screenshot above, do you think it's an issue with the waem2.prof sound profile, or possibly something else?

rdz-oss commented 1 week ago

@max-mapper , your noise profile does look unique (the horizontal lines around 5kHz). Can you write a short email to battybirdnet - at -mailbox.org ? We can then align on how you can send me some false triggers.