Mathematical Utilities

Constants

nm
Type:

float

Value:

1e-9

Nanometer unit (1e-9 meters)

um
Type:

float

Value:

1e-6

Micrometer unit (1e-6 meters)

mm
Type:

float

Value:

1e-3

Millimeter unit (1e-3 meters)

cm
Type:

float

Value:

1e-2

Centimeter unit (1e-2 meters)

m
Type:

float

Value:

1

Meter unit (1 meter)

s
Type:

float

Value:

1

Second unit (1 second)

ms
Type:

float

Value:

1e-3

Millisecond unit (1e-3 seconds)

us
Type:

float

Value:

1e-6

Microsecond unit (1e-6 seconds)

ns
Type:

float

Value:

1e-9

Nanosecond unit (1e-9 seconds)

Functions

wrap_phase(phase_u[, stay_positive])

Wrap phase values to [-π, π] or [0, 2π] range.

fft(arr_c[, normalized, pad_width, padval, ...])

Compute 2D FFT of a complex tensor with optional padding and frequency shifting.

ifft(arr_c[, normalized, pad_width, shift])

Compute 2D inverse FFT of a complex tensor with optional padding and shifting.

calculate_psnr(img1, img2[, data_range])

Calculate Peak Signal-to-Noise Ratio between multi-channel tensors.

calculate_ssim(img1, img2[, window_size, ...])

Calculate Structural Similarity Index between multi-channel tensors.

gaussian_window(size, sigma)

Create normalized 2D Gaussian window.

sc_dft_1d(g, M, delta_x, delta_fx)

Compute 1D scaled DFT for optical field propagation.

sc_idft_1d(G, M, delta_fx, delta_x)

Compute 1D scaled inverse DFT for optical field reconstruction.

sc_dft_2d(u, Mx, My, delta_x, delta_y, ...)

Perform 2D scaled DFT using separable 1D transforms.

sc_idft_2d(U, Mx, My, delta_x, delta_y, ...)

Perform 2D scaled inverse DFT using separable 1D transforms.

compute_scasm_transfer_function(Mx, My, ...)

Compute transfer function for Scaled Angular Spectrum Method propagation.