Hello, I want to detect the phase shift between two sinusoidal signals (have same frequencies) by investigating the cross correlation of them (xcorr in Matlab). But when the sinusoidal signals have low sampling frequencies (but satisfying the Nyquist criteria), the resolution of cross correlation result is very low, which is my problem. Is there any solution to this problem by using the same method (cross correlation process) and same sampling frequencies of sinusoidal signals? (Sorry for my English)
Resolution problem in cross correlation process
Started by ●September 11, 2008
Reply by ●September 11, 20082008-09-11
On 11 Sep, 13:44, "msahingil" <msahin...@mynet.com> wrote:> Hello, > > I want to detect the phase shift between two sinusoidal signals (have same > frequencies) by investigating the cross correlation of them (xcorr in > Matlab). But when the sinusoidal signals have low sampling frequencies (but > satisfying the Nyquist criteria), the resolution of cross correlation > result is very low, which is my problem.You use the time-domain cross correlation to estimate phase shifts? Note that in this case the shifts are discretized. At the limit of the Nyquist frequency the discrete steps are 180 degrees apart.> Is there any solution to this problem by using the same method (cross > correlation process) and same sampling frequencies of sinusoidal signals?Use the cross spectrum. If conditions otherwise permit, interpolate the spectra to find the coefficients at the frequency of interest. Rune
Reply by ●September 11, 20082008-09-11
>Hello, > >I want to detect the phase shift between two sinusoidal signals (havesame>frequencies) by investigating the cross correlation of them (xcorr in >Matlab). But when the sinusoidal signals have low sampling frequencies(but>satisfying the Nyquist criteria), the resolution of cross correlation >result is very low, which is my problem. > >Is there any solution to this problem by using the same method (cross >correlation process) and same sampling frequencies of sinusoidal signals?> >(Sorry for my English)If you don't mind longer signals, you can interpolate them "perfectly" by zero-padding their FFTs, since they are certainly band-limited. This would give you your desired resolution. Look for "band-limited interpolation". In fact, you can just do the following: Let x1, x2 be your two signals, N samples long each at sampling rate Fs. Find their FFts X1, X2. Define R = X1 .* conj(X2). Then zero-pad R: Rnew = fftshift([zeros(M/2,1); fftshift(R(:)); zeros(M/2,1)]). Lastly you find the peak magnitude of r = ifft(Rnew). Say it is at the n-th sample. Then the phase shift is given by n* N/(M+N) * F/Fs, where F is the frequency of the sinusoids. The larger M, the better resolution you get. There may also be a direct estimator for your desired parameter -phase shift- since interpolation does not bring in any information that isn't there already. I hope this wasn't your homework! :-) Emre
Reply by ●September 11, 20082008-09-11
>ifft(Rnew). Say it is at the n-th sample. Then the phase shift is given >by n* N/(M+N) * F/Fs, where F is the frequency of the sinusoids.Correction: (n-1) * N/(M+N) * F/Fs .
Reply by ●September 11, 20082008-09-11
On Sep 11, 11:16 am, "emre" <egu...@ece.neu.edu> wrote:> >Hello, > > >I want to detect the phase shift between two sinusoidal signals (have > same > >frequencies) by investigating the cross correlation of them (xcorr in > >Matlab). But when the sinusoidal signals have low sampling frequencies > (but > >satisfying the Nyquist criteria), the resolution of cross correlation > >result is very low, which is my problem. > > >Is there any solution to this problem by using the same method (cross > >correlation process) and same sampling frequencies of sinusoidal signals? > > >(Sorry for my English) > > If you don't mind longer signals, you can interpolate them "perfectly" by > zero-padding their FFTs, since they are certainly band-limited. This would > give you your desired resolution. Look for "band-limited interpolation". > > In fact, you can just do the following: Let x1, x2 be your two signals, N > samples long each at sampling rate Fs. Find their FFts X1, X2. Define R > = X1 .* conj(X2). Then zero-pad R: Rnew = fftshift([zeros(M/2,1); > fftshift(R(:)); zeros(M/2,1)]). Lastly you find the peak magnitude of r = > ifft(Rnew). Say it is at the n-th sample. Then the phase shift is given > by n* N/(M+N) * F/Fs, where F is the frequency of the sinusoids. The > larger M, the better resolution you get. > > There may also be a direct estimator for your desired parameter -phase > shift- since interpolation does not bring in any information that isn't > there already. >... On Sep 11, 11:33 am, "emre" <egu...@ece.neu.edu> wrote:> >ifft(Rnew). Say it is at the n-th sample. Then the phase shift is given > >by n* N/(M+N) * F/Fs, where F is the frequency of the sinusoids. > > Correction: (n-1) * N/(M+N) * F/Fs .heh, heh... having trouble believing the MathWorks line that the frequency of DC is 1? r b-j
Reply by ●September 11, 20082008-09-11
>heh, heh... having trouble believing the MathWorks line that the >frequency of DC is 1? > >r b-j:-) One more thing to keep in mind all the time! Wouldn't life be easier if you could use 0 as an index as well?.. Emre
Reply by ●September 15, 20082008-09-15