https://github.com/jjgoings/pade
do the Fourier transform using the method of Padé approximants
https://github.com/jjgoings/pade
fourier fourier-transform frequency pade pade-approximant signal time
Last synced: about 1 month ago
JSON representation
do the Fourier transform using the method of Padé approximants
- Host: GitHub
- URL: https://github.com/jjgoings/pade
- Owner: jjgoings
- Created: 2017-12-12T19:22:15.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-11-04T00:46:58.000Z (7 months ago)
- Last Synced: 2025-03-27T17:11:32.592Z (about 2 months ago)
- Topics: fourier, fourier-transform, frequency, pade, pade-approximant, signal, time
- Language: Python
- Size: 239 KB
- Stars: 21
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

Here is a small Python implementation of the Fourier transform via Pade approximants found in this paper
>Bruner, Adam, Daniel LaMaster, and Kenneth Lopata. "Accelerated broadband spectra using transition dipole decomposition and Padé approximants." Journal of chemical theory and computation 12.8 (2016): 3741-3750.
## Installation
```
pip install -r requirements.txt
pip install -e .
```## Example
Usage is very simple. Here is an example:
First, let's make a time series
```
import numpy as np
from pade import padew = 2.0
dt = 0.02
N = 5000
t = np.linspace(0,dt*N, N, endpoint=False)
signal = np.sin(2*t) + np.sin(4*t) + np.sin(8*t)
```Which looks like this

Then we do the Pade
```
fw, frequency = pade(t,signal)
```which, when we plot the imaginary component, looks like this

Which is what we expect, since our sinusoidal signal had frequencies at 2, 4 and 8. Note the agreement between FFT implementation from SciPy overlaid in the above figure.
You can look at the arguments in `pade.py` for more options, most relating to what frequencies you ultimately want to evaluate the transformed signal over. (The Pade-approximant method actually yields a rational function, so it's up to the user to choose the domain.)