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
1
vote
0answers
9 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 ...
2
votes
0answers
25 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 ...
1
vote
0answers
32 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....
2
votes
0answers
18 views

Normalising DFTs Correctly

I have been playing around with convolutions in scipy's signal package: ...
1
vote
1answer
45 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)}$. ...
3
votes
1answer
81 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 ...
1
vote
0answers
34 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\...
1
vote
1answer
138 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 ...
1
vote
1answer
50 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 ...
0
votes
1answer
34 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}...
1
vote
1answer
119 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) & = ...
2
votes
1answer
109 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 ...
3
votes
2answers
207 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 ...
0
votes
3answers
75 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 ...
1
vote
0answers
109 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}...
1
vote
0answers
49 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 ...
1
vote
0answers
35 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 ...
5
votes
0answers
70 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 ...
4
votes
2answers
299 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?
1
vote
0answers
114 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 ...
1
vote
0answers
90 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. ...
6
votes
1answer
171 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{\...
2
votes
0answers
91 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. ...
2
votes
2answers
195 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 ...
1
vote
1answer
67 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 ...
1
vote
1answer
294 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 ...
1
vote
0answers
47 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 ...
4
votes
1answer
658 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 ...
3
votes
0answers
61 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 ...
2
votes
2answers
605 views

MATLAB FFT Differentiation

I am trying to implement the Laplacian operator using Fourier Transform differentiation (https://en.wikibooks.org/wiki/Parallel_Spectral_Numerical_Methods/...
1
vote
0answers
53 views

Can convolution be generalized to 2D from several 1D convolutions?

I have a function $\mu(x)$ that I need to convolve with several functions $\nu_n(x)$. I'm currently taking the DFT of $\mu$ and multiplying it individually with the N DFTs of the functions $\nu_n$ and ...
3
votes
1answer
454 views

Split operator method

I am new to the field of computational physics and have a couple of questions regarding solving the non-linear Schrödinger equation using Operator splitting. 1) If the hamiltonian is of the form $H=\...
1
vote
1answer
63 views

nodal lines of wave-function $\psi(x,y) = \sin 12x \sin y + (1 + \epsilon) \sin x \sin 12y$

I am trying to reproduce this figure of nodal lines of a wavefunction from this work of Berry $$\psi = \sin 2r\,x \sin y + (1 + \epsilon) \sin x \sin 2r\,y$$ Here the image. The first is $\epsilon = ...
3
votes
2answers
1k views

Fourier transform by FFT : by using cubic splines to interpolate between data points, do we change the frequency content of the Fourier transform?

I have a data file with some points equally spaced. These represent some function. I have to calculate the Fourier transform of this set of points. The thing is, I'm tempted to take a cubic spline of ...
0
votes
1answer
77 views

0 Hz (quite sharp) peak in FFT and division by 0

In a previous question, link, I asked about how I could most effectively do a Fourier Transform of a radial function given at certain values and which we knew the asymptotical behaviour of. The ...
3
votes
2answers
312 views

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 ...
1
vote
0answers
71 views

Spherical Harmonics: band-limited representations of a vector field on a sphere

I have used pyShtools in the past to expand scalar functions to spherical harmonics and to synthesize band-limited representations of them. However, I am not too sure how to achieve this for a vector ...
1
vote
1answer
271 views

Convolution of two real functions using discrete Fourier transform (FFT): zero-padding and normalization

I want to obtain the convolution of two discretized real functions $f$ and $g$, $$ c(t) = \int_{-\infty}^{+\infty} \mathrm{d}{x} \, f(x) \, g(t-x) \tag{1} $$ via discrete Fourier transform (DFT). As ...
0
votes
1answer
631 views

How do I solve Laplace's equation in 2D using spectral methods?

I want to solve the 2D Laplace's equation: $$ \frac{\partial^2 T}{\partial x^2 } + \frac{\partial^2 T}{\partial y^2 } = 0 $$ with boundary conditions: T(x=0)=T(x=1)=T(y=1)=0 and T(y=0)=1 on a ...
2
votes
0answers
37 views

Finding errors in frequency from a Fast Fourier Transform from Gaussian fitting

I took a FFT of sound in a box generated by a frequency sweep over a range of frequencies, and have an array of frequencies and their corresponding FFT amplitudes. According to models for the ...
2
votes
1answer
292 views

How do I avoid divide-by-zero when solving the Poisson equation with Fourier transforms?

I wanted to try to implement part of the method in the following article using Fourier transforms. http://www.shodor.org/media/content/jocse/student_submissions/nocito2010/nocito2010_pdf Right now I ...
2
votes
1answer
686 views

Numerically computing the advection equation

I am trying to write a program to compute the advection equation. $$u_t +u_x = 0$$ I use the spectral method for the spatial derivative $u_x$ and the leapfrog method for the time derivative $u_t$. ...
2
votes
0answers
74 views

Does there exist a Fourier transform algorithm for perturbed data?

Assuming I have a length-$n$ real vector $x$ and have already computed its Fourier transform $\hat x$ (in time $O(n\log n)$), I would like to compute the Fourier transform of $y = x + \delta x$, where ...
6
votes
1answer
270 views

Does this Algorithm (probably Fourier like) Exist for 2D Shapes? [closed]

Update: Someone changed the title to this post to a possible answer ("Fourier decomposition of parametric shapes") but I changed it to a different title as that makes it clear what I was asking. As I ...
1
vote
2answers
931 views

Fourier techniques and periodic boundary conditions

Could somebody explain to me why periodic boundary conditions are automatically satisfied if you solve your problem assuming a Fourier series? So, if we assume a Fourier series for our solution, we ...
7
votes
1answer
429 views

Solving a simple Schroedinger equation with Fast Fourier Transforms

While trying to solve a stochastic Gross-Piaevskii equation I have found a problem that can be tracked down to something buggy occuring in the simplest Schrodinger equation possible: $\partial_t \psi ...
3
votes
0answers
96 views

FFT-based Image Rotation Algorithms More Accurate Than Chirp-Z?

We're currently using a Chirp-Z based implementation: R. W. Cox and R. Tong, "Two- and three-dimensional image rotation using the FFT," IEEE Trans. Image Processing, vol. 8, no. 9, pp. 1297–1299, Sep....
4
votes
1answer
131 views

Computing Fourier representation of space dependent advection operator via FFT

Consider the following equation on the circle: $$\dfrac{\partial p(x,t)}{\partial t} = a(x)\dfrac{\partial p(x,t)}{\partial x} \equiv L(p) \enspace ,$$ where $L$ is the operator acting on $p(x,t)$. ...
3
votes
0answers
59 views

Broadening spectral data by using FFT's

I obtain numerical discrete data of the form $$ S_{raw}(\omega) = \sum_{j}w_{j} \delta(\omega-\omega_{j}) $$ to compare the result with experimental data the delta peaks need to be broadened ...