Constants Use Cases Medical Parameters Coherence Equations Stack Substrate Any Language Module 12 Module 13 Module 14 Module 15 Provenance
← Back to Home

Technical documentation

Geometry constants, domain-specific use cases with working code, parameter reference, coherence interpretation, signal model equations, and provenance. For developers who want to understand the architecture, not just use it.

Quick start
pip install livingcircuit
from livingcircuit import (
  AdaptiveAmplitudeStabilizer,
  adaptive_amplitude_stabilizer,
  harmonic_vector_stabilizer,
  SimpleVoiceToneAnalyzer,
  stabilize_solar_output,
  ImpedanceNetworkSimulator,
  ImpedanceConfig,
  impedance_network_simulator,
)
Standalone modules (not in pip package yet): Phase Reflection Agent · Impedance Variance Vectors

Geometry constants

Five constants anchor the entire Living Circuit architecture. They aren't arbitrary — they express geometric relationships that produce stable, coherent behavior across signal, activation, latent, and output layers. Every module uses at least two of them.

φ
1.6180339887
All modules
Golden ratio. Used for phase spacing and harmonic relationships. When harmonics are spaced by φ they never perfectly align — this prevents resonance buildup and keeps energy distributed across the spectrum rather than concentrating at a single frequency. The complement (0.618034) drives movement scaling and tension curves. φ² (2.618034) adds a second harmonic layer in the Phase Reflection Agent and Harmonic Vector Stabilizer.
π
3.14159265...
Harmonic Resonance field Network sim
Pi. Sets the period of all sine and cosine wave functions. Used in wave layer calculations in the Pointer Resonance Field and as the period base in the Impedance Network Simulator's phase spacing calculations.
e
2.71828182...
Resonance field Network sim Harmonic
Euler's number. Governs the exponential envelope in harmonic decay functions. The natural base of exponential growth and decay makes e the correct constant for modeling realistic signal attenuation — energy loss in a physical system follows e^(-kt), not arbitrary polynomial decay.
θg
2.39996 rad
Harmonic Impedance vectors Reflection Resonance field Solar
Golden angle in radians (≈ 137.508°). Used for particle distribution in the Pointer Resonance Field, refraction rate in the Harmonic Vector Stabilizer, and as the modulation frequency in impedance calculations. When points are placed at golden angle intervals they fill space with maximum uniformity — no clustering, no gaps. This property makes it ideal for distributing signal energy across phase space.
α
0.00729735...
= 1 / 137.036
Scalar stabilizer Solar smoother Impedance base
Fine structure constant derivative (α ≈ 1/137.036 = 0.007297...). The fine structure constant is a dimensionless physical constant governing electromagnetic interactions. Used here as the impedance base and drag coefficient — it sets the fundamental resistance that makes displacement meaningful. Appears as K_DRAG = 0.007297 in the Solar Output Smoother and as the impedance seed in the scalar pipeline. Too little impedance and a system short-circuits; too much and it never resolves. This value sits naturally between those extremes.

Use cases by domain

These modules work on any signal. Here's exactly how to apply them in seven domains — which modules to use, how to stack them, and working code for each.

🤖
AI / Machine Learning
Transformer stabilization · embedding coherence · agent monitoring · long-chain reasoning
01 Amplitude Stabilizer 02 Harmonic Vector 07 Phase Reflection 08 Impedance Vectors

The most common failure mode in production AI systems isn't wrong answers — it's instability under load. When multiple users hit a model simultaneously, activation spikes propagate through transformer blocks and degrade output quality before anything visibly breaks. The Amplitude Stabilizer catches these spikes at the layer level before they compound.

For long reasoning chains, the Harmonic Vector Stabilizer conditions the latent representation before each block sees it. This keeps the internal state coherent across many steps — without it, extended reasoning tends to drift as early context gets diluted by new token influence.

The Phase Reflection Agent sits above all of this as a health monitor. Run it alongside inference and watch the coherence value. A sustained drop below 0.5 over multiple cycles means something upstream is drifting — catch it before it reaches the user.

import torch
import numpy as np
# Full code at modules.html#amp and modules.html#harmonic
from livingcircuit import AdaptiveAmplitudeStabilizer, harmonic_vector_stabilizer
from phase_reflection_agent_v3 import PhaseReflectionAgent

# Transformer block with full stabilization stack
class StabilizedTransformerBlock(torch.nn.Module):
    def __init__(self, dim, layer_idx=0):
        super().__init__()
        self.norm1 = torch.nn.LayerNorm(dim)
        self.norm2 = torch.nn.LayerNorm(dim)
        self.attn  = torch.nn.MultiheadAttention(dim, num_heads=8, batch_first=True)
        self.ffn   = torch.nn.Sequential(
            torch.nn.Linear(dim, dim * 4),
            torch.nn.GELU(),
            torch.nn.Linear(dim * 4, dim)
        )
        self.stab1 = AdaptiveAmplitudeStabilizer(dim, layer_idx=layer_idx)
        self.stab2 = AdaptiveAmplitudeStabilizer(dim, layer_idx=layer_idx)

    def forward(self, x):
        # Harmonic conditioning on input
        t = np.linspace(0, 4 * np.pi, x.shape[1])
        h = harmonic_vector_stabilizer(t)
        gain = float(h["quality_score"]) * 0.1  # subtle modulation

        attn_out, _ = self.attn(self.norm1(x), self.norm1(x), self.norm1(x))
        x = x + self.stab1(attn_out)

        ffn_out = self.ffn(self.norm2(x))
        x = x + self.stab2(ffn_out)
        return x

# Health monitoring during inference
monitor = PhaseReflectionAgent(name="inference-monitor")

