I have a large array of matricies and need to apply inverse FFT as shown in the attached diagram. I do this by restructuring the data using
getindex . After completing the inverse FFT I then recreating the original matrix structure using
reshape. Any suggestions for performance improvements? Its currently way too slow. I have used StaticArrays.jl in the past, but these matrices are too large.
using LinearAlgebra using FFTW using BenchmarkTools function computeBlock(A) rows = size(A,1) #number of rows of A for later use in reshape B = [zeros(4*length(A)) for _ in 1:length(A)] #preallocate B array (including zero pad) pad = zeros(length(A)+Int(floor(length(A)/2))) #create arrays for zero padding for i=1:length(A) #add zero padding then shift for ifft B[i] = [pad;getindex.(A,i);pad]|>fftshift end C = real.(ifft.(B)) #take ifft and extract real part D = [zeros(size(first(A))) for _ in 1:4*length(A)] #preallocate D array for i = 1:length(C) #reorganize time domain data into stacked matrices D[i] = reshape(getindex.(C,i),(rows,:)) end return D end dim = 10 #would like this to be as high as 3000 frequencyDomainData = [rand(18,dim) for _ in 1:2^11] @btime timeDomainData = computeBlock(frequencyDomainData)