傅里叶变换是许多计算任务中经常需要的组件,并且可以通过快速傅里叶变换 (FFT) 算法进行高效计算。然而,许多应用涉及潜在的连续信号,更自然的选择是使用例如傅立叶级数 (FS) 系数,以避免在模拟域和离散域之间转换的额外开销。不幸的是,很少有文献和工具用于从离散样本中操作 FS 系数。本文介绍了一个名为 pyFFS 的 Python 库,用于高效的 FS 系数计算、卷积和插值。虽然库 SciPy 和 NumPy 通过 FFT 算法为离散傅立叶变换系数提供了有效的功能,pyFFS 通过我们所说的快速傅立叶级数 (FFS) 来解决 FS 系数的计算。此外,pyFFS 包括一种基于 chirp Z 变换的 FS 插值方法,当人们希望执行插值时,该方法可以使其比 SciPy 等价物快一个数量级以上。通过 CuPy 库的 GPU 支持允许进一步加速,例如,计算 1000 x 1000 样本的 2-D FS 系数快一个数量级,2-D 插值快近两个数量级。作为一个应用,我们讨论 pyFFS 在傅立叶光学中的使用。pyFFS 可在 https://github.com/imagingofthings/pyFFS 作为开源包获得,文档位于 https://pyffs.readthedocs.io。pyFFS 包括一种基于 chirp Z 变换的 FS 插值方法,当人们希望执行插值时,该方法可以使其比 SciPy 等价物快一个数量级以上。通过 CuPy 库的 GPU 支持允许进一步加速,例如,计算 1000 x 1000 样本的 2-D FS 系数快一个数量级,2-D 插值快近两个数量级。作为一个应用,我们讨论 pyFFS 在傅立叶光学中的使用。pyFFS 可在 https://github.com/imagingofthings/pyFFS 作为开源包获得,文档位于 https://pyffs.readthedocs.io。pyFFS 包括一种基于 chirp Z 变换的 FS 插值方法,当人们希望执行插值时,该方法可以使其比 SciPy 等价物快一个数量级以上。通过 CuPy 库的 GPU 支持允许进一步加速,例如,计算 1000 x 1000 样本的 2-D FS 系数快一个数量级,2-D 插值快近两个数量级。作为一个应用,我们讨论 pyFFS 在傅立叶光学中的使用。pyFFS 可在 https://github.com/imagingofthings/pyFFS 作为开源包获得,文档位于 https://pyffs.readthedocs.io。计算 1000 x 1000 个样本的二维 FS 系数快一个数量级,二维插值快近两个数量级。作为一个应用,我们讨论 pyFFS 在傅立叶光学中的使用。pyFFS 可在 https://github.com/imagingofthings/pyFFS 作为开源包获得,文档位于 https://pyffs.readthedocs.io。计算 1000 x 1000 个样本的二维 FS 系数快一个数量级,二维插值快近两个数量级。作为一个应用,我们讨论 pyFFS 在傅立叶光学中的使用。pyFFS 可在 https://github.com/imagingofthings/pyFFS 作为开源包获得,文档位于 https://pyffs.readthedocs.io。
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.