Skip to content

Configuring rawfile outputs

Tomasz Lemiech edited this page Feb 8, 2018 · 9 revisions

RTLSDR-Airband can record raw I/Q data of any configured narrowband channel. Recorded data can be demodulated or analyzed with external digital signal processing software, like GNURadio or csdr.

Syntax

outputs is a list of outputs where the audio stream of a particular channel is to be routed. An output is a group of settings enclosed in braces { }. The number of outputs per channel is unlimited.

outputs: (
  {
    type = "rawfile";
    directory = "/home/pi";
    filename_template = "TOWER";
#   continuous = false;
#   append = true;
  }
);

Want more outputs? Just repeat the braced section several times and separate individual sections with a comma, like this:

outputs: (
  {
    # ... settings for output 1
  },
  {
    # ... settings for output 2
  }
# , ... more outputs here
);

Remember, do not put a comma after the closing brace of the last output. This is a syntax error.

Settings description

  • type (string, required) - type of this output. Put "rawfile" here.
  • directory (string, required) - the directory path where output files will be stored. It must be created beforehand.
  • filename_template (string, required) - the file name prefix. RTLSDR-Airband appends the current date and UTC time to it and creates a new file on top of every hour. A .cs16 suffix is added automatically.
  • continuous (boolean, optional) - whether RTLSDR-Airband shall record the data continuously (true) or skip silence periods when squelch is closed (false). The default is false.
  • append (boolean, optional) - if set to true (the default), RTLSDR-Airband will append the recording to the file, if it already exists. When false, the old file will be overwritten.

Format of recorded data

Recorded I/Q data is saved as complex signed 16-bit, little endian (hence the cs16 file name suffix). This means that the sequence of bytes in the file is as follows:

i1 I1 q1 Q1 i2 I2 q2 Q2 .... iN IN qN QN

where:

  • iN and IN are the least and the most significant byte of I sample number N
  • qN and QN are the least and the most significant byte of Q sample number N

Sampling rate of the recording is:

  • 8000 samples (I/Q pairs) per second when RTLSDR-Airband has been built with NFM support disabled
  • 16000 samples (I/Q pairs) per second when RTLSDR-Airband has been built with NFM support enabled

Postprocessing examples

csdr

Demodulating AM from I/Q file using csdr and playing it with mplayer:

cat filename.cs16 | csdr convert_s16_f | csdr amdemod_cf | csdr fastdcblock_ff  | csdr agc_ff 200 0.2 0.05 0.000001 | csdr limit_ff | csdr convert_f_s16 | mplayer -cache 1024 -quiet -rawaudio samplesize=2:channels=1:rate=16000 -demuxer rawaudio -

Note: substitute rate=16000 with rate=8000 if you have built RTLSDR-Airband with NFM disabled.

Demodulating NFM from I/Q file:

cat filename.cs16 | csdr convert_s16_f | csdr fmdemod_quadri_cf | csdr limit_ff | csdr deemphasis_wfm_ff 16000 100e-6 | csdr convert_f_s16 | mplayer -cache 1024 -quiet -rawaudio samplesize=2:channels=1:rate=16000 -demuxer rawaudio -

GNUradio

You can use the recorded file as an input to your GNUradio flowgraph. Just use File Source block, set the correct file path, set the "Output type" property to "Short" and "Vec length" to 1.


Now you may want to read about configuring other output types for your channels:

or jump straight to:

Clone this wiki locally