def monitored_inference(model, input_ids, cycle):
    with torch.no_grad():
        output = model(input_ids)
    state = monitor.step(cycle)
    if state.stability < 0.35:
        print(f"Cycle {cycle}: stability low ({state.stability}) — check upstream")
    return output, state
🎵
Audio Processing
Live pipeline conditioning · harmonic analysis · envelope following · noise reduction
01 Amplitude Stabilizer 02 Harmonic Vector 04 Voice Tone Analyzer 05 Solar Smoother

Audio pipelines are especially vulnerable to amplitude spikes — a sudden loud input can clip, distort, or destabilize everything downstream. The scalar Amplitude Stabilizer handles this without hard clipping, which introduces harmonic distortion. Instead it scales proportionally, preserving the signal's character while keeping it within range.

The Harmonic Vector Stabilizer works well as a pre-processing step before feature extraction. Run your audio frame through it and the quality_score tells you how coherent the harmonic content is — useful for deciding whether a frame is worth processing or should be treated as noise.

The Solar Output Smoother doubles as an envelope follower — feed it the amplitude of each audio frame and it smooths the envelope with carried state, removing tick-to-tick noise while preserving the envelope shape.

import numpy as np
from livingcircuit import (adaptive_amplitude_stabilizer,
                            harmonic_vector_stabilizer,
                            SimpleVoiceToneAnalyzer,
                            stabilize_solar_output)

def process_audio_frame(frame: np.ndarray, set_pt: float, memory: float):
    """
    Full audio conditioning pipeline for a single frame.
    frame   : raw audio samples (float32 array)
    set_pt  : current amplitude set point (carry forward)
    memory  : smoother memory (carry forward)
    """
    # 1. Tone analysis — is this frame calm, neutral, or intense?
    analyzer   = SimpleVoiceToneAnalyzer()
    tone_info  = analyzer.analyze(frame)

    # 2. Amplitude stabilization — prevent spikes from clipping downstream
    rms = float(np.sqrt(np.mean(frame ** 2)))
    stabilized_rms, set_pt = adaptive_amplitude_stabilizer(
        signal=rms, set_point=set_pt,
        variance_limit=0.15, impedance=0.5,
        learn_rate=0.03
    )

    # 3. Harmonic coherence check — is this frame worth processing?
    t = np.linspace(0, 2 * np.pi, len(frame))
    h = harmonic_vector_stabilizer(t * tone_info["intensity"])
    coherence = h["quality_score"]

    # 4. Envelope smoothing with carried state
    smooth_rms, memory = stabilize_solar_output(
        current_val=stabilized_rms,
        previous_val=set_pt,
        dt=1.0 / 44100 * len(frame),
        memory=memory
    )

    return {
        "tone":      tone_info["tone"],
        "intensity": tone_info["intensity"],
        "coherence": coherence,
        "rms":       smooth_rms,
        "set_pt":    set_pt,
        "memory":    memory,
    }

# Usage in a streaming pipeline
set_pt = 0.1
memory = 0.0
for frame in audio_stream:
    result = process_audio_frame(frame, set_pt, memory)
    set_pt = result["set_pt"]
    memory = result["memory"]
    if result["coherence"] > 1.5:  # high coherence = meaningful content
        send_to_feature_extractor(frame)
🧬
Biomedical Signals
EEG · ECG · multi-channel coherence · artifact rejection · frequency preservation
02 Harmonic Vector 03 Scalar Stabilizer 08 Impedance Vectors

EEG and ECG signals are low-amplitude, frequency-rich, and highly sensitive to processing artifacts. Hard clipping or aggressive filtering destroys the harmonic structure that carries diagnostic information. The Harmonic Vector Stabilizer conditions the signal while explicitly preserving golden-ratio harmonic relationships — the same frequency structure present in biological rhythms.

The Impedance Variance Vectors module (Module 08 — available as a standalone file on the modules page) is particularly useful for multi-channel coherence analysis. In EEG, channel coherence is a diagnostic measure — reduced coherence between channels can indicate neurological conditions. Run your electrode array through the module and the coherence score gives you a single metric for overall channel alignment.

import numpy as np
from livingcircuit import harmonic_vector_stabilizer, adaptive_amplitude_stabilizer
from impedance_variance_vectors import impedance_variance_vectors

def condition_eeg_channel(raw_signal: np.ndarray, sample_rate: int = 256):
    """
    Condition a single EEG channel while preserving harmonic structure.
    raw_signal  : raw EEG samples (microvolts, float64)
    sample_rate : samples per second (default 256 Hz)
    """
    # Normalize to [-1, 1] range
    peak = np.max(np.abs(raw_signal)) + 1e-9
    normalized = raw_signal / peak

    # Harmonic conditioning — preserves biological frequency structure
    t = np.linspace(0, len(raw_signal) / sample_rate, len(raw_signal))
    result = harmonic_vector_stabilizer(t, base_freq=1.0, num_harmonics=8)

    # Quality score tells us how coherent the harmonic content is
    quality = result["quality_score"]

    # Amplitude stabilization — remove artifact spikes without hard clipping
    conditioned = []
    set_pt = float(normalized[0])
    for sample in normalized:
        stable, set_pt = adaptive_amplitude_stabilizer(
            signal=sample, set_point=set_pt,
            variance_limit=0.3, impedance=1.0,
            learn_rate=0.01
        )
        conditioned.append(stable)

    return np.array(conditioned) * peak, quality  # restore scale

def multi_channel_coherence(eeg_array: np.ndarray):
    """
    Measure phase coherence across EEG electrode array.
    eeg_array : shape (n_channels, n_samples)
    Returns coherence score 0–1 across all channels.
    """
    substrates = np.ones(eeg_array.shape[1])
    r = impedance_variance_vectors(eeg_array, substrates,
                                    geometry_coupling=0.15)
    return r["coherence"]

