0% found this document useful (0 votes)
16 views16 pages

1 Data Representation - L13 - Data Compression

Uploaded by

danayousif1711
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views16 pages

1 Data Representation - L13 - Data Compression

Uploaded by

danayousif1711
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Chapter 1 : Data Representation

Data Compression

13 Audio Storage
Previously we Learned

We learned about:
• ADC
• Sound Sampling
• Sample rate
• Sample resolution
LESSON OBJECTIVE

• How we can compress a data


Data in a system?
Compression

KEYWORDS
• Lossy compression SUCCESS CRITERIA
• Lossless compression • Able to understand data
• Perceptual music shaping
compression techniques.
• RLE
File size reduction
• This is a process where file size is reduced using algorithms
resulting in a file that uses fewer storage bits than the original
file.
1. In a situation where one wants to send a picture to her friend,
compression will be done at the source device and decompressed at
the destination device. This enables the file to be sent faster, and it
reduces overhead traffic for transmitting the data.

2. In social media apps like WhatsApp, we notice that the image


received is of lower quality and consumes much lesser space. For a
few apps, we can set the quality of media to be downloaded.

3. We also notice compression in video streaming sites, where videos


are loaded in low quality during poor internet connectivity.
Data Compression
• Data Compression is a technique in which the size
of data is reduced without loss of information but
at a cost of lower quality.

• The categories of data compression methods are


1. Lossy compression
2. Lossless compression
• The lossy compression technique does not
restored the data in its original form, after
decompression.

• The lossless compression restores and rebuilt


the data in its original form, after
decompression.
Lossy Compression Lossless Compression
(irreversible compression) (reversible compression)
does not eliminate the data which is not
Eliminate the data which is not noticeable.
noticeable.
A file does not restore or rebuilt in its
A file can be restored in its original form.
original form.
Data’s quality is compromised. Does not compromise the data’s quality.

reduces the size of data. does not reduce the size of data.
used in Images, audio, video. used in Text, images, sound.
has more data-holding capacity. has less data-holding capacity
Algorithms used in Lossy compression are: Algorithms used in Lossless compression
Transform coding, Discrete Cosine Transform, are: Run Length Encoding, Lempel-Ziv-
Discrete Wavelet Transform, fractal Welch, Huffman Coding, Arithmetic encoding
compression etc. etc.
Run-length encoding (RLE)

• Run-length encoding (RLE) is a lossless


compression method by specifying the
number of times a character or pixel color
repeats followed by the value of the character
or pixel.
RLE algorithm
Follow the steps below is the RLE algorithm:
1. Pick the character from the source string.
2. Count the number of subsequent occurrences of
the picked character and append the count to the
destination string.
3. Pick the next character and repeat steps 1, 2 and 3
if the end of the string is NOT reached.
RLE algorithm
• For example, if the input string is
“wwwwaaadexxxxxx”

• then the function should return


“ w4 a3 d1 e1 x6 ”
SUMMARY

• Lossy compression
• Lossless compression
• Perceptual music shaping
• RLE
3! 2! 1!

1.

3 Things I 2.
learned
3.

1.
2 Interesting
2.
facts

1 Question
1.

You might also like