# Receiving RDS with the RTL-SDR

DevFeed: [Receiving RDS with the RTL-SDR](<https://devfeed.tech/articles/receiving-rds-with-the-rtl-sdr-21642.md>)

Original publisher: [Read original article](<https://www.windytan.com/2015/02/receiving-rds-with-rtl-sdr.html>)

Author: Oona Räisänen (noreply@blogger.com)

Published: 2015-02-08T19:10:00Z

Content type: tutorial

Language: en

Sources: [Oona Räisänen](<https://devfeed.tech/sources/oona-raisanen.md>)

Topics: [Command-line interface](<https://devfeed.tech/topics/cli.md>), [Tool](<https://devfeed.tech/topics/tool.md>), [C](<https://devfeed.tech/topics/c.md>), [Code](<https://devfeed.tech/topics/code.md>), [Linux](<https://devfeed.tech/topics/linux.md>)

Tags: [c](<https://devfeed.tech/tags/c.md>), [code](<https://devfeed.tech/tags/code.md>), [command-line](<https://devfeed.tech/tags/command-line.md>), [development](<https://devfeed.tech/tags/development.md>), [dsp](<https://devfeed.tech/tags/dsp.md>), [fm-radio](<https://devfeed.tech/tags/fm-radio.md>), [linux](<https://devfeed.tech/tags/linux.md>), [perl](<https://devfeed.tech/tags/perl.md>), [receiver](<https://devfeed.tech/tags/receiver.md>), [signal](<https://devfeed.tech/tags/signal.md>), [software](<https://devfeed.tech/tags/software.md>), [tool](<https://devfeed.tech/tags/tool.md>)

## AI overview

This article explains redsea, a command-line RDS decoder that supports RTL-SDR receivers through rtl_fm. It describes the tool's dependencies and operation, including the C99 DSP receiver, signal synchronization, symbol decoding, and subsequent RDS group processing by redsea.pl.

## Source excerpt

redsea is a command-line RDS decoder. I originally wrote it as a script to decode RDS from demultiplexed FM stereo sound. Later I've experimented with other ways to read the bits, and the latest addition is to support the RTL-SDR television receiver via the rtl_fm tool. Redsea is on GitHub. It has minimal dependencies (perl core modules, C standard library, rtl-sdr command-line tools) and has been tested to work on OSX and Linux with good enough FM reception. All test results, ideas, and pull requests are welcome. Update 12/2016: Redsea has seen a lot of development since this post was written; see Redsea 0.7, a lightweight RDS decoder. What it says The program prints out decoded RDS groups, one group per line. Each group will contain a PI code identifying the station plus varying other data, depending on the group type. The below picture explains the types of data you'll probably most often encounter. A more verbose output can be enabled with the -l option (it contains the same information though). The -t option prefixes all groups with an ISO timestamp. How it works The DSP side of my program, named rtl_redsea, is written in C99. It's a synchronous DBPSK receiver that first bandpass filters ① the multiplex signal. A PLL locks onto the 19 kHz stereo pilot tone; its third harmonic (57 kHz) is used to regenerate the RDS subcarrier. Dividing it by 16 also gives us the 1187.5 Hz clock frequency. Phase offsets of these derived signals are adjusted separately. The local 57 kHz carrier is synchronized so that the constellation lines up on the real axis, so we can work on the real part only ②. Biphase symbols are multiplied by the square-wave clock and integrated ③ over a clock period, and then dumped into a delta decoder ④, which outputs the binary data as bit strings into stdout ⑤. Signal quality is estimated a couple of times per second by counting the number of "suspicious" integrated biphase symbols, i.e. symbols with halves of opposite signs. The symbols are being sa