信号的相关矩阵或协方差矩阵在系统识别中扮演着重要角色。事实上,对于一个LTI随机系统,其输出序列的二阶统计量完全可以确定该系统。
定义
互相关和协方差
对于均值为0的白噪声序列,二者形式是一致的。
Matlab计算
matlab中的相关命令:
% 协方差矩阵
data_cov = cov((data));
%信号自相关
autocorr(data, 1023)
% 互相关系数
R = corrcoef(data);
% 互功率谱密度(互功率谱密度与信号的互相关函数具有傅里叶变换关系)
pxy = cpsd(x,y,window,noverlap,nfft)
% Cross-correlation 互相关or自相关
[a,b]=xcorr(x,'unbiased');
[a,b]=xcorr(x,y,'unbiased');
scaleopt
— Normalization option
'none'
(default) | 'biased'
| 'unbiased'
| 'coeff'
returns the cross-correlation of two discrete-time sequences, x
and y
.
Cross-correlation measures the similarity between x
and shifted (lagged) copies of y
as a function of the lag.
If x
and y
have different lengths, the function appends zeros at the end of the shorter vector so it has the same length, N, as the other.
autocorr和xcorr有什么不一样的?
% 与xcorr类似的还有互协方差xcov
c = xcov(x,y)
c = xcov(x)
returns the cross-covariance of two discrete-time sequences, x
and y
.
Cross-covariance measures the similarity between x
and shifted (lagged) copies of y
as a function of the lag.
If x
and y
have different lengths, the function appends zeros at the end of the shorter vector so it has the same length as the other.
https://blog.csdn.net/jonathanlin2008/article/details/6566802