Meaning of rtl_fm output values

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/osmocom-sdr@lists.osmocom.org/.

Müller, Marcus (CEL) mueller at kit.edu
Wed Mar 14 20:10:43 UTC 2018


Hi Theodric,

no, these values that appear on stdout are already audio samples (PCM
to be specific).

That is the "job" of rtl_fm:
It takes the complex time-domain baseband samples from the hardware,
detects FM (which implies detecting a frequency deviation) and convert
that to audio amplitude values.
The `aplay` command barely takes these samples and hands them over to
the sound card (after resampling to fit possible sampling rates, I
guess, as 120 kHz isn't something that sound systems usually operate
at).

The `rtl_fm` command takes a couple of parameters. In your case, `-M
wbfm` means that it's demodulating FM in a way compatible to broadcast
FM; that implies fixed parameters for deviation, emphasis etc.

What you want is really not `rtl_fm`, which primarily is a demo
program, not meant to be a flexible do-it-all solution.

What you want, showing deviation of a station, does very much sound
like a spectrum visualization. Wouldn't a waterfall or even just an
instantaneous spectrum visualization be what you want?

Best regards,
Marcus

On Wed, 2018-03-14 at 15:57 -0400, Theodric Young wrote:
> Hi,
> 
> I'm new to SDR and I have a question about the data values that are 
> generated by the rtl_fm program.
> 
> I got rtl_fm running on my system (cygwin running on Windows 7).  It is 
> sending a stream of 16-bit signed integer values to stdout which I can 
> redirect to a file or pipe to an audio playback system, such as sox.  So 
> when I do this:
> 
>   rtl_fm -f 88.1M -M wbfm -s 240k -r120k -g 30 | play -t raw -r 120k -b 
> 16 -c 1 -e s -V1 -
> 
> I hear sweet, sweet music!  Hurray!
> 
> But how do these 16-bit integers relate to the modulation level of the 
> carrier?  I'm assuming that the values are directly proportional to the 
> instantaneous frequency deviation of the transmitted signal.  Is that 
> right?  If so, how do I determine that ratio?  I'm hoping to use this to 
> build a device that shows total modulation (as a percentage of the 
> maximum modulation of +/- 75kHz) for an FM radio station.
> 
> Also, I'm assuming that the sample-rate of the output data stream needs 
> to be at least 120kHz because the baseband signal includes the stereo 
> pilot (19kHz), the stereo subcarrier (38kHz) and an RBDS subcarrier (57 
> kHz).
> 
> Any insight would be appreciated.  Thanks in advance,
> 
> Theodric Young
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6582 bytes
Desc: not available
URL: <http://lists.osmocom.org/pipermail/osmocom-sdr/attachments/20180314/426bda64/attachment.bin>


More information about the osmocom-sdr mailing list