Basic principles of digital wireless communications. Educational program

  • Tutorial

Hello. In this article, I would like to talk a little about the basic techniques and ideas of modern digital wireless communications - using the IEEE 802.11 standard as an example. Nowadays, very often people live at rather high levels of abstraction, poorly imagining how the things around us work. Well, I’ll try to bring the light of enlightenment to the masses. The article will use the things and terminology explained in this article . So people far from radio are recommended to read it first.
DANGER: there is a matan in the article - it’s especially sensitive not to press this button:

Digital Signals and Spectra

Analog signals

Before the development of computers - usually analog signals were transmitted through radio waves - that is, signals whose many values ​​are continuous .

For example - sound - the dependence of pressure on time. The signal (voltage) received from the receiver is fed to the audio frequency amplifier and causes the speaker to vibrate.

Or a video signal for a kinescope. The signal level determines the value of the power running on the screen of the beam, which at the right moments of time illuminates the phosphor, forming an image on the screen

The main disadvantage of this method of transmitting information is low noise immunity - the transmission medium always introduces some random component into our signal - a change in the shape of the video signal changes the colors of individual pixels (we all remember the noise of the radio and ripples on the TV screen).

Digital signals

Digital signals - that is, signals that have a discrete set of values - are much better than analog ones in this parameter, since we are not directly interested in the signal value, but in the range in which this value is located and we are not afraid of interference (for example, in the voltage range 0V - 1.6V we We believe that this is log 0, and in the range 3.3V - 5V log 1). The payback for this is an increase in the required speed of transmission and processing of information.

The first thing that people have learned to do is to naturally transmit such signals by wire, simply by switching the state of the data line and synchronization from one to zero.
On this, a small educational program has been completed - hereinafter we will talk about how - but how is a digital signal transmitted using radio waves. How does WiFi work?

Single pulse spectrum

In radio communications, we are often interested in the spectrum of a signal — a digital signal — a sequence of rectangular pulses — to begin with, consider the spectrum of a single rectangular pulse.
Recall what a spectrum is (the coefficient before the integral is omitted):
The spectrum of a rectangular pulse of duration T and amplitude A :

We take out the constant for the integral and make the differential change.
We consider a certain integral.
Next, we make the sine replacement according to the Euler Formula

Taak - what about the negative amplitude? Recall that in real numbers the spectrum is decomposed into the sum of sines and cosines with zero phases -

in this form, it is actually more convenient to represent it in a computer, but for analysis this form is completely inconvenient - when the signal changes in the time domain, the spectra will change in a completely incomprehensible way for a person, therefore two spectra of sinus components and cosine components are converted into polar coordinates, folding pairs sines and cosines with a zero phase into a sine with a non-zero phase, obtaining the amplitude spectrum and phase, and now recall that multiplying the signal by -1 is equivalent to a phase jump of 180 degrees, so the negative part will be reflected relative to the horizontal axis, and at the inflection points the phase will experience a 180 degree jump.

We also see that the spectrum of a single pulse is a sinc function , quite common in digital signal processing and radio engineering.

Almost all of the pulse energy is contained in the central peak of the spectrum - its width is inversely proportional to the pulse duration. And the height is directly proportional - that is, the longer the pulse - the narrower and higher its spectrum, and the shorter - the lower and wider.
The spectrum of a pulse sequence can be considered, with a good degree of accuracy, as a set of harmonics in a spectral band whose width is inversely proportional to the pulse duration T.

So, the conclusion is that by decreasing the pulse length of our digital signal we can smear the signal over a wide band of the spectrum - in this case, its height proportionally decreases - with an increase in the band N times - the spectrum height will decrease by the same amount down to the noise level. Broadband transmission has quite a few advantages - one of them is resistance to narrowband interference - since the information is spread out over the spectrum - narrowband interference spoils only a small part of this information.

If we stupidly reduce the length of the pulses of our information signal, the spectrum, of course, will expand, but the receiver does not know what information we are transmitting to it and will not be able to distinguish it from noise. Therefore, a method is needed - to convert a narrowband signal to a broadband noise-like one - for transmission over a radio channel, and after reception to convert back to a narrowband one - you need to add redundant information to the signal, that is, information known to both the receiver and transmitter, with which the receiver can distinguish the signal from noise . We encode every bit of information known to both the receiver and transmitter in a sequence.

Autocorrelation function. Barker Codes

Our task is to find a known short sequence in a long sequence of input data.
Autocorrelation is a statistical relationship between random variables from the same series, but taken with a shift.
This parameter is of particular importance in the location - here we generated some kind of signal and recorded the time - we know the speed of signal propagation, so knowing the time it took the signal to escape to the obstacle and vice versa - we can calculate the distance for the obstacle. But this is bad luck - there are no ideal conditions in life - as a rule, there is a lot of noise around and along with the reflected signal, all garbage enters the receiver input. And firstly, we should not confuse our signal with anything else, and secondly, it is enough to accurately determine the point in time when it came back.

Mathematically, autocorrelation is defined as follows:

