Method AS
Method AS
Tomoyoshi Shimobabaa,∗, Jian Tong Wenga , Takahiro Sakuraia , Naohisa Okadaa , Takashi Nishitsujia , Naoki Takadab , Atsushi
Shirakic , Nobuyuki Masudaa, Tomoyoshi Itoa
a Department of Artificial Systems, Graduate School of Engineering, Chiba University, 1-33 Yayoi-cho, Inage-ku, Chiba, Chiba 263-8522, Japan
b Department of Informatics and Media Technology, Shohoku College, 428 Nurumizu, Atsugi, Kanagawa, 243–8501 Japan
c Department of Imformation and Computer Engineering, Kisarazu National College of Technology, Kiyomi-dai Higashi 2-11-1, Kisarazu, Chiba, 292-0041 Japan
arXiv:1107.5578v1 [physics.optics] 27 Jul 2011
Abstract
Diffraction calculations, such as the angular spectrum method, and Fresnel diffractions, are used for calculating scalar light prop-
agation. The calculations are used in wide-ranging optics fields: for example, computer generated holograms (CGHs), digital
holography, diffractive optical elements, microscopy, image encryption and decryption, three-dimensional analysis for optical de-
vices and so on. However, increasing demands made by large-scale diffraction calculations have rendered the computational power
of recent computers insufficient. We have already developed a numerical library for diffraction calculations using a graphic pro-
cessing unit (GPU), which was named the GWO library. However, this GWO library is not user-friendly, since it is based on C
language and was also run only on a GPU. In this paper, we develop a new C++ class library for diffraction and CGH calculations,
which is referred as to a CWO++ library, running on a CPU and GPU. We also describe the structure, performance, and usage
examples of the CWO++ library.
Keywords:
Diffraction, Digital holography, Digital holographic microscopy, Graphics processing unit, GPGPU, GPU computing, Holography,
Real-time holography, Scalar light propagation
Nx Nx
− ≤ m1 , m2 < − − 1,
2 2
Ny Ny
− ≤ m1 , m2 < − −1 (4)
2 2
where, N x and Ny are the numbers of horizontal and vertical
pixels on the source and destination planes, respectively.
Figure 1: Diffraction calculation by monochromatic wave, whose wavelength is
λ, between a source plane (aperture function) u1 (x1 , y1 ) and a destination plane
The discretized Fresnel diffraction of the convolution form
u2 (x2 , y2 ). is as follows:
exp(i 2π
λ z)
2.1.1. Fresnel diffraction (convolution form) u2 (m2 , n2 ) = FFT −1 FFT u(m1 , m1 )
iλz (5)
The convolution form of Fresnel diffraction is expressed by:
FFT hF (m1 , m1 )
exp(i 2π
Z Z +∞
λ z)
u2 (x2 , y2 ) = u1 (x1 , y1 )
iλz −∞ (1)
π π
2 2
exp(i ((x2 − x1 ) + (y2 − y1 ) ))dx1 dy1 hF (m, n) = exp(i ((m∆x1 )2 + (n∆y1 )2 )) (6)
λz λz
The above equation is the convolution form, and can be ex- Note that the sampling pitches on the destination planes
pressed relative to the following equation according to convo- are the same as those on the source plane after the diffraction,
lution theorem: namely ∆x2 = ∆x1 and ∆y2 = ∆y1 .
exp(i 2π
λ z) −1
u2 (x2 , y2 ) = F F u(x1 , y1 ) F hF (x1 , y1 ) (2) 2.1.2. The Fresnel diffraction (Fourier form)
iλz
We can obtain the Fourier form of the Fresnel diffraction to
where, the operators F [·] and F −1 [·] indicate Fourier and in-
expand the quadratic term in Eq. (1). The form is expressed by:
verse Fourier transforms, respectively, hF (x, y) is the impulse
response function (also known as the point spread function) of exp(i 2π λ z) π
Eq. (1) as follows, u(x2 , y2 ) = exp(i (x22 + y22 ))
iλz λz (7)
Z Z +∞
2π
π u′ (x1 , y1 ) exp(−i (x2 x1 + y2 x1 ))dx1 dy1 ,
hF (x, y) = exp(i (x2 + y2 )) (3) −∞ λz
λz
3
where u′ (x1 , y1 ) is defined as, 2.1.4. Angular spectrum method
The angular spectrum method can be devised from the Helm-
(x21 + y21 )
u′ (x1 , y1 ) = u(x1 , y1 ) exp(iπ ). (8) holtz equation and is suitable for computing diffraction at short
λz distance, which is impossible for Fresnel and Shifted Fresnel
This form is rewritten by the Fourier transform. The dis- diffractions. The angular spectrum method is expressed by:
cretized Fourier form of Fresnel diffraction is expressed by:
ZZ +∞
exp(i 2π
λ z) π u(x, y) = A( f x , fy , 0)HA( f x , fy )
u(m2 , n2 ) = exp(i ((m2 ∆x2 )2 + (n2 ∆y2 )2 )) −∞ (15)
iλz λz (9)
exp(i 2π( f x x + fy y))d f x d fy ,
FFT u′ (m1 , n1 )
where, f x and fy are spatial frequencies, A( f x , fy , 0) is defined
Note that the sampling spacing on the destination plane is by A( f x , fy , 0) = F [u(x1 , y1 )], and HA ( f x , fy ) is the transfer
scaled to ∆x2 = ∆x1 /(λz) and ∆y2 = ∆y1 /(λz). function,
q
2.1.3. Shifted Fresnel diffraction HA ( f x , fy ) = exp(iz k2 − 4π2 ( f x2 + fy2 )) (16)
Shifted-Fresnel diffraction [52] enables arbitrary sampling
pitches to be set on the source and destination planes as well where, k = 2π/λ is the wave-number.
as a shift away from the propagation axis, which is referred as The discretizing frequencies are ( f x , fy ) = (m1 ∆ f x , n1 ∆ fy ),
to off-axis propagation. The equation is derived from a com- where ∆ f x and ∆ fy are the sampling pitches on the frequency
bination of Fourier form Fresnel diffraction and scaled Fourier domain. Therefore, the discretized angular spectrum method is
transform [53]. The same methods were proposed in somewhat expressed by:
different areas [54, 55]. The discretized shifted Fresnel diffrac-
tion is expressed by the following equations: u(m, n) = FFT −1 FFT u(m, n) HA (m1 , n1 ) . (17)
u2 [m2 , n2 ] = CS FFT −1 FFT u′1 [m1 , n1 ] FFT hS [m1 , n1 ] 2.1.5. Shifted angular spectrum method
The angular spectrum method calculates the exact solution
(10)
in scalar light propagation because it is derived from the Helmholtz
equation without using any approximation, but only calculates
light propagation when close to a source plane due to the alias-
exp(ikz) π ing problem. In addition, the angular spectrum method does not
CS = exp(i (x21 + y21 )) calculate off-axis propagation.
iλz λz
2π The shifted angular spectrum method [56] method enables
exp(−i (O x0 p x0 x1 + Oy0 py0 y1 )) exp(−iπ(S x m21 + S y n21 )) off-axis propagation by applying a band-limited function to Eq.
λz
(11) (16). In addition, although the angular spectrum method, as
mentioned, triggers an aliasing error when calculating a long
propagation distance [57], the shifted angular spectrum method
π 2
u′1 [m1 , n1 ] = u1 [m1 , n1 ] exp(i
(x + y20 )) overcomes the aliasing problem, making it an excellent means
λz 0 of performing diffraction calculations. The discretized shifted
exp(−i2π(m0S x O x1 + n0 S y Oy1 )) (12)
angular spectrum method is expressed by:
exp(−iπ(S x m20 + S y n20 ))
u(m2 , n2 ) = FFT −1 FFT u(m1 , n1 ) HS A (m1 , n1 )
m1 − c x n 1 − cy (18)
h[m, n] = exp(iπ(S x m2 + S y n2 )) (13) Rect( )Rect( )
wx wy
where, (O x0 , Oy0 ) and (O x1 , Oy1 ) are the shift distances away
from the propagation axis and S x , S y , x0 , y0 , x1 , y1 are defined where, HS A is the shifted transfer function of the same,
as follows:
HS A (m1 , n1 ) = HA (m1 , n1 ) exp(2π(O xm1 ∆ f x + Oy n1 ∆ fy ))
p x0 p x1 py py
Sx = , Sy = 0 1 , (19)
λz λz
x 0 = m0 p x 0 + O x 0 , y 0 = n 0 p y 0 + Oy 0 , (14)
Two rectangle functions are band-limit functions with hori-
x 1 = m1 p x 1 + O x 1 , y 1 = n 1 p y 1 + Oy 1 . zontal and vertical band-widths of w x , wy and shift amounts of
c x , cy . See Ref. [56] for the determination of these parameters.
For more details, see Ref. [52].
4
2.1.6. Summary of diffraction calculation where, the operators max{·} and min{·} take the maximum and
As mentioned, many numerical diffraction calculations have minimum values in the argument. Finally, we save the intensity
been proposed to date, a classification of which is shown in Ta- field with 256 steps as a bitmap file “lena512x512 diffract.bmp”.
ble 2. Each diffraction must be used in terms of the number of Of course, we can also save the intensity field in other image
FFTs (namely, which is proportional to the calculation time), formats. Figure 2 (b) shows the diffracted image.
required memory, propagation distance, sampling pitches and Note that the sample code does not explicitly indicate the
on- or off-axis propagation. For example, if we calculate the wavelength and sampling pitches on the source and destina-
diffraction calculation with different sampling pitches on source tion planes. The default wavelength and sampling rates are 633
and destination planes, we must use Shifted Fresnel diffraction. nm and 10µm × 10µm. If we change the wavelength and sam-
Note that, in the diffraction calculations of the convolution pling pitch, we can use the CWO member functions “SetWave-
form, the area of the source and destination planes must be ex- Length” and “SetPitch”.
panded from N x × Ny to 2N x × 2Ny during the calculation, be-
cause we avoid aliasing by circular convolution. After the cal-
culation, we extract the exact diffracted area on the destination
plane with the size of N x × Ny . Therefore, we need FFTs and
memories of size 2N x × 2Ny during the calculation.
Sampling Sampling
pitch on pitch on Number
Propagation source destination Off-axis of Required
Diffraction distance plane plane calculation FFTs memory
Fresnel
diffraction
(Convolution form) Fresnel ∆x × ∆y ∆x × ∆y N.A. 3 2N × 2N
Fresnel
diffraction
∆x ∆y
(Fourier form) Fresnel ∆x × ∆y λz × λz N.A. 1 N×N
Shifted
Fresnel
diffraction Fresnel Arbitrary Arbitrary Available 3 2N × 2N
Angular
spectrum
method Short distance ∆x × ∆y ∆x × ∆y N.A. 2 2N × 2N
Shifted
angular
spectrum method All ∆x × ∆y ∆x × ∆y Available 2 2N × 2N
for the 3D diffraction field. In line 4, we set horizontal, verti- Listing 2: 3D diffraction calculation based on the stack of 2D diffracted planes.
cal and depth-direction sampling pitches, respectively. In line 1 CWO c1,c2;
5, the 3D diffraction field is calculated by the member func- 2 c1.Load("hologram.bmp");
tion “Diffract3D”. The first argument is set to the instance of 3 c2.Create(512, 512, 512);
the CWO class maintaining the hologram. The second argu- 4 c2.SetPitch(10e−6, 10e−6, 0.01);
ment is the distance z as shown in Fig. 3 between the hologram 5 c2.Diffract3D(a1, −0.1, CWO ANGULAR);
and 3D diffracted field. The third argument concerns the type 6 c2.Save("3d.cwo");
of diffraction calculation. In line 6, we save the calculated 3D
diffraction field as a cwo file, which includes the 3D diffraction
field in complex amplitude in binary form. Figure 4 shows the
volume rendering from the cwo file. In the left figure, we can
see the two circles reconstructed head-on in the volume. In the
right figure, we can see a different view of the reconstructed
two circles.
NVIDIA Geforce GTX 460M GeForce GTX295 (1 chip) GeForce GTX 580
CUDA processors 192 240 512
Memory amout (GBytes) 1.5 0.896 1.53
Core clock(GHz) 1.35 1.24 1.54
Memory clock (GHz) 1.25 1 2
Memory band width (GByte /sec) 60 223.8 192.4
The host computer controls the GPU board and the commu- itly execute the following steps, which are hidden to CWO++
nication between the host computer and the GPU board via the library users:
PCI-express bus. The host computer can also directly access
the device memory on the GPU board, which is used for stor- 1. Allocating the required memories for calculation on the
ing input data, namely the location of the source plane or 3D device memory.
object, and the destination plane as computed by the GPU. The 2. Sending the input data (source plane or 3D object data)
multiprocessor has a shared memory, which is limited, but low to the allocated device memory.
latency and faster than the device memory. In the classes, these 3. Executing kernel functions. The result (complex ampli-
memories are used for fast calculation. tude field or CGH on the destination plane) is stored in
The CUDA compiler compiles a C-like language source the allocated device memory.
code for the instruction set of the GPU chip, which is referred 4. Receiving the result from the allocated device memory.
to as a “Kernel”. We download this “Kernel” to the GPU chip 5. Releasing the allocated device memories.
via the PCI-express bus. The kernel codes in the CWO++ li-
brary are collected in the form of a library and DLL files on 3.1. Fresnel diffraction and CGH calculations on a GPU using
Windows OS, named “gwo lib.lib” and “gwo lib.dll”. When the GWO and gwoPLS classes
we use the GWO or gwoPLS classes, we need to link these files We show the source-code of a Fresnel diffraction calcula-
to our program. See more details in Appendix A. tion on a GPU using the GWO class. This example is the same
The diffraction calculations, as mentioned, require some as Section 2.2 except using GPU, but somewhat different in
FFT operations. The CUDA compiler allows us to accelerate comparison to List 1.
the FFT algorithm on an NVIDIA GPU chip, which is named
Listing 4: Fresnel diffraction calculation on a GPU using class GWO.
CUFFT. It is similar to the FFTW library [58], and we use
CUFFT for the GWO and gwoPLS classes. 1 CWO c;
When the GWO and gwoPLS classes are used, they implic- 2 GWO g;
3 c.Load("lena512x512.bmp");
8
8 c.Load("tyranno_000.3df");
9 g.ScalePoint(p∗1000);
10 g.Send(c);
11 g.PLS(CWO PLS FRESNEL CGH);
12 g.Scale(255);
13 g.Recv(c);
14 c.Save("cgh.bmp");
9
Figure 8: Implementations of Fesnel diffraction in CWO and GWO.
11
Table 4: Calculation times of each diffraction calculation on the CPU and GPUs with the re-calculation of the impulse and transfer functions.
Table 5: Calculation times of each diffraction calculation on the CPU and GPUs with the once-calculation of the impulse and transfer functions.
12
Figure 10: Resluts of mutual conversions between each field. (a) original image (b) real part of the diffracted light (c) imaginary part of the diffracted light (d)
amplitude of the diffracted light (e) phase of the diffracted light and (f) back propagation from the complex amplitude of (d) and (e).
13
In lines 15 and 16, we recalculate a new kinoform from the
new complex amplitude generated by line 13. Repeating the
above processes, the GS algorithms gradually improve the qual-
ity of the reconstructed images. In lines 19 to 23, we calculate
a final reconstructed image from the kinoform.
Listing 8: GS algorithm on CPU.
1 CWO a1,a2;
2 a1.Load("lena2048x2048.bmp");
3 a1.Sqrt();
4 a2=a1;
5 a2.SetRandPhase();
6 a2.Diffract(0.1,CWO ANGULAR);
Figure 11: (a) Kinoform and (b) reconstructed image from the kinoform.
7 a2.Phase();
8 for(int i=0;i<ite num;i++){
it is possible to obtain a complete reconstructed image from a 9 a2.Complex();
complex amplitude field, unfortunately, we lack an appropri- 10 a2.Diffract(−0.1,CWO ANGULAR);
ate electric device to display the amplitude and phase of the 11 a2.Phase();
complex amplitude field simultaneously. Therefore, we need to 12
select either the amplitude or the phase components of the com- 13 a2.Complex(a1,a2);
plex amplitude field, which will cause the reconstructed image 14
14
Figure 12: GS algorithm in Fresnel region in order to improve the deterioration of a reconstructed image.
15
Table 7: Calculation times of the GS algorithm on the CPU and GPUs.
Figure 13: the reconstructed images when the resolution of the original image is 2, 048 × 2, 048 pixels and the numbers of iteration are 5, 20, and 40 respectively.
[18] J. R. Fienup, “ Phase retrieval algorithms: a comparison, ” Appl. Opt. 21, [27] M. Makowski, M. Sypek, I. Ducin, A. Fajst, A. Siemion, J. Suszek, and A.
2758–2769 (1982). Kolodziejczyk, “Experimental evaluation of a full-color compact lensless
[19] R. G. Dorsch, A. W. Lohmann, and S. Sinzinger, “Fresnel ping-pong algo- holographic display, ” Opt. Express 17, 20840–20846 (2009).
rithm for two-plane computer-generated hologram display, ” Appl. Opt. [28] T. Shimobaba, T. Takahashi, N. Masuda, and T. Ito, “Numerical study of
33, 869–875 (1994). color holographic projection using space-division method,” Opt. Express
[20] G. Yang, B. Dong, B. Gu, J. Zhuang, and O. K. Ersoy, “Gerchberg-Saxton 19, 10287-10292 (2011) .
and Yang-Gu algorithms for phase retrieval in a nonunitary transform sys- [29] T. Shimobaba, A. Gotchev, N. Masuda and T. Ito, “Proposal of zoomable
tem: a comparison, ” Appl. Opt. 33, 209–218 (1994). holographic projection method without zoom lens,” IDW’11 (The 18th
[21] G. Pedrini, W. Osten, and Y. Zhang, “Wave-front reconstruction from a international Display Workshop) (to be appeared in Dec. 2011).
sequence of interferograms recorded at different planes, ” Opt. Lett. 30, [30] O. Matoba and B. Javidi, “Encrypted optical memory system using three-
833–835 (2005). dimensional keys in the Fresnel domain, ” Opt. Lett. 24, 762–764 (1999).
[22] D. Zheng, Y. Zhang, J. Shen, C. Zhang and G. Pedrini, “ Wave field recon- [31] E. Tajahuerce and B. Javidi, “Encrypting three-dimensional information
struction from a hologram sequence, ”Opt. Communications 249 73–77 with digital holography, ” Appl. Opt. 39, 6595–6601 (2000).
(2005). [32] B. Javidi and Takanori Nomura, “Securing information by use of digital
[23] A. Grjasnow, A. Wuttig and R. Riesenberg, “ Phase resolving microscopy holography, ” Opt. Lett. 25, 28–30 (2000).
by multi-plane diffraction detection, ” J. Microscopy 231, 115–123 [33] H. Hamam, “Digital holography-based steganography, ” Opt. Lett. 35,
(2008). 4175–4177 (2010).
[24] E. Buckley, “Holographic Laser Projection, ” J. Display Technol. 99, 1–6 [34] R. Piestunand and J. Shamir, “Synthesis of three-dimensional light fields
(2010). and applications,” Proc. IEEE 90, 222–244 (2002).
[25] E. Buckley, “Holographic projector using one lens, ” Opt. Lett. 35, 3399– [35] T. P. Kurzweg, S. P. Levitan, P. J. Marchand, J. A. Martinez, K. R.
3401 (2010). Prough, D. M. Chiarulli, “A CAD Tool for Optical MEMS, ” Proc.36th
[26] M. Makowski, M. Sypek, and A. Kolodziejczyk, “Colorful reconstruc- ACM/IEEE conf. on Design automation, 879–884 (1999).
tions from a thin multi-plane phase hologram, ” Opt. Express 16, 11618– [36] T. P. Kurzweg, S. P. Levitan, J. A. Martinez, M. Kahrs, D. M. Chiarulli,
11623 (2008). “An Efficient Optical Propagation Technique for Optical MEM Simula-
16
tion, ” Fifth International Conference on Modeling and Simulation of Mi- [61] M. Lucente, “Interactive Computation of holograms using a Look-up Ta-
crosystems (MSM2002), 352–355 (2002). ble,” J. Electron. Imaging 2, 28–34 (1993).
[37] T. Ito, T. Yabe, M. Okazaki and M. Yanagi, “Special-purpose computer [62] M. Lucente and T. A. Galyean, “Rendering Interactive Holographic Im-
HORN-1 for reconstruction of virtual image in three dimensions,” Com- ages,” Proc. of SIGGRAPH 95 387–394 (1995).
put.Phys.Commun. 82, 104–110 (1994). [63] N. Masuda, T. Ito, T. Tanaka, A. Shiraki and T. Sugie, “Computer gen-
[38] T. Ito, H. Eldeib, K. Yoshida, S. Takahashi, T. Yabe and T. erated holography using a graphics processing unit,” Opt. Express 14,
Kunugi, “Special-Purpose Computer for Holography HORN-2,” Com- 587–592 (2006).
put.Phys.Commun. 93, 13–20 (1996). [64] L. Ahrenberg, P. Benzie, M. Magnor, J. Watson, “Computer generated
[39] T.Shimobaba, N.Masuda, T.Sugie, S.Hosono, S.Tsukui and T.Ito, holography using parallel commodity graphics hardware,” Opt. Express
“Special-Purpose Computer for Holography HORN-3 with PLD technol- 14, 7636–7641 (2006).
ogy,” Comput. Phys. commun. 130, pp. 75–82, (2000). [65] H. Kang, F. Yaras, and L. Onural, “Graphics processing unit accelerated
[40] T. Shimobaba, S. Hishinuma and T.Ito, “Special-Purpose Computer for computation of digital holograms,” Appl. Opt. 48, H137–H143 (2009).
Holography HORN-4 with recurrence algorithm,” Comput. Phys. Com- [66] Y. Pan, X. Xu, S. Solanki, X. Liang, R. Bin A. Tanjung, C. Tan, and T. C.
mun. 148, 160–170 (2002). Chong, “Fast CGH computation using S-LUT on GPU,” Opt. Express 17,
[41] T. Ito, N. Masuda, K. Yoshimura, A. Shiraki, T. Shimobaba and T. Sugie, 18543–18555 (2009).
“A special-purpose computer HORN-5 for a real-time electroholography,” [67] L. Ahrenberg, A. J. Page, B. M. Hennelly, J. B. McDonald, and T. J.
Opt. Express 13 1923-1932 (2005). Naughton, “Using Commodity Graphics Hardware for Real-Time Digital
[42] Y. Ichihashi, H. Nakayama, T. Ito, N. Masuda, T. Shimobaba, A. Shiraki Hologram View-Reconstruction,” J. Display Technol. 5, 111–119 (2009).
and T. Sugie, “HORN-6 special-purpose clustered computing system for [68] D. Carl, M. Fratz, M. Pfeifer, D. M. Giel, and H. Hofler, “Multiwave-
electroholography,” Opt. Express 17, 13895–13903 (2009). length digital holography with autocalibration of phase shifts and artificial
[43] Y. Abe, N. Masuda, H. Wakabayashi, Y. Kazo, T. Ito, S. Satake, T. Kunugi wavelengths,” Appl. Opt. 48, H1–H8 (2009).
and K. Sato, “Special purpose computer system for flow visualization [69] N. Pandey, D. P. Kelly, T. J. Naughton and B. M. Hennellyr, “Speed up of
using holography technology,” Opt. Express 16, 7686–7692 (2008). Fresnel transforms for digital holography using pre-computed chirp and
[44] T. Shimobaba, T. Ito, N. Masuda, Y. Abe, Y. Ichihashi, H. Nakayama, GPU processing,” Proc. SPIE 7442, 744205 (2009).
N. Takada, A.Shiraki and T. Sugie, “Numerical calculation library for [70] C. Trujillo, John F. Restrepo and J. Garcia-Sucerquia, “Real time nu-
diffraction integrals using the graphic processing unit: the GPU-based merical reconstruction of digitally recorded holograms in digital in-line
wave optics library,” Journal of Optics A: Pure and Applied Optics, 10, holographic microscopy by using a graphics processing unit,” Photonics
075308, 5pp, (2008). Letters of Poland 2, 177–179 (2010).
[45] T.Shimobaba, Y.Sato, J.Miura, M.Takenouchi, and T.Ito, “Real-time dig- [71] T. Shimobaba, T. Ito, N. Masuda, Y. Ichihashi, and N. Takada, “Fast cal-
ital holographic microscopy using the graphic processing unit,” Opt. Ex- culation of computer-generated-hologram on AMD HD5000 series GPU
press 16, 11776-11781 (2008) and OpenCL,” Opt. Express 18, 9955–9960 (2010).
[46] T.Shimobaba, J.Miura and T.Ito, “A computer aided design tool for de- [72] T. Nishitsuji, T. Shimobaba, T. Sakurai, N. Takada, N. Masuda, and T. Ito,
veloping an electroholographic display,” Journal of Optics A: Pure and “Fast calculation of Fresnel diffraction calculation using AMD GPU and
Applied Optics, 11, 085408 (5pp) (2009) OpenCL,” in Digital Holography and Three-Dimensional Imaging, OSA
[47] T. Shimobaba, N. Masuda and T. Ito, “Simple and fast calclulation algo- Techinal Digest (CD) (Optical Society of America, 2011), paper DWC20.
rithm for computer-generated hologram with wavefront recording plane,” [73] G. Marsaglia, “Xorshift RNGs,” Journal of Statistical Software 8, 1–6
Opt. Lett. 34, 3133–3135 (2009). (2003).
[48] T. Shimobaba, H. Nakayama, N. Masuda and T. Ito, “Rapid calcula- [74] CImg homepage, http://cimg.sourceforge.net/
tion of Fresnel computer-generated-hologram using look-up table and [75] ImageMagik homepage, http://www.imagemagick.org/script/index.php
wavefront-recording plane methods for three-dimensional display,” Op-
tics Express, 18, 19, 19504-19509 (2010).
[49] T. Shimobaba, N. Masuda, Y. Ichihashi and T. Ito, “Real-time digital holo- Appendix A. System requirements and installation
graphic microscopy observable in multi-view and multi-resolution,” Jour-
nal of Optics, 12, 065402 (4pp) (2010) System requirements for the CWO++ library are as follows:
[50] H. T. Dai, X. W. Sun, D. Luo, and Y. J. Liu, “Airy beams generated by
a binary phase element made of polymer-dispersed liquid crystals,” Opt. 1. OS : for Windows XP(32/ 64 bit), 7
Express 17, 19365-19370 (2009)
[51] D. Luoa, H.T . Dai , X. W. Sun, and H. V. Demira, “Electrically switch- 2. CUDA : CUDA 4.0 (32 bit version) (if the GWO class or
able finite energy Airy beams generated by a liquid crystal cell with pat- gwoPLS is used)
terned electrode,” Optics Communications, 283, 3846-3849 (2010).
[52] R. P. Muffoletto, J. M. Tyler, and J. E. Tohline, “Shifted Fresnel diffraction The installation of the CWO++ library involves the follow-
for computational holography,” Opt. Express 15, 5631–5640 (2007). ing steps:
[53] D. H. Bailey and P. N. Swarztrauber, “The Fractional Fourier Transform
and Applications,” SIAM Review 33, 389–404 (1991). 1. Create a project file of Visual C++.
[54] M. Leutenegger, R. Rao, R. A. Leitgeb, and T. Lasser, “Fast focus field 2. Ensure the following dll and library files are placed in
calculations,” Opt. Express 14, 11277–11291 (2006).
[55] J. F. Restrepo and J. Garcia-Sucerquia, “Magnified reconstruction of digi- your project directory:
tally recorded holograms by Fresnel Bluestein transform,” Appl. Opt. 49, (a) cwo.dll, cwo.lib, libfftw3f-3.dll (libfftw3f-3.dll can
6430–6435 (2010). be download from Ref. [58])
[56] K. Matsushima, “Shifted angular spectrum method for off-axis numerical
propagation,” Opt. Express 18, 18453–18463 (2010).
(b) gwo.dll, gwo.lib (if you use GPU version of the
[57] K. Matsushima and T. Shimobaba, “Band-limited angular spectrum CWO++ library)
method for numerical simulation of free-space propagation in far and near 3. Set library files (*.lib) to your VISUAL C++ project.
fields,” Opt. Express 17, 19662–19673 (2009).
[58] FFTW Home Page, http://www.fftw.org/.
4. Set the following C++ and header files to your project:
[59] J. Lin, X.-C. Yuan, S. S. Kou, C. J. R. Sheppard, O. G. Rodriguez-Herrera (a) cwo.h, cwo.cpp, cwo lib.h
and J. C. Dainty, “Direct calculation of a three-dimensional diffracted (b) gwo.h, gwo.cpp, gwo lib.h (if you use the GPU ver-
field,” Opt. Lett. 36, 1341–1343 (2011).
[60] L. Ahrenberg, P. Benzie, M. Magnor and J. Watson, “Computer generated
sion of the CWO library)
holograms from three dimensional meshes using an analytic light trans-
port model,” Appl. Opt. 47, 1567–1574 (2008).
17
Appendix B. Image formats
18