Find FFT and summation in 4D matrix

조회 수: 2 (최근 30일)
Ali Kareem
Ali Kareem 2016년 7월 18일
댓글: Adam 2016년 7월 18일
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
Matt J
Matt J 2016년 7월 18일
편집: Matt J 2016년 7월 18일
The code looks fine to me, although I think it would be better to do
C4=mean(C3,4);
Adam
Adam 2016년 7월 18일
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.

댓글을 달려면 로그인하십시오.

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by