Complex to Imaginary & Vice -Versa
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (2)
Andrew Newell
el 27 de En. de 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 comentarios
Don Orofino
el 27 de En. de 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 comentarios
Ver también
Categorías
Más información sobre Data Type Conversion en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!