Questions tagged [pyfftw]

A python wrapper for FFTW, a fast-fourier transform library.

A python wrapper, for FFTW, a fast-fourier transform library.

The ultimate aim is to present a unified interface for all the possible transforms that FFTW can perform. The library supports both complex DFT and the real DFT.

Related links

64 questions
4
votes
0 answers

Compare FFT speed of python (scipy and pyfftw packages) and matlab

I compared the speed of FFT using different methods in python and matlab, the results looked a little weird and I didn't know if I did it right. The code in python are as follows: from scipy import fft import pyfftw import numpy as np from timeit…
shz
  • 159
  • 8
4
votes
1 answer

Replacing numpy.fft routines with pyfftw, not working as expected

I have some working python code making use of the numpy.fft package, here is a snippet: for i in range(steps): print i psixvec = Ux * psixvec psikvec = Uk * np.fft.fftn(psixvec) psixvec = np.fft.ifftn(psikvec) return psixvec I…
Micha
  • 349
  • 3
  • 14
3
votes
1 answer

Calculation of Laplacian in real pyFFTW

For the forward (multidimensional) FFTW algorithm you can specify that the input numpy.ndarray is real, and the output should be complex. This is done when creating the byte-aligned arrays that go in the arguments of the fft_object: import numpy as…
user10415707
3
votes
0 answers

1D FFTs over multi-dimensional arrays using Arrayfire with Python

Using the pyfftw library, it is easy to do a 1D FFT over a single axis of a multi-dimensional array of shape (M, 2**N) without cycling over the zeroth index explicitly as follows: afft = pyfftw.interfaces.numpy_fft.fft(a, axis=1). Switching to…
user6565699
3
votes
1 answer

How to use fftw Guru interface

I used to use fftw_plan_dft for multi-dimensional Fourier transformation. fftw_plan fftw_plan_dft(int rank, const int *n, fftw_complex *in, fftw_complex *out, int sign, unsigned flags); Now I want to pass 64 bit integer to…
Hao Shi
  • 503
  • 4
  • 16
3
votes
1 answer

Using pyfftw properly for speed up over numpy

I am in the midst of trying to make the leap from Matlab to numpy, but I desperately need speed in my fft's. Now I know of pyfftw, but I don't know that I am using it properly. My approach is going something like import numpy as np import…
curtischris
  • 41
  • 1
  • 3
3
votes
2 answers

Fastest method to do an FFT

I have the following very basic example of doing a 2D FFT using various interfaces. import time import numpy import pyfftw import multiprocessing a = numpy.random.rand(2364,2756).astype('complex128') start = time.time() b1 = numpy.fft.fft2(a) end1…
steveo225
  • 11,394
  • 16
  • 62
  • 114
3
votes
2 answers

Error in linking fftw libraries for pyFFTW installation

I tried to install pyFFTW 0.9.2 to OSX mavericks, but I encounter the following errors: /usr/bin/clang -bundle -undefined dynamic_lookup -L//anaconda/lib -arch x86_64 -arch x86_64…
sho
  • 33
  • 4
2
votes
1 answer

Import Error with pyFFTW (scipy.fftpack) in Python 3.8

I have a numerical simulation program that works fine at the institute I'm in, there I have a Win10 box where I installed Python 3.7.3 64-bit. I am trying to run the same program in my laptop with Manjaro and Python 3.8.1 (It was also 3.7.3 at the…
user10415707
2
votes
0 answers

Why is fft_object.update_arrays() necessary in pyfftw?

I need to perform lots of 2D FFTs on square, power of 2, complex64 arrays. I'd like to use the pyfftw wrappers to make this as quick as possible. I'm running Anaconda through Ubuntu 18.04 and downloaded the pyfftw package using "conda install -c…
2
votes
0 answers

Python pyfftw memory usage

Task: Fast real-to-complex FFT computation of a large array. The shape of array a is (103430 x 1 x 100 x 900) where the dimensions are (time, a dummy dim, longitude, latitude), so let's say (~100000 x 1 x 100 x 900). The FFT should be computed over…
bproxauf
  • 1,076
  • 12
  • 23
2
votes
2 answers

I can't find python package fftw3

I'm trying to use fftw3 on python to compute ffts really fast (using all my cores!) The problem is... I can't find the fftw3 package for python... I know it exists because the function I need uses it if and only if it's installed. This is the…
ch0l1n3
  • 275
  • 3
  • 9
2
votes
1 answer

How to install pyfft on python3x?

I tried installing pyfft using python -m pip install pyfft and I get Downloading/unpacking pyfft Downloading pyfft-0.3.8.tar.gz Running setup.py (path:/tmp/pip_build_echeverl/pyfft/setup.py) egg_info for package pyfft Python >=2.5 is…
ilciavo
  • 3,069
  • 7
  • 26
  • 40
1
vote
0 answers

No performance increase when looping of FFTs in Cython

I'm writing a script that tracks the shifts of a sample by estimating the displacement of an ensemble of particles. The first implementation, in Python, works alright, but it takes too long for a large amount of samples. To combat this, I tried…
Zim-Zim
  • 11
  • 1
1
vote
1 answer

Can't install pyFFTW with python 3.9 in Macos M1

Any idea on how can I solve this issue? I really need to install pyfftw into a conda environment, which already has the other libraries I need, such as tensorflow. Up until know, I could only install the other libraries correctly (namely tensorflow)…
MrT77
  • 811
  • 6
  • 25
1
2 3 4 5