Radio Frequencies

Radio Frequencies are electromagnetic signals sent over a specific frequency such as 60 kilohertz (kHz).

To send our data over a communication channel, such as radio waves, we often use one modulation techniques among:

  • Amplitude Modulation (AM) πŸ“’
  • Frequency Modulation (FM) πŸ“»

FM as a few more advantages like it's more efficient.


Manipulating RF Recordings

rf_am_transmission

GNU Radio

GNU Radio is a suite of radio tools such as gnuradio-companion graphical editor that can be used to work on radio captures.

$ sudo apt install -y gnuradio
$ gnuradio-companion

The right panel contains a list of components that we can drag to the main panel. For instance, drag a File Source and double-click on it to make it point to your capture. Set the type to FLOAT.

To hear a sound, we could use a Audio Sink. Connect both, and don't forget to set the type to FLOAT and try to find the SampleRate. You can enter arbitrary values such as 50000 for 50 kHz.

Python

We could use the soundfile library:

# pip install soundfile sounddevice numpy
import soundfile as sf
import sounddevice as sd

sig, fs = sf.read('<AM recording>', channels=1, samplerate=50000, format='RAW', subtype='FLOAT', endian='LITTLE')
sd.play(sig, fs, blocking=True)

Additional tools

  • Audacity may work for some transmissions
  • We can use aplay from alsa-utils:
$ cat <AM recording> | aplay -f FLOAT_LE -r <sample rate>

πŸ‘» To-do πŸ‘»

Stuff that I found, but never read/used yet.

$ DEST="$HOME/tools/urh"
$ git clone -b "master" https://github.com/jopohl/urh.git $DEST
$ pip install cython # no venv because their setup.py is a pain
$ python $DEST/setup.py install --user
$ urh