In: Computer Science
a) Discuss two basic forms of compression. Given the following data string, present the result using run-length encoding. By what percentage is the data compressed? 0000011000000001000000000100001100000000 [5 Marks] b) Sam wants to send 2000 8-bit characters of data. Find the total number of bits he will transmit using asynchronous transmission. Now, if he decides to use the synchronous connection, how many bits will be transferred if 1000 characters fit within one synchronous transmission frame? [5 M
DATA COMPRESSION
Data compression is important in this age because of the amount of
data that is transferred within a certain network. It makes the
transfer of data relatively easy [1]. This section explains and
compares lossy and lossless compression techniques.
LOSSLESS DATA COMPRESSION
Lossless data compression makes use of data compression algorithms
that allows the exact original data to be reconstructed from the
compressed data. This can be contrasted to lossy data compression,
which does not allow the exact original data to be reconstructed
from the compressed data. Lossless data compression is used in many
applications .
Lossless compression is used when it is vital that the original and the decompressed data be identical, or when no assumption can be made on whether certain deviation is uncritical.
Most lossless compression programs implements two kinds of algorithms: one which generates a statistical model for the input data, and another which maps the input data to bit strings using this model in such a way that “probable” (e.g. frequently encountered) data will produce shorter output than “improbable” data. Often, only the former algorithm is named, while the second is implied (through common use, standardization etc.)
LOSSY DATA COMPRESSION
A lossy data compression technique is one where compressing data
and its decompression retrieves data that may will be different
from the original, but is “close enough” to be useful in some
way.
There are two basic lossy compression schemes:
First is lossy transform codecs, where samples of picture or sound are taken, chopped into small segments, transformed into a new basis space, and quantized. The resulting quantized values are then entropy coded .
Second is lossy predictive codecs, where previous and/or subsequent decoded data is used to predict the current sound sample or image frame.
In some systems the two methods are used, with transform codecs being used to compress the error signals generated by the predictive stage.
The advantage of lossy methods over lossless methods is that in some cases a lossy method can produce a much smaller compressed file than any known lossless method, while still meeting the requirements of the application .
Lossless compression schemes are reversible in-order for the original data can be reconstructed, while lossy schemes accept some loss of data in order to achieve higher compression.
In practice, lossy data compression will also come to a point where compressing again does not work, although an extremely lossy algorithm, which for example always removes the last byte of a file, will always compress a file up to the point where it is empty
Hypothetical scale line for run length encoding (RLE) data compression algorithm is
12W1B12W3B24W1B14W
WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW
Similar to 0000011000000001000000000100001100000000
Results to 502180119011402180
Data compression ratio = uncompressed size/ compressed size
Space saving= 1- compressed size / uncompressed size
Therefore ,
Compression rate = 40/18 = 20/9
ANSWER b)
In transmission only one byte is sent at a time . To help receiver start and stop bits are used along data in middle
Total data send = 8bits(char size) + 2 bits ( stop)
= 10bits
Number of 8 bits characters that can be transmitted per second = 2000/10 = 200
Number of 8 bit characters that can be per second = 1000/8 = 125
Hope you like my answer , please give good ratings