Imagine controlling any device ... just by sending commands using radio waves.
This is the future, Watson. "
Sherlock Holmes (Sherlock Holmes) -2009
It is difficult to imagine today's world without computers and various electronic devices. But since the invention of the transistor only 56 years have passed. Given that people own electricity from about the end of the 18th century - it’s amazing how quickly computers, phones, the Internet and other blessings of civilization burst into our lives, so familiar to us, but about 30 years ago, humanity could only dream of. Millions of people got their hands on the most powerful tool for self-realization and self-expression — after all, the truth is — have you ever wondered — how great is it that we can just take it and implement our idea without any special material investments? The computer allowed intelligent and talented people to realize themselves, the Internet gave access to petabytes of information, allowed millions of people to communicate with each other, find like-minded people, learn, learn professions, earn money - and all this without getting up from the chair ... In general, the lyrics are enough it will be a question of Software defined radio - what it is and how it works - learn under the cat
A bit of theory (yeah - how can we talk about such a complicated thing without it)
Let's start, perhaps, with the fact that Maxwell wrote his famous equations and analyzing them - predicted the existence of radio waves, which Hertz later confirmed. These equations tell us that an alternating magnetic field generates an electric one, and an alternating electric field produces a magnetic one, forming an electromagnetic wave, which I let in once, turned off the transmitter, and the wave lives and flies away into space. An electric field can generate not only a variable magnetic field, but also a charge, which follows from Maxwell’s equation (Gauss law)
The charge generates a field, if we take 2 charges at some distance from each other and one of them starts to jerk with some frequency, then after a while - with the same frequency it starts to twitch and the second - here two charges behave identical to two floats in water - if we want to transfer information from one bank of the lake to another - we place a float on both sides and start pulling at one of them - a wave will start to spread from it, which after some time will reach the other bank and rest before that on the other bank the float will begin to fluctuate. In the case of water, we can see the wave itself. The electric field - generally speaking it is not clear what it is - it cannot be seen, cannot be touched, it is a kind of abstraction, with the help of which everything is conveniently explained, and since we cannot see and touch abstraction - we can judge its presence only by the effect of the field on charges - by analogy with floats - we can only look at the float. If there is no wind on the lake - the float is at rest when there is no wave, but in reality there is almost no such thing - a breeze blows - there is a slight ripple on the water, where a fish or a frog splashed with water, someone else sits next to our float By transferring your information, or someone threw a stone into the water and waves come from all this, they are reflected from the shores and stones, stack, reinforce each other and weaken, and we can judge about this whole composition of events only by looking at the float. Welcome to the radio broadcast.
"Peace" "Lenin" "USSR" or - how to send a message to extraterrestrial civilizations
So - in order to send a radio wave - we need to move the charge in space from one point to another with some frequency, and it is logical that if we pull a lot of charges at once - each generates a wave, they all add up and form one big mega wave . It is also logical that the greater the amplitude in space, we will move the charge - the greater the amplitude of the wave. Our task is to force the charges to periodically run from one point of space to another, and for the time being - within the framework of our primitive model (I’m not going to load you with complex models) - it is desirable that they do it in a straight line.
Well - let's take a metal pin, cut it in the center and insert an alternating voltage generator into the center - during the first half period - one pin will be a plus, the other 0. Electrons that are in any metal and just wait to be kicked - here they will run to the plus, until they compensate for it and do it on this pin 0, but here comes the second half-period and the electrons begin to run from one pin to another, passing through the voltage generator. The generator in the center of the stick is nice, but not very convenient (the generator wants to be re-soldered, and reluctance to climb on the roof forever). Not a problem - we hook up two wires to the sticks and take them to our apartment, while the wires are also antennas, because charges run through them in space, but the wires are very close and the charges run in different directions, the waves generated by each wire are encountered out of phase, they kill each other, so that only the pin remains the working part and everything looks as if the charges themselves run from one end of the antenna to the other. So - we figured out the transmission - for reception we need to sit and wait for the wave to come and start pulling our electrons in the antenna, those running from one end to the other will run through the detector, the detector has some resistance, the current is converted at this resistance voltage, and we can measure and amplify voltage (in fact, in real circuits it is far from being the case, but I will not load you with such things as wave resistance and line matching, in general, everything is quite difficult, so consider for now that generated by wave the current runs through the resistance of the detector and is converted into voltage) - So - we learned how to receive and transmit radio waves - Mission Completed.
')
Level 2 - Modulation
Of course, it’s fun and interesting to watch the floats jerking in convulsions, but it quickly bothers you and wants to talk to your beloved grandmother, and we still know how to send an unthinking wave into space - in order to transmit some information using a wave - it needs to be modulated - for example, we can pull a float with a small amplitude - this will correspond to a logical 0, with a large amplitude - a logical one. Or we can pull more or less often - the main thing is to agree - what our codes mean. Now a little simple (and not so) mathematics - there are 3 types of modulation:
Amplitude
Frequency
Phase
Pictures can be viewed here in this article:
Modulation and I will probably stop at some points from mathematics, without which - in my opinion, to understand something at a normal level - is problematic.
So - we want to transmit some sort of time-varying signal
which has a spectrum
and generally speaking, it would be desirable to be able to move this spectrum, because if we all use the same frequency band, the spectra of different radio stations will overlap and the information will be distorted. There is a technological background (for example, 50 hertz from the mains), noise of the 1 / f type, and so on - in the low-frequency region, it is very inconvenient for us to transmit. In addition, different frequencies have different features of distribution, which is described in the above article. Having some level of mathematical culture - you can see that if you multiply the initial function by the complex exponent - the signal spectrum will shift by the frequency that stands in the exponent
the spectrum of the signal after multiplication is obtained as follows:
But unfortunately a complex exponential - mathematical abstraction, there are no real signals that satisfy our needs, but there is cosine to be content with this - we multiply the signal by cosine
It turns out that the original spectrum was divided into two - one crawled to the right, the second to the left along the frequency axis, and the one that falls into the negative frequency range is reflected relative to 0 and as a result we get the following picture:
there is a slight discrepancy to the written formulas - the fact is that I just called the cosine on the signal and multiplied as a rule by 1 + mx (t) , where m is a certain coefficient, then it turns out that the carrier frequency is also added to the two symmetric spectra
To transmit the AM signal in its pure form — irrational due to redundancy — it takes up to 2 times the frequency band than the original spectrum — a place in the frequency band is expensive, so one of the side bands together with a part of the carrier is suppressed by the filter
the carrier itself does not carry any information in itself - so it’s not scary if we reduce it, even save a little on transmitter power.
Well, now we are able to transmit the useful signal in the necessary frequency band. The main difference between modulations from each other - noise immunity - amplitude modulation transmits the original spectrum as it is only in the other frequency band, and in the frequency band where we move the original spectrum - there are interferences that add up to the useful signal and spoil it. In addition - the signal amplitude will vary depending on the distance to the transmitter, if there are buildings - reflections will occur, we will receive the same signal with a delay and hear the echo. Frequency modulation occupies a larger frequency band in the spectrum and due to this, it has high noise immunity - if on fingers - we smear useful information over a wide frequency band and if some frequency comes with interference that will spoil the signal, then it will spoil only a small part of it, because that the signal is spread over the spectrum. In fact, there is a lot to say about modulation and other things, especially about the transmission of digital signals, but there is a lot of mathematics there and in order not to be particularly scary - I will not discuss the issue in more detail.
The essence of SDR technology
Generally speaking - it’s very cool that mathematics gave us the opportunity to move the spectrum here and there easily - without this possibility, I hardly ever wrote this article at all, there wouldn’t be cell phones, free Wi-Fi in McDonalds and other pleasures of life. Our grandfathers - to extract information, they made all kinds of analog circuits that made the mathematical transformation we need, like this:
but since we have such a thing as a computer - we can not think - how to stick a couple of transistors, so that the output signal depends on the input according to the dependency we need - we just take and program the formula we need. Only now we would receive a signal in digital form so that there is something to work on - the SDR is responsible for this. Digitizes analog radio signal (or vice versa makes analog of digital signal when it comes to transmission). As we remember, we transmit the signal in the high-frequency domain, and to digitize the signal we need to have an ADC, which, according to Kotelnikov's theorem, must have a sampling frequency at least twice the maximum frequency of the signal. Although modern ADCs already allow digitizing the RF signal directly - it is a bit unwise - having the ability to move the frequency as we want - to set a super-expensive thresher at 2 GHz, which will digitize the signal directly. Recall - as we generally got the high-frequency spectrum - multiplied by the cosine and the spectrum went up and down the frequency of this cosine. And what actually prevents us from doing the same again? We multiply the signal from the antenna to cosine - again the spectrum is divided into 2 - one crawls into the low-frequency region, the other - into the high-frequency region, we cut off the high-frequency spectrum with a filter, and digitize the low-frequency spectrum, even though we can digitize any frequency ADC. - the speed of the ADC only affects the width of the digitized strip. Well, after that - after digitizing, we can already create our receiver with the help of programming - even radio engineering knowledge is not needed, only mathematics, radio engineers care - that the signal gets into the computer. Actually, in the following articles, if the topic arouses interest - I am going to tell you about the hardware of the SDR receiver, as well as the software part, you can also use modern methods of transmitting and encoding information. And finally, my amateur SDR, the Softrock RX / TX Ensemble II, works like this, which I received as a gift, using a PC sound card as an ADC, I didn’t record my video of work, therefore I’ve posted it found on YouTube - my receiver works the same way, the first photo in the article - it is