# Usage
channels = load_eeg_data()  # shape (32, 2560) — 32 channels, 10s at 256Hz
coherence = multi_channel_coherence(channels)
print(f"Channel coherence: {coherence:.3f}")
if coherence < 0.25:
    print("Low coherence — possible artifact contamination or electrode issue")
📈
Finance & Trading
Tick data smoothing · feature vector coherence · drift detection · signal continuity
03 Scalar Stabilizer 05 Solar Smoother 07 Phase Reflection 08 Impedance Vectors

Financial tick data has two problems: sudden spikes (bad prints, fat fingers, flash crashes) and continuous noise that obscures trend. The scalar stabilizer handles spikes — it keeps values within a bounded range of a rolling set point without clipping. The Solar Smoother handles noise — it carries state between ticks and blends corrections forward, producing a clean envelope.

For ML-based trading systems, the Impedance Variance Vectors module checks feature vector coherence before feeding a batch into the model. A coherence drop across your feature set often signals a regime change — the market is doing something the model hasn't seen before, and feeding it incoherent inputs will produce unreliable output.

import numpy as np
# Full code at modules.html#scalar, modules.html#solar, modules.html#impedance, modules.html#reflection
from livingcircuit import adaptive_amplitude_stabilizer, stabilize_solar_output
from impedance_variance_vectors import impedance_variance_vectors
from phase_reflection_agent_v3 import PhaseReflectionAgent

class TickDataConditioner:
    """Clean tick data before feeding into a trading model."""

    def __init__(self, variance_limit=0.05, impedance=2.0):
        self.variance_limit = variance_limit
        self.impedance      = impedance
        self.set_pt         = None
        self.memory         = 0.0
        self.prev           = None
        self.monitor        = PhaseReflectionAgent(name="tick-monitor")
        self.cycle          = 0

    def process(self, price: float, dt: float = 1.0):
        if self.set_pt is None:
            self.set_pt = price
        if self.prev is None:
            self.prev = price

        # 1. Spike removal
        clean, self.set_pt = adaptive_amplitude_stabilizer(
            signal=price, set_point=self.set_pt,
            variance_limit=self.variance_limit,
            impedance=self.impedance,
            learn_rate=0.005
        )

        # 2. Noise smoothing with carried state
        smooth, self.memory = stabilize_solar_output(
            current_val=clean,
            previous_val=self.prev,
            dt=dt, memory=self.memory
        )
        self.prev = smooth

        # 3. Health check
        self.cycle += 1
        state = self.monitor.step(self.cycle)

        return smooth, state.stability

def check_feature_coherence(feature_matrix: np.ndarray, threshold=0.3):
    """Flag batches where feature coherence has dropped."""
    substrates = np.ones(feature_matrix.shape[1])
    r = impedance_variance_vectors(feature_matrix, substrates)
    stable = r["coherence"] >= threshold
    if not stable:
        print(f"Feature coherence {r['coherence']:.3f} — possible regime change")
    return r["coherence"], stable
🤖
Robotics & Control Systems
Servo control · motion coherence · sensor feedback · PID conditioning
03 Scalar Stabilizer 05 Solar Smoother 07 Phase Reflection

Robotic control loops are sensitive to feedback spikes — a sudden joint encoder glitch or contact event can drive a PID controller into oscillation before the system can recover. The scalar stabilizer sits between the sensor and the controller, absorbing spikes without the hard limits that cause their own oscillation problems.

For repetitive motion systems — pick-and-place, CNC, welding robots — the Phase Reflection Agent tracks cycle coherence over time. A degrading stability value across cycles is an early indicator of mechanical wear, calibration drift, or approaching system limits before anything visibly fails.

import numpy as np
from livingcircuit import adaptive_amplitude_stabilizer, stabilize_solar_output
from phase_reflection_agent_v3 import PhaseReflectionAgent

class RobotJointController:
    """
    Conditioned joint controller with cycle health monitoring.
    Sits between sensor feedback and PID input.
    """

    def __init__(self, joint_id: str, max_velocity=1.0):
        self.joint_id     = joint_id
        self.max_velocity = max_velocity
        self.set_pt       = 0.0
        self.memory       = 0.0
        self.prev_pos     = 0.0
        self.monitor      = PhaseReflectionAgent(name=f"joint-{joint_id}")
        self.cycle        = 0

    def condition_feedback(self, raw_pos: float, dt: float):
        # Spike rejection — protects PID from encoder glitches
        clean_pos, self.set_pt = adaptive_amplitude_stabilizer(
            signal=raw_pos, set_point=self.set_pt,
            variance_limit=0.02,       # 2% of range
            impedance=3.0,             # high impedance = strong correction
            learn_rate=0.01
        )

        # Velocity smoothing with carried state
        smooth_pos, self.memory = stabilize_solar_output(
            current_val=clean_pos,
            previous_val=self.prev_pos,
            dt=dt, memory=self.memory
        )
        self.prev_pos = smooth_pos

        # Cycle health monitoring
        self.cycle += 1
        state = self.monitor.step(self.cycle)

        if self.cycle % 100 == 0:
            summary = self.monitor.summary()
            if summary["stability"]["mean"] < 0.4:
                print(f"Joint {self.joint_id}: degrading stability "
                      f"({summary['stability']['mean']:.3f}) — inspect for wear")

        return smooth_pos, state

# Usage in a control loop
controller = RobotJointController("shoulder", max_velocity=0.5)
dt = 0.001  # 1kHz control loop

while robot.running:
    raw_feedback = robot.read_encoder("shoulder")
    clean_feedback, health = controller.condition_feedback(raw_feedback, dt)
    pid_command = pid.compute(clean_feedback)
    robot.send_command("shoulder", pid_command)
