100% found this document useful (1 vote)
649 views89 pages

Quantization

This document discusses audio digitization. It begins by explaining how audio signals are analog and must be converted to digital form through sampling and quantization. It describes the Nyquist sampling theorem which states that a signal's analog form can be reconstructed from samples taken at least twice the highest frequency present. It also discusses quantization which converts sample values to discrete levels, introducing potential quantization error. Common digital audio techniques like PCM which performs pulse code modulation are also covered.

Uploaded by

annanndhiii
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
649 views89 pages

Quantization

This document discusses audio digitization. It begins by explaining how audio signals are analog and must be converted to digital form through sampling and quantization. It describes the Nyquist sampling theorem which states that a signal's analog form can be reconstructed from samples taken at least twice the highest frequency present. It also discusses quantization which converts sample values to discrete levels, introducing potential quantization error. Common digital audio techniques like PCM which performs pulse code modulation are also covered.

Uploaded by

annanndhiii
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 89

1

Illustration of the Quantization Error


2
Uniform Quantization
Most ADCs use
uniform
quantizers.
The quantization
levels of a uniform
quantizer are
equally spaced
apart.
Uniform quantizers
are optimal when
the input
distribution is
uniform. When all
values within the
Dynamic Range of
the quantizer are
equally likely.
Input sample X
Example: Uniform =3 bit quantizer
q=8 and X
Q
= { 1, 3, 5, 7}
2 4 6 8
1
5
3
Output sample
X
Q
-2 -4 -6 -8
Dynamic Range:
(-8, 8)
7
-7
-3
-5
-1
Quantization Characteristic
3
Quantization Example
Analogue signal
Sampling TIMING
. Quantization levels
- Quantized to 5 levels
Quantization levels
- Quantized 10 levels
4
PCM encoding example
. . Chart 1 Quantization and digitalization of a signal
& . Signal is quantized in 11 time points 8 quantization segments
. . Chart 2 Process of restoring a signal
: PCM encoded signal in binary form
101 111 110 001 010 100 111 100 011
010 101
Total of 33 bits were used to encode a
signal
: Table Quantization levels with belonging code
words
Levels are encoded using this table
= M 8
5
Encoding
The output of the quantizer is one of M possible
signal levels.
If we want to use a binary transmission system, then
we need to map each quantized sample into an n
bit binary word.

Encoding is the process of representing each


quantized sample by an bit code word.
The mapping is one-to-one so there is no distortion
introduced by encoding.
Some mappings are better than others.
A Gray code gives the best end-to-end
performance.
The weakness of Gray codes is poor
performance when the sign bit (MSB) is
received in error.
2
2 , log ( )
n
M n M
6
Gray Codes
With gray codes adjacent samples differ only in
one bit position.
Example (3 bit quantization):

X
Q
Natural coding Gray Coding

+7 111 110

+5 110 111

+3 101 101

+1 100 100

-1 011 000

-3 010 001

-5 001 011

-7 000 010
With this gray code, a single bit error will result in
an amplitude error of only 2.
Unless the MSB is in error.

7
Waveforms in a PCM system for M=8
M=8
( ) d PCM Signal
( ) c Error
Signal
( ) , , b Analog Signal PAM Signal Quantized PAM
Signal
( ) a Quantizer Input output
characteristics
2
2 log ( )
is the number of Quantization levels
is thenumber of bits per sample
n
M n M
M
n

Quantization
Analog source has infinite levels
In order to process the source output
digitally, the source have to be
quantized to a finite number of levels
Reduce number of bits to a finite number
Introduce some distortion
Quantization error can be modeled as White
process
The information lost in the quantization
process can never be recovered
Classification of
quantization
Scalar Quantization
Each source output is quantized
individually
Further Divided into
Uniform quantization
Equal quantization region
Nonuniform quantization
Various length quantization region
Vector quantization
Blocks of source output are quantized
Scalar Quantization
( )
i i i
x Q x x
)
1

