Monday, December 14, 2015

Simple FM-receiver with RTLSDR-dongle and gnuradio-companion

GNU Radio is a free software development toolkit which makes the task of signal processing the input from sources such as the cheap 10$-rtlsdr dongles easier.

Bundled together with  GNU Radio is gnuradio-companion which is a python  code generator tool.
Gnuradio-companion is used to build 'flowgraphs'. When the flowgraph is constructed and 'compiled', python code is generated that creates and connects the blocks in the flowgraph. These blocks then step by step 'clean' and demodulate the incoming signal .

Below is the flowgraph I built using gnuradio-companion. A RTLSDR dongle is used as signal source to receive on a frequency containing FM-radio:


Note that the rtlsdr-dongle is just receiving the signal and not demodulating it. The signal is fed into gnu-radio companion for processing and demodulation.

Info about the flowgraph

RTLSDR source has samplerate set to 2.0e6Mhz/s

Ch0 frequency in the source-block is associated with the wxgui-slider variable where max is 110Mhz,min 90 Mhz,default 97.796Mhz.
Outgoing signals are then fed to a wxgui FFT-sink, a waterfall sink and a rational resampler.The FFT(Fast Fourier Transform)-sink and waterfall sink are mainly there to get a quick visual view of any signals coming in from the signal source.

In the rational resampler the decimation rate is set to 4 to reduce the signal by 1/4. This is done to prevent the CPU from overloading. To further clean up the signal it is fed into a lowpass-filter,where the cutoff frequency is set to 100000Hz and the transition width is set to 1000000.

Then the signal is sent to a wideband-FM-demodulator block,WBFM-receive, where the quadrature
rate is set to 500000 and decimation to 1.

Afterwards another resampler-block with interpolation 48 and decimation 500 prepare the signal for next block which is the audio sink. Finally the signal is sent to the computer-sound card which in gnuradio-companion is represented by an audio-sink.Most computer soundcards operate with samplerate 48Khz so it is essential that this is set in the audio sink.

Note: Sometimes the property device-name in the audio-sink must be defined.
Usually it can be left empty but if no sound is produced  try to set device-name as 'pulse' incase your OS uses pulseaudio to handle sound.

If alsa is used on your OS, device-name parameter of audio sink could be set as 'hw:0,0' or 'plughw:0,0'

When the flowgraph is generated(i.e compiled) and executed FM-radio should be heard from
sound card accompanied by an output similar to:





Sunday, December 6, 2015

Building multimon-ng from source and capture FMSFSK-signals

I noticed that the kali linux 2.0 repository version of multimon-ng does not include the FMSFSK demodulation option.

FMSFSK demodulation in multimon-ng is used to demodulate German Funkmeldesystem-signals.

To get the complete multimon-ng version, first install its dependencies:


apt-get install qt4-qmake  libpulse-dev  cmake  libx11-dev  pulseaudio


Then clone and build multimon-ng from source:

git clone https://github.com/EliasOenal/multimonNG.git

cd multimonNG

mkdir build && cd build

qmake ../multimon-ng.pro

make && make install

ldconfig



Then connect the rtlsdr-dongle to the computer and hook it up to a decent antenna.

The rtlsdr-dongle's ppm-value should also be identified via tools such as kalibrate for more reliable results.

When an appropriate frequency is found, pipe the sound from rtl_fm to multimon-ng for demodulation:


rtl_fm -f 431.865e6 -p -2 -l 100 | multimon-ng -a FMSFSK -a AFSK1200 -t raw /dev/stdin