DSP Code Snippets


Listen to FM Radio (GNURadio)

Using GNURadio to listen to FM Radio. To change the station frequency, set the Ch0 Frequency argument of the RTL-SDR Source block to the desired FM station frequency. Every block's arguments can stay on their default values, except for those specified below.

An RTL-SDR block connects to a Rational Resampler block. The Resampler block connects to a Low Pass Filter block. The Filter connects to a WBFM block, which, itself, connects to an Audio Sink block

Animated Constellation Plot (Python)

Using matplotlib and NumPy to create an animated Constellation Plot visualization at a given frequency. Requires an RTL-SDR to be plugged in and matplotlib, numpy, and pyrtlsdr to be installed.

Listen to FM Radio (Python)

Use NumPy, SciPy, and PyAudio to listen to demodulate FM radio and play the message signal through the device speakers. Modified from a GitHub Gist made by @edy555. Requires an RTL-SDR to be plugged in and numpy, scipy, pyaudio, and pyrtlsdr to be installed.

Animated PSD / FFT Plot (Python)

Using matplotlib to create an animated Power Spectral Density / Fast Fourier Transform visualization at a given frequency. Requires an RTL-SDR to be plugged in and matplotlib and pyrtlsdr to be installed.

Read From .iq File (Python)

Use NumPy to import I/Q samples from a file and optionally use matplotlib to visualize some of the samples. Modified from a PySDR page.

Write to .iq File (Python)

Use NumPy to export I/Q samples to a file. Modified from a PySDR page.