That is, we impose the function on ourselves, but with a shift, we multiply and calculate the integral, mark the point, then shift again, again calculate the integral and so on for all possible shifts. If we apply the function not to ourselves, but to some other, then this is simply called correlation .
The picture below shows convolution , correlation, and autocorrelation operations .
The difference between convolution and correlation - in the direction - convolution of the functions f (x) and g (x) - is the same correlation, only the functions f (x) and g (-x), autocorrelation is the correlation of the function with itself

That is, at the time when the input signal is most similar to the function we need, the correlation function will have a peak. The width of this peak, if noise is not taken into account, will be equal to twice the length of the probe pulse and will be symmetrical with respect to the central peak - even if the signal under investigation is not symmetrical. By the way - there can be several peaks - the central peak and the so-called side lobes - depends on the function. The correlation method is the most optimal method for determining a signal of a known shape against a background of white noise - in other words, the method has the best signal to noise ratio. The probe pulse must satisfy the following requirements - to have the narrowest central peak and at the same time to have a minimum level of side lobes, that is, the function is similar to itself only in a very short time interval - slightly shift and it becomes completely different. In the location, the chirp signal satisfies these requirements .
Having a minimum level of side lobes, the autocorrelation function of the chirp signal is as follows: An
analog of the chirp signal in discrete systems is the Barker sequence.
For example, the well-known sequence of 11 bits in length: 11100010010.
We find the autocorrelation function of this sequence, cyclically shifting it and counting the sum of pairwise products, thus replacing the 0 to -1
And so on - in general, the autocorrelation function has a value of 11 only with complete coincidence, in all other cases - -1.
The same is true for sequence inversion, that is, for 00011101101. Plus, the direct and inverse sequences weakly correlate with each other - we will not confuse them.
It turns out that we can encode each bit of information with 11 bits of the Barker sequence - direct for units and inverse for zeros. The elements of a Barker sequence are called chips . In practice, coding happens like this:

The receiver can simply read the correlation of the Barker sequences (direct and inverse) and the input signal and determine the peaks of the correlation function - where zeros are encoded in the input signal, and where are zeros


In general - how to make a narrowband information signal - broadband noise-like, and then restore it - figured out. Now let's talk a little about the methods of transmitting data through the medium - the medium may be vacuum, air, fiber, wire, etc. In order to transmit a signal using radio waves, we need a carrier frequency, modulating it - we push our information onto the carrier. There are 3 main types of modulation - amplitude, frequency and phase.
You can send our signal ready for transmission to the switch and simply turn the carrier transmission on and off - thereby modulating the amplitude The
advantages and disadvantages of amplitude modulation were considered in this article , so we will not dwell on it in detail here - at the present time, amplitude modulation is almost never used.

The next type of modulation is frequency , when the data signal controls the carrier frequency - either directly (VCO), or switching between two different generators (a phase jump occurs)
There is also something to say, but some other time, otherwise the article will turn out too much big.

Phase modulation

It’s easy to guess that here we are encoding information in the phase of the signal — for example, zero corresponds to a zero phase shift, and a unit corresponds to a 180 degree shift — this encoding method is easily implemented technically — for example, multiplying a signal by 1 means we have a zero phase shift, and multiplying by - 1 - 180 degree shift. This modulation is called the Binary Phase Shift Key or BPSK.
But what if we want to have more phase shifts? First, I’ll explain the logic of the engineers who came up with the following dances with a tambourine - you have only 2 control signals - 1 and -1 and with the help of them you need to code an arbitrary number of phase shifts in the simplest way - you can of course put some kind of super DAC and control the generated frequency directly but math offers us something better. Namely, this formula:

By the way - on its basis we made the transition from the spectra of sinusoids and cosines with zero phases to the spectrum of sinusoids with nonzero phases and the phase spectrum - now we just do the inverse transformation.

This is the basis of Quadrature Modulation
- together with the carrier, we generate another signal that is shifted relative to the carrier by 90 degrees, that is, it is squared with it . Now - by controlling the amplitude of each signal (In phase and Quadrature) - multiplying by 1 or -1, and then adding up - we can already get 4 possible phase shifts.

Now at a time we can encode 2 bits. That is, the transmission rate doubles. But the likelihood of an error will also inevitably increase.

Similarly, a larger number of phase shifts can be obtained. Possible signal states are usually shown on the vector diagram or on the plane of the signal constellation.
Please note that the sequence of binary words on the diagram is a Gray code , which minimizes the probability of error. In addition - there is an additional shift of 45 degrees - this is done in order to reduce spurious amplitude modulation during phase jumps by 180 degrees

In practice, the synchronous transmission method is not used - because there is a binding to some kind of initial phase, and over time an error accumulates and the phase floats away, you need to constantly reset the initial phase - synchronize the receiver and transmitter. Therefore, the carrier of information in real systems is not a phase, but a phase change - a differential signal transmission method eliminates synchronization. For example, each time zero appears, the phase makes a 180 degree jump (BPSK).

Then we can start talking about the intricacies of implementation - as always - in practice, everything turns out to be more complicated than in theory, this article is rather a small educational program for expanding one's horizons.