Topic: Application of normalized cross-spectrum on 1-D sine signals

Dear all
I am working on phase correlation to coregister signals (as well as to meassure relative shift) as suggested in IEEE paper by Leprince et al., 2007. I am trying to apply equations 19,20,21 and 22 on I-D sin functions having same frequency and amplitude but differ with relative phase of 108 degrees. My Matlab code is given in the mail below. The senario that I am trying to simulate is that i am sampling the two signals at 1000 samples/sec. And the difference in the phase is 108 degs that corresponds to a shift of 4 samples (i.e. The signal two (Y2) is 4 steps a head than signal 1 (Y1)). Now in this condition the peak correlation according to inverse of fourier transform of normalized cross-spectrum should be at index 4. But my code in matlab is not working as I understood the theory of Eq 22 in the paper.   

Fs=1000; %samples per sec
N=[1:1000]; %Total number of samples
Y1=sin(2*pi*100*(1/Fs)*N); %Signal of 100 Hz starts at 0 phase
Y2=sin(((pi/180)*108)+2*pi*100*(1/Fs)*N); %Signal of 100 Hz starts at 108 phase
F1=fft(Y1,1024); % Fourier transform of Y1
C2=conj(fft(Y2,1024)); % Conjugate of Fourier transform of Y2
R=NU./DE; %Normalized cross spectrum
RESULT=ifft(R,1024); %Inverse FFT of normalized cross spectrum dirc delta function
[V IND]=max(RESULT) % location of peak correlation

Kind regards


Re: Application of normalized cross-spectrum on 1-D sine signals

Well, I think now I have corrected the code for finding relative shift between the signals. So, now for the time being I think, I have solved my earlier posted issue. The code is as follows:

Y0=sin(2*pi*1*t); % reference signal with 0deg phase
Y45=sin(2*pi*1*t+(pi/4)); % signal with phase of 45 deg. 2 samples ahead with Y0
Y90=sin(2*pi*1*t+(pi/2)); % signal with phase of 90 deg. 4 samples a head with Y0
PEAK(:,1)=ifft(CS(:,1)); % look for corelation peak. It is on sample 3
PEAK(:,2)=ifft(CS(:,2));% look for corelation peak. It is on sample 5


Re: Application of normalized cross-spectrum on 1-D sine signals

Dear Jazzmy,

I would not recommend using the simple FFT normalized cross-correlation method for pure sine waves. In your first example, when you normalize your cross-spectrum, you end up having to divide by zero (or very small values) for all frequencies but the one encoding your sine wave, hence the inverse FFT makes no sense. In general, this method is known to be very inaccurate anyway, and it's only used in the paper to provide rough estimates to initialize a more robust algorithm that does not involve any inverse FFT. If you're working with pure sine waves, I would strongly recommend you to work only in the Fourier domain by estimating the phase shift for those frequencies with enough power (hence we use a threshold in our paper). I would recommend you to use the method described by equation 37 (actually the one just before with no number.

Also not that signal windowing is necessary to insure accurate spectrum estimation.