2018/05/31

Identity Matrix 單位矩陣

Identity Matrix / Unit Matrix 單位矩陣/恆等矩陣

Example:

I =
[ 1 0 ]
[ 0 1 ]

I =
[ 1 0 0 ]
[ 0 1 0 ]
[ 0 0 1 ]

I =
[ 1 0 0 0 ]
[ 0 1 0 0 ]
[ 0 0 1 0 ]
[ 0 0 0 1 ]

Matlab Example:

>> I = eye(4)

I =

     1     0     0     0
     0     1     0     0
     0     0     1     0
     0     0     0     1

>>

For an NxN identity matrix I and a NxN matrix A,

AI = IA = A

For an NxN identity matrix I and a Nx1 matrix B or a 1xN matrix C,

IB = B
CI = C

Reference:

Identity Matrix (Wikipedia/維基百科)

2018/05/05

Matlab: cross-correlation and autocorrelation 互相關與自相關

cross-correlation 互相關
autocorrelation 自相關

For autocorrelation function in Matlab:
autocorr - Econometrics Toolbox - for statistics. 😳
xcorr - Signal Processing Toolbox - for engineers!! 😄

To use xcorr:
xcorr(x, y) => cross-correlation of discrete signals x and y.
xcorr(x) => autocorrelation of x. Special condition of cross-correlation since auto correlation is the cross-correlation of signal x and shifted version of itself.

Autocorrelation is a special case of cross-correlation.

Autocorrelation may be used for pitch (fundamental frequency, F0) detection.


References:

Cross-correlation (Wikipedia)
Autocorrelation (Wikipedia)
Pitch detection algorithm (Wikipedia)
D. Gerhard. Pitch Extraction and Fundamental Frequency: History and Current Techniques, technical report, Dept. of Computer Science, University of Regina, 2003.