Professional Documents
Culture Documents
Spring’04
Unitary Transforms
UMCP ENEE631 Slides (created by M.Wu © 2004)
Fast computation
UMCP ENEE631 Slides (created by M.Wu © 2001)
{ z(n) } { Z(k) }
UMCP ENEE631 Slides (created by M.Wu © 2001/2004)
N 1
z ( n) 1
n, k = 0, 1, …, N-1
N k 0
Z ( k ) W nk
N
WN = exp{ - j2 / N }
~ complex conjugate of primitive Nth root of unity
Vector form and interpretation for inverse transform
z = k Z(k) ak
ak = [ 1 WN-k WN-2k … WN-(N-1)k ]T / N
Basis vectors
– akH = ak* T = [ 1 WNk WN2k … WN(N-1)k ] / N
Energy Conservation
UMCP ENEE631 Slides (created by M.Wu © 2001/2004)
– || y ||2 = || x ||2
Rotation
– The angles between vectors are preserved
Decorrelation
– Highly correlated input elements quite uncorrelated output coefficients
– Covariance matrix E[ ( y – E(y) ) ( y – E(y) )*T ]
small correlation implies small off-diagonal terms
Question: What unitary transform gives the best compaction and decorrelation?
Z ( k ) z ( n ) ( k ) cos
n 0 2N
z ( n)
N 1
( 2n 1)k
Z ( k ) ( k ) cos
k 0 2N
1 2
(0) , (k )
N N
Transform matrix C
– c(k,n) = (0) for k=0
– c(k,n) = (k) cos[(2n+1)/2N] for k>0
C is real and orthogonal
– rows of C form orthonormal basis
– C is not symmetric!
– DCT is not the real part of unitary DFT! See Assignment#3
related to DFT of a symmetrically extended signal
Periodicity Implied by DFT and DCT
UMCP ENEE631 Slides (created by M.Wu © 2004)
100 100
50 50
z(n) Z(k)
0 0
DCT
-50 -50
-100 -100
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
n k
From Ken Lam’s DCT talk 2001 (HK Polytech)
0.0 0.0 0 0
n 0.0 0.0 0 0
0.0 0.0 0 0
k 0.0 0.0 0 0
N 1 N 1
y ( k , l ) x ( m, n) ak ,l (m, n)
UMCP ENEE631 Slides (created by M.Wu © 2001/2004)
m 0 n 0
N 1 N 1
x( m, n)
k 0 l 0
y ( k , l ) hk ,l (m, n)
Computational complexity
– N2 values to compute
– N2 terms in summation per output coefficient
– O(N4) for transforming an NxN image!
2-D Separable Unitary Transforms
Complexity ~ O(N3)
– May further reduce complexity if unitary transf. has fast implementation
Basis Images
the image 1 1
1 2
2 2 X
A
1 1 3 4
2 2
– Y = F X F X = F* Y F*
1 N 1 N 1
Y ( k , l )
N
m 0 n 0
X ( m , n ) W N
nl
W mk
N
N 1 N 1
X (m, n) 1
N
k 0 l 0
Y ( k , l ) W nl
N W N
mk
Summary and Review (1)
– Forward transform
In the form of inner product
Project a vector onto a new set of basis to obtain N “coefficients”
– Inverse transform
Use linear combination of basis vectors weighted by transform coeff.
to represent the original signal
Optimal Transform
Optimal Transform
Recall: Why use transform in coding/compression?
– Decorrelate the correlated data
UMCP ENEE631 Slides (created by M.Wu © 2004)
What unitary transform gives the best energy compaction and decorrelation?
– “Optimal” in a statistical sense to allow the codec works well with
many images
Signal statistics would play an important role
Review: Correlation After a Linear
Transform
Consider an Nx1 zero-mean random vector x
– Covariance (autocorrelation) matrix Rx = E[ x xH ]
UMCP ENEE631 Slides (created by M.Wu © 2004)
Decorrelation
UMCP ENEE631 Slides (created by M.Wu © 2001/2004)
Goal: to find the forward and backward transform matrices to minimize the
restriction error for each and every m
– The minimum is achieved by KLT arranged according to the
decreasing order of the eigenvalues of R
K-L Transform for Images
Optimality
UMCP ENEE631 Slides (created by M.Wu © 2001)
Applications
– (non-universal) compression
– pattern recognition: e.g., eigen faces
– analyze the principal (“dominating”) components
Energy Compaction of DCT vs. KLT
DCT has excellent energy compaction for highly
correlated data
UMCP ENEE631 Slides (created by M.Wu © 2004)