Docsity

Lossy Compression, Distortion Measures - Lecture Notes | ECE 8873, Study notes of Electrical and Electronics Engineering

Toggle sidebar
bg1
Spring 2004 ECE 8873 B. H. Juang Copyright 2004 Lecture 5, Slide #1
ECE 8873
Data Compression & Modeling
Lecture 5:
Lossy Compression, Distortion Measures
School of Electrical and Computer Engineering
Georgia Institute of Technology
Spring, 2004
Spring 2004 ECE 8873 B. H. Juang Copyright 2004 Lecture 5, Slide #2
• A quantization/coding scheme consists of
– An encoder
If and appear as a parsable units in their
respective domain, we can define the average code length
a per input “unit,” which can be sample, pixel, word
(variable number of letters), sequence, area, or time.
– A decoder
– A reproduction codebook
Fundamentals
*** }1,0{: =→ BA
α
AxxAB ˆ
ˆ
))((
ˆ
:** ∈=→
αββ
,
Ax ∈
))](([ xlE
α
Usually
)(x
α
.
ˆ
ˆ
ˆ
))((
ˆxxAxxAA equal notmay but , ∈=⊂
αβ
}),({ IiiC ∈=
β
.generality of loss outindex with integer
in drepresente elements has codeset the
and codeword a called is Each
I
Iii ∈),(
β
Why?
Spring 2004 ECE 8873 B. H. Juang Copyright 2004 Lecture 5, Slide #3
Objectives & Concerns
• Given , find the encoder and the decoder such
that the discrepancy between and is minimum.
• How to measure discrepancy? Use “distortion
measure” .
• Instead of looking at , we are interested in
I
)
ˆ
,( xxd
xx
ˆ
For the distortion measure to be useful, it should be:
• Easy to compute;
• Tractable (at least for consistency);
• Meaningful for perception or in specific applications.
),()))]((,([)]
ˆ
,([
βααβ
DXXdEXXdE ==
))](([ xlE
α
Spring 2004 ECE 8873 B. H. Juang Copyright 2004 Lecture 5, Slide #4
General Distance or Dissimilarity Measure
• Point to point
• Point to set
• Set to set
• Dissimilarity measure between probability distribution
or density functions
pf3
pf4
pf5

Partial preview of the text

Download Lossy Compression, Distortion Measures - Lecture Notes | ECE 8873 and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

ECE 8873 B. H. Juang

Copyright 2004

Lecture 5, Slide #

ECE 8873

Data Compression & Modeling

Lecture 5:

Lossy Compression, Distortion Measures

School of Electrical and Computer Engineering

Georgia Institute of Technology

Spring, 2004

Spring 2004

ECE 8873 B. H. Juang

Copyright 2004

Lecture 5, Slide #

-^

A quantization/coding scheme consists of

  • An encoder

If

and

appear as a parsable units in their

respective domain, we can define the average code lengtha

per input “unit,” which can be sample, pixel, word

(variable number of letters), sequence, area, or time.

  • A decoder– A reproduction codebook

Fundamentals

*^

:^

B

A

A

x

x

A

B

:^

*^

α β

β

A

x

))]

[^

x

l

E

Usually

) ( x α

ˆ^

x x A x x A A

equal

not

may

but

,^

I

i

i

C

β

generality

of

loss

out

index with

integer

in

d

represente

elements

has

codeset

the

and

codeword

a

called

is

Each

I

I

i

i^

Why?

ECE 8873 B. H. Juang

Copyright 2004

Lecture 5, Slide #

Objectives & Concerns

-^

Given

, find the encoder and the decoder such

that the discrepancy between

and

is minimum.

-^

How to measure discrepancy? Use “distortionmeasure”

-^

Instead of looking at

, we are interested in

I

) ˆ , (^

x x d

x

ˆ x

For the distortion measure to be useful, it should be:•^

Easy to compute;

-^

Tractable (at least for consistency);

-^

Meaningful for perception or in specific applications.

)))]

