Fourier transforms are an often necessary component in many computational tasks, and can be computed efficiently through the fast Fourier transform (FFT) algorithm. However, many applications involve an underlying continuous signal, and a more natural choice would be to work with e.g. the Fourier series (FS) coefficients in order to avoid the additional overhead of translating between the analog and discrete domains. Unfortunately, there exists very little literature and tools for the manipulation of FS coefficients from discrete samples. This paper introduces a Python library called pyFFS for efficient FS coefficient computation, convolution, and interpolation. While the libraries SciPy and NumPy provide efficient functionality for discrete Fourier transform coefficients via the FFT algorithm, pyFFS addresses the computation of FS coefficients through what we call the fast Fourier series (FFS). Moreover, pyFFS includes an FS interpolation method based on the chirp Z-transform that can make it more than an order of magnitude faster than the SciPy equivalent when one wishes to perform interpolation. GPU support through the CuPy library allows for further acceleration, e.g. an order of magnitude faster for computing the 2-D FS coefficients of 1000 x 1000 samples and nearly two orders of magnitude faster for 2-D interpolation. As an application, we discuss the use of pyFFS in Fourier optics. pyFFS is available as an open source package at https://github.com/imagingofthings/pyFFS, with documentation at https://pyffs.readthedocs.io.
翻译:Fourier 变换是许多计算任务中通常必要的组成部分,可以通过快速 Fourier 变换算法(FFT) 有效计算。 但是,许多应用都包含一个基本的连续信号,而更自然的选择是使用 Fourier 序列(FS) 系数,以避免在模拟和离散域间翻译的额外间接成本。 不幸的是, 用于从离散样本中操纵 FRS 系数的文献和工具很少。 本文引入了一个称为 Python 库的 Python 库, 用于高效 FS 系数的计算、 convolution 和内推法。 虽然 SciPy 和 NumPy 图书馆通过 FFT 算法为离散 Fourier 变换系数提供高效功能, 而 Pyierre 序列 PyPyPy 和 NumPyPy Sy 等提供高效功能, 通过我们称为 FourPy Sy Sy Supal 的快速级文件。 Py- fal FF Serveals 将快速的系统/ massal lax lax lax lax lax lax lax lax lax lax lax sils p.