xcorr zero lag
显示 更早的评论
Dear all, How can I use xcorr for 0 lags? In the test I'm running I don't want to 'slide' one sequence over another but keep them fixed. Thanks in advance. Happy new year! Diego
3 个评论
Diego
2012-1-1
Diego
2012-1-1
the cyclist
2012-1-1
I don't have the Signal Processing Toolbox, so I can't check myself, but the syntax in your first comment looks right to me. Can you give a more complete example of the code you have written, the result, and why specifically you believe it to be wrong (or not what you expect)?
回答(1 个)
Wayne King
2012-1-1
Hi Diego, Why doesn't this work?
[c,lags] = xcorr(randn(1000,1),rand(1000,1),0,'coeff');
This gives you exactly what you have described; the cross correlation between two input vectors at zero lag.
c is the value of the normalized cross correlation sequence at zero lag.
4 个评论
Diego
2012-1-1
Wayne King
2012-1-1
you're not telling me what d means in the above. are P and Q different lengths? If they are, you can't use the 'coeff' option.
Diego
2012-1-1
Diego
2012-1-3
类别
在 帮助中心 和 File Exchange 中查找有关 Correlation and Convolution 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!