SkillAgentSearch skills...

AngularSpectrumMethod.jl

No description available

Install / Use

/learn @syoshida1983/AngularSpectrumMethod.jl
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

AngularSpectrumMethod

Stable Dev Build Status

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.

[!NOTE] The x-axis is the horizontal direction, and the y-axis is the vertical.

<p align="center"> <img src="https://github.com/syoshida1983/AngularSpectrumMethod.jl/blob/images/rect.jpg" width="250px"> &emsp;&emsp; <img src="https://github.com/syoshida1983/AngularSpectrumMethod.jl/blob/images/ASM50mm.jpg" width="250px"> <br> &emsp;&emsp;&emsp; input field &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; diffracted field by ASM </p>

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)
  1. Kyoji Matsushima and Tomoyoshi Shimobaba, "Band-Limited Angular Spectrum Method for Numerical Simulation of Free-Space Propagation in Far and Near Fields," Opt. Express 17, 19662-19673 (2009)
<p align="center"> <img src="https://github.com/syoshida1983/AngularSpectrumMethod.jl/blob/images/ASM5m.jpg" width="250px"> &emsp;&emsp; <img src="https://github.com/syoshida1983/AngularSpectrumMethod.jl/blob/images/BandLimitedASM.jpg" width="250px"> <br> ASM with a long propagation distance &emsp;&emsp;&emsp;&emsp;&emsp; Band-limited ASM &emsp;&emsp;&emsp;&emsp;&emsp; </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)
  1. Rainer Heintzmann, Lars Loetgering, and Felix Wechsler, "Scalable angular spectrum propagation," Optica 10, 1407-1416 (2023)
<p align="center"> <img src="https://github.com/syoshida1983/AngularSpectrumMethod.jl/blob/images/rect.jpg" width="250px"> &emsp;&emsp; <img src="https://github.com/syoshida1983/AngularSpectrumMethod.jl/blob/images/ScalableASM.jpg" width="250px"> <br> &emsp;&emsp;&emsp;&emsp;&emsp; input field &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 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)
  1. Tomoyoshi Shimobaba, Kyoji Matsushima, Takashi Kakue, Nobuyuki Masuda, and Tomoyoshi Ito, "Scaled angular spectrum method," Opt. Lett. 37, 4128-4130 (2012)
<p align="center"> <img src="https://github.com/syoshida1983/AngularSpectrumMethod.jl/blob/images/ScaledASMx2.jpg" width="250px"> &emsp;&emsp; <img src="https://github.com/syoshida1983/AngularSpectrumMethod.jl/blob/images/ScaledASMx0.5.jpg" width="250px"> <br> Scaled ASM with R = 2.0 &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; R = 0.5 &emsp;&emsp;&emsp; </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)
  1. Kyoji Matsushima, "Shifted angular spectrum method for off-axis numerical propagation," Opt. Express 18, 18453-18463 (2010)
<p align="center"> <img src="https://github.com/syoshida1983/AngularSpectrumMethod.jl/blob/images/ASM50mm.jpg" width="250px"> &emsp;&emsp; <img src="https://github.com/syoshida1983/AngularSpectrumMethod.jl/blob/images/ShiftedASM.jpg" width="250px"> <br> &emsp;&emsp;&emsp;&emsp;&emsp;&emsp; ASM &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 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)
  1. 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)
  2. Kyoji Matsushima, "Formulation of the rotational transformation of wave fields and their application to digital holography," Appl. Opt. 47, D110-D116 (2008)
  3. 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.

<p align="center"> <img src="https://github.com/syoshida1983/AngularSpectrumMethod.jl/blob/images/rect.jpg" width="250px"> &emsp;&emsp; <img src="https://github.com/syoshida1983/AngularSpectrumMethod.jl/blob/images/TiltedASM.jpg" width="250px"> <br> &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; input field &emsp;&emsp;&emsp;&emsp;&emsp;&emsp; Tilted ASM with rotation around the x-axis </p>
View on GitHub
GitHub Stars7
CategoryProduct
Updated3mo ago
Forks1

Languages

Julia

Security Score

77/100

Audited on Dec 22, 2025

No findings