Rainbow plots

03.12.2012 18:57

In the most simple mode of operation, VESNA with the spectrum sensing expansion is basically a very slow, slightly inaccurate but also a very small and cheap spectrum analyzer. The FCD scanner application exploits that and displays the spectrum in the traditional waterfall plot or a plain spectrogram.

Because of limited bandwidth the receiver can only see a small part of the spectrum at once and operates as a swept-spectrum analyzer. This means that it's essentially blind at most frequencies most of the time. If a device is transmitting individual packets with a lot of quiet time in between it is very probable that its transmission will only be picked up after several frequency sweeps, as it must happen by chance that VESNA's receiver will be listening at the same frequency as the transmitted packet.

FCD scanner waterfall spectrogram plot.

The waterfall plot shows this nicely, for instance above for wireless LAN beacons - these are transmitted in regular intervals with a bandwidth much wider than resolution bandwidth, hence giving a distinct moiré pattern.

However, waterfall plots aren't particularly convenient to estimate the power of the signal or it's bandwidth since the power is displayed in color. On the other hand just plotting power versus frequency doesn't show you information about past sweeps.

Active FMT triggered by frequency change of a WLAN signal

Rohde & Schwarz has this really nice persistence display mode on their high-end spectrum analyzers that shows signal's history in color and power and frequency on the spatial axes. What they do is basically show you a two-dimensional histogram of power and frequency pairs (more detailed description is in their white paper).

This is all great, but their hardware can do hundreds of thousands of Fourier transforms per second, meaning they fill up the histogram in an instant. Directly copying this method to FCD scanner is quite useless, as VESNA gives you a sweep per second or less. This means it takes unreasonably long to accumulate enough history to build any kind of a useful histogram. Here's for instance how the histogram looks like for a history of 10 sweeps:

FCD scanner old persistence spectrum plot.

I did however come up with a method that manages to produce results that are pretty close to the histogram method, but actually works with significantly less data. Here's how it looks like:

FCD scanner new rainbow persistence plot.

The outline of the wireless LAN network is nicely visible, as well as some other packet transmissions on the higher frequencies.

It works by sorting all power measurements at each frequency from the highest to the lowest, placing them on a power versus frequency plot and then filling the space between the samples with colors from a colormap. The colors are evenly distributed between the samples, with the median value given the highest value (i.e. brightest color) and both extremes given the lowest one. This gives you one vertical line and the whole plot is constructed by repeating this procedure for all frequencies in a sweep.

This display mode is now available using the --rainbow-plot option in fcd_scanner. Check the source for exact details of the implementation - the rainbowplot() is just 28 lines of code using matplotlib.

Posted by Tomaž | Categories: Code

Add a new comment

(No HTML tags allowed. Separate paragraphs with a blank line.)