Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
how use from fft in three dimensional domain

Subject: how use from fft in three dimensional domain

From: ghasem

Date: 25 Apr, 2013 12:44:10

Message: 1 of 1

I have several 4 dimensional arrays in space-time domain (named as : aux_a,aux_b,...).
in each of them,forth dimension is time and three other dimensions are spatial coordinates.
I want to calculate their DFT for a given frequency interval .but I don't know how implement fftn or faster method in this case.
I wrote following code:
n = 10000; % number of time steps.
dt = 5e-3; % sampling time interval
freq = (50:5:300); % desired frequency interval
% aux_a,b are a predetermined 4d arrays in space-time domain
% [ you suppose aux_a,b,... =rand(3,4,5,n) ,...]
a = zeros(3,4,5,length(freq));
b = zeros(3,4,5,length(freq));
for m = 1:n
    for k = 1:length(freq)
        exp_h = exp(-1j * freq( k )* m * dt);
        a(:,:,:,f) = a(:,:,:,f) + exp_h * aux_a(:,:,:,m);
        b(:,:,:,f) = b(:,:,:,f) + exp_h * aux_b(:,:,:,m);
now suppose I have 22 other 4 dimensional arrays like as b and c in above.and I have to calculate their fourier transform like as above.
this code is very slow.I want to use from fftn or a better method.
but I don't know how implement fftn for this problem.
is there anyone who help me?

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us