|October 8, 2003, 04:59||
Phase delay computation
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
|October 8, 2003, 06:11||
Re: Phase delay computation
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 :
THEN FOR EACH BLOCK i:
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
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 :
7) update values for coherence and phase spectra :
END OF THE BLOCK LOOP
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) http://www.numerical-recipes.com/nronline_switcher.html
S.L. Marple, Digital spectral analysis, Prentice-Hall, 1987
Hope this help
|Thread||Thread Starter||Forum||Replies||Last Post|
|alphaEqn.H in twoPhaseEulerFoam||cheng1988sjtu||OpenFOAM Bugs||15||May 1, 2016 16:12|
|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|