A modified version of the AudioMoth standard firmware. This software performs live classification of samples using a neural network from Edge Impulse and saves audio clips containing a specific sound.
Clone the contents of AudioMoth-Project.
Replace the src/main.c
from AudioMoth-Project with the src/main.c
from this repository. Put all the remaining src/*.c
files and all the src/*.h
files from this repository into the /src/
and /inc/
folders of the AudioMoth-Project repository. Copy the edgeimpulse/
and dsplib/
folder (including its contents and subfolders) from this repository into the AudioMoth-Project repository. Replace the build/Makefile
from AudioMoth-Project with the build/Makefile
from this repository.
In fatfs/inc/ffconf.h
make the following changes
- Disable support for long file names:
#define FF_USE_LFN 0
- Disable support for exFAT filesystem:
#define FF_FS_EXFAT 0
- Enable tiny buffer configuration:
#define FF_FS_TINY 1
The SD card used with AudioMoth Edge Impulse needs to have a SETTINGS.TXT
. An example SETTINGS.TXT file is included in this repo and can be customized.
Currently AudioMoth with Edge Impulse only supports FAT32-formatted SD cards
- Train a different neural network (using MFCC for audio) on the Edge Impulse platform. Currently AudioMoth only supports 16kHz or 8kHz with 1 second audio samples. Go to the "Deployment" tab, build the C++ library, and download the ZIP file (and unzip it).
- In the
firmware/Makefile
set theEI_MODELPATH =
variable to the path of the Edge Impulse ZIP Model folder. - In
firmware/src/main.c
set the#define EI_MODEL_FREQUENCY
toKHZ_16
for a 16 kHz Edge Impulse model orKHZ_8
for a 8 kHz Edge Impulse model. The AudioMoth will record audio files at the same frequency as the Edge Impulse model. - Run
make clean
andmake
to build the firmware with the new model.
See AudioMoth LED Guide for the meaning of the LED lights and troubleshooting.
- Check that the Edge Impulse model sample rate (8 kHz or 16 kHz) matches the AudioMoth sample rate setting (
firmware/src/main.c
set the#define EI_MODEL_FREQUENCY
) - If this problem still persists, the Edge Impulse model uses too much RAM (likely during the MFCC block). Reduce the parameters used in MFCC and try the updated model. Models with RAM usage > 20 kB are likely not to work.
The dsplib
source files are from the ARM CMSIS-DSP embedded compute library under the Apache 2.0 license.
The rest of the firmware is Copyright 2023 Open Acoustic Devices under the MIT license.