1
x
)
2
x
)
3
x
)
N
x
)
x
( ) Q x
Quantization Error
i
x x
)
Signal-to-Quantization-Noise
Ratio
Mean-Square Quantization Error

Where f
x
(x) denotes pdf(probability
density function) of the source
random variables
SQNR(Signal-to-Quantization-Noise
Ratio)

2
1
( ) ( )
i
N
i X
i
D x x f x dx

)
2
10
[ ]
10log
dB
E X
SQNR
D

Uniform Quantization
Equal quantization range
1
( ~ ] a
2
( , ] a a +
3
( , 2 ] a a + +
( ( 2) , )
N
a N +
1
x
)
2
x
)
3
x
)
N
x
)
a

Uniform Quantization
Optimal Quantization Level
The Centroid of the interval (Center of
mass)

Design of the uniform quantizer is


equivalent to determining a and
Then we can easily calculate SQNR
If X has uniform distribution
Then Quantization level = midpoints of
quantization range (a + (i-2) + /2)
( )
[ | ]
( )
i
i
X
i i
X
xf x dx
x E X X
f x dx

)
Uniform Quantization
Symmetric pdf with even N (N=6)
Uniform Vs.
Gaussian
+ a 4
+ a 3
+ a 2
+ a
a
-
x
=0
6
x
)
5
x
)
4
x
)
3
x
)
2
x
)
1
x
)

+ a 4
+ a 3
+ a 2
+ a
a
-
x
=0
6
x
)
5
x
)
4
x
)
3
x
)
2
x
)
1
x
)
Center is given
Only one
parameter
is chosen to
minimize
distortion
Nonuniform Quantization
Uniform Vs.
Nonuniform
+ a 3
+ a 2
+ a
a
-
x
4
x
)
3
x
)
2
x
)
1
x
)
5
x
)
=0

a4
a3
a2
a1
-
x
4
x
)
3
x
)
2
x
)
1
x
)
5
x
)
=0
Different
Quantization
Region
Uniform
Quantization
Region
Nonuniform Quantization
Superior than Uniform quantization
Less Distortion
Higher SQNR
Lloyd-Max Conditions for optimal condition

Choose initial quantization level:


Repeat until Minimum distortion
Calculate quantization region boundary:
Calculate quantization level:
1
1
1
( )
,
2
( )
i
i
i
i
a
X
a
i i
i i
a
X
a
xf x dx
x x
x a
f x dx

) )
)
, 1
i
x i N
)
L
, 1
i
x i N
)
L
, 1
i
a i N L
Homework
Illustrative Problem 4.8
Problems
4.12
Uniform Quantization
Symmetric pdf with even N (N=5)
Uniform Vs.
Gaussian
+ a 3
+ a 2
+ a
a
-
x
4
x
)
3
x
)
2
x
)
1
x
)
5
x
)
=0

+ a 3
+ a 2
+ a
a
-
x
4
x
)
3
x
)
2
x
)
1
x
)
5
x
)
=0
Homework
Illustrative Problem
4.4, 4.5, 4.7
Problems
4.6, 4.7
20

2. Audio

2.1 Human Perception

2.2 Audio Bandwidth

2.3 Digitization

2.4 Audio Compression

2.4.1 Differential PCM

2.4.2 Adaptive Differential


PCM

2.4.3 MP3
Contents
21
Audio: speech, music or synthesized
audio.
Audio signals are analog.
Audio Perception

Sound waves generate air pressure


oscillations.
q
Stimulate human auditory system.
q
Transform to neural signals
recognizable by the brain.
2.1 Human Perception
22
Features of human auditory
system:
q
1. Frequency range: Human can
listen to audio signals within the
typical frequency range 20 --
20,000 Hz.
q
2. Dynamic range: It is the range
of the softest to the loudest
audio amplitude that human can
hear.

Different persons may have