RF & Power Systems
Transmission line simulation · three-phase analysis · harmonic distortion · impedance matching
09 Network Simulator 08 Impedance Vectors 03 Scalar Stabilizer

The Impedance Network Simulator was built for exactly this domain. A transmission line is a series of nodes with progressive phase delay, impedance variation, and signal attenuation — that's exactly what the simulator models. Set num_nodes to the number of line segments, frequency to your operating frequency, and phase_shift_per_node to the expected delay per segment.

For three-phase power analysis, set num_nodes=3 and phase_shift_per_node=2π/3 (120° spacing). The built-in FFT returns the harmonic spectrum — useful for detecting harmonic distortion injected by nonlinear loads.

import numpy as np
from impedance_network_simulator import ImpedanceNetworkSimulator, ImpedanceConfig

# Three-phase 50Hz power system
three_phase = ImpedanceConfig(
    num_nodes=3,
    frequency=50.0,
    phase_shift_per_node=2 * np.pi / 3,   # 120° between phases
    impedance_variance=0.08,               # 8% variation — realistic grid tolerance
    damping_factor=0.0,                    # continuous steady-state operation
    coupling=0.05,                         # slight inter-phase coupling
    noise_level=0.005
)

sim = ImpedanceNetworkSimulator(three_phase)
t   = np.linspace(0, 0.1, 5000)           # 100ms at 5kHz sample rate
signals, impedances = sim.simulate(t)

# Harmonic analysis — detect distortion
freqs, spectrum = sim.get_frequency_spectrum(node_idx=0)
peak_freq = freqs[np.argmax(spectrum)]
harmonics = freqs[spectrum > np.max(spectrum) * 0.1]  # >10% of peak

print(f"Fundamental: {peak_freq:.1f} Hz")
print(f"Harmonics detected: {harmonics[:5]}")

# Phase relationships
phases = sim.calculate_phase_relationships()
print(f"Phase differences: {np.degrees(phases['phase_differences'])}")

# Transmission line — 8 segments at 100MHz
tx_line = ImpedanceConfig(
    num_nodes=8,
    frequency=100e6,
    phase_shift_per_node=np.pi / 8,        # 22.5° per segment
    impedance_variance=0.15,
    damping_factor=0.02,                   # slight attenuation per segment
    coupling=0.08,
    noise_level=0.01
)
tx_sim = ImpedanceNetworkSimulator(tx_line)
tx_signals, tx_z = tx_sim.simulate(np.linspace(0, 1e-7, 2000))
metrics = tx_sim.calculate_variance_metrics()
print(f"Impedance range: {metrics['min_signal']:.3f} — {metrics['max_signal']:.3f}")
🏭
IoT & Industrial
Sensor continuity · process control · anomaly detection · multi-node arrays
03 Scalar Stabilizer 05 Solar Smoother 07 Phase Reflection 08 Impedance Vectors

Industrial sensor networks generate continuous streams of scalar values — temperature, pressure, flow rate, vibration — that need to be stable between poll intervals, free of bad readings, and monitored for drift. The combination of scalar stabilizer (spike rejection) plus solar smoother (between-poll continuity) handles the signal quality problem with no external dependencies.

For multi-sensor arrays, the Impedance Variance Vectors module gives you a coherence health metric across the whole array. When a sensor starts drifting or failing, it becomes phase-scattered relative to the others — coherence drops before the reading goes obviously out of range. This gives you an early warning signal.

import numpy as np
from livingcircuit import adaptive_amplitude_stabilizer, stabilize_solar_output
from impedance_variance_vectors import impedance_variance_vectors
from phase_reflection_agent_v3 import PhaseReflectionAgent

class IndustrialSensorNode:
    """Single sensor node with spike rejection and continuity smoothing."""

    def __init__(self, sensor_id: str, expected_range: tuple):
        self.sensor_id     = sensor_id
        self.low, self.high = expected_range
        self.center        = (self.low + self.high) / 2
        self.variance      = (self.high - self.low) / 4
        self.set_pt        = self.center
        self.memory        = 0.0
        self.prev          = self.center

    def read(self, raw_value: float, dt: float):
        # Normalize to [-1, 1] for stabilizer
        norm = (raw_value - self.center) / (self.variance + 1e-9)

        # Spike rejection
        clean_norm, self.set_pt_norm = adaptive_amplitude_stabilizer(
            signal=norm,
            set_point=getattr(self, 'set_pt_norm', 0.0),
            variance_limit=0.5,
            impedance=1.5,
            learn_rate=0.02
        )

        # Continuity smoothing
        smooth_norm, self.memory = stabilize_solar_output(
            current_val=clean_norm,
            previous_val=self.prev,
            dt=dt, memory=self.memory
        )
        self.prev = smooth_norm

        # Restore scale
        return smooth_norm * self.variance + self.center

def check_array_health(sensor_readings: np.ndarray, threshold=0.35):
    """
    sensor_readings : shape (n_sensors, n_features)
    Returns coherence score and health flag.
    Coherence below threshold signals possible sensor failure or drift.
    """
    substrates = np.ones(sensor_readings.shape[1])
    r = impedance_variance_vectors(sensor_readings, substrates,
                                    geometry_coupling=0.1)
    healthy = r["coherence"] >= threshold
    if not healthy:
        print(f"Array coherence {r['coherence']:.3f} — inspect sensors")
    return r["coherence"], healthy
Module 12 — Harmonic Field Allocator
Signal placement · dead-node recovery · AI inference locality · photonic arrays · neuromorphic routing
C++ · no dependencies Pairs with: 07 Phase Reflection Pairs with: 09 Impedance Network