[

)]

[

β α

α β

D X X d E X X d E

))]

[^

x

l

E

Spring 2004

ECE 8873 B. H. Juang

Copyright 2004

Lecture 5, Slide #

General Distance or Dissimilarity Measure

-^

Point to point

-^

Point to set

-^

Set to set

-^

Dissimilarity measure between probability distributionor density functions

ECE 8873 B. H. Juang

Copyright 2004

Lecture 5, Slide #

Distortion Measures

•^

A distortion measure is a real non-negative function that mapstwo variables, possibly vector valued, to a scalar that indicatesthe degree of dissimilarity between the two variables.

-^

The space the two variables are in may be a metric space. Aspace

V

is

metric

if the

distance

function

between two

points A and B is characterized by the following properties:For–

if and only if

x

y

distance only when the two points coincide)

(the distance is symmetric)

(triangle inequality.)

•^

But, a general measure of dissimilarity may not satisfy theseproperties.

(^

x y d y x d

V z V y V x

and

(^

y x d 0 ) , (

and ,

y x d y x d ) , ( ) , ( ) ,

(^

z x d z y d y x d

Spring 2004

ECE 8873 B. H. Juang

Copyright 2004

Lecture 5, Slide #

Lp Norm

-^

Let

x

be a

N

-dimensional vector,

The length of

x

can be defined in many ways. The

norm of

x

is defined as

-^

Or, it may be normalized:

  • When

p

=1, it is the mean absolute value.

  • When

p

=2, it is the RMS value.

  • When

p

, it is referred to as “Chebyshev,”

“supremum,” “minimax,” or “uniform” norm.

p L ) , , ,

(^

2

1

N

x

x

x

L

x

p

N n

p n

p^

x

/ 1

1

∑

=

x

p

N n

p n

p^

x

N

/ 1

1

∑

=

x

ECE 8873 B. H. Juang

Copyright 2004

Lecture 5, Slide #

Lp Norm as Distortion Measure

-^

Let

x

and

y

be two

N

-dimensional vectors,

-^

The difference of the two vectors is

-^

The normalized

of

z

can be used as a distortion

measure between

x

and

y

-^

When

p

=1, it is the city block distance.

-^

When

p

=2, it is the (normalized) Euclidean distance.

-^

When

p

, it is referred to as “Chebyshev,” or peak

distance.

(^

2

1

N

y

y

y

L

y

(^

2 1 2 2 1 1

N

N

N

z z z y x y x y x

L

L

y

x

z

p

L

(^

2

1

N

x

x

x

L

x

p

N n

p n

n

p^

y

x

N

d

/ 1

1

(^

^ 

∑

=

y

x

y x

Spring 2004

ECE 8873 B. H. Juang

Copyright 2004

Lecture 5, Slide #

Weighted Euclidean Distance

•^

Euclidean distance

-^

Different significance may be manifested along differentdimensions, thus weightingwhere

is a diagonal matrix. In general, it may not be.

•^

Normalized weighted Euclidean distance:

-^

How to introduce general weighting?

-^

The role of covariance matrix – if

is the inverse covariance

matrix, the effect is to “equalize” the statistical spread alongeach data dimension – Mahalanobis distance.

W

∑=

N n

n

n^

y

x

d

1

2

2

(^

y

x

y x

W

(^

1

2

y x W y x y x −

∑

=

t

N n

n

n n

W

y

x

w

d

1

1

1

(^2) )

(

) , (

−

=

=





−

=^

∑

∑

N n

n

N n

n

n n

W^

w

y

x w

d^

y x

ECE 8873 B. H. Juang

Copyright 2004

Lecture 5, Slide #

Ali-Silvey Class of Distances for PDFs

(^

[^

]

(^

)

function

decreasing

non a is

and

to

respect

with n

expectatio

the is

function,

convex a is

ratio,

likelihood

the is

where

(.)

) (

) (

) (

) (

) , (

1

2 1

2 1 1

1

f

p

E

C

X p

X p

X

X C E f p p d

p

p

= γ

γ

distance.

Leibler-

Kullback

the

becomes it

and

If

log

(^

x x f x x x C

(^

)

distance.

Chernoff

the

becomes it

If

)]

[

)]

( [ ) ( , ) (

log

max )

, (^

2 1 1 1 0 2 1

dx

x p x p t t p p C

t

t

t^

∫^

−

≤ ≤

ρ

ρ

Spring 2004

ECE 8873 B. H. Juang

Copyright 2004

Lecture 5, Slide #

-^

Euclidean distance

-^

Signal-to-(coding)-noise ratio

-^

SNR with gain optimization

-^

Segmental signal-to-noise ratio

-^

Average segmental signal-to-noise ratio

Waveform Distortion Measures

∑

∑

i^

i

i^ i

i y

x

x

SNR

2 2

10

log 10

∑

i^

i

i^

y

x

d

(^

y x ) , , , ,

(^

2

1

L

L

i

x

x

x

x

(^

2

1

L

L

i y y y = y ∑

∑

−=

−=

I

I i^

i n

i n I

I i^

i n

n

y

x

x

r^

2

2

ε

ρ

^ 

=

−

Nn^

rn

N

SSNR

1

10

1

log

10

log

log

10

ρ

rn

SSNR

if

log

10

1

∑

=

−

N n^

rn

N

SSNR

 

^ 

−

−

2

10

(^1)

log 10

y x

y x

SNRG

ECE 8873 B. H. Juang

Copyright 2004

Lecture 5, Slide #

Spectral Distortion Measures

-^

Nonlinear distortion– THD (total harmonic distortion): the ratio of total

rms power of the newly created harmonics due tonon-linear distortion to that of the original signalpower, expressed in dB.

-^

Linear distortion– Equivalent to result of filtering;– Measured in a number of ways, particularly when

perceptual significance is taken into account.

Spring 2004

ECE 8873 B. H. Juang

Copyright 2004

Lecture 5, Slide #

Spectral Distance & Log Spectral Distance • Lp norm of spectral difference• Lp norm of log spectral difference

)

(^ ω X

⇔ x

∫−

π π

(^

d

Y

X

d

p

p^

y x

∫−

π π

(^

d

V

d

p

p^

y

x

log

log

Y

X

V

)

(^ ω Y

⇔ y

Power spectral density: p =

Î

mean absolute log spectral distance

p

Î

mean root mean square log spectral distance

p

Î

mean peak log spectral distance

ECE 8873 B. H. Juang

Copyright 2004

Lecture 5, Slide #

Cepstral Distances

∞

−∞

−

n

n j

xn

e

c

X

ω

ω

log

cepstrum. or ts

coefficien

cepstral

the

called

and

real

are xn

xn

c

c^

−

∞

−∞=

−^

n^

yn

xn

c c d Y X d

2

2

22

log

log

π π

ω π

ω

ω

From Parseval’s Theorem

−=

L

L n^

yn

xn

c

c

L

d

2

22

Truncated cepstral distance:Truncating the cepstrum amounts to low-quefrency(lowpass) liftering and will cause smoothing on thelog spectrum.

Spring 2004

ECE 8873 B. H. Juang

Copyright 2004

Lecture 5, Slide #

For a stable all-pole filter,

is analytic inside the unit

circle and can be represented by the Laurent expansion

Cepstrum of Model Spectrum

2 2

ω σ

ω

j e A

X

for

1 1

− ∑=

−^

n

a kc

n

a

c

n k

k n k

n

n

log

(^1) − z A

−

1

log

) (

log

n

n zcn

z A

σ

σ

Differentiating both sides wrt

and equating the coefficients of

like powers of

(^1) −

z

(^1) −

z

−

p n

n

zn

a

z

A

0

p

k

a

a

k^

for 0

and 1 0

n

n

n

n n^

c c c z c z A

−

∞ −∞=

−

and,

log

where

log

2

0

2 2

σ

σ

LPC cepstrum

ECE 8873 B. H. Juang

Copyright 2004

Lecture 5, Slide #

Cepstrum

 

^ 

−



^ 

−



^ 

−



^ 

−

=

=

=

−

=

=

−

4

3

2

1

1

1

1

1

1

1

)

(^1) (

)

(^1) (

)

(^1) (

)

(^1) (

) (^

p k^

k

p k^

k

p k^

k

p k^

k

r

z w

z z

z v

z u

Gz

z X

[^

]

[^

]

∑

∑

∑

∑

=

−

=

−

−

=

=

−

log

1

1

1

1

1

1

2

4

1

3

n

v

w

n

n

u

z

n

n

G

c

p k

nk

p k

nk

p k

nk

p k

nk

n

k

k

k

k^

z

w

v

u

and ,

,

,

of

value

absolute

maximum is λ

|

|

|

|

| | n

c

n

n

<

Cepstrum is a decayingsequence. Thesignificance of cepstrumdeminishes as the indexgets higher. Truncation isthus justified.

2

2

1

}

{

n

c E

n^

≈

Spring 2004

ECE 8873 B. H. Juang

Copyright 2004

Lecture 5, Slide #

Weighted Cepstrum Distance

2

2

n

c

E

n^

ω π

ω

ω

ω

ω

π π

log

log

2

(^22)

d

d

S

d

d

S

d

d

W

−

−∞=

−

n

jn

en

jnc

S

d d

ω

log

−∞=

′

−

=

n

n

n

W

c

c

n

d

2

2

22

)

(

Weighting by inverse variance

Spectral slope distance

n

n

nc

is called the root power sum for LPC cepstrum

ECE 8873 B. H. Juang

Copyright 2004

Lecture 5, Slide #

Perceptual Significance

-^

End quality of a compression system is to be judgedby human listeners (for speech & audio) or viewers(for image & video)

-^

Human judgment involves “subjective” preferences.

-^

However, physiological studies provide clues,explanations, and justifications for incorporatingperceptual effects in a distortion measure.

-^

Perceptual dimensions:– Representation – e.g., mel frequency scale vs.

linear scale, all-pole, …

  • Weighting – emphasis on perceptually important

dimensions such as formants …

  • Bit allocation

Spring 2004

ECE 8873 B. H. Juang

Copyright 2004

Lecture 5, Slide #

Nonlinear Perceptual “Frequency” Scale

5000 500 200100 50 20 20001000

50

100

1000

10000

Frequency (Hz)

Critical Bandwidth (Hz)

0

2000

4000

6000

8000

10000 12000

0 30002500 20001500 1000500

10

100

1000

10000

linear frequency

scale

logarithmicfrequency

scale

Frequency (Hz)

Pitch (mel)

Frequency (Hz)

Pitch perception

Loudness perception

ECE 8873 B. H. Juang

Copyright 2004

Lecture 5, Slide #

Concept of Difference Limen (DL)

•^

DL is the perceptual sensitivity threshold – the minimumdeviation or difference along a certain dimension that isperceptually noticeable; sometimes also called just noticeabledifference (JND)

-^

Examples– Vowel formant frequencies: 3-5%– Formant amplitude:

◊^

nd

formant: ~3dB

◊^

Overall intensity: ~1.5dB (also 1

st

formant)

◊^

Harmonics in spectral valleys: 13-(-

  • Formant bandwidth: 20-40%– Fundamental frequency: 0.3-0.5%– Light intensity: ~2% (Weber ratio)

Spring 2004

ECE 8873 B. H. Juang

Copyright 2004

Lecture 5, Slide #

Perceptual Masking - Asymmetry

80 56

SPL (dB)

Tonal masker Threshold

24dB

1000 Critical BW

Masked noiseFreq (Hz)

SMR

80 76

SPL (dB)

Noise maskerThreshold

4dB

410

Critical BW

Masked tone Freq (Hz)

SMR