Correlation between two random signals
Mostra commenti meno recenti
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?
Risposta accettata
Più risposte (1)
Jan
il 1 Ott 2015
1 voto
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 Commenti
rihab
il 1 Ott 2015
Jan
il 1 Ott 2015
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.
Categorie
Scopri di più su Correlation and Convolution in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!