# Define fft\_plan! for nested array

**URL:** <https://discourse.julialang.org/t/define-fft-plan-for-nested-array/67309>\
**Category:** New to Julia\
**Tags:** fftw\
**Created:** [August 29, 2021, 8:10pm UTC](https://discourse.julialang.org/t/define-fft-plan-for-nested-array/67309 "2021-08-29T20:10:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jinml](https://avatars.discourse-cdn.com/v4/letter/j/91b2a8/32.png) [@jinml](https://discourse.julialang.org/u/jinml)\
**Post date:** [August 29, 2021, 8:10pm UTC](https://discourse.julialang.org/t/define-fft-plan-for-nested-array/67309/1 "2021-08-29T20:10:41Z")

</div>

Hi, I have a nested array `Array{SVector{n},2}`, which is a 2D array of n-`SVector`s. I would like to perform in-place fft to each component of the n-`SVector`s. This is what worked for me:

```julia
julia> A=rand(SVector{2,ComplexF64},5,5);

julia> Ar=reinterpret(reshape,eltype(A[1,1]),A);

julia> fft!(Ar,(2,3));

```

My question is, is there a way to create a `fft_plan!` type of object, such that when this same operation need to be performed on the same type / size of arrays, I don’t have to reinterpret every single time?

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [August 29, 2021, 10:27pm UTC](https://discourse.julialang.org/t/define-fft-plan-for-nested-array/67309/2 "2021-08-29T22:27:23Z")

</div>

> [@jinml](#):
>
> My question is, is there a way to create a `fft_plan!` type of object, such that when this same operation need to be performed on the same type / size of arrays, I don’t have to reinterpret every single time?

Yes, since the underlying FFTW library can handle this, but you’d have to dig into the low-level depths of FFTW.jl.
