From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Sinusoidal phase difference issue.
Date: Mon, 20 Jun 2011 18:58:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 11
Message-ID: <ito57s$579$>
References: <itnrb0$2ku$> <itntrm$a1j$> <ito1pa$mpo$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1308596284 5353 (20 Jun 2011 18:58:04 GMT)
NNTP-Posting-Date: Mon, 20 Jun 2011 18:58:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:732846

"zoul " <> wrote in message <ito1pa$mpo$>...
> I fail to understand (mostly due to ignorance) how you have made the estimate over an infinite number of cycles, although the time lag of -0.15 is correct when f equals 2(using the given code). Could you please explain in more detail the issue pointed out when f increases.Also do you reckon using correlation is the best way to estimate time lag(phase difference) if large number of cycles are used??
> cheers
- - - - - - - - -
  You are dealing with a periodic function in the sine function and therefore such matters as time lag are inherently indeterminate when they involve time periods of greater than half that period.  As you increase the frequency of the sine wave you decrease the value at which that time lag computation becomes indeterminate.  Check out:;Shannon_sampling_theorem

  My remark about the total number of cycles involved is based on the idea that if only a few cycles are included in the correlation computation, then other periodicities are present in your signal and can skew your results.  You need many cycles to minimize the effect of such aperiodicities (if that is a valid word.)

Roger Stafford