Complex to Imaginary & Vice -Versa
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello everyone
I am applying fft on image which giving me complex value . for getting magnitude i am using " X = abs(Y)" function . after dat i m applying Log Polar transformation . After that i m applying the inverse process for each function . so i want to know that is there particular function for reversing the "abs" function i.e. getting the real complex value from the real one. Such as i am using IFFt for FFT, ILPM for LPM...plz help me ...thnx n regards
댓글 수: 0
답변 (2개)
Andrew Newell
2011년 1월 27일
You can't reverse the abs function. If the original phase is what you need, you could save the phase angle using P = angle(Y). There is a file in Matlab Central that does log-polar sampling (see http://www.mathworks.com/matlabcentral/fileexchange/27023).
댓글 수: 0
Don Orofino
2011년 1월 27일
Hi Amitesh
You can generally invert rectangular/polar transformations as long as you don't lose magnitude or phase information. You can use elementary operations (abs/angle), functions (pol2cart/cart2pol), complex exponentials, etc, depending on data format and personal preference. For example,
X = rand(100,1);
Y1 = fft(X); % Y1 is complex-valued, as you've specified
R = abs(Y1); % magnitude of complex data
T = angle(Y1); % angle of complex data
%[R,T] = somethingInteresting(R,T);
Y2 = R.*complex(cos(T),sin(T)); % many ways to get back
err = max(abs(Y1-Y2))/eps % effective zero (a few eps)
What you do with somethingInteresting (Log Polar transformation?) is up to you. You can't generally "invert" from just abs and expect to recover the original data.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!