CFD Online Logo CFD Online URL
Home > Forums > Main CFD Forum

Phase delay computation

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   October 8, 2003, 04:59
Default Phase delay computation
Posts: n/a
Hi I have question ?. I have a curve say input f(t) which is function of time t and this is harmonic.From this input agter processing i get output say g(t) which is periodic and funation of time. When I plot above function in time space.I find same pahse difference between and also there is difference in magnitude. I want to how to compute this phase difference.I know it has something to do with FFT. So anybody who has already done it before and knows of some reference pls reply. Thanks in advance. prasat
  Reply With Quote

Old   October 8, 2003, 06:11
Default Re: Phase delay computation
Lionel Larcheveque
Posts: n/a

To obtain the phase difference between two time series, you can compute their cross-spectrum, or more likely its normalized forms, the coherence and phase spectra. To estimate them, proceed as follow (Welch's method):

1) for each time series f and g with m samples, separates them into n blocks of length m_b, with m_b a power of two, such as consecutive blocks overlaps for about 50 % => n~=int(2*m/m_b-1). You must choose m_b to obtain at least 20 blocks (more is desirable if f and g are really noisy).

2) set value for (squared) coherence Co and phase Ph mean spectra to zero :




3) Compute the mean fm_i and gm_i of f_i and g_i over the block i, and perform subtractions of the means for all the samples j=1,...,m_b



4) use a windows w(j) to reduce leakage. For instance the Welch one : w(j)=1-( (j-m_b/2) / (m_b/2) )^2

and then



5) Compute FFTs F_i and G_i of f_i and g_i using your favorite computing library, with F_i and G_i being complex numbers

6) compute A_F and A_G autospectra and C crossspectrum :

A_F_i(j)=F_i(j)*conjugate[F_i(j)] (Real)

A_G_i(j)=G_i(j)*conjugate[G_i(j)] (Real)

C_i(j)=F_i(j)*conjugate[G_i(j)] (Complex)

7) update values for coherence and phase spectra :

Co(j)=Co(j)+[C_i(j)*C_i(j)]/[A_F_i(j)*A_G_i(j)] (Real)

Ph(j)=Ph(j)+atan{Im[C_i(j)]/Re[C_i(j)]} (Real)


8) compute mean values of coherence and phase spectra over the n blocks



The coherence spectra gives you the spectral normalized correlation (from 0 to 1) between f and g for each frequency.

If coherence largely differs from 0 for a given frequency, then look at the phase spectrum : it corresponds to the phase shift between f and g for this frequency.

Note that you have to read the FFT library documentation in order to determine the relation between the index j and the corresponding frequency .

If further informations are needed, look for instance at :

Numerical recipes, chapter 13 for Welch's periodogram method (autospectra only)


S.L. Marple, Digital spectral analysis, Prentice-Hall, 1987

Hope this help
  Reply With Quote

Old   October 8, 2003, 08:20
Default Re: Phase delay computation
Posts: n/a
Thanks alot I will try to do understand that. Pratap
  Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
alphaEqn.H in twoPhaseEulerFoam cheng1988sjtu OpenFOAM Bugs 14 September 18, 2011 13:46
VOF for single phase? vuccj7 FLUENT 0 April 20, 2011 19:59
two Phase column simulation chemeng OpenFOAM 3 August 18, 2010 12:53
Source Term used in Eulerian Model(Two phase) Padian FLUENT 1 May 19, 2008 03:47
compressible two phase flow in CFX4.4 youngan CFX 0 July 1, 2003 23:32

All times are GMT -4. The time now is 15:42.