# Plotting the real or absolute of correlation?

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?

• The method you implement implements circular correlation, not linear correlation. Jan 1, 2022 at 14:21
• I am trying to find the time varying correlation of the two vectors. The index of the element represents the sample number. Jan 1, 2022 at 15:33