Places signal state across a 3D harmonic field using golden ratio distance scoring, congestion penalties, and golden angle directional bias. Keeps related state close to an anchor node and recovers automatically when a node fails — routing to the nearest healthy substitute without intervention.

The first C++ module in the stack. All five geometric constants are embedded directly in the scoring function. Compiles on any C++17 compiler with no external dependencies.

Simulation results

AI KV-Cache locality (6×6×6 lattice)     — 96/96 succeeded · 0 failures
Dead node recovery (8 nodes killed)       — 30/30 auto-rectified · zero intervention
Photonic plane (8×8×1 array)             — 200/200 · avg coherence score 0.921
Neuromorphic spike routing (5×5×5)       — 500/500 · 0 saturation
Multi-model inference (4 models × 24L)   — 96/96 locality-aware placements

Usage

// Create a 4×4×4 lattice, 1MB per node
LatticeMemoryManagerV2 manager(4, 4, 4, 1024 * 1024);

// Allocate near anchor node 0
auto result = manager.allocateNear(0, 256 * 1024);
// result.success · result.moduleId · result.score · result.reason

// Dead node — allocator reroutes automatically
manager.setFunctional(nodeId, false);

Full source and documentation — modules.html

Module 13 — Spiral Resonance Field
Signal visualization · harmonic attention · human-AI interaction · live monitoring
Vanilla JS · pure canvas No dependencies Pairs with: 06 Pointer Resonance

Two golden spirals expanding outward from center — the outer tracking horizontal observer position, the inner tracking vertical. A focal point orbits toward the direction of pull. Background waves provide a continuous field beneath the spiral geometry. No auto-animation. The field only moves when the observer moves.

The same constants that drive the other twelve modules — φ, the golden angle, e, π — describe the shape of a field under attention. Signal requires a source.

First public deployment: thelivingcircuit.ai/about.html

Spiral equations

Outer: r(i) = 42 + i·0.089 + sin(i·0.085)·pull
       θ(i) = i·0.041·φ + (mouseX − cx)·i·0.00014

Inner: r(i) = 27 + i·0.067 + sin(i·0.13)·pull
       θ(i) = i·0.0365·φ − (mouseY − cy)·i·0.00021

Focal: angle  = atan2(mouseY−cy, mouseX−cx) × 1.4
       radius = 88 + pull × 260

Usage

// Drop into any canvas element
createSpiralResonanceField(canvas);

// The field initializes with default pointer position
// and begins responding to pointermove events immediately.
// No configuration required — pure canvas, no library.

Full source and documentation — modules.html

Module 14 — Geometric Oscillatory Sound Rectifier
Audio processing · geometric rectification · harmonic injection · impedance modeling
Pure Python · NumPy Pairs with: 02 Harmonic Vector Pairs with: 04 Voice Tone

Processes audio through a geometry-based signal chain. Polygon or circle substrate maps the input to a radius field. Integrity wobble applies symmetry-preserving oscillation. Optional geometric inversion flips the field inside-out. Full-wave rectification folds negative excursions. Harmonic injection adds rotational geometry layers.

The mass parameter (∂/∂m) controls harmonic richness and effective output impedance — higher mass means richer harmonics and less hard limiting at output.

Usage

from geometric_oscillatory_sound_rectifier import GeometricOscillatorySoundRectifier

rect = GeometricOscillatorySoundRectifier(fs=44100, base_geometry='polygon', num_sides=5)
output = rect.process(audio, integrity=0.88, wobble_freq_ratio=1.618,
                      mass=2.5, num_harmonics=12)

Full source — modules.html

Module 15 — Token Coherence Conditioner
Token stream scoring · context drift correction · pipeline coherence gating
Pure Python · NumPy Pairs with: 10 Coherence Filter Pairs with: 07 Phase Reflection Pairs with: 02 Harmonic Vector

Maps tokens into an 8D harmonic space using golden ratio phase projection. Scores token streams against a seeded anchor vector. When coherence falls below threshold, applies iterative correction passes — nudging low-similarity tokens toward the anchor without hard replacement.

Composable stack: Module 10 gates the input → Module 15 conditions the stream → Module 07 observes drift over cycles → Module 02 stabilizes the coherence score time series.

Usage

from token_coherence_conditioner import TokenCoherenceConditioner

tcc = TokenCoherenceConditioner(coherence_threshold=0.59, max_passes=4, blend_strength=0.45)
tcc.set_seed(["harmonic", "coherence", "signal", "geometry"])
result = tcc.condition(tokens)
# result["coherence"] · result["status"] · result["passes_applied"]

Full source — modules.html

🏥
Medical — In Development
Clinical coherence · diagnostic support · complex case review · referral preparation
Coming

A dedicated medical module is in development. It adapts the Living Circuit's harmonic coherence architecture into a read-only clinical coherence engine — designed to support clinicians working through complex cases, not to replace clinical judgment.

The core behavior carries directly from the Ghost Field principle: insufficient coherence returns a request for more data instead of overconfident output. In a medical context this means the system flags gaps, contradictions, and ambiguities in a patient record rather than bridging them with assumptions. A diagnostic odyssey case with ten years of fragmented records across four specialties is exactly the kind of problem this architecture is built for.

Built on the Clinical Cross-Reference prototype — a coherence engine that detects gaps, contradictions, anchoring bias, and urgent review flags across a patient's clinical record, while always returning a full evidence trace for independent human review.

Intended applications:

  • Complex case review where multiple specialists have seen the patient
  • Rare disease / diagnostic odyssey support — pattern recognition across fragmented records spanning years and multiple specialties
  • Referral preparation — surface contradictions before a specialist sees the patient
  • Medication-timeline contradiction detection across prescribers
  • Cross-specialty coherence checks on clinical documentation
