Gerchberg–Saxton algorithm: Difference between revisions

Content deleted Content added
Goyala1 (talk | contribs)
No edit summary
No edit summary
Line 8:
The paper by R. W. Gerchberg and W. O. Saxton on this algorithm is entitled “A practical algorithm for the determination of the phase from image and diffraction plane pictures,” and was published in ''Optik'' (35, 237–246 1972).
 
The [[Pseudopseudo-code]] 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.
 
==Pseudo-code algorithm==
 
'''Let:'''
FT - Forwardforward Fourier Transformtransform
IFT - Inverseinverse Fourier Transformtransform
''i'' - the imaginary numberunit, sqrt(-√−1) (square root of -−1)
exp - exponential function (''e^''<sup>''x''</sup>)
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'', Amplitudeamplitude(''z'') = sqrt(''x*''&middot;''x'' + ''y*''&middot;''y'')
for real ''x'', Amplitudeamplitude(''x'') = |''x''|
Phase - Phase extracting function:
e.g. Phase(z) = arctan(y/x)
'''end Let'''