different frequency and dynamic
ranges.
2.1 Human Perception
23
2.2 Audio Bandwidth
Period and Frequency
q
A periodic signal consists of a
continuously repeated waveform
pattern. If its period is T, its
frequency is:
q

Example: The following signals


are periodic with period T and
frequency
T
f
1

T
f
1

24
2.2 Audio Bandwidth
25
Signal Characteristic

A signal can be decomposed into many


sinusoidal signal components such that
different components
q
1. have different frequencies and
q
2. may have different amplitudes.

(This decomposition can be done by


mathematical techniques called Fourier series
and Fourier transform.)
2.2 Audio Bandwidth
26
2.2 Audio Bandwidth
( Frequency of 1st component 1st
) = harmonic f
1
= / 1 T
( Frequency of 2nd component 2nd
) harmonic
( Frequency of 3rd component 3rd
) harmonic
= 3 f
1
= 5 f
1
27
2.2 Audio Bandwidth
Frequency Domain
q After decomposing a signal into its components, we
can analyze the properties of this signal in the
frequency domain.

Example:

q It is difficult to visualize the energy content of a signal


in the time domain, but it is easy to do so in the
frequency domain.
28
2.2 Audio Bandwidth
Bandwidth
q
Bandwidth is the range of component
frequencies. Example:

q
A signal may have infinite number of
components.
FIn this case, bandwidth is defined to be
the frequency range over which x% (say,
99%) of the energy of the signal lies.
29
2.2 Audio Bandwidth
Effect of Limited Bandwidth

q
If a network does not have sufficient
bandwidth to send all the frequency
components of a signal
Fsome frequency components are omitted
Fthe signal is distorted.
F
q
If a network has a larger bandwidth to
send more frequency components of an
audio signal
Fthe audio signal is relatively less distorted.
30
31
2.3 Digitization
Digitization: convert an analog audio
signal to digital form via sampling
and quantization.

Sampling
q
Sample the magnitude of the audio
signal at a certain rate.
32
2.3 Digitization

: Nyquist Theorem For a signal that has no frequency


, components higher than x Hz its analog signal can be
completely reproduced from its samples taken at the rate 2 of
. samples per second
: Illustration of Nyquist sampling rate
33
2.3
Digitization

Example
Telephone systems transmit voice signal
. components with at most 4000 Hz Sampling
/ . rate should be 8000 samples sec
34
Quantization

q
If N bits are used to represent a
sample value, there are 2
N
distinct quantization values.
q
Each sample value is rounded
to the nearest quantization
value, so there may be
quantization error.

2.3
Digitization
35
2.3
Digitization

. , If the first sam ple value is 24 1 it is quantized to 24 ( 0001


), 1000 so the quantization error . . is0 1
36
2.3
Digitization

( ) Pulse Code Modulation PCM


q : PCM perform sampling and quantization on audio
. signals
q : PCM is used in
F : Digital telephone networks
Use a sampling rate of 8000
samples per second and 8 bits
, per sample so the data rate is
( 64 kbps adopted in - ITU T
. G 711).
F : Audio CD Use a sampling rate
of 44100 samples per second
, and 16 bits per sample so the
data rate for stereo audio is
. . 1 411 Mbps
37
2.4 Audio
Compression

. . 2 4 1 Differential PCM
q Differential PCM . is a compressed version of PCM It
has
lower bit rate but its voice quality may be
. poorer
q Differential PCM
Voice signal changes slowly compared with the
. sampling rate
q Successive sample values have a small
. difference
q
q Use fewer bits to encode the difference
between the current sample value and the
. previous one
q
q , Lower bit rate but voice quality may be
degraded when voice amplitude changes
. abruptly
38
2.4 Audio
Compression

Exam ple
q , For PC M in digitaltelephony sam pling rate is 8000
/ . sam ples sec and 8 bits are used for each sam ple
. D ata rate is 64 kbps
q
q If differentialPC M is adopted and 6 bits are used to
encode the difference betw een successive sam ple
, . values data rate is reduced to 48 kbps
39
2.4 Audio
Compression

