how does the xcorr fun works and what is the difference between corr and xcorr?
Ältere Kommentare anzeigen
i didnt understand the difference by searching on the matlab document, what is the default lag of xcorr function?
Akzeptierte Antwort
Weitere Antworten (2)
What xcorr is computing is described here,
whereas what corr is computing is described here,
William Rose
am 24 Mai 2022
0 Stimmen
@tony jubran, by default, xcorr() computes the cross correlation at all possible overlap values for two signals. If x and y are vectors of length M and N respectively, then xcorr() returns a vector of length N+M-1. Special case: If x and y have equal length, N, then the vector returned by xcorr() has length 2N-1, and element N (the middle element) of the vector corresponds to full overlap, i.e. zero lag.
x=ones(1,4);
y=xcorr(x,x); disp(y)
1 2 3 4 3 2 1
This is with the default normalization. Hope that helps.
Kategorien
Mehr zu Correlation and Convolution finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!