Explicit boundaries — these will not change:
  • Read-only. No modifications to clinical records.
  • No definitive diagnosis.
  • No autonomous treatment decisions.
  • Not validated for clinical care.
  • All output carries an evidence trace for independent human review.

When released this will be the most significant addition to this library — and likely the most significant open application of harmonic geometry conditioning to clinical signal analysis.

Researchers, clinicians, and health systems interested in early access or collaboration: ghost@thelivingcircuit.ai

Parameter reference

Complete parameter tables for the modules with the most configuration surface.

harmonic_vector_stabilizer

ParameterDefaultDescription
t1D time array, minimum 16 samples. The signal window being conditioned.
amplitude1.0Output signal amplitude scaling.
base_freq1.0Fundamental frequency in Hz. Clamped to [0.01, 8.0].
num_harmonics12Number of harmonic layers. More layers = richer signal, slower computation. Clamped to [2, 24].
phase_gain0.32Amplitude of multi-harmonic phase variance. Clamped to [0, 0.75].
phase_ratio1.61803 (φ)Golden ratio — controls harmonic spacing. Change this to alter the harmonic relationship.
refraction_bias0.82Base impedance level. Higher = more signal resistance.
refraction_depth0.38Impedance modulation depth per layer.
refraction_rate2.39996Golden angle — impedance oscillation frequency.
min_impedance0.28Lower clamp on refraction. Prevents division-near-zero.
harmonic_falloff2.15Power-law amplitude decay per harmonic. Higher = energy concentrated in early harmonics.

impedance_variance_vectors

ParameterDefaultDescription
vectorsInput array, shape (n_vectors, dimension) or (dimension,). Any float matrix.
substratesCoupling array. In projected mode must match dimension. In cyclic mode any length.
base_freq1.0Base oscillation frequency across harmonic layers.
variance_gain0.18Amplitude of phase variance. Raise for more field sensitivity.
variance_decay0.68Exponential decay of variance across layers. Does NOT significantly affect total energy.
substrate_strength0.72Coupling strength between substrate and impedance.
num_layers5Harmonic layers. More layers = deeper analysis, slower computation.
harmonic_falloff2.22Power-law weight decay. Lower = energy spread deeper into layers.
geometry_coupling0.35Influence of vector geometry on phase. Keep in [0.0, 2.0] range.
substrate_mode"projected""projected": geometry-aware, requires substrate length == dimension. "cyclic": uniform, any length.

ImpedanceNetworkSimulator config

ParameterDefaultDescription
num_nodesNumber of network nodes. Each gets a progressive phase shift.
frequencyOscillation frequency in Hz. Works from 1Hz to 100MHz+.
phase_shift_per_nodeπ/4Phase delay between adjacent nodes in radians. Use 2π/3 for three-phase, 2π/N for uniform distribution.
impedance_variance0.2Log-normal spread of per-node impedance variation. Higher = more node-to-node variation.
damping_factor0.05Exponential amplitude decay per unit time. 0.0 = continuous oscillation. 0.5 = ~2s time constant.
coupling0.0Cross-node influence strength. Adjacent nodes affect each other. Capped relative to impedance_variance.
noise_level0.01Additive Gaussian noise amplitude. Models real-world signal degradation.

PhaseReflectionAgent

ParameterDefaultDescription
name"Visitor"Identifier for this agent instance. Appears in logs.
max_history300Maximum states kept in the rolling deque. Set to None for unlimited (not recommended for long runs).
State fields returned per cycle: cycle, coherence (0–1), tension (0.12–0.88), stability (0.22–0.93), refraction (0.25–1.35), hue (0–360°), floor_count (consecutive floor hits), open_question (rotating diagnostic prompt).

Coherence interpretation

The coherence score appears in three modules — Harmonic Vector Stabilizer (quality_score), Impedance Variance Vectors (coherence), and Phase Reflection Agent (coherence). They all measure the same underlying thing: how consistently a signal is moving in a harmonic direction. But the scale means different things in different contexts.

Universal coherence scale

0.0 – 0.3ScatteredSignals are phase-diverse or noisy. In AI: possible instability or garbage input. In sensors: hardware issue or extreme environmental noise. In audio: incoherent source material.
0.3 – 0.6PartialUseful signal with spread. Normal for diverse inputs. In embeddings: heterogeneous batch — expected. In finance: mixed regime signals. In robotics: expected during transitions.
0.6 – 0.85CoherentSignals moving in consistent harmonic direction. In AI: good latent state quality. In sensors: healthy array. In audio: coherent source with clear harmonic structure.
0.85 – 1.0AlignedHigh phase alignment. May indicate low input diversity. In embeddings: possibly too similar — check for degenerate representations. In sensors: check for sensor coupling or shared noise source.

Module-specific interpretation

harmonic_vector_stabilizer → quality_score

The quality_score is mean(magnitude) / std(magnitude) — a signal-to-noise ratio across the harmonic output. Values above 2.0 indicate a strong, coherent harmonic signal. Values below 1.0 suggest the input is too noisy or short for meaningful harmonic analysis. Unlike the 0–1 coherence score, quality_score is unbounded above — values of 5–10 are possible for very clean, periodic inputs.

impedance_variance_vectors → coherence

Measures |mean(signal)| / mean(|signal|) — the ratio of the mean complex signal magnitude to the mean absolute magnitude. When all vectors produce signals pointing the same complex direction, this approaches 1.0. When they scatter randomly in phase space, the complex mean cancels toward zero. This is the standard circular coherence measure from directional statistics.

PhaseReflectionAgent → coherence

