AngularSpectrumMethod.jl
No description available
Install / Use
/learn @syoshida1983/AngularSpectrumMethod.jlREADME
AngularSpectrumMethod
This package provides the functions for diffraction calculations based on the angular spectrum method (ASM).
In addition to the standard diffraction calculation with ASM, various diffraction calculations with band-limited, scalable, scaled, shifted, and tilted ASM are available.
In-place versions of each function are also provided. When using the in-place version functions, append an ! to the end of each function name.
Installation
To install this package, open the Julia REPL and run
julia> ]add AngularSpectrumMethod
or
julia> using Pkg
julia> Pkg.add("AngularSpectrumMethod")
Usage
Import the package first.
julia> using AngularSpectrumMethod
ASM
The function ASM returns the diffracted field by the angular spectrum method (ASM).
Evanescent waves are not eliminated but attenuated as $\exp(-2{\pi}wz)$.
Without attenuation, the total energy $\iint|u|\mathrm{d}x\mathrm{d}y$ is conserved.
julia> v = ASM(u, λ, Δx, Δy, z; expand=true)
Arguments
u: input field.λ: wavelength.Δx: sampling interval in the x-axis.Δy: sampling interval in the y-axis.z: diffraction distance.expand=true: if true (default), perform 4× expansion and zero padding for aliasing suppression.
<p align="center"> <img src="https://github.com/syoshida1983/AngularSpectrumMethod.jl/blob/images/rect.jpg" width="250px">    <img src="https://github.com/syoshida1983/AngularSpectrumMethod.jl/blob/images/ASM50mm.jpg" width="250px"> <br>     input field             diffracted field by ASM </p>[!NOTE] The x-axis is the horizontal direction, and the y-axis is the vertical.
Band-limited ASM
The function BandLimitedASM returns a diffracted field by the band-limited ASM (see Ref. 1).
julia> v = BandLimitedASM(u, λ, Δx, Δy, z; expand=true)
<p align="center"> <img src="https://github.com/syoshida1983/AngularSpectrumMethod.jl/blob/images/ASM5m.jpg" width="250px">    <img src="https://github.com/syoshida1983/AngularSpectrumMethod.jl/blob/images/BandLimitedASM.jpg" width="250px"> <br> ASM with a long propagation distance       Band-limited ASM       </p>
Scalable ASM
The function ScalableASM returns automatically scaled diffraction field by the scalable ASM (see Ref. 2).
The sampling pitch in the destination plane $\Delta_{d}$ is $\Delta_{d}=\dfrac{\lambda z}{pN\Delta_{s}}$,
where $\Delta_{s}$ is the sampling pitch in the source plane, $N$ is the number of pixels in the source or destination plane, and $p=2$ is the padding factor.
julia> v = ScalableASM(u, λ, Δx, Δy, z; expand=true)
<p align="center"> <img src="https://github.com/syoshida1983/AngularSpectrumMethod.jl/blob/images/rect.jpg" width="250px">    <img src="https://github.com/syoshida1983/AngularSpectrumMethod.jl/blob/images/ScalableASM.jpg" width="250px"> <br>       input field          diffracted field by Scalable ASM </p>
Scaled ASM
The function ScaledASM returns a scaled diffraction field according to the scale factor $R$ by the scaled ASM (see Ref. 3).
julia> v = ScaledASM(u, λ, Δx, Δy, z, R; expand=true)
<p align="center"> <img src="https://github.com/syoshida1983/AngularSpectrumMethod.jl/blob/images/ScaledASMx2.jpg" width="250px">    <img src="https://github.com/syoshida1983/AngularSpectrumMethod.jl/blob/images/ScaledASMx0.5.jpg" width="250px"> <br> Scaled ASM with R = 2.0            R = 0.5     </p>
Shifted ASM
The function ShiftedASM returns a shifted diffraction field with the shift distance $x_{0}$ and $y_{0}$ by the shifted ASM (see Ref. 4).
julia> v = ShiftedASM(u, λ, Δx, Δy, z, x₀, y₀; expand=true)
<p align="center"> <img src="https://github.com/syoshida1983/AngularSpectrumMethod.jl/blob/images/ASM50mm.jpg" width="250px">    <img src="https://github.com/syoshida1983/AngularSpectrumMethod.jl/blob/images/ShiftedASM.jpg" width="250px"> <br>        ASM            Shifted ASM with x direction shift </p>
Tilted ASM
The function TiltedASM returns a tilted diffraction field for a rotation matrix $T$ by the tilted ASM (see Ref. 5, 6).
If weight=true, a diagonal weighting matrix is used as the Jacobian determinant (default false).
In this case, the energy conservation improves, but the computational cost is high (see Ref. 7).
julia> v = TiltedASM(u, λ, Δx, Δy, T; expand=true, weight=false)
- Kyoji Matsushima, Hagen Schimmel, and Frank Wyrowski, "Fast calculation method for optical diffraction on tilted planes by use of the angular spectrum of plane waves," J. Opt. Soc. Am. A 20, 1755-1762 (2003)
- Kyoji Matsushima, "Formulation of the rotational transformation of wave fields and their application to digital holography," Appl. Opt. 47, D110-D116 (2008)
- James G. Pipe and Padmanabhan Menon, "Sampling density compensation in MRI: Rationale and an iterative numerical solution," Magn. Reson. Med. 41, 179-186 (1999)
<p align="center"> <img src="https://github.com/syoshida1983/AngularSpectrumMethod.jl/blob/images/rect.jpg" width="250px">    <img src="https://github.com/syoshida1983/AngularSpectrumMethod.jl/blob/images/TiltedASM.jpg" width="250px"> <br>         input field        Tilted ASM with rotation around the x-axis </p>[!NOTE] Rotations.jl is helpful in generating rotation matrices.
