Skip to main content

emf_to_spd

Function emf_to_spd 

Source
pub fn emf_to_spd(alpha: f32, mu: f32, sigma: f32) -> Spd
Expand description

Convert an EMF payload [α, μ, σ] to a Spectral Power Distribution.

The mapping is:

  • σ (signature): selects the peak wavelength via λ = 400 + σ·300 nm (σ=0 → 400 nm blue, σ=0.5 → 550 nm green, σ=1 → 700 nm red)
  • α (amplitude): scales the total radiant power
  • μ (modulation): controls the spectral bandwidth (μ=0 → narrow/monochromatic, μ=1 → broad/white)

The SPD is a Gaussian peak centred at λ with width proportional to μ, scaled by α. When μ is large, the peak broadens toward a flat spectrum.