. . 2 4 2 Adaptive Differential PCM


Adaptive differential PCM is an improved version of
. differential PCM
: Main idea When the voice amplitude changes steeply for a
, significant duration change to use a larger quantization
( . ., step i e a larger difference between successive
) quantization values
40
2.4 Audio
Compression

41
2.4 Audio
Compression

- . ITU T G 721 , adopts adaptive differential PCM a


, sampling rate of 8000 samples per second and 4
bits for encoding the
. difference between successive sample values
q , Bit rate is 32 kbps but voice quality is
only slightly worse than that in PCM
. at 64 kbps
42
2.4 Audio
Compression

. . 2 4 3 MP3
. . - CD audio has a data rate of 1 411 Mbps Well known
: compression method for CD audio MP3.
q : . ( MP3 MPEG audio layer 3 MPEG
specifies three audio compression
.) layers
q
q MP3 adopts perceptual coding to
attain a high compression ratio
and provide very good audio
. quality
43
2.4 Audio
Compression

Perceptual Coding
q It is based on the science of psychoacoustics, which
. studies how people perceive sound
q
q It exploits certain flaws in the human auditory system
, for compression such that the compressed audio sounds
about the same to human even though its signal
. waveform may become quite different
44
2.4 Audio
Compression

: 1st Flaw Threshold of A udibility


q ( . ., When a frequency component is very weak i e its power
), . is below a threshold human cannot hear it
q ( ) Threshold of audibility averaged over many people
: Compression Omit the frequency components whose
. power falls below the threshold of audibility
45
2.4 Audio
Compression

: 2nd Flaw Frequency M asking


q : Some sounds can mask other sounds a loud sound in
one frequency band hides a softer sound in another
. frequency band
q : Masking effect
Compression: . Omit the masked frequency components
46
2.4 Audio
Compression

: 3rd Flaw Tem poralM asking


q , When a masking sound ends it takes a short time
. before hearing the masked sound
q : Masking effect
Compression: If the amplitudes of the masked frequency
, components are less than the decay envelope omit these
. components
47
2.4 Audio
Compression

To use M P3 , for compression we select two


: options
q Sampling rate: We can sample the
, . waveform at 32 kHz 44 1 kHz or 48
. kHz on one or two channels
q
q Bit rate: , Typically we choose the bit
, rate to be 96 kbps 128 kbps or 160
. kbps
48
2.4 Audio
Compression

M ain Steps for C om pression


