📜 ⬆️ ⬇️

Basics of digital signal processing for the smallest

Digital cameras, mp3, DVD, cellular communication, various digital signal processing algorithms are used everywhere. The figure has firmly entered our daily life, has greatly simplified the work with sound, graphics and video, made it possible to provide additional services in the usual telephone and much more.
But what is all the same "digital signal" and why it has such advantages, and most importantly how to get it. In this article I will try to explain the basics of analog-digital and digital-analog conversion of signals and tell you about the advantages of digital signals.

What is digital and analog signals and what is the difference? Figure 1 shows the simplest analog signal. Its main characteristics are the signal level and time during which this level changes. The number of complete cycles of a signal level change (that is, the number of times the signal level was the same) per unit of time is called the signal frequency. Frequency and level are not constant.

image
Figure 1. The simplest analog signal
')
The digital representation of such a signal is essentially a conversion of the value of a signal level taken at specific points in time into a binary system of calculation. Figure 2 shows the digital signal.

image
Figure 2. Digital Signal

As can be seen from the figure, a digital signal has only two level values, 0 and 1. Such a signal is very easy to process, because there are only two states. This property is used in logic, if input 0, then output 1, if input 1, then it does not pass, etc. Various coding and compression algorithms are easily applicable to such a signal. Such a signal is easy to monitor for errors, for example, if the sum of zeros and ones in a block is 0, then this block came to the receiver without errors, and vice versa.
Another plus of such a signal is that it has a high degree of noise immunity. After all, the receiver is only interested in two states, two signal levels, everything else is cut off in FIG.

Now let's see how all the same analog signal is converted to digital.
The first thing that needs to be understood is that the human senses are not able to analyze information in digital form. For this reason, the digit is applied only at the stage of signal processing. To a person, all information comes in analog form. Figure 3 shows the simplest signal conversion circuit. Here, the ADC is an analog-to-digital converter , and the D / A converter is a digital-to-analog converter .

image
Figure 3. Signal conversion circuit

As mentioned above: “A digital representation of a signal is essentially a conversion of the value of a signal level taken at specific points in time into a binary system of calculation.”
Let's try to convert our analog signal to digital. Take the signal level values ​​at certain intervals, as shown in Figure 4. This process is called discretization, and the frequency with which the signal level values ​​are taken is the sampling frequency (Fd).

image
Figure 4. Signal Discretization.

The question arises, what should be the sampling rate? After all, we need to take care of the inverse transformation, and most importantly so that during this transformation we do not lose information. It is not possible to convert all values ​​into each unit of time, otherwise the sampling rate would be equal to infinity.
The answer to this question was given by an outstanding Soviet and Russian scientist in the field of radio engineering, radio communications and radio astronomy - Kotelnikov Vladimir Alexandrovich in his theorem of the same name ( Kotelnikov's theorem ).
The essence of the theorem is that an analog signal can be recovered without loss if, during digitization, the sampling frequency was equal to twice the maximum frequency of the original analog signal.
For example, take the usual analog signal in a telephone line. Its frequency is not constant and depends on many properties of the human voice, but it always ranges from 0.3 to 3.4 kHz. That is, in this case, the maximum signal frequency of 3.4 kHz. Therefore, to digitize this signal with the possibility of its lossless recovery, you need to take a sampling rate of 6.8 kHz.

After the sampling process, we obtain a discrete signal, that is, a signal that represents individual samples taken over time (Figure 5).

image
Figure 5. Discrete signal.

It now remains to convert the resulting discrete signal levels into a binary system. For this purpose, such a concept as level quantization is applied. In other words, the scale of signal levels is divided into intervals - quantization levels . At this stage, the bit depth (bit depth) of the future digital signal is determined, and most importantly, how accurately the reconstructed analog signal will match the original one. The more levels, the more accurately the digital signal will correspond to the analog one.
Next, the discrete signals are assigned the value of the nearest quantization level. Take a look at Figure 6. As you can see, in fact, the values ​​of the discrete signal levels are rounded to the nearest quantization level. Naturally, this distorts the received digital signal. Such distortions are called “ quantization noises ”.

image
Figure 6. Quantization.

The quantization stage is complete. Now the levels of the discrete signal from the decimal system of conversion are converted to binary.

UPD: For example, one of the levels is 5, in the binary system it will be 101. As a result, we obtain a sequence (block) of three pulses with levels of 1.0 and 1, respectively. You also need to remember about the bit depth (the number of bits in the block) of the received digital signal, it should be the same in each block. For this, the missing number of bits in the form of zeros is added to the beginning of each block.

Everything, on this digitization of the signal is over. At the output we get the signal shown in Figure 2.
It is not difficult to guess that the process of digital-analog conversion is exactly the opposite, therefore it does not make sense to describe it. And yet, the restored signal will never be equal to the original, another question is whether we will feel the difference, because the human senses are far from perfect.
I described only the basic process of digitizing the signal. Naturally, digital signal processing does not end there. Further, various coding algorithms come in, which allow to eliminate redundancy (reduce volume, compress), add additional information to the signal for error control, and much more, but this is another story.

Source: https://habr.com/ru/post/60363/


All Articles