XCORR of two harmonic signals has a triangular shape. Why?
18 views (last 30 days)
Hello! I have two signals (H and Z), which are almost harmonic. Both vectors contain 4018 elements each (I attach the picture). I want to calculate cross correlation between them, and what I get is shown on the second picture. My code is simple:
What can be the reason of such triangular shape? I tried to calculate xcorr of sin and cos, and even added trend to one of them, but it's not triangular, it must be also harmonic... Why can this happen?
Christoph F. on 30 Nov 2017
Edited: Christoph F. on 30 Nov 2017
> What can be the reason of such triangular shape?
The reason is that both signals have a significant DC component/offset. Try removing it. For example
or a more sophisticated method like highpass filtering or forward-backward highpass filtering with filtfilt.