q . Perform sampling on the audio signal Divide
the samples into groups with 1152 samples
. per group
q
q : ( ) Each group is passed through i 32 digital
, ( ) filters to get 32 frequency subbands and ii
a psychoacoustic model to determine the
. masked frequencies
q
q " " ( Based on the available bit budget depending
), on the chosen bit rate allocate more bits
to the subbands with larger unmasked
. spectral power
q
q , Finally use Huffman coding to encode the bits
( . ., i e assign shorter codewords to numbers
). that appear frequently
Example
Networks: Data Encoding 50
Networks: Data Encoding 51
PCM
Nonlinear Quantization Levels
Networks: Data Encoding 52
Delta Modulation DCC 6
th
Ed.
W.Stallings
Analog Representations of Sound
, : Magnified phonograph grooves viewed from above
The shape of the grooves encodes the continuously
. varying audio signal
Analog to Digital Recording Chain
ADC
Continuously varying electrical energy is
an analog . of the sound pressure wave
Microphone converts acoustic to
. electrical energy It s a transducer.
ADC ( ) Analog to Digital Converter converts
. analog to digital electrical signal
. Digital signal transmits binary numbers
DAC ( ) Digital to Analog Converter converts digital
. signal in computer to analog for your headphones
Analog versus Digital
Analog
Continuous signal that mimics shape of
acoustic sound pressure wave
Digital
Stream of discrete numbers that
represent instantaneous amplitudes of
, analog signal measured at equally
. spaced points in time
Analog to Digital Conversion
Instantaneous amplitudes of continuous
, analog signal measured at equally
. spaced points in time
A series of snapshots
[ . . . , ] a k a sample word length bit depth
: Precision of numbers used for measurement
, . the more bits the higher the resolution
: Example 16 bit
Analog to Digital Overview
Sampling Rate
How often analog signal is measured
Sampling Resolution
[ , ] samples per second Hz
: , Example 44 100 Hz
Sampling Rate
: Nyquist Theorem
Sampling rate must be at least twice as high as the highest
. frequency you want to represent
Determines the highest frequency that you can represent
. with a digital signal
Capturing just the crest and trough of a sine wave will
. represent the wave exactly
Aliasing
What happens if sampling rate not high enough?
A high frequency signal
sampled at too low a rate
looks like
. a lower frequency signal
That s called aliasing or foldover. - An ADC has a low pass - anti
aliasing filter . to prevent this
. Synthesis software can cause aliasing
Common Sampling Rates
Sampling Rate Uses
44.1 kHz (44100) CD, DAT
48 kHz (48000) DAT, DV, DVD-Video
96 kHz (96000) DVD-Audio
22.05 kHz (22050) Old samplers
. Most software can handle all these rates
Which rates can represent the range of frequencies
( ) audible by fresh ears?
- 4 bit Quantization
- A 4 bit binary number has 2
4
= . 16 values
0
2
4
6
8
10
12
14
A
m
p
l
i
t
u
d
e
A better approximation
. Time measure amp at each tick of sample clock
Quantization Noise
- : Round off error difference between actual
signal and quantization to integer values
: - Random errors sounds like low
amplitude noise
The Digital Audio Stream
, It s just a series of sample numbers to be
: interpreted as instantaneous amplitudes
. one for every tick of the sample clock
: Previous example
11 13 15 13 10 9 6 1 4 9 15 11 13 9
, This is what appears in a sound file along
with a header that indicates the sampling
, . rate bit depth and other things
Common Sampling Resolutions
Word length Uses
8-bit integer Low-res web audio
16-bit integer CD, DAT, DV, sound files
24-bit integer DVD-Video, DVD-Audio
32-bit floating point Software (usually only for
internal representation)
- 16 bit Sample Word Length
- A 16 bit integer can represent 2
16
, or
, , ( ). 65 536 values amplitude points
We typically use signed - , 16 bit integers
, . and center the 65 536 values around 0
, 32 767
- , 32 768
0
Audio File Size
CD characteristics
- : Sampling rate
, ( . ) 44 100 samples per second 44 1 kHz
- - How big is a 5 minute CD quality sound file?
- : Sample word length
( . ., ) 16 bits i e 2 bytes per sample
- : Number of channels
( ) 2 stereo
Audio File Size
* 5 minutes 60 seconds per minute
= 300 seconds
- - How big is a 5 minute CD quality sound file?
, * * 44 100 samples 2 bytes per sample 2 channels
= , 176 400 bytes per second
* , 300 seconds 176 400 bytes per second
= , , = . . ( ) 52 920 000 bytes c 50 5 megabytes MB
: DAC Sample and Hold
, To reconstruct analog signal hold each sample value
; . for one clock tick convert it to steady voltage
0
1
2
3
4
5
6
7
A
m
p
l
i
t
u
d
e
Time
: DAC Smoothing Filter
- Apply an analog low pass filter to the output of the
- - : sample and hold unit averages stair steps into a
. smooth curve
0
1
2
3
4
5
6
7
A
m
p
l
i
t
u
d
e
Time
Prof. Brian L. Evans
Dept. of Electrical and Computer Engineering
The University of Texas at Austin
EE445S Real-Time Digital Signal Processing Lab Spring 2011
Lecture 8
Quantization
71
Outline
Introduction
Uniform amplitude quantization
Audio
Quantization error (noise) analysis
Noise immunity in communication
systems
Conclusion
Digital vs. analog audio (optional)
72
Resolution
Human eyes

