A weekend experiment…
I have never worked with Arduino Zero or its derivatives before. This SAMD21 board is from Aliexpress. It has the native USB port only and in at least one instance its PCB layout seems to be at odds with the Arduino IDE files describing Arduino Zero (see program comments). Still – it works.

The Zero has no EEPROM, so one must be simulated in FLASH, but its contents are erased each time a new version of the program is uploaded. Furthermore, the default ADC settings make it tragically slow. (It is 12-bit though.) And I needed the FFT. So I took the opportunity to test three libraries that promised to be able to address the obvious challenges. Their documentation and examples were useful in getting to know the Zero. The results are satisfactory, although there are some quirks or I didn’t get everything right. Still – they do work. The initial obstacles were overcome.
The main program is a proof of concept but it performs as expected.
The microphone module is based on the MAX9814 audio-amplifier with AGC. The alarm is activated when certain frequencies (frequency ranges) get stronger or weaker than in the normal soundscape. For example, it can distinguish between different blow dryer settings, each producing a slightly different sound spectrum – one peaking at around 1240 Hz, the other at around 1730 Hz. Individual tones can also be recognized with reasonable accuracy. Multiple alarms can be set. You can choose which frequencies to pay attention to, the type of change that will trigger the alarm etc. It would also be possible to define more complex spectrum shapes to look for.
The program first learns what is ‘normal’ by listening and storing average magnitude values for individual frequency bins while everything is OK. One bin is about 29 Hz wide. The maximum frequency is set to 10 kHz.
This could be useful with cooling fans and other machinery with relatively constant acoustic signatures.

There is a lot of work still to be done.
The Teensy is generally better suited for a task of this kind, but the Zero could perform well for the given frequency range and comparable reaction times.
Download FFT_ALARM.ino version 0.6α.
Audio spectrum analyzer (and much more) on your phone, for free:
https://phyphox.org/



