Close

Sensing the RF

A project log for SDR in a box

A simple box that will open airwaves for you

piranha32piranha32 08/21/2014 at 02:180 Comments

In my project I have to detect presence of short pulses sent by the transmitter. The detector must be robust, must be able to automatically adjust to changing signal and noise levels, and provide a mechanism for recording geographic coordinates of the location where the signal was detected. After quick scan of available GnuRadio modules I decided to implement the detection myself, because none of the existing modules was able to do the job.

My implementation is split into three blocks, that can be connected together to form a pulse detector. Each of the blocks can be used independently of the other.

Computing stream statistics

The detection method I chose uses comparison of the momentary signal level to the threshold computed dynamically based on mean value and standard deviation of the input signal. Classic formulas that can be found in the books assume that the statistics is calculated for all samples. Since I am interested not in overall statistics of the signal, but in the conditions at most k samples earlier (where k is the window size in samples), I had to find a way to calculate statistics over a finite window.

Computing average value over a window is pretty simple, however standard deviation is much more challenging. After a long search I found this post. Although the math may look intimidating at the beginning, the principle is very simple: the value of variance of the signal is computed using partial sums updated for each sample. As new sample is coming, its value and a square are added to the partial sums, and the values and squares of the sample from k steps away are subtracted. With this simple trick each of the partial sums contains only values for samples between time moments n-k and n.

Detecting the pulse

[TBC]

Logging the data

[TBC]

General structure of pulse detector

Discussions