Computed from 0.62 + 0.28·cos(movement) + 0.12·sin(movement·φ²), clamped to [0.18, 0.96]. This is a synthetic coherence — it models how a system's internal state would evolve under harmonic forcing. Low coherence cycles with high tension produce low stability values, which trigger the floor recovery mechanism. Watch floor_count — repeated floor hits mean the system is under sustained stress.

Signal model equations

The mathematical foundations behind each module's core computation.

Impedance Network Simulator

Node signal model
S(n,t) = [A(n)·sin(ωt + φₙ) + H(n)·sin(2ωt + φₙ/2)] × E(t) + noise

Where:

Optional cross-node coupling: S(n,t) → S(n,t) + coupling × [S(n-1,t) + S(n+1,t)]

Harmonic Vector Stabilizer

Layer accumulation
signal += (A · e^(i·(movement + variance))) / refraction × weight
weight = 1 / layer^harmonic_falloff × e^(-0.22 · (layer-1))
variance = phase_gain · tanh(sin(m·φ) + 0.6·sin(m·φ²) + 0.35·cos(m·φ_c))

The tanh saturation prevents variance from blowing up at high frequencies. The three-component variance (using φ, φ², and φ complement) creates a phase modulation that's rich but bounded.

Adaptive Amplitude Stabilizer (scalar)

Damping function
damping = 1 / (1 + overflow / impedance) when |delta| > variance_limit
stabilized = set_point + delta × damping
next_set_point = (1 - learn_rate) × set_point + learn_rate × stabilized

The damping function approaches 1.0 (no correction) when delta is within the variance limit, and approaches 0 (full correction to set_point) as delta grows large relative to impedance. The set_point itself tracks the stabilized output, preventing long-term drift.

Phase Reflection Agent

State equations per cycle
movement = cycle × φ_c coherence = 0.62 + 0.28·cos(movement) + 0.12·sin(movement·φ²) + recovery tension = 0.48 + 0.35·sin(movement·φ) refraction = 0.68 + 0.42·cos(movement·θ_g) stability = clamp(coherence − tension × 0.45, 0.22, 0.93) hue = (coherence·180 + tension·120 + cycle·8) mod 360

Recovery = 0.08 × min(floor_count, 4) — injects a coherence lift proportional to how many consecutive cycles stability has been at the floor (0.28 threshold).

Composable stack — technical view

How the modules connect mathematically, not just visually.

Data flow and types

ModuleInput typeOutput typeFeeds into
SimpleVoiceToneAnalyzerfloat32 array (audio)dict: tone, intensity, confidenceharmonic_vector_stabilizer (intensity → base_freq scaling)
harmonic_vector_stabilizerfloat64 1D array (time)dict: signal, magnitude, phase, quality_scoreAdaptiveAmplitudeStabilizer (quality_score as gain modulation)
AdaptiveAmplitudeStabilizertorch.Tensor (batch, seq, dim)torch.Tensor (same shape, stabilized)Model blocks, ffn output
adaptive_amplitude_stabilizerfloat scalar(float, float): stabilized value, next set_pointstabilize_solar_output
stabilize_solar_outputfloat scalar + memory(float, float): smoothed value, next memoryFinal output stream
impedance_variance_vectorsndarray (n_vectors, dim)dict: coherence, magnitude, energyPhaseReflectionAgent (coherence as external input)
PhaseReflectionAgentcycle index (int)ReflectionState: all metricsUpstream modules as feedback signal
ImpedanceNetworkSimulatortime array + config(signals matrix, impedances array)impedance_variance_vectors (signals as vector batch)

Closing the loop

The most powerful configuration uses the Phase Reflection Agent's output to dynamically adjust upstream parameters. When state.stability drops, tighten the amplitude stabilizer's variance_limit. When state.coherence rises, relax it. This creates a self-regulating system that adapts to changing conditions:

from phase_reflection_agent_v3 import PhaseReflectionAgent
from livingcircuit import adaptive_amplitude_stabilizer

monitor = PhaseReflectionAgent()
base_variance_limit = 0.3
memory = 0.0
set_pt = 0.0

for cycle, value in enumerate(signal_stream):
    state = monitor.step(cycle + 1)

    # Dynamically adjust variance limit based on system stability
    # Low stability → tighter bounds. High stability → relax bounds.
    dynamic_limit = base_variance_limit * state.stability

    stabilized, set_pt = adaptive_amplitude_stabilizer(
        signal=value,
        set_point=set_pt,
        variance_limit=dynamic_limit,
        impedance=0.5 + (1.0 - state.coherence),  # more impedance when incoherent
        learn_rate=0.02
    )
    stabilized, memory = stabilize_solar_output(stabilized, set_pt, dt=1.0, memory=memory)

Substrate independence

Every module in this library is built on geometric constants — φ, π, e, the golden angle, and α. These are not silicon-specific parameters. They are not learned weights. They are not tuned to any particular hardware architecture. They describe relationships between signals that hold regardless of what medium carries those signals.

This has a practical consequence that becomes more significant as computing hardware evolves.

Why geometry is substrate-agnostic

Electronic signals and optical signals behave differently at the physical layer — different noise profiles, different interference patterns, different propagation characteristics. But the mathematical relationships between phase, coherence, impedance, and stability are descriptions of signal geometry, not descriptions of electronics. A coherence score of 0.6 means the same thing whether the vectors came from a GPU, a neuromorphic chip, or a photonic processor.

The five constants used across these modules:

φ
1.6180339887
Universal
The golden ratio appears in optimal packing problems, wave interference minimization, and energy distribution across any oscillating system — electronic or optical. It describes how to distribute energy without resonance buildup, regardless of substrate.
θg
2.39996 rad
Universal
The golden angle produces maximally uniform distribution in any phase space. In photonic systems where phase relationships between light beams determine signal integrity, golden-angle spacing provides the same stability properties it provides in electronic phase arrays.
α
1/137.036
Universal
The fine structure constant governs electromagnetic coupling strength. It is already a fundamental constant of the physical universe — not a tuned parameter. In photonic systems it appears naturally in the coupling between optical modes. Using it as an impedance seed means the conditioning layer is already calibrated to the physics of light.

