Correlation between two random signals
显示 更早的评论
I have two signals in MATLAB, say
a = randn(1,1e6) + randn(1,1e6)*exp(-1i * 2*pi * 1.1);
b = randn(1,1e6) + randn(1,1e6)*exp(-1i * 2*pi * 1.4);
I am finding the correlation between them as follows:
R=corrcoef(a,b);
r = R(2,1);
Now each time I run my code, the correlation coefficient is different. I even tried to increase the number of samples (from 1e6 to higher values) but that didn't work. Is there some other way to find the correlation coefficient between such signals?
采纳的回答
更多回答(1 个)
Jan
2015-10-1
1 个投票
It is expected that the correlation between two random signals has a (low) random value. So what do you mean by "that didn't work"? I do not see a reason to look for another way, because corrcoeff works fine. Only your expectations do not agree with the mathematical definition.
2 个评论
rihab
2015-10-1
Jan
2015-10-1
Please read the documentation and source code of corrcoeff.m to find out, what's going on. Because you create random inputs for this function each time, the output must be different also. Only the magnitude of the output should be "small", because the inputs are random. You cannot expect the correlation to have a fixed value as e.g. 0.0 even for uncorrelated signals.
类别
在 帮助中心 和 File Exchange 中查找有关 Correlation and Convolution 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!