# Tag Info

7

The frequency content of the interpolated signal is significantly influenced by the interpolation basis. If you have a band-limited function that you have adequately sampled (i.e. satisfying Nyquist criterion), interpolating with any function that is not band-limited to the same frequency will indeed introduce high-frequency noise. Unfortunately, exact band-...

6

There are three issues that are likely to cause such problems in pseudospectral methods: Gibbs oscillations Aliasing Time step too large In any case you likely develop oscillations in the solution until some point ends up with a negative density, resulting in a NaN when computing the pressure or sound speed or some other term. The solution to 3 is obvious, ...

6

One issue causing the jagged spectra at high wavenumbers is under sampling there. For example consider the 2D analogue of your binning procedure: You don't want to sample from the red zones as they will become increasingly under-sampled as you move past a radius of size $|k_{x}|=|k_{y}|$.

6

FFTW can do this using certain options: RODFT00, etc. It's probably better to call a library like FFTW than coding it yourself unless you have very special needs.

4

The interpolation indeed affects the Fourier transform. @Steve already gives the correct answer in general, but I want to give you an example that helps the intuition more. Think for example that you have samples a sine function on a set of equally spaced points. If you did a (discrete) FFT on these points alone, you would of course recover a Fourier ...

3

From the old document: Intel® Math Kernel Library FFT to DFTI Wrappers, A314775-001US: All transforms require additional memory to store the transform coefficients. When performing multiple FFTs of the same dimension, the table of coefficients should be created only once and then used on all the FFTs afterwards. Using the same table rather than creating ...

3

You might want to take a look at the Eigen C++ matrix class library. http://eigen.tuxfamily.org/index.php?title=Main_Page There is an FFT class in the unsupported section of the library but my impression is that it is relatively mature. Here is a snippet of code using this FFT class with the BOOST multi-precision classes. #include <vector> #...

2

Let us write it as $$A_j = \sum_{l'=1}^{NL} S_{jl'}L_{l'}$$ Where $$S_{jl'} = \sum_{k= 0}^{K-1}[T_k\epsilon_{l'\text{mod} R,k}]e^{2\pi i \frac{k}{K}j}$$ (I'm using R for the number of rows, the re-use of L is much too confusing) This last expression is clearly the discrete Fourier Transfrom of the ...

2

By interpolating in frequency you are extending the length of your signal in time. You haven't done anything to increase your sampling rate so $\Delta t$ is fixed. Your new time grid will be of length N+M where N is the original length and M is the number of points added through interpolation. Are you uniformly interpolating your frequency domain signal ...

2

FFTW3 now supports MPI, but the APIs between 2 and 3 have many differences. Thus, I'm 99% certain you should use FFTW2. However, if you ask around, you may be able to find a usable version of Gadget-3 which has been slated for but not yet officially released for awhile now. We see a lot of both on our systems.

2

I think you are looking for mpi4py-fft, which is a Python package (BSD-2 licensed) with its wrappers on the serial FFTW library. From pretty extensive mpi4py documentation: Parallel FFTs are computed through a combination of global redistributions and serial transforms. The library also depends on mpi4py (developed also by one of the co-authors of mpi4py-...

2

First, there are non-uniform mesh FFT variations that you could use without having to do the coordinate transformation. Second, the FFT is not easily applicable to the transformed problem. The reason why the FFT is easily applicable to the Laplace equation without transformation is that (showing this for the 1d case here) $${\cal F}[p_{xx}](k) = -k^2 {\... 2 You actually do recover the convolution, but as it is discussed in the comments, there is a normalization issue due to discretization. According to the documentation, fft is implemented like this:$$ A_k = \sum_{m=0}^{n-1} a_m \exp \{ - 2\pi i \frac{mk}{n} \} $$with A_k being the Fourier-coefficients, a_m the m-th element of your signal vector and ... 1 The whole point of the guru interface is to do complicated FFTs without copying the data into contiguous arrays. This advantage is not very important if data needs to be communicated through MPI anyway. Taking advantage of a guru like interface would be complicated and ineffective in an MPI setting. In other words, if your data is not in the expected MPIFFTW ... 1 The method produces a velocity field in Fourier space, where k_1,k_2,k_3 are the components of the wave vector k \in {\mathbb R}^3. In order to get a velocity field in physical space, you need to do an inverse Fourier transform. This typically done via the inverse Fast Fourier Transform (iFFT). 1 ARPREC (http://crd-legacy.lbl.gov/~dhbailey/mpdist/) is an arbitrary-precision C++/Fortran package and contains an FFT implementation. Apfloat (http://www.apfloat.org/apfloat/) is another C++ arbitrary-precision library which contains FFT. Both of the above packages have been included in the FFTW benchmark (http://www.fftw.org/speed/) 1 The FFT algorithm computes the discrete Fourier transform (DFT), which transforms x_{1:n} to \hat x_{1:n} by$$ \hat x_k = \sum_{j=1}^{n} x_j \, e^{-2\pi i (j-1) (k-1)/n}. $$The DFT is a linear transform, as is clear from its formula, meaning that it computes multiplication by a matrix F:$$ \hat x = Fx, \qquad F = \big( e^{-2\pi i (j-1) (k-1)/n} \big)...

1

I would definitely advise going FFTW-route anyway. FFTW is a high-quality library with good documentation that can be used in a convenient way in your project without requiring many modifications or lots of additional code. However, since you explicitly asked about an FFTW alternative, you can go Intel MKL route. Now, Intel Math Kernel Library offers ...

Only top voted, non community-wiki answers of a minimum length are eligible