Displaying images after a Fourier Transform and Phase Retrieval Algorithms
Show older comments
I'm playing around with Matlab to write code for retrieving the lost phase information from an image and diffraction pattern (Fourier Transform).
I came across Steve's blog post here(<http://blogs.mathworks.com/steve/2009/12/04/fourier-transform-visualization-using-windowing/>) which lead me to a critical line of code for displaying the Fourier transform.
G = fft2(g); imshow(log(abs(fftshift(G)) + 1), [])
My questions are:
1. I understand that the Fourier transform must be shifted using this 'fftshift()' function to display it properly. Is there a similar function to shift the image data so that it may be displayed properly after it goes through an iteration of Fourier and inverse Fourier transforms?
2. If I do 100+ iterations of a Fourier and inverse Fourier transform to my data, do I need to shift it using the 'imshow(log(abs(fftshift(G)) + 1), [])' after every iteration, or will the data be fine to just use that code to shift the data at the end of all my iterations.
3. Does anyone know of any matlab code written for phase retrieval algorithms?
1 Comment
Rick Stockton
on 3 May 2016
In my lab we routinely use Fourier transforms. What we always do is fftshift(fft(fftshift(G))) when performing the transform. That way you never have to wonder about your data. Its also a very fast operation so it shouldn't slow your code down too much.
As for phase retrieval check out: http://www.physics.ucla.edu/research/imaging/OSS/ Note that it requires a 2D matrix for the input so if you have a 1D phase retrieval you will have to look somewhere else or modify the code.
Cheers,
Answers (1)
Sean de Wolski
on 5 Apr 2012
your first question:
doc ifftshift % ;)
Categories
Find more on Image Transforms 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!