Skip to content

Get_FFT

ychu0213@gmail.com edited this page Jan 31, 2021 · 4 revisions

from Get_FFT import Filon_COS

Filon_COS(C, t, a=0, outputfile='')

  • C: the auto-correlation function in a numpy array
  • t: the time frame corresponding to C in a numpy array
  • a: frequency interval for FFT, default is 0 so as to be determined as $2\pi/t_{max}$
  • outputfile: the filename of writing out the FFT results

Example

Filon_COS(C, t, a=0, outputfile='')

Description

This module performs Fourier Transformation by using the Filon's integral method (cosine) via: $$ \begin{align*} D(\omega) &=\frac{1}{\pi} \int_{-\infty}^{+\infty} C(t)\cos(\omega t)dt\ &=\frac{1}{\pi}2\int_{t_0=0}^{t_{2n}=\infty} C(t)\cos(\omega t)dt \ &=\frac{1}{\pi}2\delta t(\alpha[C_{2n}\sin(\omega t_{2n})-C_0\sin(\omega t_0)] +\beta F_{2n}+\gamma F_{2n-1}) \end{align*} $$ where $C(t)$ is the time correlation function and its length (as a numpy array or list) should be odd, $\delta t$ is the time interval for $C(t)$, and the details of other factors are available from Filon's Integration Formula. $$ \theta = \omega \delta t $$

$$ \alpha =\frac{1}{\theta}+\frac{\sin(2\theta)}{2\theta^2}-\frac{2\sin^2\theta}{\theta^3} $$

$$ \beta=2\left[ \frac{1+\cos^2\theta}{\theta^2}-\frac{\sin(2\theta)}{\theta^3}\right] $$

$$ \gamma = 4\left(\frac{\sin\theta}{\theta^3}-\frac{\cos\theta}{\theta^2} \right) $$

References

https://mathworld.wolfram.com/FilonsIntegrationFormula.html

http://www.ccl.net/cca/software/SOURCES/FORTRAN/allen-tildesley-book/f.37.shtml

Allen and Tildesley, Computer Simulation of Liquids, Appendix D [P506]