Radio signal identification «by ear»: Discrete Fast Fourier audio hashes comparison in Python
A Shazam for radio signals: listen for a few seconds and get a match among some 350 known signals.
Sound recognition apps hash audio with the fast Fourier transform. Using an experimental Python implementation, all samples from the Signal Identification Wiki were fingerprinted into an SQLite database, so that SIGID can be done by ear in 5–10 seconds. Installation and usage steps are included.
Topics: SIGID, signal identification, FFT, audio fingerprinting, Python, SDR, Sigidwiki
Most sound identification apps uses fast fourier transform to generate hashes from a sound. These hashes are stored in a huge catalog of audio fingerprints, and when a user tags a song for a few seconds, the app generates an audio fingerprint and seeks for a match on the database.
«I think that you’re listening to X«.
This clever guy created his own version of Shazam for experimental purposes. When I saw it, I thought about the posibility of use this application for SIGID.
SIGID (Signal Identification) is to search for unknown radio signals, trying to identify them through example sounds and waterfall images using software defined radio (RTLSDR, Airspy, SDRPlay, HackRF, etc.).
So first I have downloaded all audio samples from Signal Identification Wiki database and generated a SQLite database for the python script.
Listening for about 5-10 seconds, the script can now identify a lot of known signals (about 350)! In this article you can found a direct link to download my database and save potential time and problems.
How can I do the same?
- Install python, pip and dependencies:
sudo apt-get install python-tk ffmpeg portaudio19-dev python-pyaudio python-pip sudo pip install matplotlib termcolor scipy pydub PyAudio
- Clone and set up SQLite database:
git clone https://github.com/baliksjosay/audio_recogition_system cd audio_recognition_system make clean reset
- Download my generated hash database of Sigidwiki:
https://www.dropbox.com/s/9v7eslkwglzs3ys/fingerprints2.rar?dl=1
- Unzip file in /db/ directory.
- Test the script! Two ways:
- Via microphone/virtual cable (5 seconds):
python recognize-from-microphone.py -s 5
- Vía saved audio file (Update: we are all having troubles with this option):
python recognize-from-file.py sampleaudiofile.mp3
Enjoy it!
PS. – Doesn’t work? Think about demodulation. The same signal sounds pretty different from, i. ex. AM to FM. Some known signals (CW, FM broadcast…) may fail.
PS.2 – Update 4/2/2020. I’ve submitted my project and Rtl-sdr.com blog published a review 😀
PS.3 – Update. Some users reported problems using the «recognize-from-file.py», but no problems with «recognize-from-microphone.py». If you need to work only and exclusively with «from file» option, please contact with the author of the script (and please, share with us your conclusions!). Thank you!
PS.3 – Update 12/2/2020. Dan Maloney wrote a review on Hackaday 😀