To install click the Add extension button. That's it.

The source code for the WIKI 2 extension is being checked by specialists of the Mozilla Foundation, Google, and Apple. You could also do it yourself at any point in time.

4,5
Kelly Slayton
Congratulations on this excellent venture… what a great idea!
Alexander Grigorievskiy
I use WIKI 2 every day and almost forgot how the original Wikipedia looks like.
Live Statistics
English Articles
Improved in 24 Hours
Added in 24 Hours
What we do. Every page goes through several hundred of perfecting techniques; in live mode. Quite the same Wikipedia. Just better.
.
Leo
Newton
Brights
Milds

# Gerchberg–Saxton algorithm

## From Wikipedia, the free encyclopedia

Gerchberg-Saxton algorithm for iterative phase retrieval, FT is Fourier transform.

The Gerchberg–Saxton (GS) algorithm is an iterative phase retrieval algorithm for retrieving the phase of a complex-valued wavefront from two intensity measurements acquired in two different planes.[1] Typically, the two planes are: the image plane and the far field (diffraction) plane, and the wavefront propagation between these two planes is given by the Fourier transform. The original paper by Gerchberg and Saxton considered image and diffraction pattern of sample acquired in an electron microscope.

It is often necessary to know only the phase distribution from one of the planes, since the phase distribution on the other plane can be obtained by performing a Fourier transform on the plane whose phase is known. Although often used for two-dimensional signals, the GS algorithm is also valid for one-dimensional signals.

The pseudocode below performs the GS algorithm to obtain a phase distribution for the plane, Source, such that its Fourier transform would have the amplitude distribution of the plane, Target.

## Pseudocode algorithm

Let:
FT – forward Fourier transform
IFT – inverse Fourier transform
i – the imaginary unit, √−1 (square root of −1)
exp – exponential function (exp(x) = ex)
Target and Source be the Target and Source Amplitude planes respectively
A, B, C & D be complex planes with the same dimension as Target and Source
Amplitude – Amplitude-extracting function:
e.g. for complex z = x + iy, amplitude(z) = sqrt(x·x + y·y)
for real x, amplitude(x) = |x|
Phase – Phase extracting function:
e.g. Phase(z) = arctan(y / x)
end Let

algorithm Gerchberg–Saxton(Source, Target, Retrieved_Phase) is
A := IFT(Target)
while error criterion is not satisfied
B := Amplitude(Source) × exp(i × Phase(A))
C := FT(B)
D := Amplitude(Target) × exp(i × Phase(C))
A := IFT(D)
end while
Retrieved_Phase = Phase(A)

This is just one of the many ways to implement the GS algorithm. Aside from optimizations, others may start by performing a forward Fourier transform to the source distribution.

## References

1. ^ Gerchberg, R. W.; Saxton, W. O. (1972). "A practical algorithm for the determination of the phase from image and diffraction plane pictures" (PDF). Optik. 35: 237–246.
Basis of this page is in Wikipedia. Text is available under the CC BY-SA 3.0 Unported License. Non-text media are available under their specified licenses. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc. WIKI 2 is an independent company and has no affiliation with Wikimedia Foundation.