pub struct DecimationAccumulator { /* private fields */ }Expand description
The DSFB RF Structural Semiotics Engine.
§Type Parameters
W: window width (sign drift + DSA accumulator). Paper Stage III:W = 10.K: grammar persistence threshold. Paper default:K = 4.M: heuristics bank capacity. Paper default:M = 32.
§Memory Footprint (no_std, no_alloc)
All storage is stack-allocated. For W=10, K=4, M=8:
- SignWindow<10>: ~52 bytes
- GrammarEvaluator<4>: ~20 bytes
- DsaWindow<10>: ~212 bytes
- HeuristicsBank<8>: ~400 bytes
- PolicyEvaluator: ~8 bytes
- Total: ~700 bytes — suitable for Cortex-M4F stack Streaming residual-norm decimation accumulator.
Collects factor residual-norm samples and emits a single root-mean-square
value per epoch. This down-samples the semiotic pipeline to the physics
timescale of structural change (thermal, oscillator aging) decoupled from
the carrier sample rate.
§Rationale (paper §XIX-A — Semiotic Decimation)
At 1 GSPS, a 27 ns per-sample budget is budget-limited for the full Fisher-Rao and Lyapunov machinery. Structural changes that DSFB detects (PA drift, oscillator aging, mask approach) occur at timescales > 10 ms. A decimation factor of 10 000 at 1 GSPS yields 100 kHz structural monitoring — seven decades above the physics rate, with a 27 µs per-epoch budget (10 000× more comfortable). This is architecturally identical to how a spectrum analyzer operates: full-rate ADC, decimated FFT, symbol-rate detection.
§Instruction-Level Determinism
The accumulator is branchless (no dynamic dispatch, no heap, no loop beyond
the caller’s own loop). The inner hot path is exactly 6 arithmetic
operations per input sample regardless of factor. Only the push()
return Some(rms) branch fires once per factor samples — fully
predictable by branch predictors and cycle-count manifests
(paper §XIX-B, Phase II deliverable).
§Usage
use dsfb_rf::engine::DecimationAccumulator;
let mut d = DecimationAccumulator::new(1000);
for i in 0..999 { assert!(d.push(0.05).is_none()); }
let rms = d.push(0.05).unwrap(); // epoch complete
assert!((rms - 0.05).abs() < 1e-5);Implementations§
Source§impl DecimationAccumulator
impl DecimationAccumulator
Sourcepub const fn new(factor: u32) -> Self
pub const fn new(factor: u32) -> Self
Construct a new accumulator with the given decimation factor.
factor = 1 means every sample is emitted (no decimation).
factor = k means one RMS value is emitted per k input samples.
A factor of zero is treated as 1 (safety for const contexts).
Trait Implementations§
Source§impl Clone for DecimationAccumulator
impl Clone for DecimationAccumulator
Source§fn clone(&self) -> DecimationAccumulator
fn clone(&self) -> DecimationAccumulator
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more