Understanding the local information environment is critical to understanding how disinformation is spread. It parts of the world, FM radio is the most popular medium for mass communication. Radio programs and advertisements can be ripe with disinformation. Sitting around and listening to the radio all day can be a daunting task for an analyst, especially if the radio broadcasts are in a language you don’t understand.
Recording local broadcasts can allow researchers to convert the audio into text which can be analyzed using natural language processing (NLP) techniques. Software defined radio (SDR) antennas can be used with a Linux machine, such as a Raspberry Pi, to record local FM radio broadcasts.
For this you will need an SDR antenna. I used the Nooelec RTL-SDR v5 which can be purchased here. Knowledge of Linux commands and file system is helpful but not necessary for this tutorial. Learn more about the Linux command line here.
With your SDR plugged into your Linux machine (or raspberry Pi) open a terminal and enter the following commands.
First you need to install the dependencies.
sudo apt-get install libusb-1.0-0-dev
sudo apt-get install sox
On as Raspberry Pi you may need to install these additional dependencies.
sudo apt-get install cmake
sudo apt-get install autotools-dev
sudo apt-get install automake
Then you will need to download code from GitHub and install it. This code is rtl-sdr software that will allow your SDR to work on your Linux machine.
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make
sudo make install
sudo cp ../rtl-sdr.rules /etc/udev/rules.d/
sudo ldconfig
You also need to edit the RTL blacklist with the following command. Nano is a text editor (feel free to use the editor of your choice) open the file with this command.
sudo nano /etc/modprobe.d/blacklist-rtl.conf
Paste the following lines into the blacklist-rt.conf file.
blacklist dvb_usb_rtl28xxu
blacklist rtl2832
blacklist rtl2830
Save the file by pressing ctrl+o and exit by pressing ctrl+x.
Now reboot your system so that the changes can take effect. (Leave your SDR plugged in).
reboot
After the system reboots, open your terminal again and enter the following commands to install more dependencies. First you will need to install liquid-dsp which is required by stereodemux. Stereodemux is required to record the FM broadcast in stereo. Install liquid-dsp with the following commands.
git clone https://github.com/jgaeddert/liquid-dsp.git
cd liquid-dsp
./bootstrap.sh
./configure
make
sudo make install
sudo ldconfig
cd
The last cd command returns you to your main directory. Next install stereodemux with the following commands.
git clone https://github.com/windytan/stereodemux
cd stereodemux
make
Now you are ready to record local broadcasts. Execute the following command while still in the stereodemux folder as the executable ./demux file is located there. I use -f 102.5M because that is a local FM country radio station. Replace 102.5 with your target FM frequency. The file out.wav is the audio output file. This command will run and record the broadcast until you manually terminate it with the command ctrl+c.
rtl_fm -M fm -l 0 -A std -p 0 -s 192k -g 40 -F 9 -f 102.5M | \
./demux -r 192k -R 44.1k | \
sox -t .s16 -r 44.1k -c 2 - -C -4.2 out.wav
Now that you have an audio file of the broadcast you can transcribe it into text and even translate it using Open-AI whisper. That technique is described in this article. Happy hunting!