필터 지우기
필터 지우기

What is the difference between ifft(f) and ifft(f,n)?

조회 수: 1 (최근 30일)
Marcia Azeredo
Marcia Azeredo 2013년 1월 28일
Hi. I have one vector f with some values of velocity in function of the frequency. I have to plot this velocities in function of the time. I don't know if I have to use ifft(f) or ifft(f,n). In this last case, what is n?
Thanks.
  댓글 수: 1
Daniel Shub
Daniel Shub 2013년 1월 28일
I am not a huge fan of RTFM answers, but in this case ... what does help ifft or doc ifft say about what n is?

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

답변 (1개)

John Petersen
John Petersen 2013년 1월 29일
편집: John Petersen 2013년 1월 29일
if N =length(f), there is no difference between ifft(f) and ifft(f,N)
  댓글 수: 2
Marcia Azeredo
Marcia Azeredo 2013년 1월 29일
But, if N is not equal length(f)? I think that N is the number of points that i'd like, or, in this case, N is length of the vector that contain the values of the times that i'd like to plot, but i'm not sure.
John Petersen
John Petersen 2013년 2월 4일
You can zero pad f so that it has the N samples. e.g. Say f is a 256 element column array and N = 400.
f1 = [f; zeros(400-256,1)];
iF = ifft(f);
iF1 = ifft(f1,N);
figure;plot(iF1);
hold on; plot(iF,'r')
Now you can see the difference, just zero padded at the end. Is this what you wanted?
Does the time vector correspond to the sampling points of the signal f?

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

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by