Why do "corr(x,y)" and "xcorr(x,y)" give different answers when x and y are simulated discrete samples of radar signals of form a*e^ib, with partially correlated randomized b values?
56 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Paul Smith
am 7 Dez. 2018
Kommentiert: Paul Smith
am 12 Dez. 2018
To calculate the correlation between discrete samples from two simulated radar signals (column vectors of equal length), there appear to be two approaches in Matlab. One is the function "corr(x,y)" in the statistics toolbox and the other is "xcorr(x,y)" in the signal processing toolbox. For a given set of signal samples x,y these two functions give different results and the reason for the difference is not apparent.
0 Kommentare
Akzeptierte Antwort
Honglei Chen
am 11 Dez. 2018
It would be helpful if you could provide a script showcasing the difference and explain why you think the two should be the same.
From the documentation, corr and xcorr are quite different. corr computes the correlation coefficients between the two sequences, while xcorr computes the correlation of one sequence with another sequence at different delays. So to me it's expected that the two results are different.
HTH
3 Kommentare
Honglei Chen
am 12 Dez. 2018
Thanks for the clarification. The difference is that corr removes the mean of the signal while xcorr does not. If you compare
corr(x,y)
and
xcorr(x-mean(x),y-mean(y),0,'coeff')
the two should be the same.
HTH
Weitere Antworten (0)
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!