Skip to main content

qualia_core_db/tensor/
payload.rs

1//! Spectral-Logical Payload [α, μ, σ] implementation
2
3use serde::{Deserialize, Serialize};
4
5/// Spectral-Logical payload [α, μ, σ]
6#[repr(C)]
7#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
8pub struct SpectralPayload {
9    /// Amplitude / Dynamic Range / Confidence Weight
10    pub alpha: f32,
11    /// Modulation / Phase / Metadata Carrier
12    pub mu: f32,
13    /// Spectral Signature / Logical Class Index
14    pub sigma: f32,
15}
16
17impl Default for SpectralPayload {
18    fn default() -> Self {
19        Self {
20            alpha: 1.0, // Full confidence by default
21            mu: 0.0,
22            sigma: 0.0,
23        }
24    }
25}
26
27impl SpectralPayload {
28    pub fn new(alpha: f32, mu: f32, sigma: f32) -> Self {
29        Self { alpha, mu, sigma }
30    }
31}