-
Notifications
You must be signed in to change notification settings - Fork 38
Input formats
Raw MPX is the default input format if no command-line option is given. It gets read via stdin.
- format: PCM (no headers)
- encoding: signed 16-bit little-endian
- channels: 1
You should at least set the sample rate with -r <rate_hz>
.
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. In many SDR programs this is called the NFM mode. It looks like this:
A sample rate of 171,000 Hz works fastest, as a neat multiple of the data speed. Any other rate will be resampled internally. 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.
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 or any other comments, 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}
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 spaces and line feeds are ignored.
$ redsea --input bits
10001011100001011100110010000101100001010011001001110000101011110110101100010010
00110100000011010010000010001011100001011100110000000101100010101000101011101001
10101100111110100101010100100010000011001001110010001011100001011100110000100101
10010110100110010101000101010100110101100000010101000100010101111110110010001011
10000101110
{"pi":"0x22E1","group":"2A","prog_type":"Easy listening","tp":true}
The TEF6686 outputs USB serial data that looks like this:
R34104000cd4600
Ss66.2,7,34
Pa502
Ss66.1,8,34
Pa502
Ss66.0,10,34
Redsea can read this via stdin and decode into RDS groups with redsea --input tef
.