Sample received light on 2-D grid

Photoreceptor density in retina


falls off exponentially away
from fovea (point of focus)

Respond logarithmically to
intensity (amplitude) of light
Human ears

Respond to frequencies in 20 Hz to 20
kHz range

Respond logarithmically in both


intensity (amplitude) of sound
(pressure waves) and frequency
(octaves)

Log-log plot for hearing response vs.


frequency
: Foveated grid
point of focus in middle
73
Data Conversion
Analog-to-Digital
Conversion

Lowpass filter has


stopband frequency
less than f
s
Digital-to-Analog
Conversion

Lowpass filter has stopband


frequency less than f
s

Discrete-to-continuous
conversion could be as
simple as sample and hold
Analog
Lowpass
Filter
Discrete
to
Continuou
s
Conversio
n
f
s
Lecture
7
Analog
Lowpass
Filter

Quantize
r
Sampler at
sampling
rate of f
s
Lecture
8
Lecture
4
74
Types of Quantizers
Quantization is an interpretation of a
continuous quantity by a finite set
of discrete values
Amplitude quantization approximates
its input by a discrete amplitude
taken from finite set of values
System Property Amplitude
Quantizer
Sampler Sampler +
Quantizer
Linearity Yes
Time-invariance No
Causality Yes
Memoryless Yes
, For the sampler stay in the continuous
time domain at the input and output to
decide on time invariance
75
Public Switched Telephone
Network
Sample voice signals at 8000
samples/s
Quantize voice to 8 bits/sample

Uniformly quantize to 8 bits/sample, or

Compand by uniformly quantizing to 12


