PCA Mynotes
PCA Mynotes
Compression/dimensionality
reduction
(PCA)
Consider a square matrix A
1 1
2 2
1 1
2 2
Orthogonal matrix
A square matrix with real entries. Both
rows and columns are orthonormal
Orthonormal: Orthogonal + unit norm
Row/column vectors have unit norm
(length) and dot product is zero between
vectors
Complex version : Unitary matrix
a00 a10 a01a11 0 (orthogonal basis vectors )
2 2 2 2
a a a a 1
00 01 10 11 (norm is unity )
Consider a square matrix of size NXN
T
A A I if A is orthogonal,
1 T
So A A
1 *T
A A For unitary matrix
Orthogonal transform
y T y xT AT Ax xT x
Discrete cosine transform (DCT)
(An Orthogonal Transformation)
N 1
(2n 1)k
y (k ) C (k ). x(n) cos
n 0 2 N
N 1
(2n 1)k
x(n) C (k ) y (k ) cos
k 0 2 N
1 2
C (k ) for k 0, and for k 0
N N
Let, N=2
1 1
y (0) 2 2 x(0)
y (1) 1
1 x(1)
, y Ax
2 2
1 1
x(0) 2 2 y (0)
x(1) 1
1 y (1)
, x A1 y AT y
2 2
DFT (Unitary Transform)
2
1 N 1 j nk
y (k )
N
x ( n )e
n 0
N
, k 0,1, ...., N 1, (1)
2
1 N 1 j nk
x ( n)
N
y ( k )e
k 0
N
, n 0,1, ...., N 1, (2)
Consider N=4 (4 point DFT)
y (0) 1 1 1 1 x(0)
y (1) 1 j 1 j x(1)
1
y (2) 2 1 1 1 1 x(2) y Bx
y (3) 1 j 1 j x(3)
x[0] 1 1 1 1 X [0]
x[1] 1 j 1 j X [1]
1
x[2] 2 1 1 1 1 X [2]
x[3] 1 j 1 j X [3]
1 *T
xB X B X
Advantages of DCT over DFT
Basis vectors are real i.e. A is real. So, less
computational complexity.
Better energy compaction.
Meaning of energy compaction: The sum of
squared error between the source signal
x[n] and reconstructed signal with k
transformed coefficients i.e., truncated
transform
Application DCT
Most important is in image compression
JPEG uses DCT.