Silver bullet for the Kremlin demon


Finally, in the topic of navigation interference, we got to the coolest and most interesting. Moreover, this interesting turned out to be not so difficult technically.

This is interesting - spatial processing of signals from antenna arrays. In ordinary, especially amateur, radio communication and radio navigation practice, this is still rare. This is due to the additional multiple costs for the number of radio paths. But sometimes this is perfectly acceptable. For example, in mobile communications. Spatial processing, MIMO, is widely used here. Even a regular WiFi hotspot has had it for a long time.

Although there are still few examples of the use of spatial processing in amateur radio engineering, it is beginning to gain its place. This is facilitated by lower prices for SDR cards with 2x2 MIMO, such asLimeSDR or XTRX ... There are even relatively inexpensive solutions for Massive MIMO ...

In the practice of satellite radio navigation, antenna arrays are even less common. This is probably due to the narrowness of the field of knowledge, but not only. The complexity of the processing schemes remains an important factor. Signals from GPS, GLONASS and others satellites have such a low power on the surface of the Earth that even an inexperienced intruder can easily create interference millions of times higher than this power. What can we say about the state violators, for whom I had chase some years ago. All Moscow will not let you lie. Kremlin demons!

The problem is a nationwide one, so we urgently turn to practice. We take a four-channel antenna array of the L1 range. Let's take a four-channel SDR card for satellite navigation. We connect.


We make a synchronous recording of the signal from four antennas from the windowsill. At the same time, we emit harmonic interference from the LimeSDR output at the center frequency of GPS L1 - 1575.42 MHz. The signal spectrum is as follows:


To plot the spectrum, we use a Matlab program obtained fromprof. Dennis akos and slightly modified to handle a 16-bit complex signal. Here there is an archive with sources.

In addition to the spectrum, the program displays more detailed signal parameters: histogram and graph over time.


Analysis of the graphs shows that the input signal fills almost the entire available dynamic range of the digital path. From the maximum of the signal to the noise of about 60 dB, which, even taking into account the gain from the FFT processing, is quite a lot. Let's check that this is enough so that the satellite signals are not found by the correlator.


As you can see, the "spectrum" of GPS L1 C / A-code signals is uniform, without bursts. This means that no satellite signals were found. We check four files (from each antenna) - nothing.

Now let's hit radio electronic crime with easy math. Let's take a simple Matlab code like this:

<code lang="matlab">% clean up
close all;

% read data from 4 files
fileNames = ['c:\work\aj\habr1\dump2\Dump_15_channel_0.int16';...

countFiles = size(fileNames,1);
countInSamples = 5000000;
dataArr = zeros(countFiles, countInSamples);
fID = 0;
for i = 1:countFiles
fID = fopen(fileNames(i,:));
if (fID == -1)
fprintf('This file does not exist: %s\n', fileNames(i,:));
data = fread(fID, countInSamples, 'int16');
dataArr(i,:) = data;


% create I/Q array
dataArrIQ = zeros(countFiles, countInSamples/2);
for i = 1:countFiles
k = 1;
for j = 1:2:countInSamples
dataArrIQ(i, k) = complex(dataArr(i, j), dataArr(i, j + 1));
k = k + 1;


res = (diag(diag(inv(corrcoef(dataArrIQ'))).^(-1)) / corrcoef(dataArrIQ')) * dataArrIQ;


% write the result into 4 files
for i = 1:countFiles
out = zeros(1, countInSamples);
for j = 1:(countInSamples/2)
out(2*j-1) = real(res(i,j));
out(2*j) = imag(res(i,j));
fID = fopen(strcat('out',num2str(i),'.int16'),'w');
fwrite(fID, out, 'int16');
Here is a specially given code with all the giblets so that you can copy it and use it for launches and improvements. After launching this simplest spatial noise compensator, output files are obtained, from which we choose the best one and again check it on the software receiver of Professor Akos.


From the spectrum, we see that the interference did not disappear at all, but decreased in level by about 30 dB. Why didn't she fall lower? The next graph gives us a clue.


The statistics of the samples at the output of the compensator are similar to the statistics of noise. The spectrum is plotted using the Fourier transform, which "exposes" the harmonic components of the mixture of interference and noise. And in a wide band, small remnants of interference "drown" in the noise. We did not succeed in suppressing the interference below the noise. Physics. Although in the time domain, the harmonic remains visible.


So, the noise has decreased by 30 dB. What will the correlator show us now? Will he be able to find the signal?


Voila! Signal found! The receiver has detected satellite number 1. The correlation level is not very good, but let's give the receiver a little work and see the results.


In the top plots, we can see the constellation and demodulation result quite clearly. The results of the correlator, phase and delay loops do not look very good. They bend over time. This can be explained by the shortcomings of the presented compensator algorithm, which we will talk about later. But this does not change the main thing: the hindrance is removed by the power of mathematics!

Thanks to Matlab, all the math is in one line of code:

<code lang="matlab">res = (diag(diag(inv(corrcoef(dataArrIQ'))).^(-1)) / corrcoef(dataArrIQ')) * dataArrIQ;</code>
In a more readable form, the code will be like this:

<code lang="matlab">cm = corrcoef(dataArrIQ');
cc = diag(diag(inv(cm)).^(-1));
res = (cc / cm) * dataArrIQ;</code>
First, the autocorrelation matrix of the input signal is calculated. Then this matrix is reversed and each row of the inverse matrix is divided elementwise by the corresponding diagonal element. The inverse matrix normalized in this way is multiplied by the input signal and the result is a noise-free output signal. The idea behind this operation is to "decorrelate" signals received from different antennas and highly correlated due to the presence of interference. The calculation formula is as follows:


With such simple math, you can pull the GPS receiver out of the demon's mouth and get a pretty good SNR.


There is one caveat: since the interference is harmonic, it can be suppressed by a frequency filter, not a spatial one, without using an antenna array. This capability is now built into all good navigation receivers. We have considered the compensation of harmonic interference by the antenna array in order to simplify the material. But it does allow us to demonstrate a principle that can be used to combat broadband interference as well. Broadband interference compensation is somewhat more complicated. We hope to talk about broadband interference compensation in future posts.

Also, the disadvantage of the presented code is the interval over which the interference parameters are averaged. Now it is equal to the sample duration. In reality, the parameters change over time, and we must track these changes at the desired rate.

All of the above you can do yourself. Take the compensator code from the article. Receiver code from Professor Akos here ... Take files with recordings here ... Remember, they all weigh over a gigabyte together.

Modify the code, achieve better results, publish them. Who knows, maybe some of us will be able to approach the characteristics of the best products of the domestic industry, such as this is ...
Papay 5 march 2021, 22:03
Vote for this post
Bring it to the Main Page


Leave a Reply

Avaible tags
  • <b>...</b>highlighting important text on the page in bold
  • <i>..</i>highlighting important text on the page in italic
  • <u>...</u>allocated with tag <u> text shownas underlined
  • <s>...</s>allocated with tag <s> text shown as strikethrough
  • <sup>...</sup>, <sub>...</sub>text in the tag <sup> appears as a superscript, <sub> - subscript
  • <blockquote>...</blockquote>For  highlight citation, use the tag <blockquote>
  • <code lang="lang">...</code>highlighting the program code (supported by bash, cpp, cs, css, xml, html, java, javascript, lisp, lua, php, perl, python, ruby, sql, scala, text)
  • <a href="http://...">...</a>link, specify the desired Internet address in the href attribute
  • <img src="http://..." alt="text" />specify the full path of image in the src attribute