Implications for photonic computing

Photonic processors use light rather than electrons to perform computation. The stability challenges are real and unsolved — phase coherence between optical channels, managing interference between signal paths, maintaining signal integrity across temperature and fabrication variation. These are signal geometry problems. The same class of problems these modules address in electronic AI systems.

A conditioning layer built on geometric constants doesn't need to be rewritten for new hardware. It needs to be reapplied. The Harmonic Vector Stabilizer's coherence output is as meaningful for an optical signal array as it is for a transformer's latent space. The Impedance Variance Vectors module measures phase alignment across any vector batch — the source of those vectors is irrelevant to the math.

The brute-force approaches to AI stability — massive parameter counts, hardware-specific optimization, empirical tuning — don't transfer cleanly when the physics changes. A framework built on geometric relationships that predate silicon does.

For researchers working in photonic AI systems: These modules are MIT licensed, framework-agnostic, and built on constants that are native to electromagnetic physics. If you're working on signal conditioning, coherence measurement, or stability primitives for optical computing architectures, the math here may be directly applicable.
Read: The Photonic Bridge → ghost@thelivingcircuit.ai

The math works in any language

These modules are written in Python and C++. The math is not specific to either.

What that means for builders

Every module is an implementation of geometric constants — φ, π, e, the golden angle, and α. The relationships they describe are substrate-agnostic. They hold in any language, on any hardware, for any signal. If you need the logic in Rust, Go, JavaScript, Swift, Julia, or anything else — drop the module source into an AI and ask for a translation. The math carries because it is not Python. Python is just the current expression of it.

The code is Python and C++. The math is not.

Drop any module into an AI as plain text. Ask for a translation to your language. The logic carries.

How to port a module

Paste the module source into any AI with this prompt:

"Translate this to [Rust / Go / JavaScript / C# / Swift / Julia].
Preserve all geometric constants exactly:
  PHI          = 1.6180339887498948
  PI           = 3.14159265358979323846
  E            = 2.71828182845904523536
  GOLDEN_ANGLE = 2.399963229728653
  ALPHA        = 1.0 / 137.035999084
Keep the same function signatures and return structure.
Do not substitute approximations for the constants."

What stays the same across languages

The five constants, the mathematical relationships between them, the scoring functions, the phase calculations, and the coherence thresholds. These are not tuned parameters — they are geometric facts. They do not change when the language changes.

What changes across languages

Syntax, type handling, library calls for array math, and how you import or include the module. Everything cosmetic. Nothing structural.

Verified C++ port

Module 12 (Harmonic Field Allocator) is already shipped in C++ with all five constants embedded directly in the scoring function. Module 13 (Spiral Resonance Field) is pure Vanilla JS — same geometric constants, different substrate. Both prove the same point: the math is not the language.

Provenance

Timestamped authorship record for all Living Circuit modules. SHA-256 hashes verify file integrity.

John Burlingame
Harmonic Systems Architect
The Living Circuit LLC · Rosenberg, Texas
Timestamp
2026-05-17T21:41:14Z

These works are original designs built from first principles through harmonic geometry. No prior art. The conditioning primitives published under The Living Circuit LLC were designed, authored, and tested by John Burlingame. They represent a novel approach to AI system stability and signal conditioning using geometric constants as structural anchors rather than learned parameters. These files do not degrade. The mathematics is stable. The authorship is singular.

File integrity — SHA-256
ModuleFileSHA-256
Adaptive Amplitude Stabilizeramplitude.py8e152e12a0377418b3198a8ae58b05cf319f1ee7c46fbd232a702919ae710e5c
Harmonic Vector Stabilizerharmonic.py5ab07f4e5f651689665977c4cc316636001469424f06a347491a2f0400d48c92
Voice Tone Analyzervoice.py84baf46e8c6fa4e7171a6598df8e5744602f2e0f70f8436a67ab7d831a6891b6
Solar Output Smoothersolar.py6d64348745706e8c08bd63d97fc1e05445b4b73bacfbff31ad8b2d1519eb7e64
Phase Reflection Agent v3phase_reflection_agent_v3.py128e8cdf7a8915d6fb25c2ece9f395cf3d32a024054eb11d859c59b253ea2004
Sitethe-living-circuit-v6.htmlc92352ae70e806fe7e5c3f779613004e4f5cf4a2f62a465ef89259736271a3b1
Harmonic Field Allocatorlattice_memory_manager_public.cpp0d52b1e254afe19aeb6419e47cfff3068d1a8c4bec00ea5eb05908f72984c9ac
Spiral Resonance Fieldmodule13_spiral_resonance_field.js3833c9ca2c0162ff420facf53d6bfb059956486a590451d3ff43d4ec0350b553
Geometric Oscillatory Sound Rectifiergeometric_oscillatory_sound_rectifier.pyf9afdae203d2b865d6ad1cdcd62979530b7899f4ee0dc0ba73f74cd982bdd8b6
Token Coherence Conditionertoken_coherence_conditioner.pydf2e37f858f4af60e3705f0f7062402af26222c57d82ae8eaf0266c0f9bb7f8e
Packagelivingcircuit-1.1.0.zip50cb8a1b39cd9b7117436a2c10b504662eea40afa2eafe3705c771b8fef06b00
Copyright © 2026 The Living Circuit LLC. Public code modules: MIT License. Website text, branding, and non-code content: All rights reserved. Built by John Burlingame / The Living Circuit LLC.