# \#fft

**URL:** https://discourse.julialang.org/tag/fft/1117.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [AOCLFFTZ.jl v5.3.2](https://discourse.julialang.org/t/aoclfftz-jl-v5-3-2/139243)

<div class="topic-metadata">

**Author:** [@aelobdog](https://discourse.julialang.org/u/aelobdog)\
**Replies:** 0\
**Last updated:** [September 7, 2026, 2:14pm UTC](https://discourse.julialang.org/t/aoclfftz-jl-v5-3-2/139243 "2026-09-07T14:14:37Z")

</div>

Hello, AOCL-FFTZ is AMD’s in-house Fast Fourier Transform (FFT) library is purpose-built and optimized for Zen-based processors, delivering improved computational performance and faster execution of FFT workloads on AMD…

---

## [Fourier transform of a Dual vector](https://discourse.julialang.org/t/fourier-transform-of-a-dual-vector/118538)

<div class="topic-metadata">

**Author:** [@cdqb](https://discourse.julialang.org/u/cdqb)\
**Replies:** 4\
**Last updated:** [November 18, 2025, 7:46am UTC](https://discourse.julialang.org/t/fourier-transform-of-a-dual-vector/118538 "2025-11-18T07:46:47Z")

</div>

I am trying to Fourier transform a vector of Dual numbers (or rather, ForwardDiff is trying to do that for me as part of a bigger task). However, this does not seem to work with the perhaps most commonly used package FFT…

---

## [Repeated allocations for fft in pseudospectral code](https://discourse.julialang.org/t/repeated-allocations-for-fft-in-pseudospectral-code/130472)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 1\
**Last updated:** [July 4, 2025, 4:37pm UTC](https://discourse.julialang.org/t/repeated-allocations-for-fft-in-pseudospectral-code/130472 "2025-07-04T16:37:44Z")

</div>

I’m trying to tune a pseudospectral PDE code which has calls to fft and ifft at every iteration. I was wondering if there was some way to reduce the repeated memory allocations (assuming this improves performance). By …

---

## [2D-FFT gives nonzero imaginary value at \[1,1\]](https://discourse.julialang.org/t/2d-fft-gives-nonzero-imaginary-value-at-1-1/129500)

<div class="topic-metadata">

**Author:** [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Replies:** 1\
**Last updated:** [May 31, 2025, 11:08am UTC](https://discourse.julialang.org/t/2d-fft-gives-nonzero-imaginary-value-at-1-1/129500 "2025-05-31T11:08:12Z")

</div>

Perhaps this is just my imperfect knowledge of how FFT works, but according to the theory, the Fourier transform at zero frequency of real-valued data is always real, and I thought that this should also happen with FFT. …

---

## [Repeated Convolutions With Large 1D Arrays](https://discourse.julialang.org/t/repeated-convolutions-with-large-1d-arrays/127194)

<div class="topic-metadata">

**Author:** [@donkeysaddle](https://discourse.julialang.org/u/donkeysaddle)\
**Replies:** 20\
**Last updated:** [April 14, 2025, 7:45pm UTC](https://discourse.julialang.org/t/repeated-convolutions-with-large-1d-arrays/127194 "2025-04-14T19:45:45Z")

</div>

What’s the optimal way to compute repeated convolutions with large 1D arrays? the filters, (g\_x,g\_y, & g\_z) stay the same each iteration, but the “signals” change. To be clear, the computation of the f’s is fast, the co…

---

## [Runtime dispatch for plan\_fft](https://discourse.julialang.org/t/runtime-dispatch-for-plan-fft/126958)

<div class="topic-metadata">

**Author:** [@henry2004y](https://discourse.julialang.org/u/henry2004y)\
**Replies:** 1\
**Last updated:** [March 14, 2025, 5:24pm UTC](https://discourse.julialang.org/t/runtime-dispatch-for-plan-fft/126958 "2025-03-14T17:24:10Z")

</div>

Hi, I am learning about JET.jl while optimizing a function that involves FFT. I happened to find that JET.jl detected a runtime dispatch for plan\_fft or plan\_fft!: using JET using FFTW julia\> @report\_opt plan\_fft!(zer…

---

## [Forward Automatic Differentiation & FFTs](https://discourse.julialang.org/t/forward-automatic-differentiation-ffts/126036)

<div class="topic-metadata">

**Author:** [@marcobonici](https://discourse.julialang.org/u/marcobonici)\
**Replies:** 13\
**Last updated:** [February 22, 2025, 10:18pm UTC](https://discourse.julialang.org/t/forward-automatic-differentiation-ffts/126036 "2025-02-22T22:18:37Z")

</div>

I need to understand if there is a combination of packages that is able to wdo what I need. I need to do some FFTs, differentiate through them both in Forward and Backward mode with one of the Julia AD engines (it might…

---

## [Why is CUDA.FFT slow only when performed over the second dimension of a 3D array?](https://discourse.julialang.org/t/why-is-cuda-fft-slow-only-when-performed-over-the-second-dimension-of-a-3d-array/125358)

<div class="topic-metadata">

**Author:** [@marcsgil](https://discourse.julialang.org/u/marcsgil)\
**Replies:** 0\
**Last updated:** [January 29, 2025, 6:49pm UTC](https://discourse.julialang.org/t/why-is-cuda-fft-slow-only-when-performed-over-the-second-dimension-of-a-3d-array/125358 "2025-01-29T18:49:19Z")

</div>

Consider the following test on the CPU: using CUDA, FFTW, BenchmarkTools x = randn(ComplexF32, 2^7, 2^7, 2^7) for dim ∈ 1:ndims(x) @info "FFT along dimension $dim" display(@benchmark CUDA.@sync fft($x, $dim)) …

---

## [How to apply fft to an array of static arrays?](https://discourse.julialang.org/t/how-to-apply-fft-to-an-array-of-static-arrays/124127)

<div class="topic-metadata">

**Author:** [@marcsgil](https://discourse.julialang.org/u/marcsgil)\
**Replies:** 4\
**Last updated:** [December 24, 2024, 6:58am UTC](https://discourse.julialang.org/t/how-to-apply-fft-to-an-array-of-static-arrays/124127 "2024-12-24T06:58:54Z")

</div>

I’d like to be able to do something like using StaticArrays, FFTW A = \[@SVector rand(ComplexF64, 3) for m ∈ 1:512\] fft(A) but FFTW.jl throws an error when I try it. Due to performance and ergonomic reasons, I really w…

---

## [Fastest Julia implementation for a cyclic convolution of real vectors](https://discourse.julialang.org/t/fastest-julia-implementation-for-a-cyclic-convolution-of-real-vectors/123665)

<div class="topic-metadata">

**Author:** [@lukemin](https://discourse.julialang.org/u/lukemin)\
**Replies:** 17\
**Last updated:** [December 12, 2024, 4:44pm UTC](https://discourse.julialang.org/t/fastest-julia-implementation-for-a-cyclic-convolution-of-real-vectors/123665 "2024-12-12T16:44:03Z")

</div>

Hi, I am looking for the fastest way to implement the cyclic convolution of two real vectors. In other words, given some positive integer n \> 0 which is not necessarily power-of-two, I want to multiply two degree-(n-1) …

---

## [Help with NUFFT (NFFT) vs FFT in Radial MRI applications](https://discourse.julialang.org/t/help-with-nufft-nfft-vs-fft-in-radial-mri-applications/122106)

<div class="topic-metadata">

**Author:** [@matividalg](https://discourse.julialang.org/u/matividalg)\
**Replies:** 0\
**Last updated:** [November 1, 2024, 12:52am UTC](https://discourse.julialang.org/t/help-with-nufft-nfft-vs-fft-in-radial-mri-applications/122106 "2024-11-01T00:52:02Z")

</div>

Hi there! I have a few problems when generating a “fHat” matrix of a NFFT (using package NFFT) vs when dealing with the inverse fft of my own (imperfect) adquisition. Let me illustrate. I’m simulating a regular Gradient…

---

## [Reusing a complex FFT array’s memory as a real array, “C-style”](https://discourse.julialang.org/t/reusing-a-complex-fft-array-s-memory-as-a-real-array-c-style/120849)

<div class="topic-metadata">

**Author:** [@lmtzx9h4qqnt](https://discourse.julialang.org/u/lmtzx9h4qqnt)\
**Replies:** 7\
**Last updated:** [October 4, 2024, 1:50pm UTC](https://discourse.julialang.org/t/reusing-a-complex-fft-array-s-memory-as-a-real-array-c-style/120849 "2024-10-04T13:50:28Z")

</div>

When doing a complex-to-real FFT (using FFTW.jl), the real input and complex output arrays take roughly the same amount of memory. To quote from the rfft() docstring, If A has size (n\_1, …, n\_d), the result has size (n…

---

## [FFT scaling. Matlab vs. Julia](https://discourse.julialang.org/t/fft-scaling-matlab-vs-julia/116404)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 8\
**Last updated:** [June 30, 2024, 11:25pm UTC](https://discourse.julialang.org/t/fft-scaling-matlab-vs-julia/116404 "2024-06-30T23:25:08Z")

</div>

Matlab documentation states and I am puzzled by this. (i) Why doesn’t fft() do this scaling internally? I have to do X = (1/L)\*fft(x,N);% Now we compute the coefficients X\_k in order to get the correct spectrum…

---

## [How to avoid memory blow up with FFT without expensive garbage collection?](https://discourse.julialang.org/t/how-to-avoid-memory-blow-up-with-fft-without-expensive-garbage-collection/115400)

<div class="topic-metadata">

**Author:** [@singularity](https://discourse.julialang.org/u/singularity)\
**Replies:** 3\
**Last updated:** [June 10, 2024, 7:55pm UTC](https://discourse.julialang.org/t/how-to-avoid-memory-blow-up-with-fft-without-expensive-garbage-collection/115400 "2024-06-10T19:55:33Z")

</div>

I am trying to write a code that has a for loop inside which an array is broken into chunks, sent to multiple processors, and FFT is performed on those chunks. Without using garbage collection GC.gc() command at the end …

---

## [Is it time to make a pure Julia FFT?](https://discourse.julialang.org/t/is-it-time-to-make-a-pure-julia-fft/99256)

<div class="topic-metadata">

**Author:** [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)\
**Replies:** 14\
**Last updated:** [May 8, 2024, 3:21pm UTC](https://discourse.julialang.org/t/is-it-time-to-make-a-pure-julia-fft/99256 "2024-05-08T15:21:13Z")

</div>

While FFTW is great, it is a GPL-licensed C library. R, Mathematica, Python’s Scipy, etc have their own FFT library. Should we finally have our own FFT library? A pure Julia FFT may provide several advantages such as bei…

---

## [Weird phase result between two simple sine curves](https://discourse.julialang.org/t/weird-phase-result-between-two-simple-sine-curves/111769)

<div class="topic-metadata">

**Author:** [@PeX](https://discourse.julialang.org/u/PeX)\
**Replies:** 12\
**Last updated:** [March 18, 2024, 7:32pm UTC](https://discourse.julialang.org/t/weird-phase-result-between-two-simple-sine-curves/111769 "2024-03-18T19:32:41Z")

</div>

Hi all, I’m trying to get the relative phase between two simple sine series: I’m trying to use FFTW to get their angle from the dominant frequency and calculate the relative phase: function FFT\_phase\_rel(sig1, sig2,…

---

## [\[ANN\] FFTIndexing.jl](https://discourse.julialang.org/t/ann-fftindexing-jl/111433)

<div class="topic-metadata">

**Author:** [@brainandforce](https://discourse.julialang.org/u/brainandforce)\
**Replies:** 0\
**Last updated:** [March 10, 2024, 9:23pm UTC](https://discourse.julialang.org/t/ann-fftindexing-jl/111433 "2024-03-10T21:23:52Z")

</div>

FFTIndexing.jl is a small package I’ve written that provides a few types that you can use to index an array in a manner that exposes the underlying frequency bins from a Fourier transform. This package accomplishes simi…

---

## [Is there a library for a generic convolution function?](https://discourse.julialang.org/t/is-there-a-library-for-a-generic-convolution-function/110329)

<div class="topic-metadata">

**Author:** [@AwesomeQuest](https://discourse.julialang.org/u/AwesomeQuest)\
**Replies:** 1\
**Last updated:** [February 17, 2024, 2:13am UTC](https://discourse.julialang.org/t/is-there-a-library-for-a-generic-convolution-function/110329 "2024-02-17T02:13:23Z")

</div>

I need to do a convolution of BigInts and DSP says that BigFloat isn’t supported when I try.

---

## [Error in FastTransforms.jl for cheb2leg](https://discourse.julialang.org/t/error-in-fasttransforms-jl-for-cheb2leg/108995)

<div class="topic-metadata">

**Author:** [@erny123](https://discourse.julialang.org/u/erny123)\
**Replies:** 1\
**Last updated:** [January 22, 2024, 10:20pm UTC](https://discourse.julialang.org/t/error-in-fasttransforms-jl-for-cheb2leg/108995 "2024-01-22T22:20:31Z")

</div>

I’m working with Legendre transforms and according to FastTransforms.jl, one can do a Chebyshev Transform and use the cheb2leg() function to transform from Chebyshev coefficients to Legendre coefficients. I’ve compared …

---

## [Fourier expansion package](https://discourse.julialang.org/t/fourier-expansion-package/108621)

<div class="topic-metadata">

**Author:** [@baizhan](https://discourse.julialang.org/u/baizhan)\
**Replies:** 8\
**Last updated:** [January 11, 2024, 1:33am UTC](https://discourse.julialang.org/t/fourier-expansion-package/108621 "2024-01-11T01:33:42Z")

</div>

I have a periodic function, say f(x+T)=f(x), then it can be decomposed into a sum of sin and cos functions. For example, f(x)=\\sum\_{s=-\\infty}^{\\infty}A\_{s}e^{isx}, where A\_{s}=\\frac{1}{T}\\int\_{-T/2}^{T/2}f(x)e^{-is…

---

## [Chebyshev Transform using FFTW and FastTransforms.jl Speed](https://discourse.julialang.org/t/chebyshev-transform-using-fftw-and-fasttransforms-jl-speed/107387)

<div class="topic-metadata">

**Author:** [@erny123](https://discourse.julialang.org/u/erny123)\
**Replies:** 6\
**Last updated:** [December 16, 2023, 6:18pm UTC](https://discourse.julialang.org/t/chebyshev-transform-using-fftw-and-fasttransforms-jl-speed/107387 "2023-12-16T18:18:38Z")

</div>

I’m looking into spectral methods for some PDEs. For the discrete Chebyshev Transform, it is basically a discrete cosine transform: I’ve looked at FastTransforms.jl as they have a Chebyshev Transform which can be used…

---

## [Batched CUDA FFT Plans](https://discourse.julialang.org/t/batched-cuda-fft-plans/105187)

<div class="topic-metadata">

**Author:** [@MaximilianGelbrecht](https://discourse.julialang.org/u/MaximilianGelbrecht)\
**Replies:** 2\
**Last updated:** [October 20, 2023, 6:50am UTC](https://discourse.julialang.org/t/batched-cuda-fft-plans/105187 "2023-10-20T06:50:21Z")

</div>

CUDA.jl PR1903 added support for FFTs along more directions with CUDA.jl v5. I am a bit confused how this works in practice, as I can’t find it documented. The PR states This is achieved by allowing fft-plans to have f…

---

## [How to detect oscillations/characteristic frequencies in data?](https://discourse.julialang.org/t/how-to-detect-oscillations-characteristic-frequencies-in-data/105169)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 5\
**Last updated:** [October 19, 2023, 7:37pm UTC](https://discourse.julialang.org/t/how-to-detect-oscillations-characteristic-frequencies-in-data/105169 "2023-10-19T19:37:33Z")

</div>

I have a (many) signal I have gotten from experiments. The extent can be argued, but I’d definitely say there is something pulsing/oscillatory going on: using Plots plot(signal) How do I actually show this though? I …

---

## [Is CUDA.jl and FFTW threadsafe?](https://discourse.julialang.org/t/is-cuda-jl-and-fftw-threadsafe/99219)

<div class="topic-metadata">

**Author:** [@jpdoane](https://discourse.julialang.org/u/jpdoane)\
**Replies:** 4\
**Last updated:** [May 22, 2023, 2:44pm UTC](https://discourse.julialang.org/t/is-cuda-jl-and-fftw-threadsafe/99219 "2023-05-22T14:44:21Z")

</div>

I am getting the following error when using CUDA.jl FFTW plans in multiple threads. Is this interface not threadsafe? If not, do I just need a mutex around plan\_fft!(), or might the actual fft be not threadsafe as well? …

---

## [CUDA.jl crashes if a 4d FFT is asked](https://discourse.julialang.org/t/cuda-jl-crashes-if-a-4d-fft-is-asked/97165)

<div class="topic-metadata">

**Author:** [@shiroghost](https://discourse.julialang.org/u/shiroghost)\
**Replies:** 2\
**Last updated:** [April 7, 2023, 9:42pm UTC](https://discourse.julialang.org/t/cuda-jl-crashes-if-a-4d-fft-is-asked/97165 "2023-04-07T21:42:04Z")

</div>

Hi, It seems that CUDA.jl and FFTW.jl do not work for Arrays with dimensions larger than 3: julia\> b = randn(8, 8, 8); julia\> cb = CuArray(b); julia\> fft(b); julia\> fft(cb); julia\> sum(fft(b) .- Array(fft(cb))) 3.31956…

---

## [CuPy CuFFT ~2x faster than CUDA.jl CuFFT](https://discourse.julialang.org/t/cupy-cufft-2x-faster-than-cuda-jl-cufft/89151)

<div class="topic-metadata">

**Author:** [@Dreycen\_Foiles](https://discourse.julialang.org/u/Dreycen_Foiles)\
**Replies:** 15\
**Last updated:** [February 27, 2023, 6:42pm UTC](https://discourse.julialang.org/t/cupy-cufft-2x-faster-than-cuda-jl-cufft/89151 "2023-02-27T18:42:31Z")

</div>

I am working on a simulation whose bottleneck is lots of FFT-based convolutions performed on the GPU. I wanted to see how FFT’s from CUDA.jl would compare with one of bigger Python GPU libraries CuPy. I was surprised to …

---

## [Help needed with FFT and NFFT](https://discourse.julialang.org/t/help-needed-with-fft-and-nfft/93449)

<div class="topic-metadata">

**Author:** [@Karajan](https://discourse.julialang.org/u/Karajan)\
**Replies:** 14\
**Last updated:** [February 12, 2023, 11:36am UTC](https://discourse.julialang.org/t/help-needed-with-fft-and-nfft/93449 "2023-02-12T11:36:10Z")

</div>

Hi, I think I could use some help understanding nonuniform discrete Fourier transforms (NFFT). Either I’m not using the tools correctly or I’m misunderstanding how they work in general. I read that when my signal has no…

---

## [Why are the return-values of fft and fftfreq so terrible?](https://discourse.julialang.org/t/why-are-the-return-values-of-fft-and-fftfreq-so-terrible/87510)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 16\
**Last updated:** [November 12, 2022, 10:48pm UTC](https://discourse.julialang.org/t/why-are-the-return-values-of-fft-and-fftfreq-so-terrible/87510 "2022-11-12T22:48:46Z")

</div>

The situation When I calculate the fft of a signal, I want to plot it almost every time. However, there is a number of operations that I want to do each time, as the output from fft and fftfreq is honestly terrible. So …

---

## [How do frequencies shift after a FFT?](https://discourse.julialang.org/t/how-do-frequencies-shift-after-a-fft/88089)

<div class="topic-metadata">

**Author:** [@bertulli](https://discourse.julialang.org/u/bertulli)\
**Replies:** 11\
**Last updated:** [October 9, 2022, 6:22pm UTC](https://discourse.julialang.org/t/how-do-frequencies-shift-after-a-fft/88089 "2022-10-09T18:22:26Z")

</div>

Hi all! I hope this is the right subcategory to ask in. I’m playing around with the FFTW package to perform some Fourier transforms. I got how to define a signal and transform it, but I can’t get how (and why) can I shi…

---

## [Comparison of different fft-implementations](https://discourse.julialang.org/t/comparison-of-different-fft-implementations/86021)

<div class="topic-metadata">

**Author:** [@ellocco](https://discourse.julialang.org/u/ellocco)\
**Replies:** 11\
**Last updated:** [October 7, 2022, 10:00pm UTC](https://discourse.julialang.org/t/comparison-of-different-fft-implementations/86021 "2022-10-07T22:00:26Z")

</div>

Hi, I am struggling with fft-analysis of real-world data. Main objective are correct results. Currently I use two different fft-implementations: FFTW.fft() SciPy.fft.fft() The reason for this is that FFTW.fft() see…

[Next page](https://discourse.julialang.org/tag/fft/1117.md?match_all_tags=true&page=1&tags%5B%5D=fft)
