Home > database >  How to take irfft of multidimensional array in julia?
How to take irfft of multidimensional array in julia?

Time:10-21

I am new to julia, and I am trying to take the irfft of B, which is a 3d array of size (n/2, n, n) where B = rfft(A). However, the irfft in julia reqires an additional input d for the size of the transformed real array, and I'm unsure of what to put. I tried n and n/2, but both did not seem to work as expected when I printed the resulting matrix out.

CodePudding user response:

Check out this discussion. Presumably any triple of numbers will do the trick, but may or may not give you what you want.

CodePudding user response:

This should work:

using FFTW

function test(n = 16)
    a = rand(n ÷ 2, n, n)
    f = rfft(a)
    @show irfft(f, n ÷ 2   1)
end

test()
  • Related