0% found this document useful (0 votes)
14 views15 pages

Lec11 Audio Comp

This lecture discusses audio compression techniques. It begins with an overview of digital sound basics like sampling and quantization. It then covers topics like how often sound needs to be sampled, quality requirements, and file formats. The lecture focuses on differential pulse code modulation (DPCM) as an audio compression technique. DPCM works by transmitting the difference between actual and predicted sample values rather than the raw samples, allowing for fewer bits of information. Examples are provided to illustrate how DPCM encoding and decoding works. Advantages like reduced bandwidth and disadvantages like increased complexity are also summarized.

Uploaded by

Ali Ahmed
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)
14 views15 pages

Lec11 Audio Comp

This lecture discusses audio compression techniques. It begins with an overview of digital sound basics like sampling and quantization. It then covers topics like how often sound needs to be sampled, quality requirements, and file formats. The lecture focuses on differential pulse code modulation (DPCM) as an audio compression technique. DPCM works by transmitting the difference between actual and predicted sample values rather than the raw samples, allowing for fewer bits of information. Examples are provided to illustrate how DPCM encoding and decoding works. Advantages like reduced bandwidth and disadvantages like increased complexity are also summarized.

Uploaded by

Ali Ahmed
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/ 15

CS 411 : Data Compression

Lecture 11

Audio Compression
Digital Sound Basics

 Sound is a continuous wave through the air


 Made up of pressure differences, detected by
measuring pressure levels at a location. It
maps to loudness.
 The peak pressure, also called the 0-to-peak
pressure, is the range in pressure between
zero and the greatest pressure of the signal.
The peak-to-peak pressure is the range in
pressure between the most negative pressure
and the most positive pressure of the signal.

2 of
17
Digital Sound Basics

Microphone changes analog sound


pressure to analog voltage levels.
To digitize sound, the signal must be
sampled in time and encoded into
numbers. Sampling is the process of
recording an analog signal at regular
discrete moments of time.
Quantization divides signal strength
into levels, linearly or
logarithmically. Quantizing samples
to levels and then to sequences of
bits leads to quantization error.
3 of
17
Digital Audio Questions

 How often should sound be sampled?


 Need to sample at a rate at least twice as high
as highest frequency, otherwise frequency is
lost. Nyquist Theorum
 What quality is required?
 Telephone, radio, CD, different quality
requirements.
 Signal to Noise Ratio (SNR) is a measure of the
quality of a signal
 noise may be introduced during conversion
from sound to voltage and due to
sampling/quantization.
 Format to use?
4 of
 .au, aiff, .wav, and of course .mp3 17
Audio data compression

Redundant information
Implicit in the remaining
information
Ex. oversampled audio signal
Irrelevant information
Perceptually insignificant
Cannot be recovered from
remaining information
5 of
17
Audio Compression- DPCM Principles
 Differential pulse code modulation is a derivative of the
standard PCM
 It uses the fact that the range of differences in
amplitudes between successive samples of the audio
waveform is less than the range of the actual sample
amplitudes
 Hence fewer bits to represent the difference signals

Encoder
• Previously digitized sample is held in the register (R)
• The DPCM signal is computed by subtracting the current contents (Ro)
from the new output by the ADC (PCM)
• The register value is then updated before transmission

Decoder
• Decoder simply adds the previous register contents (PCM) with the DPCM
• Since ADC will have noise there will be cumulative errors in the value of
the register signal
Differential pulse-code modulation (DPCM)

 It is a signal encoder that uses the baseline of pulse-code modulation


(PCM) but adds some functionalities based on the prediction of the
samples of the signal. The input can be an analog signal or a digital
signal. It is considered as a lossy compression technique when
applied for images. It compresses an image by removing the useless
bits. We estimate the output image y(n) from the input image x(n)
and the prediction error e(n).
 If x(n) is the nth sample from an image, instead of sending x(n), we
send the differentiation e(n) = x(n) – x(n-1). At the output (receiver),
knowing e(n) and several earlier sample value x(n-1), we can
reconstruct x(n) as well as the estimation value y(n) at the receiver
where e(n) = x(n) – y(n)
 X(n) can be generated as x(n) = e(n) + y(n)
 Samples are reconstructed at the receiver iteratively. The prediction
error e(n) should be smaller than the difference between successive
samples. Therefore, this technique is referred to as the differential
pulse code modulation (DPCM) where the estimate of a value is
deduced from previous samples such that y(n) = x(n-1).
Differential pulse-code modulation (DPCM)
In DPCM e(n) (the difference between x(n) and its predicted value y(n)) will be sent, not
the actual sample x(n). We generate y(n) from the past sample value, from the received
x(n). The error is then quantized, so as to reduce the amount of information to send over
the transmission channel.
Encoder: Decoder:
1. Read a sample of the signal.
1. Receive data (quantized error).
2. Compute the error compared to the
2. Compute the predict the value of
predictor.
the sample.
3. Quantize the error
3. Add the error and predict together
4. Add the quantized error to the to retrieve signal value (pixel).
predict and keep this value to be
used by the predictor for the 4. Keep this value to be used by the
following samples predictor for the following samples.
Example
 Consider the inout sample x(n) = {2.1,2.2,2.3,2.6,2.7,2.8}
 Assume first order prediction y(n) =x q (n-1)
 Encoder

X(n) Y(n) = x q(n-1) e(n) e q(n) X q(n)=y(n)+e q(n)

2.1 0 initially 2.1 – 0 = 2.1 2 0+2=2


2.2 2 2.2 – 2 = 0.2 0 2+0=2
2.3 2 2.3 – 2 = 0.3 0 2+0=2
2.6 2 2.6 – 2 = 0.6 1 2+1=3
2.7 3 2.7 – 3 = -0.3 0 3+0=3
2.8 3 2.8 – 3 = -0.2 0 3+0=3
 Transmitted sequence = {2 , 0 , 0 , 1 , 0 , 0}
 Decoder

e (n) y(n) = x (n-1) x q(n)=y(n)+e q(n)


q q
2 0 intially 0+2=2

0 2 2+0=2

0 2 2+0=2

1 2 2+1=3

0 3 3+0=3

0 3 3+0=3

 Received signal = {2 , 2 , 2 , 3 , 3 , 3}
Example

consider the 8x8 image f(x,y) below, where x=0 to 7, and y=0 to 7.
Explain how predictive coding can be used to compress the above image with
showing the transmitted image and the received image, Assume that
the prediction formula is p(x,y)=0 when x=0 and p(x,y)=f(x-1,y) when x>0
Advantages Disadvantages
 Bandwidth requirements  High bit rate
is less compared to PCM
 Practical usage is
 The prediction filters limited
reduces the problem of
 It needs predicator
quantization error
circuits to be used
 The number of bits used which is very complex
to represent one sample
value is also reduced
compared to PCM

You might also like