Skip to content

View a saved cu8 file

Rick van Schijndel edited this page Mar 30, 2019 · 3 revisions

Under development : Version 0

Three ways to view a saved ".cu8" transmission sample file

1. Introduction

When investigating the transmissions from a new device, it is sometimes helpful to see the waveform of a transmission, in order to discover the modulation scheme, and to determine timing parameters. This entry describes (with pictures) 3 different options that are available:

  • Audacity : an open source audio editor, is a "traditional" suggestion for viewing the waveform of a signal.
  • sigrok / pulseview : a more recent option. rtl_433/examples includes a script (sigrok-open.sh) which will convert a cu8 file into the correct format(s) and then open the temporary files in pulseview for you.
  • IQ Spectrogram : an online option that you can use from a browser, without needing to install any software on your own computer. IQ Spectrogram presents a view similar to the "waterfall" display available from "software defined radio" programs, such as SDR# (with the waveform displayed along the bottom of the screen).

When run with the appropriate runtime option, ie rtl_433 -S all -f ..., rtl_433 saves transmission files, with names ending in ".cu8", that can be used to provide inputs to all of these programs.

2. Audacity

To quote from its website

Audacity is an easy-to-use, multi-track audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems. Developed by a group of volunteers as open source.

Audacity is also great software for looking at the waveform of individual saved ".cu8" test files.

It can be obtained from the Audacity project website

After installing it, you :

  • import the .cu8 file as a raw sample,
  • nominate
    • unsigned 8-bit PCM encoding,
    • "no-endianess" byte order, and
    • set the correct sampling frequency (the rtl_433 default is 250000 Hz) to get a valid timescale, then
  • zoom in and see the individual pulses
  • (and even the I and Q components of your signal as the left and right stereo channels).

See the images below for what you should see.


Tip

If you aren't sure what I and Q components of a signal means, there are lots of helpful websites. Some that I particularly liked (the first one has some neat interactive graphics) are :


Audacity screen images

These come from the Windows version of Audacity (version 2.2.2) downloaded around October/November 2018.

On first starting Audacity, you see the following introductory screen.

Introductory screen

I set the project sample rate (bottom left of the screen) to 250000 Hz. On reflection, I think this was unnecessary (but it seemed to do no harm either)

Set sample rate

To load a cu8 file, use File > Import > Raw Data ...

File Import Raw

After selecting the cu8 file to be imported, a dialog box pops up. This is where you nominate 8 bit PCM, no-endianness, and a sample rate of 250000 Hz. This sample rate matters (since otherwise all the timings that Audacity reports are wrong)

Set import options

An initial view of the whole transmission. This is a burst of OOK data (constant amplitude On Off signals), not FSK (frequency change modulation).

Initial view of the complete transmission

After using View > Zoom In (a few times)

Zoom in on part of the transmission

(and adjusting the horizontal scroll bar), you can see a sequence of individual pulses.

Sequence of individual pulses

Audacity shows two tracks, labelled left and right channel stereo. In the case of cu8 files, these are the I and Q signals (which is which is pretty arbitrary). Some "clever" transmission schemes send different information in the I and Q signals (effectively doubling the transmission rate), but you can see here that the I and Q signals are pretty much the same.

You may also spot that the pulse widths are pretty constant, but the gaps between them vary (this is a PPM modulation scheme).

When you zoom in still further (this next image shows 3 pulses and two gaps), it becomes apparent that the I and Q signals within a pulse aren't all that stable. The Digitech XC-0324 temperature sensor that generated these samples is a low cost device after all (and this one had just been in the freezer for half an hour). I believe that usually the I and Q signals are combined using quadrature (combined signal = square root (I squared + Q squared)) to get a cleaner signal for analysis.

Close up view of three individual pulses

Zoom in really close, and the display changes. Here you are seing the I and Q values of individual sample readings, within a single pulse, shown as dots and vertical bars.

Really close up view of IQ values for individual samples

