CWO++library  0.32
 All Classes Functions Variables Groups
Macros
Diffraction
Convolution

Macros

#define CWO_ANGULAR   (0x01)
#define CWO_HUYGENS   (0x03)
#define CWO_FRESNEL_CONV   (0x04)
#define CWO_FRESNEL_FOURIER   (0x05)
#define CWO_FRESNEL_ANALYSIS   (0x06)
#define CWO_FRESNEL_DBL   (0x07)
#define CWO_FRAUNHOFER   (0x08)
#define CWO_SHIFTED_ANGULAR   (0x09)
#define CWO_SCALED_ANGULAR   (0x0a)
#define CWO_SCALED_FRESNEL   (0x0b)
#define CWO_FRESNEL_ARBITRARY_DIRECT   (0x0c)
#define CWO_FRESNEL_ARBITRARY   (0x0d)
#define CWO_FRESNEL_ARBITRARY2   (0x0e)
#define CWO_FRAUNHOFER_ARBITRARY   (0x0f)
#define CWO_LAPLACIAN_WAVE_RETV   (0x10)
#define CWO_NU_ANGULAR1   (0x11)
#define CWO_NU_ANGULAR2   (0x12)
#define CWO_NU_FRESNEL1   (0x13)
#define CWO_NU_FRESNEL2   (0x14)
#define CWO_ARSS_FRESNEL   (0x14)
#define CWO_DIRECT_SOMMER   (0x15)
#define CWO_FFT   (0x16)
#define CWO_IFFT   (0x17)
#define CWO_SCALED_FFT   (0x18)
#define CWO_SHIFTED_FRESNEL   (0x19)
#define CWO_SIMPLE_SASM   (0x20)

Detailed Description


Macro Definition Documentation

#define CWO_ANGULAR   (0x01)

When selecting CWO_ANGULAR, the CWO library calculates the angular spectrum method. The Angular spectrum method is expressed as:

\begin{eqnarray*} u(x,y) = \int \!\!\int_{-\infty}^{+\infty} & & A(f_x, f_y, 0) \exp(i z \sqrt{k^2 - 4 \pi^2 (f_x^2 + f_y^2)}) \\ & & \exp(i \ 2 \pi (f_x x + f_y y)) d f_x d f_y \end{eqnarray*}

The CWO library calculates this diffraction using the FFT algorithm,

\begin{eqnarray*} u(m_2,n_2) = FFT[ u(m_1, n_1) ] \exp(i z \sqrt{k^2 - 4 \pi^2 (f_x^2 + f_y^2)}) \end{eqnarray*}

Examples:
Amplitude CGH, Kinoform, simple_diffraction.cpp, and simple_diffraction_with_gpu.cpp.
#define CWO_HUYGENS   (0x03)

When selecting CWO_HUYGENS, the CWO library calculates the Huygens-Fresnel diffraction (convolution form).

#define CWO_FRESNEL_CONV   (0x04)

When selecting CWO_FRESNEL_CONV, the CWO library calculates the Fresnel diffraction (convolution form).

#define CWO_FRESNEL_FOURIER   (0x05)

When selecting CWO_FRESNEL_ANALYSYS, the CWO library calculates the Fresnel diffraction (fourier form).

#define CWO_FRESNEL_DBL   (0x07)

When selecting CWO_FRESNEL_DBL, the CWO library calculates the double-step Fresnel diffraction.

#define CWO_FRAUNHOFER   (0x08)

When selecting CWO_FRAUNHOFER, the CWO library calculates the Fraunhofer diffraction.

#define CWO_SHIFTED_ANGULAR   (0x09)

When selecting CWO_SHIFTFRESNEL, the CWO library calculates the Shfted-Fresnel diffraction.

#define CWO_ARSS_FRESNEL   (0x14)

When selecting CWO_ARSS_FRESNEL, the CWO library calculates the aliasing-reduced scaled and shifted Fresnel diffraction.

#define CWO_FFT   (0x16)

When selecting CWO_FFT, the function Diffract executes FFT operation.

#define CWO_IFFT   (0x17)

When selecting CWO_IFFT, the function Diffract executes inverse FFT operation.

#define CWO_SCALED_FFT   (0x18)

When selecting CWO_SCALED_FFT, the function Diffract executes scaled FFT operation.

#define CWO_SIMPLE_SASM   (0x20)

When selecting CWO_SHIFTED_FRESNEL, the CWO library calculates the Shfted-Fresnel diffraction.