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!