Mathematical Foundations¶
Metric¶
- Function \( d:K\times K \rightarrow \mathbb{R} \)
- Characteristics:
- Non-negativity: \( d(x,y)\geq 0 \)
- Identity: \( x=y \Rightarrow d(x,y) = 0 \)
- Symmetry: \( d(x,y) = d(y,x) \)
- Triangular inequality: \( d(x,z)\leq d(x,y)+d(y,z) \)
Distance Functions¶
Minkowski Distance¶
- Generalization of Manhatten/Euclidean distance
- \( x, y \in \mathbb{R}^n \)
- Parameter \( r \)
- \( d_r(x, y) = (\sum_{1\leq i\leq n}|x_i-y_i|^r)^\frac{1}{r} \)
- \( r=1 \): Manhattan distance
- \( r=2 \): Euclidean distance
Mahalanobis distance¶
- Distance between vectors
- Often used in statistics
- Covariance matrix \( \Sigma \)
- \( D(x,y)=\sqrt{(x-y)^T * \Sigma^{-1} * (x-y)} \)
Transformation¶
- Idea:
- Transform from one domain into another (keeping all information)
- See other things
- Properties
- Reversible
- Information preserving (no loss)
- Using input signal
- Discrete function
Fourier Transformation¶
- High-level feature
- Transformation from original domain to frequency domain
- Original domain
- Images: Position space (image row)
- Audio: Time domain
- Decompose periodic function into sum of simple oscillating functions (sin, cos)
- Lower frequency contain most information
- Discrete Fourier Transform
- For discrete functions (i.e., sequence of real values)
- Sequence of \( n \) real numbers \( x_0,...,x_{n-1} \)
- Transform to sequence of coefficients
- \( a_0,...,a_{n/2} \) (for cos)
- \( b_0,...,b_{n/2} \) (for sin)
- \( a_k = \sum_{j=0}^{n/2} f(j)cos(kj) \)
- Coefficients are amplitudes of sine and cosine waves (project signal into sine/cosive waves)
- \( x_k = \sum_{i=0}^{n/2}a_l cos(2\pi\frac{lk}{n}) + \sum_{i=0}^{n/2}b_l sin(2\pi\frac{lk}{n}) \)