UVP --> Matlab - School of Engineering

Download Report

Transcript UVP --> Matlab - School of Engineering

Principal Component Analysis
Principles
and
Application
Fast
Multi-Sensor
Large


Computers Instruments
Data Sets
Examples:
•Satellite Data
•Digital Camera, Video Data
•Tomography
•Particle Imaging Velocimetry (PIV)
•Ultrasound Velocimetry (UVP)
Large Data Sets
Low resolution image
x 
y

 p ( x1 , y1 )
 p( x , y )
2
1



 p( x400 , y1 )
p( x2 , y1 )
p( x2 , y2 )
p( x400 , y2 )
p( x1 , y600 ) 
p ( x2 , y600 ) 


p( x400 , y600 ) 
• There are 400 x 600 = 240,000 pieces of information.
• Not all of this information is independent
=> information compression (data compression)
Example 1
Two component velocity measurement
Experiment:
• Consider the flow past a cylinder, and suppose we position a
cross-wire probe downstream of the cylinder.
• With a cross-wire probe we can measure two components of
the velocity at successive time intervals and store the results
in a computer.
u1 
v  ,
 1
time
u2 
v  ,
 2

u j 
,  ,
v j 
um 
,  
 vm 
Mathematical Representation of Data
• As the previous slide suggests, the pair of velocities can be
represented as a column vector:
u j 
uj   
v j 
• u is a vector at position x in physical space:
y
u
x
x
• The magnitude and angle of the vector changes with time.
Basic Statistics
• Mean velocity :
• Variance :
u 
1 m
u    , where the bar means u   u j
m j 1
v 
1 m
  Var (u )   (u j  u )2
m j 1
2
u
1 m
  Var (v)   (v j  v ) 2
m j 1
2
v
• Covariance :
1 m
cov(u, v)   (u j  u )(v j  v )
m j 1
cov(v, u )  cov(u, v)
• Correlation :
uv 
cov(u, v)
 u v
,
 1  uv  1
Plot u vs v
u1
v
 1
uj
vj
um 
vm 
v
u
The data look correlated
Examine the Statistics
v’
Move to a data centered
coordinate system
v
(u , v )
u’
Calculate the
Covariance
matrix
u
1 m 2
 m  ui
1

1 m
 m  viui
 1
1 m



u
v
 i i
m 1

1 m 2
vi 

m 1

Diagonal terms are the
variances in the
u’ and v’ directions
Examine the Statistics
v’
Move to a data centered
coordinate system
Calculate the
Covariance
matrix
v
(u , v )
u’
u
1 m 2
 m  ui
1

1 m
 m  viui
 1
1 m



u
v
 i i
m 1

1 m 2
vi 

m 1

covariance or cross-correlation
Rotate coordinates to remove the correlations
v”
v
2
u”
1
u
Covariance
matrix
in the
(u”,v”)
coordinate
system
m 2
ui


1 1
m
 0


0 

m
2
1 vi 
We have just carried out a
Principal Axis Transformation.
This is the first step in a
Principal Component Analysis
(PCA).
Principal Component Analysis
A procedure for transforming a set of correlated
variables into a new set of uncorrelated variables.
How do we do it??
Construction of the
PCA coordinate system
The PCA coordinate system is one that maximizes the mean
squared projection of the data. In this sense it is an “optimal”
orthogonal coordinate system. Its popularity is primarily due to
its dimension reducing properties.
The basic algorithm for constructing the PCA eigenvectors is:
• Find the best direction (line) in the space, 1.
• Find the best direction (line) 2 with the restriction that it must
be orthogonal to 1.
• Find the best direction (line) i with the restriction that i is
orthogonal to j for all j < i.
How do we find this nice
coordinate system??
Calculate the eigenvalues and eigenvectors
of the
Covariance Matrix
Example 2.
Velocity Profile Measurement
Experiment:
• Pipe Flow -- measurement of velocity profile.
u(z)
z
 u1 
u 
u   2
 
 
un 
where uk  u ( zk )
Vectors in Profile Space
• As before we represent the velocities in the form of a column
vector, but this time the vector is not in physical space.
• The space in which our vector lives is one we shall call
profile space or pattern space.
• Profile space has n dimensions. In this example, the
position zk defines a direction in profile space.
• As time evolves, we measure a sequence of velocity profiles:
 u ( z1 , t1 ) 
u ( z , t ) 
 2 1 ,




u ( zn , t1 ) 
time 
 u ( z1 , t2 ) 
u ( z , t ) 
 2 2 ,




u ( zn , t2 ) 
 u ( z1 , t j ) 
u ( z , t ) 
2 j 
, 
,




u
(
z
,
t
)
 n j 
 u ( z1 , t m ) 
u ( z , t ) 
,  2 m 




u ( zn , tm ) 
The Preliminary Calculations
1. UVP Data Matrix (n x m=128 x 1024)
U
 u ( z1 , t1 ) u ( z2 , t1 )
u ( z , t ) u ( z , t )
2 2
 2 1


u ( zn , t1 ) u ( zn , t2 )
u ( z1 , tm ) 
u ( z2 , tm ) 


u ( zn , t m ) 
2. Mean Profile Matrix (n x m)
U
 u ( z1 ) u ( z1 )
u ( z ) u ( z )
2
 2


u ( zn ) u ( zn )
1 m
u ( zi )   u ( zi , tk )
m k 1
u ( z1 ) 
u ( z2 ) 


u ( zn ) 
3. Centered Data Matrix
(n x m)
X
1
U  U
m
4. Covariance Matrix
(n x n = 128 x 128)
T
1
1
R
U  U
U  U


m
m
X
 R  XXT
XT
The Diagonalization
Eigenvalue Equation
Eigenvectors (eigenprofiles)
R  λΦ  0
Φ  1
n 
Eigenvalues
 1

λ 

0
1  2 
0
the data in the  k direction:
2
T
k

n 
Note: k is the variance of
k   k
1 i  k
 i  
0 i  k
0 
1
 11

n   

 n1
1n 


 nn 
Example 3.
Taylor-Couette Flow
UVP Example
UVP data
space
time
Covariance Matrix
Before
After
(diagonalisation)
space
compression!!
space
The Eigenvalue Spectrum
(Signal) Energy Spectrum
1
Energy Fraction
Ek 
k

n
k 1
Ek
k
0


n
k 1
1
Ek  1
Mode Number
128
11
Ek
cumulative sum of Ek
0
1
Mode Number
20
Filtering and Reconstruction
• Decompose X into signal and noise dominated
components (subspaces):
X  XF  XNoise
where XF is the Filtered data
XNoise is the Residual
• Reconstruct filtered UVP velocity
UF  XF  U
U
UF
XNoise=U-UF
Eigenvalue Spectrum
Filtered Time Series
(Channel 70)
Raw data
Filtered data
Residual
Power Spectra
(Integrated over all channels)
Superimpose the Spectra
Generalizations
Generalise
1
X
U  U ref

m

• Response to a stimulus Uref  0
• Comparison of multiple data sets obtained by
varying a parameter to study a transition.