I had two vectors of data and I computed their correlation using corr(f,g) = ifft( fft(f) .* conj(fft(g)) ) / cov(f,g)
. I cannot figure out whether to use the real or absolute of the result.
The two vectors are observation data, not signals. From their individual plots, I can see that they are negatively correlated but I want to visualise how the correlation property works (correlation in the time domain to the product in frequency domain).
The value of cov(f,g)
is negative. When I take the absolute the entire correlation vector is negative since the numerator is always positive, and if I take real then half of the points in the correlation vector are negative and the other half positive.
Which one should I take, and is the formula I'm using to calculate it correct?