Audacity can display more than one cu8 file at a time. (It's core objective is to allow users to edit and mix audio tracks). This final image shows three cu8 files, from 3 different Digitech XC-0324 transmitters.

Note how the I and Q values from the 2nd sensor (the middle pair of tracks) appear noticeably more stable than those from the 1st and 3rd sensors.

IQ values from 3 different transmitters

3. sigrok / pulseview

PulseView is one component of the sigrok (pronounced ess-eye-grok, I think) project.

From the sigrok wiki home page

The sigrok project aims at creating a portable, cross-platform, Free/Libre/Open-Source signal analysis software suite that supports various device types (e.g. logic analyzers, oscilloscopes, and many more). It is licensed under the terms of the GNU GPL, version 3 or later. Design goals and features include:

...

Cross-platform. Works on Linux, Mac OS X, Windows, FreeBSD, OpenBSD, NetBSD, Android (and on x86, ARM, Sparc, PowerPC, ...).

...

Various frontends. PulseView (LA GUI), sigrok-meter (DMM GUI), sigrok-cli (command-line), and other frontends all build upon the above libraries.

The wiki contains links to the sigrok downloads page, which provides instructions for numerous options for obtaining and installing PulseView on different hardware and Operating System combinations.

In the rtl_433/examples/ directory there is a script, sigrok-open.sh which uses rtl_433 to manipulate a saved cu8 file, convert it into the format(s) expected by PulseView, and then opens the (temporary) files it has created using PulseView.

To invoke it you just enter the following :

examples/sigrok-open.sh <path to the cu8 file>

Of course, you have to have installed pulseview first. On my Raspberry Pi, with Raspbian stretch as the OS, I opted for a simple approach :

sudo apt-get update
apt-get install pulseview

This had one small downside, namely that it installed a rather old version (0.2.0) of PulseView. (As at Jan 2019, the stable release version from the sigrok website is 0.4.1). Apparently the PulseView API has changed very slightly since version 0.2.0 --- anyway, to get the sigrok-open.sh script to work for me I had to make a minor edit to one line, towards the end of the script, removing the -i from

pulseview -i "$out"

so that it read

pulseview "$out"

On different systems, and with more up to date versions of pulseview, this should not be necessary.

One other tip : "under the hood", the open-sigrok.sh script invokes rtl_433 to generate some temporary files. When I first tried to run the script, although I had compiled rtl_433 (several times!) I hadn't remembered to install it, so it wasn't found (and since it runs in quiet mode, I didn't see any error messages). Once discovered though, easily fixed. From the appropriate build directory, run :

make install

After which you can really easily use sigrok-open.sh to view cu8 file waveforms.

PulseView screen images

These screen images were taken from a Raspberry Pi, running Raspbain Stretch as the operating system, and an older version (0.2.0) of PulseView.

When PulseView first opens, it is zoomed out, so nothing much is visible :

Initial sigrok PulseView screen

Don't panic, just use View > Zoom to Fit (or the equivalent screen button) and you immediately see :

After View Zoom to Fit

Zoom in more closely and you get a nice clean representation of the waveform of your signel :-)

I haven't worked out yet whether the nice clean square nature of the waveforms is due to :

  • the way rtl_433 prepares the files for PulseView, or
  • the way PulseView decides to display "logic" waveforms.

It does make identifying the modulation scheme (OOK PPM) easy though, since the (varying) gaps between the pulses stand out nicely.

Zoom in some more

(After zooming in still further) there is a View > Show Cursors menu option which makes reading the timing parameters for the modulation scheme really easy as well.

View Show cursors

4. IQ spectrogram

Using IQ spectrogram is really quite simple.

Point your bowser at the (http://triq.net/iqs) web address, and then either :

  • "drag and drop" a cu8 file onto the screen, or
  • press the "+" symbol, and select the cu8 file to upload.

If all goes well, you should see something like the images below pretty well instantaneously.

Caveat

At the time of drafting (mid Jan 2019), using a laptop running Windows 10, this :

  • works fine using Chrome as a browser
  • but encounters a javascript error when using Edge or Internet Explorer 11.

This may be a quirk of my laptop (it is rather old :-( ), or something else ...

IQ Spectrogram Images

As mentioned earlier, IQ spectrogram images are rather similar to a snapshot of the the "waterfall" displays produced by SDR programs.

Except that the "waterfall" is rotated 90 degrees, so transmission frequencies are shown vertically, and time "falls" horizontally across the screen.

Changing the menu option from db tiny to db full makes the individual pulses easier to see (at the bottom of the screen, below the sideways waterfall)

Changing the menu option from x1 to x8 zooms in and gives a better view of the shape of individual pulses.