Brief Explanation of Digital Signal Processing, Compression, Encryption, and File Translation

It happens many people have no idea what Digital Signal Processing means, although they do hear more and more often these words, today. Considering the name, Digital Signal Processing, people are lead towards thinking this procedure deals with digital signals. No; Digital Signal Processing is a method of improving the quality of the analog signals, only. Indeed, the naming used (DSP) it is rather improper, because it relates to all types of digital processing. The methods, and the techniques used in DSP deal only with processing signals that are analog in nature. In the digital signals case, we can only compress, encrypt, and translate them to other digital formats; these (different) procedures do not require any DSP techniques. Using the DSP name when referring to digital signals causes confusion.

Let’s take each of these one step at a time, and using few practical examples. Suppose we have an old vinyl record and we want to copy its analog signal on a digital CD, to better protect that recording–CDs are a lot more reliable to hold information unaltered, over time. This means we need to convert the analog signal to digital format, and the best way of doing it is by using DSP techniques, as follows. First, we need an analog-to-digital hardware module to convert the analog signal into digital format–this is typically a “codec”–then we select a specific scanning frequency, to accomplish this task. Because we work with audio frequencies, a 40 KHz scanning frequency should be sufficient.

Please note this: the scanning frequency needs to be at least double than the maximum frequency of the original analog signal–the analog audio signals have frequencies within the range of 10 Hz to 16 KHz. After scanning, we have the copy of the analog vinyl record, in digital data format, expressed as a series of digital integer values in binary format.

Unfortunately, our vinyl record is fairly old, and it has a lot of noise on it; that noise is also present on the digital copy, and it needs to be filtered out, before we burn the digital CD. The next step is to take the digital copy–please note this: the digital copy still represents the analog signal–and we apply to it a mathematical transformation function: in this way, we change digital data from “time-domain” to the “frequency-domain”. This is done gradually, by chopping digital data into frames of 512, 1024, or 4096 integers in size, and transforming one frame at a time. Once we have the data in frequency-domain, it is easy to filter the noise out, and to select/amplify only the audio frequencies we want. For this we use digital firmware or software filters, which are, in fact, known mathematical algorithms.

Once the record it is properly filtered, we need to change it back to time-domain, and we do this by using a second transformation function. Now we are able to listen our record, filtered of (any) noise. If we are satisfied with the quality of the recording, we can burn the CD; otherwise, we could repeat the above procedure, until results are exactly what we expect them to be. Digital Signal Processing ends here.

Now, we have a CD holding a digital signal–an audio file in this particular case. It may happen our audio digital file takes too many memory bytes to store, and we cannot afford that much. We want our digital file to use the smallest amount of memory, so that we can transfer the file quickly over the Internet, or we would like to store as many records as we can in a small MP3 player, for example. For this we need a “compression” technique, and, implicitly, an “encryption” one.

There are very many compression/encryptions methods available, and very many will be developed into the future. Basically, the digital signal is in fact a series of integers–an integer is 2 bytes; one byte is 8 bits; each bit is either 0 or 1–and each integer represents one mathematical value in the range of 0 to 65535. Now, we notice each digit in the range 0 to 65535 is repeated a number of times, in the entire digital audio file. This information is very important, because it helps us to convert our series of integers into a mathematically encrypted structure, by means of a software compression/encryption “key”. Instead of using, for example, the integer 23501 for 1522 times in our digital audio file, we use only the information about that integer, meaning we store only the value 1522, one single time, corresponding to the integer 23501.

The compression/encryption key–this is in fact another mathematical algorithm–it is responsible for taking the initial digital file and breaking it into frames of integers; for replacing each integer with the number of times it is used; and for storing the code needed to reconstitute the initial series of integers, which is the original digital file. Commonly, the key works with a special memory structure, named a “binary-tree”. In this binary-tree the position of each number represents how many times an integer appears in the entire file (or in one frame), and it also holds the information needed to reconstitute the frames, and then the entire audio digital file.

Once the digital audio file is in binary-tree format its size becomes dramatically smaller–it is compressed–and we can use it for memory storage, or for fast file transfer. In this binary-tree format data is also encrypted, in addition to being compressed, and we need that compression/encryption key, in order to reconstitute the initial digital signal; otherwise, there is no way we could “decipher” that binary-tree.

Now, what else can we do to our digital audio file? Well, there are many audio file formats, and we might need to change our digital audio file from one format to another. The simplest audio file format holds data as series of bits, of 0s and 1s. Another type may have data grouped in small packages, in series of bytes, integers, or doubles. This last type of data grouping allows for another level of information compressing; however, in order to change from one file format to the other we need appropriate hardware, firmware, or software data read/write drivers. Changing the file format it is named “translation” or “conversion”, and this is a lot easier to implement.

Basically, this is all we do to analog and digital signals. As you can see there is a lot of mathematics involved, but the good news is, all those mathematical routines and algorithms are standard. A developer does not necessarily need to know a lot of mathematics, in order to perform his job fairly well. Those standard mathematical algorithms have been developed and optimized by groups of engineers and programmers, and we all use them. However, if you intend to develop proprietary algorithms, in order to achieve more spectacular effects, you need to study very well all DSP, compression/encryption, and translation techniques. For more information please check my home site, and try to discover other related articles I wrote, in various publications on the Internet.

Leave a Reply