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.
To install this package, open the Julia REPL and run
julia> ]add AngularSpectrumMethod
or
julia> using Pkg
julia> Pkg.add("AngularSpectrumMethod")
Import the package first.
julia> using AngularSpectrumMethod
The function ASM
returns the diffracted field by the angular spectrum method (ASM).
Evanescent waves are not eliminated but attenuated as
julia> v = ASM(u, λ, Δx, Δy, z; expand=true)
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.
Note
The x-axis is the horizontal direction, and the y-axis is the vertical.
input field
diffracted field by 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)
ASM with a long propagation distance
Band-limited ASM
The function ScalableASM
returns automatically scaled diffraction field by the scalable ASM (see Ref. 2).
The sampling pitch in the destination plane
julia> v = ScalableASM(u, λ, Δx, Δy, z; expand=true)
input field
diffracted field by Scalable ASM
The function ScaledASM
returns a scaled diffraction field according to the scale factor
julia> v = ScaledASM(u, λ, Δx, Δy, z, R; expand=true)
Scaled ASM with R = 2.0
R = 0.5
The function ShiftedASM
returns a shifted diffraction field with the shift distance
julia> v = ShiftedASM(u, λ, Δx, Δy, z, x₀, y₀; expand=true)
ASM
Shifted ASM with x direction shift
The function TiltedASM
returns a tilted diffraction field for a rotation matrix 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)
Note
Rotations.jl is helpful in generating rotation matrices.