Questions tagged [fourier-transform]

For questions about Fourier transforms, how they are used, and implementation details.

Filter by
Sorted by
Tagged with
7 votes
2 answers

Least Squares and Fourier Series

I have a little bit of problem figuring out the relation between Fourier series and Least Squares. As far as I understand, LS is a way of minimizing the quadratic error between a measured value $y_i$ ...
  • 1,019
6 votes
2 answers

Fourier Transform of function in Spherical Harmonics

I have a function $f(r,\theta,\phi)$ which I am expressing in terms of spherical harmonics $$ f(r,\theta,\phi) = \sum_{l=0}^{\infty} \sum_{m=-l}^{l} g_{l,m}(r) d_{l,m}(\theta,\phi) $$ where $d_{l,m}$...
  • 2,109
6 votes
2 answers

C++ libraries for Fast Fourier Transform in high precision

I am looking for a C++ library for Fast Fourier Transform (FFT) in high precision (e.g., using high precision real data types similar to mpfr_t in MPFR or ...
4 votes
2 answers

How to calculate efficiently and accurately the Fourier transform of a radial function in Fortran

As my question states, I want to calculate the Fourier transform $F(q)$ of a radial function $f(r)$ (defined on $[0,\infty)$ and which decays like an exponential $\exp(-Ar+b)$ at large $r$) as ...
  • 175
3 votes
0 answers

How to obtain values in physical space for a given spectrum?

My question falls under purview of turbulent flows. I want to add an initial perturbation, for which I have a given energy spectrum (say$ E(k)=ak^4e^{-bk^2} $). The steps involved in getting these ...
  • 83
1 vote
0 answers

Calculate integrals using numpy.fft

Good evening, I would like to understand why I do not get the correct result: I assume that I know my function on discrete data points and expand it as a discrete Fourier transform: $\text{sin}(x)=\...
3 votes
1 answer

My calculated laser pulse duration is too large. Where am I wrong?

I am currently writing a small Python script to estimate the pulse duration from the optical spectrum. At the end, the idea is to observe the effects of the spectral phase on the pulse duration and ...
  • 31
3 votes
1 answer

precision loss in non-trigonometric, periodic functions using FFTW and NaNs after marching forward in time (Fortran)

I have developed a pseudospectral solver of the Navier-Stokes equations using FFTW. I tested my formulation of right hand sides (RHS) of the NS equations against standard trigonometric functions (...
1 vote
2 answers

Numpy FFT gives me a pulse shorter than it should be. Not sure what I am doing wrong

I've created a code (Python, numpy) that defines an ultrashort laser pulse in the frequency domain (pulse duration should be 4 fs), but when I perform the Fourier Transform using DFT, my pulse in the ...