Signal Compression
Introduction
Signal compression is a crucial part of designing multimedia applications in today's digital age. Signal compression can possibly be considered the backbone of modern technological activity. In this blog, we'll go over some of the most important concepts of signal compression before presenting some of its most important applications. But first, let's look at what signal compression is and why it's so important.
Table of Contents
What is Signal Compression?
Why use Signal Compression?
How is Signal Compression done?
Examples of where Signal Compression is seen
Conclusion
What is Signal Compression?
A signal is generally defined as a function of one or more independent variable(s) such as time, position, temperature etc.Signals generally convey information about the state and behavior of the system. Thus the main objective of signal processing is to preserve the information contained in the signal and extract or manipulate it when necessary.
By formal definition, signal compression can be defined as the process where the redundant information present in a signal is identified and deleted. But roughly speaking, we can say that Signal compression is concerned with the reduction of the amount of data present in a particular signal while still preserving the main information content present in the signal.
As a general approach, we mainly classify the signal compression methods into two basic groups: lossless and lossy compression. In the lossless compression methods, there is no information which is lost due to the compression of the signal. This means that the original signal can be recovered exactly from the compressed data, with no distortion or losses at all. On the other hand, in the lossy compression methods, some amount of information is lost, due to compression and the signal that is reconstructed is not a perfect replica of the original signal but is still an okay approximation that can be used for the practical applications. The information that is lost in this compression is usually less relevant and thus serves no important purpose.Thus latter method can be considered as a better alternative as long as no useful information is lost.
The need of Signal Compression
Signal Compression is beneficial for the following reasons
1) Most digital signals that we use for practical purposes contain a huge amount of data. For example, a gray-level image of size 512 x 512 with 8 bits per pixel contains 2,097,152 bits ([512]^2 * 8 = 2,097,152). A colored image of the same size contains 3 times as many bits.
2) For efficient storage of digital signals, it is often necessary to compress the data into a smaller size requiring a significantly fewer number of bits.
3) In most signals, some percentage of the data is not relevant and the key information can be still extracted even if this irrelevant data is removed.Signal compression helps us to isolate those bits of data that are required for processing the key information.
4) A signal in compressed form or state also requires less bandwidth for transmission.
Due to these reasons, Signal Compression is one of the most important aspects in Digital Signal Processing and in multimedia applications.
How is Signal Compression done?
Now let’s move on to the part where I explain about how signal compression of a signal be it a 1D speech/audio signal or a 2D image signal is done in the first place. As a general rule of thumb, it is difficult to visualize things, so first let’s focus on a 1D signal. The compression in the case of 1D audio signal can be of two types. One which deals with the dynamic range of the sound and the other which you might have guessed is related to decreasing the sound file size or data compression. The latter can be further classified into a lossy or lossless compression. This would be explained in much more detail below, first let’s focus on dynamic range compression. Dynamics basically refers to the difference in level of the softest parts and the loudest parts in the audio signal. This difference is called the dynamic range of the audio. Dynamic range compression is something which is used in the production of different variants of the same music by the device playing the sound. Some of them are Bass, Jazz, Hip-Hop,etc.
There are mainly 6 types of dynamic range compression techniques.
Three of them are mentioned below:
Downward Compression
2. Upward Compression
Upward compression, as you may have guessed by now, does the exact opposite of downward compression. This type of audio compression increases the level of sounds which fall below a certain set threshold.
3. Parallel Compression
This is something which is done when the music producer wants more control on the depth to be added to the sound. The original signal is split into two or duplicated and each channel is then processed independently. In most cases the main signal is left un-compressed while the duplicate channel is compressed heavily. The required result in the mix is achieved by blending the two audio channels together.
It is because of using these and other similar techniques, that music producers and audio mixers are able to achieve those high and low pitch notes in the sound we hear in pop concerts. So the next time you hear that boAts has launched a new “bassHeads Headphone”, don’t forget that this is where that “bass” is coming from.
Now that we have some basic understanding of how dynamic range compression works and is used in the industry by music producers, let’s see about how data compression works. Data compression can be of two types as was mentioned earlier. It can be either lossy or lossless.
The 3 most prominent lossy compression techniques used as of today are given below:
MP3
AAC
OGG Vorbis
First Let’s see how compression is done in MP3 files.
MP3 Files
MP3 compression basically follows the principle of “ perceptual coding “ or “ Psychoacoustic ” to perform compression. An uncompressed audio file stored in a CD of size approx. 30 MBs can be represented by an MP3 file by around 3 MBs. Since it uses a lossy compression technique the two audios will not be exactly the same, but the difference would be unrecognizable unless you have the ears of a bat.
Before the actual compression of sound takes place, the following preprocessing steps are taken care of by the encoder.
It removes all sound components which have a frequency not in the range of 20Hz-20KHz.
If two sound components with a very high difference in their amplitude occur at the same time, then it basically discards the quiet one, which may be influenced by “ Survival of the fittest “ theory by Charles Darwin [ this is just another theory by me :) ].
Next comes the step of sampling and quantization. The two techniques are used such that the resultant sound has a bit rate of 32 - 320 Kbps. The higher the bit rate, the higher the sound quality and lower the compression because the more information is stored about the same sound. A bit rate of 128 Kbps is considered to be industry standard and is used by many.
2. AAC files
Advanced Audio Coding or AAC compression was introduced as a successor to the MP3 compression standard. This compression technique is used by Apple ITunes and other applications. AAC is found to provide a higher sound quality and transparency than MP3 for files coded at the same bit rate.
Here are few of the reasons that would make AAC the winner:
AAC can use a frequency of 8 kHz to 96 kHz, while Mp3 can only use 16 kHz to 48 kHz of frequency.
AAC supports a maximum of 48 audio channels while MP3 can only support a maximum of 2 channels in the MPEG 2 mode.
The dynamic nature and flexibility and scalability provided by the AAC file format could be the reason it was introduced in the MPEG 4 mode.
The 2 most prominent lossless compression techniques used as of today are given below:
FLAC
ALAC
The difference between the two file compression formats is that the latter is used by Apple devices and applications.
1. FLAC files
FLAC is file format which was introduced when a need of having all those background music of guitars, and musical instruments in the decompressed audio was felt and this was of course not possible in lossy compression otherwise they wouldn’t be called lossy techniques.
Some of the salient features of FLAC file format is given below:
It can reduce the size of the original uncompressed file by roughly 50-60%, while having the ability to reconstruct an identical copy of the original signal.
It performs the the compression / encoding of original signal in two stages:
In this stage, the original signal is split into fixed length blocks.
The next stage involves representing each block by its approximated mathematical polynomial equation. The difference between the original signal block and mathematical approximation is called a residual and is stored separately using Rice coding.
The decompression phase of this technique executes the steps in reverse order.
The approximated equation of each block is first converted to its equivalent waveform.
Then the residual which was encoded using Rice coding is decoded and added to the waveform.
The resultant block representations are then concatenated to get the final signal.
This signal obtained is an exact replica of the original signal.
I would be providing references of how Rice Coding is done in the last section.
Here's a simple diagram which shows how signal compression and decompression is carried out.
Steps followed in Signal Compression.
Examples and real life applications of Signal Compression
a) Image Compression
Speech, audio, image, and digital video are all important fields of signal compression, and many compression techniques are used in a practical way.
For Example,in image compression the quality of image and its size is decreased by reducing the number of pixels.
Here, as one can see, the compressed image size is less than the size of the real image.
(Below, the first one is original and the second one is the compressed image)
Original image
Compressed Image
Here, one can determine the compression as lossless as one can still determine that the compressed image is a Ferrari Car.
b) GNSS Signal Processing
Nowadays, the emergence of advanced GNSS signal processing technology is also enhanced by Signal Compression.
Here, GNSS receivers are responsible for processing L-band Signals In Space (SIS) from GNSS satellites, where each satellite transmits a continuous signal at the GHz range, which is configured with periodic digital code, which is also edited with a data message.
Signal compression, in the case of GNSS receivers, reduces the required computational power.Where,a large number of raw digitized baseband signal samples (typically on the order of 10^7-10^8) is reduced to a small vector having only a few tens of samples,where the exact number of samples depends on the type of GNSS signal being processed.Here, compression requires only simple additions to be made.
So, here, the subsequent processing of any kind is made much easier due to the very small size of the compressed signal.
Conclusion
In this blog, we had a detailed discussion about signal compression in digital signal processing, the need of signal compression and the different signal compression techniques. We also discussed the different applications as well as the real life examples of signal compression like compression of images, audio files etc. We hope you found this blog useful, and we'd love to hear your thoughts and feedback in the comments section below.
References
[1] https://en.wikipedia.org/wiki/Dynamic_range_compression
[2] https://ledgernote.com/blog/q-and-a/how-does-mp3-compression-work/
[3] https://www.youtube.com/watch?v=WIIKXOrt3bk
Contributors -
Arbaz Ahmed Addewala - 2019130002
Aniket Narbariya - 2019130043
Satyam Rai - 2019130051
Great Info 👏👌
ReplyDeleteGreat!!
ReplyDeleteVery nice content. A good start point to begin learning about signal compression. Keep up the good work.
ReplyDeleteLearned a lot of new stuff about Signal Compression. The explanation about dynamic compression and MP3 file format was really very good and intuitive. Highly Recommended
ReplyDeleteGood examples.Beginner friendly content
ReplyDelete