Questions tagged [fourier-transform]
For questions about Fourier transforms, how they are used, and implementation details.
111
questions
0
votes
1
answer
78
views
Derivative using torch.fft oscilates on the boundary
I was trying to use the torch.fft to compute derivatives. The issue is that even for a simple example ($f = \sin(x)$), I have weird oscillations on the boundaries.
...
0
votes
0
answers
87
views
First and second component of fft for circle approximation to periodic curve
I wanted to understand how the fast fourier transform work in numpy and for this I tried apply it on $n$ points of an ellipse $t_k = \frac{2\pi}{n-1}k$ with $k=1...n$ $$f_k = f(t_k) = (acos(t_k), bsin(...
0
votes
0
answers
83
views
Convolution in Fourier space with Python
I am trying to implement following step into the my cosmological particle mesh code.
From the PM code, I obtained the 3D array for density and used the following code in python, but I'm not sure, if ...
3
votes
2
answers
1k
views
compute accurate derivatives using FFT
I'm trying to learn how to compute accurate derivatives using the FFT. In the code at the end of this question I'm trying to compute derivatives of
$$
f(x) = \exp(-10(x-1)^2) ,\, \, x \in [0,2]
$$
...
1
vote
1
answer
75
views
Numerically computing envelope of Gibbs oscillation
If I numerically compute the envelope of $\sin(\pi t)$ using a Hilbert transform, I obtain exactly what I expect:
If I do the same for $\mathrm{sinc}(t)$, still I obtain an envelope which agrees with ...
0
votes
1
answer
91
views
How to plot the power spectrum
I have an array of data whose columns are solution vectors to a system of ODEs at a specific time. I want to plot the power spectrum of a solution at a specific time, but when I attempt this I get ...
3
votes
0
answers
158
views
Numerical integration in Fourier space over 3D grid
I am attempting to implement a model outlined in this paper:
General magnetostatic shape–shape interactions
Background
This model allows the calculation of magnetostatic interaction energies between ...
3
votes
0
answers
135
views
Fast Fourier Transform on Meshes
I have a (closed, manifold, oriented) triangular mesh for which I build a matrix $L\in\mathbb{R}^{n\times n}$ discretising the negated Laplace-Beltrami operator. The matrix $L$ is symmetric positive ...
2
votes
0
answers
74
views
Complex matrix logarithm discontinuity by solving inverse Fourier integral by alternative method to FFT
NOTE: This code is a piece of code I am using for a master's thesis, so I do not expect someone to do the work for me, but I gladly accept suggestions of any kind.
However, I am trying to get the ...
3
votes
0
answers
258
views
Helmholtz decomposition of a vector field in Fourier space with Python
I have a 3D vector field and I want to extract its divergence-free part (also called transverse component), using the Helmholtz decomposition.
In principle, this can be done in the Fourier space, as ...
1
vote
0
answers
42
views
Spectral Intensity of complex signal
I'm simulating an electromagnetic wave that has a real and imaginary part. Something like:
$$ E(x,t) = A(x,t) e^{-i(\omega t - k x)} $$
Where $A(x,t)$ is some complex amplitude. Then taking the ...
0
votes
0
answers
77
views
How to accelerate a convolution (laplace kernel) with FFT
I have the following computation I'm trying to program and accelerate with the FFT.
$$
\phi(x) = \sum_{y \in Y} K(x, y) q(x), \> \> \forall x \in X
$$
Where $X$ and $Y$ are sets of Cartesian ...
0
votes
0
answers
106
views
0
votes
0
answers
82
views
Deviation between Analytic DFT and FFT in Python
Within my work, I am trying to compare analytically retrieved power spectra with ones calculated from fft packages in python.
The problem I have, is that the analytic form of the peaks I derived does ...
1
vote
1
answer
232
views
How to get the inverse FFt in this Fortran code?
I find this fft algorithm on the link
The code looks simple and easy to implement. But it does not have inverse fast Fourier transformation. A brief search on the internet shows that to get the ...