Skip to content
Oona Räisänen edited this page May 16, 2020 · 19 revisions

Raw multiplex (MPX)

By default, if no command-line option is given, redsea expects a raw FM multiplex input via stdin:

  • format: PCM
  • sample rate: 171 kHz
  • encoding: signed 16-bit little-endian
  • channels: 1

MPX refers to a demodulated FM multiplex signal at baseband, with its possible stereo subcarrier at 38 kHz and RDS at 56 kHz. You can obtain an MPX signal by demodulating an FM station without stereo decoding and de-emphasis.

MPX spectrum

The default sample rate of 171,000 Hz works fastest, as a neat multiple of the data speed. Any other rate will be resampled internally and can be specified using -r. The rate can't be lower than 128,000 Hz though.

Multiple stations can be decoded simultaneously using multi-channel MPX input, specified with --channels. This format consists of multi-channel frames; a frame is a block of samples, one sample for each channel. Each channel is demodulated independently and this is indicated in the output JSON stream with the channel field.

MPX can also be read from a WAV file (or any other format supported by libsndfile) using -f filename.wav. In this case, sample rate and the number of channels are detected automatically from the header.

Hex groups

Redsea can read demodulated RDS data in the hex format created by RDS Spy. This format has one RDS group per line written as ASCII hexadecimals. Each line must start with the group; space characters are ignored. Bad blocks must be replaced by ----. Lines shorter than 16 characters are ignored. Lines can also contain the RDS Spy timestamp information, since everything following the group is ignored.

$ redsea --input-hex
6403 0440 CB41 594C
6403 1440 00E1 7C54
6403 E443 2020 6202
6403 0441 B741 4520
6403 245D 2020 2020

{"pi":"0x6403","group":"0A","di":{"stereo":false},"is_music":false,"prog_type":"
Current affairs","ta":false,"tp":true}
{"pi":"0x6403","group":"1A","country":"fi","has_linkage":false,"prog_item_number
":31828,"prog_item_started":{"day":15,"time":"17:20"},"prog_type":"Current affai
rs","tp":true}
{"pi":"0x6403","group":"14A","other_network":{"pi":"0x6202","tp":false},"prog_ty
pe":"Current affairs","tp":true}
{"pi":"0x6403","group":"0A","di":{"artificial_head":false},"is_music":false,"pro
g_type":"Current affairs","ta":false,"tp":true}
{"pi":"0x6403","group":"2A","prog_type":"Current affairs","tp":true}

ASCII bits

The ASCII bits input can be useful if you are bit-banging an RDS decoder chip, for instance. It's very simple; just the delta-decoded raw RDS data as a stream of ASCII '0's and '1's. All other characters like line feeds are ignored.

$ redsea --input-bits

10001011100001011100110010000101100001010011001001110000101011110110101100010010
00110100000011010010000010001011100001011100110000000101100010101000101011101001
10101100111110100101010100100010000011001001110010001011100001011100110000100101
10010110100110010101000101010100110101100000010101000100010101111110110010001011
10000101110

{"pi":"0x22E1","group":"2A","prog_type":"Easy listening","tp":true}
Clone this wiki locally