the IFFT returns zeros

조회 수: 6 (최근 30일)
Ambroise WALLYN
Ambroise WALLYN 2013년 1월 16일
Hi,
I'm trying to do a deconvolution with the formula from a standard (to check if it returns the same results as the function "deconv"):
ifft( fft(h1) / fft(h2) )
fft(h1) / fft(h2) gives me a NxN matrix as expected. However, only one column is different to zeros(:,1), but it can make sense.
Then, when I try to do the inverse fast Fourier transform, Matlab often returns only zeros !
Here is the part of my code:
if true
AA=fft(a(:,4),siz_ft);
BB=fft(a(:,3),siz_ft);
CC=AA/BB;
DD=ifft(CC,siz_ft);
for k=1:siz_ft
if DD(:,k)~=zeros(siz_ft,1)
DD(1:4,k)
end
end
end
It means that DD returns something only 4 times over 16 different measures.
Does anyone have an idea about my problem ?
Thank you for any help !

채택된 답변

Matt J
Matt J 2013년 1월 16일
편집: Matt J 2013년 1월 16일
For starters, I think you need to be doing elementwise division.
CC=AA./BB
Beyond that, it's not clear from your description what you're seeing. First you say your seeing all zeros and then you say "DD returns something only 4 times over 16 different measures" which I assume to mean is not all zeros.
I'm also not sure how you're able to loop over DD(:,k) without getting an error message, because in your code DD only has 1 column.

추가 답변 (1개)

Ambroise WALLYN
Ambroise WALLYN 2013년 1월 16일
편집: Ambroise WALLYN 2013년 1월 16일
Hi, thank you for your answer !
So, I already find that it works with elementwise division but I thought it was not correct...
Then, I'm sorry not being clear enough :
the code I wrote is part of a loop from 1 to 16 (where a(:,3) and a(:,4) change) and so DD returns something only 4 times over the 16 measures from the loop
Finaly, I don't have an error message since CC=AA/BB returns a matrice n-by-n
Whatever, thank you for your answer, since the element-wise division AA./BB works !
  댓글 수: 2
Matt J
Matt J 2013년 1월 16일
OK. If my answer helped, you are encouraged to Accept-click it formally (my Answer, not your response).
Ambroise WALLYN
Ambroise WALLYN 2013년 1월 18일
Ok, sorry. I've just done it Thank you again

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

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by