I'm trying to find the phase shift between two 100x100 matrices, s and p. To start with I'm using two sine waves (2D) slightly shifted. I manage to compute the correct amplitude spectrum (using the Fourier Transform of the cross correlation between s and p) but the phase value at the peaks is not the one that I have set. I'm not using cpsd because I did not manage to understand the correct way to use it for 2D matrices. The manual is very confusing and I couldn't get any help online.

When I do the same procedure for 1D sine waves, using cpsd or fft of xcorr employing the welch method, I get both the amplitude and phase right. I suppose that conceptually I'm doing the right thing, but there's sth about how to get the phase shift between two matrices that is bugging me.

I really would appreciate any tips on how to compute the phase shift between matrices. Some real piece of code would be lovely.

thank you in advance for your time


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.