aspcore.correlation
Implements autocorrelation and cross-correlation estimators, as well as related useful calculations.
Estimation of correlation function and covariance matrix of signal.
Sample covariance for vector-valued variable, including the non-zero mean case, even for processing a streaming signal, where the full signal is not available at once.
Covariance estimation with optimal linear shrinkage [chenShrinkage2010] and almost optimal non-linear shrinkage [ledoitQuadratic2020].
References
[chenShrinkage2010] Y. Chen, A. Wiesel, Y. C. Eldar, and A. O. Hero, “Shrinkage Algorithms for MMSE Covariance Estimation,” IEEE Trans. Signal Process., vol. 58, no. 10, pp. 5016–5029, Oct. 2010, doi: 10.1109/TSP.2010.2053029. [link]
[ledoitQuadratic2020] O. Ledoit and M. Wolf, “Quadratic shrinkage for large covariance matrices,” Dec. 2020, doi: 10.5167/UZH-176887. [link]
Functions
|
|
|
Computes the cross-correlation matrix from two signals. |
The correlation is of shape (num_channels, num_channels, max_lag) corr[i,j,k] = E[x_i(n)x_j(n-k)], for k = 0,...,max_lag-1 That means corr[i,j,k] == corr[j,i,-k] |
|
|
Implements the OAS covariance estimator with linear shrinkage from Shrinkage Algorithms for MMSE Covariance Estimation |
|
Implements the quadratic-inverse shrinkage, the non-linear shrinkage from "Quadratic shrinkage for large covariance matrices" by Ledoit and Wolf. |
|
autocorr is of shape (num_channels, max_lag) |
|
An autocorrelation function should be of shape (num_channels, num_channels, max_lag) |
|
|
Takes a (num_channels, corr_len) autocorrelation function |
|
|
seq is a single channel sequence of shape (1, period_length), that should be a single period of a periodic signal |
|
data is a matrix of size (data_dim, num_samples) data2 is an optional matrix of size (data_dim2, num_samples) the cross-correlation is calulcated if this is supplied |
Classes
|
Autocorrelation is defined as r_m1m2(i) = E[s_m1(n) s_m2(n-i)] the returned shape is (num_channels, num_channels, max_lag) r[m1, m2, i] is positive entries, r_m1m2(i) r[m2, m1, i] is negative entries, r_m1m2(-i) |
|
Estimates the correlation matrix between two random vectors v(n) & w(n) by iteratively computing (1/N) sum_{n=0}^{N-1} v(n) w^T(n) The goal is to estimate R = E[v(n) w^T(n)] |