Find FFT and summation in 4D matrix

1 Ansicht (letzte 30 Tage)
Ali Kareem
Ali Kareem am 18 Jul. 2016
Kommentiert: Adam am 18 Jul. 2016
Hello,
Please, I have F(8*409600*3) matrix. I want to reshape it into B(8*512*3*800) matrix (each row should divide into 800 parts) then I have to find Fast Fourier transform(FFT) for each (8*512) rows and multiply it by its conjugate and divide by a constant after that I have to find summation of elements of each row in fourth dimension and average them by the number of slices within the fourth dimension (800). I mean
(B(1,1,1,1) +B(1,1,1,2)+B(1,1,1,3)……+B(1,1,1,800))/800
(B(1,2,1,1) +B(1,2,1,2)+B(1,2,1,3)……+B(1,2,1,800))/800
And so on for each row.
I used below code it seems work but does not give a correct result.
F=rand(8,409600,3);
B=reshape(F,8,512,3,[]);
C1=fft(B, [],2);
C2=C1.*conj(C1);
C3=C2/(3000);
C4=sum(C3,4)/800;
Thanks
  2 Kommentare
Matt J
Matt J am 18 Jul. 2016
Bearbeitet: Matt J am 18 Jul. 2016
The code looks fine to me, although I think it would be better to do
C4=mean(C3,4);
Adam
Adam am 18 Jul. 2016
You say you have to find the FFT for each (8*512) rows. After your reshape to B you are doing the FFT on dimension 2 which is going to do the FFT in 3d along the 512 dimension. Whether or not this is what you want I don't know.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Fourier Analysis and Filtering finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by