bits and map
12 bits logarithmically to 8 bits (by
lookup table) to allocate more bits in
quiet segments (where ear is more
sensitive)
) 1 log(
) 1 log(

+
+

x
y
= / 256 in US Japan and A = . 87 6 in
Europe

'


+
+

+

1
1
log 1
log 1
1
0
log 1
x
A
if
A
x A
A
x if
A
x A
y
Maximum
data rate?

kbps
law
x
1
1
y
A law
x
1
1
76
Uniform Quantization
Round to nearest integer (midtread)

Quantize amplitude to levels {-2, -1, 0,


1}

Step size for linear region of


operation

Represent levels by {00, 01, 10, 11} or


{10, 11, 00, 01}

Latter is two's complement


representation
Rounding with offset (midrise)

Quantize to levels {-3/2, -1/2, 1/2, 3/2}

Represent levels by {11, 10, 00, 01}

Step size
1
3
3
1 2
2
3
2
3
2

,
`

.
|


1
3
3
1 2
) 2 ( 1
2



x
Q[x]
1 -2
-2
1
x
Q[x]
1 -2
-1
1
2
Used in
- slide 8
10
77
Handling Overflow
Example: Consider set of integers {-
2, -1, 0, 1}

Represented in two's complement


system {10, 11, 00, 01}.

Add (1) + (1) + (1) + 1 + 1

Intermediate computations are 2, 1,


2, 1 for wraparound arithmetic and
2, 2, 1, 0 for saturation arithmetic
Saturation: When to use it?

If input value greater than maximum,


set it to maximum; if less than
minimum, set it to minimum

Used in quantizers, filtering, other


signal processing operators
Wraparound: When to use it?

Addition performed modulo set of


integers

Used in address calculations, array


indexing
Native support in
MMX and DSPs
Standard two s
complement
behavior
78
Audio Compact Discs (CDs)
Sampled at 44.1 kHz

Analog signal bandwidth from 0 Hz of


20 kHz

Analog signal bandwidth from 20 kHz to


22.05 kHz is for anti-aliasing filter to
roll off from passband to stopband
(rolloff is about 10% of maximum
passband frequency)
Amplitude is uniformly quantized to B
= 16 bits to yield signal-to-noise
ratio of

1.76 dB + 6.02 dB/bit * B = 98.08


dB

This loose upper bound is derived later


in slides 8-11 to 8-15

In practice, audio CDs have dynamic


range of about 95 dB
79
Dynamic Range
Signal-to-noise ratio in dB

For linear systems, dynamic


range is equal to SNR
Linear time-invariant filter for
bandlimited signal

Pass signal bandwidth: magnitude


response of 1 means 0 dB

Attenuate out-of-band noise: A


stopband
=
dynamic range
Power Noise log 10
Power Signal log 10
Power Noise
Power Signal
log 10 SNR
10
10
10 dB

Why 10 log
10
?
For amplitude A,
A
dB
= 20 log
10
A
With power P A
2
,
P
dB
= 10 log
10
A
2
P
dB
= 20 log
10
A
80
Dynamic Range in Audio
Sound Pressure Level (SPL)

Reference in dB SPL is 20 Pa
(threshold of hearing)

40 dB SPL noise in typical living room

120 dB SPL threshold of pain

80 dB SPL resulting dynamic range

Audio CDs give 95 dB of dynamic range


Estimating dynamic range
(a)Find maximum RMS output of the
linear system with some specified
amount of distortion, typically 1%
(b)Find RMS output of system with small
input signal (e.g.
-60 dB of full scale) with input signal
removed from output
(c)Divide (b) into (a) to find the dynamic
range
Anechoic room 10
dB
Whisper 30 dB
Rainfall 50 dB
Dishwasher 60 dB
City Traffic 85
dB
Leaf Blower 110
dB
Siren 120 dB
. Slide by Dr Thomas
. , D Kite Audio
Precision
81
Quantization Error (Noise)
Analysis
Quantization
output

Input signal plus


noise

Noise is difference
of output and
input signals
Signal-to-noise
ratio (SNR)
derivation

Quantize to B bits

Quantization error
Assumptions

m (- m
max
, m
max
)

Uniform midrise
quantizer

Input does not


overload
quantizer

Quantization error
(noise) is
uniformly
distributed

Number of
quantization
levels L = 2
B
is
large enough
so that
Q
B
[ ]
m v
m v m m Q q
B
] [
L L
1
1
1

82
Quantization Error (Noise)
Analysis
Deterministic signal x(t)
w/ Fourier transform
X(f)

Power spectrum is
square of absolute
value of magnitude
response (phase is
ignored)

Multiplication in Fourier
domain is convolution
in time domain

Conjugation in Fourier
domain is reversal &
conjugation in time

Autocorrelation of
x(t)

Maximum value
(when it exists) is
at R
x
(0)

R
x
( ) is even
symmetric,
i.e. R
x
( ) = R
x
(-
)

) ( ) ( ) ( ) (
*
2
f X f X f X f P
x

{ ) ( * ) ( ) ( ) (
* *
x x F f X f X
) ( * ) ( ) (
*
x x R
x
t
1
x(t)
0 T
s

R
x
( )
-T
s
T
s
T
s
83
Quantization Error (Noise)
Analysis
Two-sided random signal n(t)

Fourier transform may not exist, but


power spectrum exists

For zero-mean Gaussian random process


n(t) with variance
2

Estimate noise power


spectrum in Matlab
{
2 2 *
) ( ) ( ) ( ) ( ) ( + f P t n t n E R
n n
{ ) ( ) (
n n
R F f P
= ; % . N 16384 finite no of
sam ples
= ( , ); gaussianN oise randn N 1
( ( ( )) . plot abs fft gaussianN oise
); ^ 2
approxim ate
noise floor
{


+ + dt t n t n t n t n E R
n
) ( ) ( ) ( ) ( ) (
* *

{ ) ( * ) ( ) ( ) ( ) ( ) ( ) (
* * *


n n dt t n t n t n t n E R
n
84
Quantization Error (Noise)
Analysis
Quantizer step size

Quantization error

q is sample of zero-
mean random
process Q

q is uniformly
distributed
Input power:
P
average,m

SNR exponential in
B

Adding 1 bit
increases SNR by
factor of 4
Derivation of SNR
in deciBels on
next slide
L
m
L
m
max max
2
1
2


2 2

q
{

B
Q
zero
Q Q
m
Q E
2 2
max
2
2
2 2 2
2
3
1
12


B
Q
m
P P
2
2
max
m average,
2
m average,
2
3
SNR
Power Noise
Power Signal
SNR

,
`

.
|

85
Quantization Error (Noise)
Analysis
SNR in dB = constant + 6.02 dB/bit *
B

What is maximum number of bits of


resolution for

Landline telephone speech signal of


SNR of 35 dB

Audio CD signal with SNR of 95 dB


( ) ( )
( ) ( ) B m P
m P
m
P
B
02 . 6 log 20 log 10 477 . 0
) 2 ( log B 20 log 20 log 10 3 log 10
2
3
log 10 SNR log 10
max 10 m average, 10
10 max 10 m average, 10 10
2
2
max
m average,
10 10
+ +
+ +

,
`

.
|

,
`

.
|

. . 1 76 and 1 17 are common constants used in audio


Loose
upper
bound
86
Noise Immunity at Receiver
Output
Depends on modulation, average
transmit power, transmission
bandwidth and channel noise
Analog communications (receiver
output SNR)

When the carrier to noise ratio is high,


an increase in the transmission
bandwidth B
T
provides a
corresponding quadratic increase in
the output signal-to-noise ratio or
figure of merit of the [wideband] FM
system.
Simon Haykin, Communication
Systems, 4
th
ed., p. 147.
Digital communications (receiver
symbol error)

For code division multiple access


(CDMA) spread spectrum
communications, probability of symbol
error decreases exponentially with
transmission bandwidth B
T

Andrew Viterbi, CDMA: Principles of
Spread Spectrum Communications,
1995, pp. 34-36.
87
Conclusion
Amplitude quantization approximates
its input by a discrete amplitude
taken from finite set of values
Loose upper bound in signal-to-noise
ratio of a uniform amplitude
quantizer with output of B bits

Best case: 6 dB of SNR gained for each


bit added to quantizer

Key limitation: assumes large number of


levels L = 2
B
Best case improvement in noise
immunity for communication
systems

Analog: improvement quadratic in


transmission bandwidth

Digital: improvement exponential in


transmission bandwidth
88
Digital vs. Analog Audio
An audio engineer claims to notice
differences between analog vinyl
master recording and the remixed
CD version. Is this possible?

When digitizing an analog recording, the


maximum voltage level for the
quantizer is the maximum volume in
the track

Samples are uniformly quantized (to 2


16

levels in this case although early CDs
circa 1982 were recorded at 14 bits)

Problem on a track with both loud and


quiet portions, which occurs often in
classical pieces

When track is quiet, relative error in


quantizing samples grows

Contrast this with analog media such as


vinyl which responds linearly to quiet
portions
Optional
89
Digital vs. Analog Audio
Analog and digital media response to
voltage v

For a large dynamic range

Analog media: records voltages above


V
0
with distortion

Digital media: clips voltages above V


0
to
V
0

Audio CDs use delta-sigma
modulation

Effective dynamic range of 19 bits for


lower frequencies but lower than 16
bits for higher frequencies

Human hearing is more sensitive at


lower frequencies
( )
( )

'

<

> +

0
3 / 1
0 0
0 0
0
3 / 1
0 0
for
for
for
) (
V v v V V
V v V v
V v V v V
v A

'

<

>

0 0
0 0
0 0
for
for
for
) (
V v V
V v V v
V v V
v D
Optional

You might also like