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!