Cross-correlation of two complex signals using sliding dot product
16 views (last 30 days)
Show older comments
Is there anyone has done cross-correlation between two complex signals (uneqal lengths) using sliding dot product without zero padding?
I am stuck on my code and I don't get correct resuts. So, if someone has done that, could you please share your code?
I don't want to use the built-in xcorr function since it does zero padding.
0 Comments
Accepted Answer
Matt J
on 26 Jan 2023
Edited: Matt J
on 26 Jan 2023
If there is to be no zero-padding, what should happen when the shorter signal slides to the edge of the longer signal? Does the sliding simply stop at that point?. If so, just use convolution with the 'valid' flag,
x=rand(1,10); y=rand(1,3);
result = conv(x,flip(y),'valid')
Checking the result against explicit dot products:
dot(y,x(1:3)) %the first dot product
dot(y, x(8:10)) %the last dot product
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!