Complex to Imaginary & Vice -Versa
7 views (last 30 days)
Show older comments
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 Comments
Answers (2)
Andrew Newell
on 27 Jan 2011
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 Comments
Don Orofino
on 27 Jan 2011
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 Comments
See Also
Categories
Find more on Time Series in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!