Skip to main content
. 2024 Nov 17;24(22):7333. doi: 10.3390/s24227333
Algorithm 1 Frequency-Filtered Angular Measurement Algorithm
  • Input: 

    Reference image Iref, displaced image Idisp, Talbot distance DTalbot, number of pixels N.

  • Output: 

    Angular offset in the x-direction θx; Angular offset in the y-direction θy.

  • 1:

    Acquire the reference image Iref and the displaced image Idisp.

  • 2:

    Compute the horizontal and vertical sums of Iref to obtain Srow,ref and Scol,ref, respectively. Similarly, compute the horizontal and vertical sums of Idisp to obtain Srow,disp and Scol,disp.

  • 3:

    Perform Fourier transform on Srow,refScol,refSrow,disp, and Scol,disp to obtain their respective frequency domain representations FTrow,refFTcol,refFTrow,disp, and FTcol,disp.

  • 4:

    Calculate the frequency domain phase information by computing ϕx=angle(FTrow,disp/FTrow,ref) for the horizontal direction and ϕy=angle(FTcol,disp/FTcol,ref) for the vertical direction.

  • 5:

    Compute the frequency domain phase slopes kx=ϕx·FTrow,ref in the x-direction and ky=ϕy·FTcol,ref in the y-direction.

  • 6:
    Calculate the angular offsets θx and θy in the x-direction and y-direction, respectively, using the following formulas:
    θx=tan1kx·N2πDTalbot,θy=tan1ky·N2πDTalbot