pyfli.sp_analysis.simulator.measurement_sim#

Simulate patterned measurements with optional Gaussian and shot noise.

This module belongs to pyfli.sp_analysis.simulator and is part of PyFLI single- pixel camera basis generation, acquisition simulation, and reconstruction solvers. Public API includes classes MeasurementSimulator.

Classes

MeasurementSimulator([noise_level, shot_noise])

Simulate patterned single-pixel measurements from a scene and sensing basis.

class MeasurementSimulator(noise_level=0.0, shot_noise=False)[source]#

Bases: object

Simulate patterned single-pixel measurements from a scene and sensing basis. It can add Gaussian noise, shot noise, differential measurements, and simple SNR estimates.

Parameters:
  • noise_level (float) – Additive noise level used by the measurement simulator.

  • shot_noise (bool) – Whether to add Poisson shot noise to simulated measurements.

capture(scene, patterns)[source]#

Simulates the physical projection: y = A * x

Parameters:
Return type:

ndarray

process_differential(measurements)[source]#

Implements y_diff = y_pos - y_neg. Matches the stacked output of BasisPatterns.generate_hadamard(differential=True).

Parameters:

measurements (ndarray)

Return type:

Any

simulate_fourier_acquisition(scene, fourier_patterns)[source]#

For grayscale fringes, we simulate the ‘DC-centered’ signal. In the lab, you often measure the average brightness of the room first and subtract it.

Parameters:
Return type:

Any

static get_snr(clean_signal, noisy_signal)[source]#

Calculates SNR in decibels. Higher is better.

Parameters:
Return type:

Any