How to obtain a FFT and satisfy a certain condition for it ?
조회 수: 2 (최근 30일)
이전 댓글 표시
I have an array of points that gives me an interferogram like this:
I have to take the Fourier transform of this curve, precisely the FFT (Fast Fourier Transform). Before doing the FFT, I have to select a certain point X of the array in a way that the part before X is shifted to the end, like in the following figure (where X in this example is more or less 250):
In this way the length of the curve is kept constant. Now I have to do the FFT of this curve, which is obtained as a complex number: a+ib. From this FFT I can retrieve the magnitude as M=sqrt(a^2 + b^2) and the phase phi=atan(b/a). I'm interested in obtaining 'phi' and plotting it. If I choose a different point X of the array where I "cut" the interferogram, the quantity 'phi' will change also. The question is: Given an array of point (i.e. an interferogram, like the one in the first picture) how can I automatically find the point X that gives me a curve 'phi' which is as flat as possible (i.e. with the minimum slope) and as close as possible to zero? I'd like to find a way to obtain this point X authomatically when I load the trace, otherwise I have to try every time different points to satisfy the above condition. Thank you in advance.
댓글 수: 2
Matt J
2014년 1월 29일
편집: Matt J
2014년 1월 29일
Well, the solution is not unique. If, for example the second graph you've shown was the initial sequence of samples, then X=0 would be one solution because the frequency origin is a symmetry point, but X=length(signal)/2 is another solution because it is also a symmetry point (ignoring noise). You may need more criteria.
채택된 답변
Matt J
2014년 1월 30일
편집: Matt J
2014년 1월 30일
As follows, perhaps. You would pre-compute A once and reuse it for different input signals of the same length, N.
N=length(signal);
A=exp(bsxfun(@times,(-2j*pi/N)*(0:N-1),(0:N-1).')); %pre-compute
S=fft(signal(:));
unflatness=sum(abs(imag(bsxfun(@times,S,A))));
[~,X]=min(unflatness),
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!