Questions tagged [fourier-analysis]

Questions on the computational aspects of Fourier analysis, including the various applications of the fast Fourier transform (FFT).

Filter by
Sorted by
Tagged with
2 votes
1 answer
99 views

Can this finite difference dispersion be eliminated somehow?

I am trying to solve the wave equation $$ {\partial ^2u(t,x) \over \partial x^2} = {\partial ^2u(t,x) \over \partial t^2} \tag1 $$ with the following boundary and initial conditions: $$ {\partial u \...
Nikola Ristic's user avatar
5 votes
1 answer
763 views

Taking derivative using FFT

I would like to calculate derivative of a given function ( a 1D array) using Array. Here is the code ...
learning_physics's user avatar
1 vote
1 answer
145 views

Fourier Transform with logarithmic spacing?

I have a very long time series $f(t)$ (hours) dataset taken at a very high sample rate (250 MHz) and would like to understand its frequency structure at many different frequency scales (from milli-Hz ...
KF Gauss's user avatar
  • 171
5 votes
1 answer
93 views

Prediction of sphere (i.e. roast) core temperature heated in an oven

The real-life problem Assume I put a spherical roast with initially constant temperature of start_temp=25 (°C) into an oven with ...
Dieter Menne's user avatar
0 votes
0 answers
70 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 ...
raeel's user avatar
  • 31
0 votes
0 answers
39 views

Efficiently compute the Fourier series coefficients of a piecewise trigonometric function

I am searching for the most efficient algorithm to compute the Fourier series coefficients of a number of given functions $f(\theta)$ $$a_k = \int_0^{2\pi} f(\theta)\cos(k\theta) \\ b_k = \int_0^{2\pi}...
Hosein Javanmardi's user avatar
3 votes
0 answers
105 views

How to take the Fourier transform of a Fibonacci chain in a Python script?

This may be an easy question to answer but I am really stuck. In several topics (especially that of quasicrystals) the Fibonacci chain's Fourier transform and diffraction pattern is mentioned. Despite ...
uhoh's user avatar
  • 1,026
1 vote
0 answers
138 views

Deconvolution of sinc function in spectrum calculation in FTS

In Fourier transform spectroscopy (FTS) I am calculating a broadband interferogram (e.m. frequency 190-300 GHz top-hat), then back-retrieving the spectrum by FT. Here in the figure, you can see the ...
Raizen's user avatar
  • 61
0 votes
0 answers
41 views

Describing a vector field

I am currently making use of a 2D vector field that I would like to be able to describe and characterize. I thought of a few metrics that I could use, but they seem limited for both a qualitative and ...
AlixL's user avatar
  • 101
1 vote
0 answers
56 views

How do people deal with resized grid steps while numerically integrating using discrete Fourier Transform?

I am trying to simulate light propagation on python using FFT following the Fresnel diffraction equation given on Wikipedia: The problem with this is that the output matrix from the DFT would be ...
Romutulus's user avatar
0 votes
0 answers
74 views

Fourier integral over elements

Suppose I have a triangular element with vertices ${\vec{r_1},...,\vec{r_3}}$ and a function $f(\vec{r})$. I want to calculate the fourier integral over this triangle such that: $$F(k_x,k_y)=\int \int ...
strahd's user avatar
  • 11
2 votes
1 answer
300 views

Why do problems arise in FFT for smaller value of df in Python?

...
Subhadip Saha's user avatar
-1 votes
1 answer
290 views

How to obtain the exact value of wavelength from a 2D FFT amplitude vs wavenumber plot like it is obtainable from 1D FFT amplitude vs wavenumber plot?

I have a two dimensional multi modal spatial signal generated from a MATLAB code using sinusoidal functions of different wave numbers, amplitudes and phases. What I want to know is that if I have the ...
Shataneek Banerjee's user avatar
3 votes
2 answers
2k views

Solving numerically the 1D Kuramoto-Sivashinsky Equation using spectral methods

Lately, I've been trying to solve numerically the 1D Kuramoto-Sivashinsky Equation using spectral methods. Let $\nu$ be the viscosity and $[0,L]$ the domain. The 1D equation is, $$ u_t + uu_x + u_{xx} ...
Mathieu Rousseau's user avatar
1 vote
1 answer
6k views

Understanding why scipy.fft.fft (fast Fourier transform) doesn't work as expected

I write the following fast Fourier transform code into my Python notebook expecting to see a plot wherein there's a spike at $1/2\pi$ since that's the frequency of the sin function, but instead I get ...
user avatar
3 votes
1 answer
106 views

Cauchy Lorentzian simulation on FFT with oscillation

Recently I do simulation on Lorentzian Function with FFT Lorentzian Function is 2a/(x**2+a**2) ...
Huang alex's user avatar
0 votes
0 answers
68 views

Adaptive quadrature methods for Fourier Optics

In Fourier Optics one often needs to compute approximations to bivariate integrals like $$ \int_{-\frac{l}{2}}^{\frac{l}{2}}\int_{-\frac{l}{2}}^{\frac{l}{2}} {\rm e}^{i\phi(\xi,\eta)}\mathrm{exp}\left[...
Arrigo's user avatar
  • 301
2 votes
1 answer
448 views

Galerkin method for heat equation

I'm working out the Galerkin method for the heat equation $$\frac{\partial u}{\partial t} - \frac{\partial^2 u}{\partial x^2} = 0$$ subject to $u(0,t)=0,u_x(1,t)=v(t)$. I want to use a Fourier basis ...
user1237300's user avatar
1 vote
0 answers
194 views

Poisson equation with FFT and normalization

I'm trying to understand how to solve Poisson equation with FFT. Say, if we have the simplest periodic example $$u_{xx}=-4\pi\cos(x)$$ The solution then should be $$u=4\pi\cos(x)$$ I really get ...
Tangur's user avatar
  • 11
3 votes
0 answers
44 views

Is the given equation for Fractional Fourier Transform wrong?

In order to compute $$ \hat{f}_k = \sum_{m = 0}^{M - 1} e^{-2\pi i k m \theta} f_m, \ \ k = 0, ..., M - 1$$ for any $\theta$, my book states that this can be done using fractional Fourier transform ...
eAOoe's user avatar
  • 31
1 vote
0 answers
78 views

How to use RODFT00 and REDFT00

I have some difficulty in implementing RODFT00 and REDFT00. I want to use them for fluid simulations. I would really appreciate ...
user162281's user avatar
1 vote
0 answers
109 views

How do I calculate the amplitude after a 2D r2c transform using FFTW?

...
mmrbest's user avatar
  • 11
2 votes
0 answers
35 views

Fast approximate evaluation of Fourier-Legendre series

Suppose I know that a function from $[0,\pi] \to \mathbb{R}$ may be written as $$ \sum_{k=0}^\infty A_l \frac{2l+1}{4\pi} P_l(r) $$ where $A_l$ all are known. Is there a way in which I may very ...
eja's user avatar
  • 21
1 vote
0 answers
223 views

How to use discrete cosine and discrete sine transforms in fftw

I work on fluid-related simulations. I have used FFT for fluid simulation. I want to use discrete cosine transform (DCT) and discrete sine transform (DST) to transform my velocity field to wavenumbers....
user162281's user avatar
2 votes
0 answers
22 views

Normalising DFTs Correctly

I have been playing around with convolutions in scipy's signal package: ...
Max Hart's user avatar
1 vote
1 answer
97 views

Obtain velocity from imposed energy spectrum using the inverse FFT

I am trying to obtain the spatial representation of $u(x)$ (e.g. velocity) from its energy spectrum $E(k)=k^4\exp(-(k/k_0)^2)$, which is given in the frequency domain, provided $|u(k)|=\sqrt{2E(k)}$. ...
Adr's user avatar
  • 173
3 votes
1 answer
242 views

Calculating the Convolution Using DFT (FFT)

I have the following convolution as part of a numerical simulation. $$T(r)=\int \mathrm{d}^3r_2\, p(r_2)f(r_2)\alpha(r-r_2)\, .$$ My problem is that the analytical expressions for $f$ and $p$ do ...
lattitude's user avatar
  • 131
1 vote
0 answers
91 views

Pseudospectral method for Rayleigh-Benard with constant temperature gradient

$$ \nabla\cdot \mathbf{u} = 0 \\ \frac{\partial \mathbf{u}}{\partial t}+\left(\mathbf{u}\cdot \nabla\right)\mathbf{u} = -\nabla p+\nu\nabla^2\mathbf{u}+\alpha g\theta\mathbf{e}_z\\ \frac{\partial\...
user162281's user avatar
1 vote
2 answers
883 views

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 ...
python_enthusiast's user avatar
1 vote
1 answer
131 views

Demagnetizing field using scalar potential method

I want to calculate the stray magnetic field from a ferromagnet using the scalar potential method (1). The problem consists of a ferromagnetic cuboid divided into small cuboidal cells in which the ...
Shishir's user avatar
  • 11
0 votes
1 answer
221 views

Specifying mesh spacing for DFT in numpy

I was testing the .fft package of numpy 1.16.1 in Python 3.7.2. In particular I was trying to verify that the transform resembles the analytical one for: $$f(x) = \mathrm{exp}\left[-\left(\frac{x-5}{2}...
user avatar
1 vote
1 answer
1k views

FFT solver for the Poisson problem with Dirichlet boundary conditions

I am trying to solve the Poisson problem with Dirichlet boundary condition in 1D: \begin{equation} \begin{array}{rcl} - \mu \Delta u & = & f~in~[0,1], \\ u(0) & = & 0, \\ u(1) & = ...
PeteAgor's user avatar
2 votes
1 answer
619 views

Incorporating a potential barrier in a wave-packet simulation (Fourier Transform method)

I'm trying to simulate the scattering of a wave-packet at a potential barrier in Python. I'm using a Fourier Transform method (not sure if its the same as the Split-Step method), where I apply Fourier ...
FeelsToWaltz's user avatar
3 votes
2 answers
832 views

Generate high n quantum harmonic oscillator states numerically

How can I generate the higher $n$ quantum harmonic oscillator wavefunction (in position space) numerically? Here, higher means around $n=500$, or say $n=2000$, where $n$ is the $n$th oscillator ...
ph-jd's user avatar
  • 31
0 votes
3 answers
79 views

Rudin lecture -- if f(x) is not integrable on some interval, does it not have a Fourier Series expansion on that interval?

I found an old lecture on YouTube given by Walter Rudin (1990, in Wisconsin), and towards the beginning he mentions that if $f(x)$ were not integrable, on some interval, it would be obvious that it ...
user29552's user avatar
1 vote
0 answers
447 views

What does the Jackson Kernel measure?

A certain filter I'm writing uses two different kernels. The Fejer kernel (which is common) and the Jackson kernel: $$ \Delta_T(x) = T \,\left( \frac{\sin \pi T x}{\pi T x}\right)^2 \quad\text{and}...
john mangual's user avatar
2 votes
1 answer
117 views

FFTW on subarray with MPI

With the guru interfaces of FFTW, I can apply transforms only to parts of a multidimensional array by modifying the fftw_iodim ...
Hannes's user avatar
  • 71
1 vote
0 answers
38 views

How to numerically transform a 2D Fourier spectrum with arbitrary frequency shift to center frequency?

Suppose $F(u,v)$ is the center frequency Fourier representation of some $f(x,y)$ in 2D. $$ f(x,y)=\int\limits_{-\infty}^{\infty}\int\limits_{-\infty}^{\infty}F(u,v)e^{2\pi i (xu+yv)}dudv $$ In ...
lorniper's user avatar
  • 593
5 votes
0 answers
147 views

Discrete sine and cosine transform for mixed derivatives

Using sine and cosine transforms to solve Poisson's equation with Dirichlet boundary conditions seem quite standard nowadays (see, e.g., here or Table 2 in this paper). In the case of Poisson's ...
Hannes's user avatar
  • 71
6 votes
3 answers
4k views

Error propagation through an FFT

If I take the Fourier transform of data $x \pm \sigma$, is there a standard approach to what the error in the outputs will be? Would the best way be a direct evaluation of the upper and lower bounds?
Goods's user avatar
  • 171
1 vote
0 answers
295 views

Fourier transform spherical system

I need to take the Fourier transform of a 3D function $h(r)=h(|r|)$ so that I can invert a convolution problem. What is the best way to do this with Python? I know the the FT is equivalent to a sine ...
Goods's user avatar
  • 171
1 vote
0 answers
122 views

Code for solving the heat equation on the semi-infinite rod

Cross posted in mathematica.SE. Question : I want to test the solution which is given below is right by Matlab/Maple/Mathematica. Please look the post in mathstackexhange or Please look below. ...
HD239's user avatar
  • 121
6 votes
1 answer
232 views

Fourier characteristics of repeated numerical derivative

Background I am trying to analyse fourier characteristics of a derivative. For example if I have a first order derivative approximated as following: $$\frac{\partial \Psi(x)}{\partial x} = \frac{\...
Amartya's user avatar
  • 243
2 votes
0 answers
152 views

Precision not improving by decreasing step-size in nonlinear Schrödinger

I tried to simulate soliton propagation by solving the nonlinear Schrödinger equation using the split-step Fourier method. The following is an example of the Matlab code copied from a textbook. ...
Physicist's user avatar
  • 227
2 votes
2 answers
281 views

von Neumann stability analysis for spatial variable flux

Can we use the von Neumann stability analysis to investigate the stability of the discrete form of the following problem? $$u_t+\frac{\partial(x^2u)}{\partial x}=S(u,x)\ .$$ Please give some hint ...
Sandy's user avatar
  • 33
1 vote
1 answer
116 views

fft with non uneven spacing between the value of the signal

I am trying to implement in C or C++ a solution for a fft and Ifft when the signal values are not obtained at a constant rate, making it having a desviation between the values and the periodic ones. I ...
Miguel Sanz Narrillos's user avatar
2 votes
1 answer
1k views

1-D turbulent energy spectra in homogeneous direction (non-isotropic)

I am trying to compute the one-dimensional energy spectra for my channel-flow simulation. I have already written a post-processing script to achieve this; however, I need to validate my code before ...
Inquisitor101's user avatar
1 vote
0 answers
76 views

Perfect filtering of high frequencies in 2D FFT (Multidimensional 2/3 Rule)

Let $u_n$ be an array containing discrete values of the function $u(x,y)$. Performing a 2D FFT to this array we obtain $\hat{u_n}$ representing the values of $\hat{u}(k_x,k_y)$. I would like to ...
Bremsstrahlung's user avatar
4 votes
1 answer
1k views

Von Neumann stability analysis with a constant term

I have a question concerning the von Neumann stability analysis of finite difference approximations of PDEs. There seem to be a wealth of online source explaining the application of this stability ...
J.Galt's user avatar
  • 143
3 votes
0 answers
69 views

How to do numerical computation of $L^p$ norm of a $p$ dimensional trigonometric polynomial

Id like to know methods for numerical computation of $L^2$ norm of a two dimensional trigonometric polynomial. I have the coefficients. If I want to compute the L^1 norm, I can do so by sampling in ...
Rajesh D's user avatar
  • 141