A native, formally verified signal processing engine for astronomical baseband recordings.
New to TurboKain? Read the complete, hands-on User Guide (
docs/USER_GUIDE.md) for plain-English walk-throughs of all 14 instruments, configuration presets, Python automation, and pipeline recipes.
Classical Search for Extraterrestrial Intelligence (SETI) historically presupposes intentional, high-power narrowband isotropic beacons directed at the Solar System. Modern communication theory and orbital link budgets dictate that advanced intelligences communicating across interstellar baselines will optimize strictly for channel capacity and energy efficiency ($\text{bits}/\text{joule}$). Such transmissions are:
TurboKain is designed for the Bystander Mission: extracting structural signatures that thermal noise cannot produce from raw dual-polarization radio telescope baseband recordings.
The pipeline processes baseband voltage streams down to phase coherence, cyclostationary spectral correlation densities, dispersed pulse trains, chirped Doppler carriers, microsecond-scale autocorrelation lattices, and post-Shannon symbolic machine execution.
TurboKain applies the SQLite / BusyBox doctrine to high-performance astrophysics pipelines: source code is maintained in strictly decoupled, domain-isolated modules during development, then fused into a single whole-program translation unit for native compilation.
kain/core/*.kn ──► kain amalgamate --raw kain/core -o kain/core.kn ──► kain build kain/core.kn ──► core.exe (~1.2 MB)
(14 modules) (whole-program LLVM) │
├── core <tool> [args...]
├── core help <tool>
├── core prove
└── core sweep <f32>
core.kn exposes the entire call graph to LLVM. The optimizer performs aggressive inter-procedural inlining, dead-code elimination, and loop vectorization across instrument boundaries.core.exe, ~1.2 MB) linked directly against operating system system-call boundaries (kernel32). It requires zero runtime dependencies, interpreters, or shared libraries.Byte and Float memory regions) without disk roundtrips.dispatch.kn captures invocation context via GetCommandLineA(). It operates as a subcommand suite (core <tool> [args...]) or as a multi-call binary (copying or linking core.exe to <tool>.exe executes that instrument directly).The core engine comprises 14 specialized instruments spanning the complete RF analysis chain:
| Instrument | Module | Domain | Operational Contract | Sensitivity / Gate Floor |
|---|---|---|---|---|
slice | slice.kn | Baseband Ingest | GUPPI .raw (2-bit / 8-bit) $\to$ .f32 complex/power voltage | Layout-aware, 67M samples in 2.3 s |
fil_reader | fil_reader.kn | Spectral Ingest | Sigproc .fil (8/16/32-bit) $\to$ calibrated .f32 | Header validation, band-mean extraction |
config | config.kn | Geodesy / Config | Resolves 40 telemetry, RF geometry, and search bounds | CLI $\gt$ Header $\gt$ Preset arbitration |
sk_gate | sk_gate.kn | RFI Excision | Spectral Kurtosis ($SK$) estimator over 4096/2048 STFT | Excision threshold: $\vert SK - 1 \vert \ge 0.50$ |
xeno_scan | xeno_scan.kn | Anomaly Screening | 6-marker battery: SK, coherence, comb, dispersion, tail | $\ge 20.0$ ladder ratio, $6.0\sigma$ zero-crossing |
boxcar_bank | boxcar_bank.kn | Dispersed Pulses | $O(N)$ prefix-sum matched filtering over DM space | Threshold default: $14.0\sigma$ |
fold_sum | fold_sum.kn | Epoch Folding | Hann-windowed STFT + sub-band 8-harmonic folder | Multi-harmonic threshold: $16.0\sigma$ |
fam_god | fam_god.kn | Cyclostationary | 3-decade FFT Accumulation Method (SCD estimation) | Regularized Gamma $p$-value, FWE trials correction |
frame_hunt | frame_hunt.kn | Periodic Modulation | Envelope periodogram + 6-subharmonic comb search | Harmonic family acceptance within 5% |
drift_hunt | drift_hunt.kn | Chirped Carriers | Taylor dedoppler shift-and-add over $(\dot{f}, f)$ space | Sidereal and topocentric chirp acceleration |
lag_hunt | lag_hunt.kn | Autocorrelation | Direct lag microscope ($0.01\text{ ms} - 10\text{ s}$) | 4-lens lattice (phase/power/cadence/event) |
bitslice | bitslice.kn | Stream Conversion | Floating-point voltage $\to$ packed bitstreams (sign/diff/mag) | Coherent integrate-and-dump at baud rate $\alpha$ |
xvm_sandbox | xvm_sandbox.kn | Symbolic Execution | Subleq, Rule 110 cellular automata, LZ/Berlekamp-Massey | Complexity threshold, TAG steps gate ($2200$) |
cadence_pair | cadence_pair.kn | Spatial Filtering | Pointing corroboration gate (ON vs. OFF beam triage) | Formal law gates: WATCH, COMMON, CLEAN |
For $M$ spectral power estimates across channel bins, the estimator evaluates departures from Gaussianity: $$V_k = \frac{\sum_{m=1}^M P_{m,k}^2}{\left( \sum_{m=1}^M P_{m,k} \right)^2}, \quad SK_k = \frac{M+1}{M-1} \left( M \cdot V_k - 1 \right)$$ For Gaussian white noise, $\mathbb{E}[SK_k] = 1$ with variance $\sigma_{SK}^2 \approx \frac{4}{M}$. RFI contamination is excised when $\vert SK_k - 1 \vert \ge 0.50$ across evaluated bins.
Phase-modulated digital communications (BPSK, QPSK, FSK) exhibit non-zero spectral correlation at cyclic frequency $\alpha$: $$S_x^\alpha(f) = \lim_{T \to \infty} \frac{1}{T} \mathbb{E}\left[ X_T\left(f + \frac{\alpha}{2}\right) X_T^*\left(f - \frac{\alpha}{2}\right) \right]$$ The FFT Accumulation Method evaluates complex channelizer outputs over channel pairs $(f_k, f_l)$ where $f_k - f_l = \alpha$. Detection significances are evaluated via exact regularized lower incomplete Gamma integrals: $$P(\chi^2 \ge 2 \cdot \text{SNR} \mid 2M) = 1 - \frac{\gamma(M, \text{SNR})}{\Gamma(M)}$$ corrected for Family-Wise Error (FWE) rate across the trial grid.
Cold plasma dispersion delays lower frequencies according to the dispersion measure ($DM$): $$\Delta t = k_{\text{DM}} \cdot DM \cdot \left( f_{\text{low}}^{-2} - f_{\text{high}}^{-2} \right), \quad k_{\text{DM}} \approx 4.148808 \times 10^3 \text{ MHz}^2 \text{ pc}^{-1} \text{ cm}^3 \text{ s}$$ For continuous carrier emissions, Doppler drift rates induced by orbital acceleration are parameterized via linear chirps: $$f(t) = f_0 + \dot{f}_0 \cdot t$$ integrated via the Taylor tree algorithm across $(\dot{f}, f)$ resolution elements.
Demodulated bitstreams are evaluated for computational density and non-random state transitions:
TurboKain compiles directly from source through the native Kain compiler:
# 1. Synthesize the amalgamated single-file core
kain amalgamate --raw kain/core -o kain/core.kn
# 2. Compile to native executable
kain build kain/core.kn --target llvm -o core.exe
Every instrument contains mathematical self-tests verifying analytical bounds against synthetic Gaussian noise and injected reference signals. Run the full battery natively:
tkc prove
# or: core prove
Verification output demonstrates zero-divergence against analytical ground truths:
================================================================================
TurboKain Core Suite — Unified Native Prove Battery (9 instruments)
================================================================================
[1/9] bitslice --prove -> receipt=PASS prove=4/4
[2/9] boxcar_bank --prove -> receipt=PASS prove=4/4
[3/9] config --prove -> receipt=PASS prove=6/6
[4/9] drift_hunt --prove -> receipt=PASS prove=4/4
[5/9] fil_reader --prove -> receipt=PASS prove=4/4
[6/9] frame_hunt --prove -> receipt=PASS prove=9/9
[7/9] lag_hunt --prove -> receipt=PASS prove=9/9
[8/9] xeno_scan --selftest -> [selftest] ALL PASS
[9/9] xvm_sandbox --selftest-> receipt=PASS selftest=24/24
================================================================================
Core Battery Receipt: ALL 9 PROVE BATTERIES PASSED (receipt=PASS)
================================================================================
tkc / core)The binary is aliased as tkc (TurboKain Core), core, and turbokain_core. Tool shorthands (fam, lag, boxcar, drift, frame, sk, xeno, xvm, bits, cad, cfg, fil) are supported out of the box.
# Master directory of all 14 tools and data flows
tkc help
# Detailed mathematical parameters, flags, and contracts for an instrument
tkc help slice
tkc help fam
tkc help boxcar
tkc help xvm
tkc sweep)Execute the complete 7-stage screening and detection battery on a voltage slice in a single pass:
tkc sweep <path_to_voltage.f32> --out-dir reports/target_sweep/ --fs 2929687.5
This executes in sequence:
sk_gate (Spectral kurtosis RFI screening)xeno_scan (Statistical anomaly lattice)boxcar_bank (Transient dispersed pulse detection)drift_hunt (Chirped carrier dedoppler extraction)frame_hunt (Harmonic comb and periodicity identification)lag_hunt (Direct time-domain autocorrelation lattice)fam_god (Cyclostationary spectral correlation density mapping)Individual instruments execute directly with explicit argument contracts:
# Ingest 128 blocks of channel 44 from a raw GUPPI baseband file
tkc slice /data/raw/blc00_guppi.raw 44 /data/slices/ch44.f32 128 --pol 0
# Run multi-decade cyclostationary baud rate estimation
tkc fam --in /data/slices/ch44.f32 --fs 2929687.5 --segbank --out reports/fam.md
# Decimate and slice bits at detected baud rate
tkc bits --in /data/slices/ch44.f32 --alpha 11090.0 --out /data/bits/ch44_b11090
# Evaluate computational complexity in the symbolic execution sandbox
tkc xvm --in /data/bits/ch44_b11090.head.sign.bin --out reports/xvm.md
# Gate spatial persistence against an off-target reference observation
tkc cad --on reports/on_target.md --off reports/off_target.md --out reports/cadence.md
memory.tsv (change log) and catalog.tsv (instrument ledger).config.kn).CLEAN, WATCH, COMMON, CANDIDATE) are governed by formal logical invariants (law blocks in Kain). Automated tools generate candidate metrics and evidence receipts; promotion to interstellar candidate status requires multi-epoch verification and human analyst adjudication.TurboKain ingests raw baseband recordings from major radio observatories:
All signal processing algorithms are validated against Python and C oracle benchmarks (SetiYeti) and verified across sky observations including FRB 121102, TRAPPIST-1, Sagittarius B2, and interstellar interloper 1I/'Oumuamua.
20 commits
Rust
98.1%
Python
1.9%
A native, formally verified signal processing engine for astronomical baseband recordings.
New to TurboKain? Read the complete, hands-on User Guide (
docs/USER_GUIDE.md) for plain-English walk-throughs of all 14 instruments, configuration presets, Python automation, and pipeline recipes.
Classical Search for Extraterrestrial Intelligence (SETI) historically presupposes intentional, high-power narrowband isotropic beacons directed at the Solar System. Modern communication theory and orbital link budgets dictate that advanced intelligences communicating across interstellar baselines will optimize strictly for channel capacity and energy efficiency ($\text{bits}/\text{joule}$). Such transmissions are:
TurboKain is designed for the Bystander Mission: extracting structural signatures that thermal noise cannot produce from raw dual-polarization radio telescope baseband recordings.
The pipeline processes baseband voltage streams down to phase coherence, cyclostationary spectral correlation densities, dispersed pulse trains, chirped Doppler carriers, microsecond-scale autocorrelation lattices, and post-Shannon symbolic machine execution.
TurboKain applies the SQLite / BusyBox doctrine to high-performance astrophysics pipelines: source code is maintained in strictly decoupled, domain-isolated modules during development, then fused into a single whole-program translation unit for native compilation.
kain/core/*.kn ──► kain amalgamate --raw kain/core -o kain/core.kn ──► kain build kain/core.kn ──► core.exe (~1.2 MB)
(14 modules) (whole-program LLVM) │
├── core <tool> [args...]
├── core help <tool>
├── core prove
└── core sweep <f32>
core.kn exposes the entire call graph to LLVM. The optimizer performs aggressive inter-procedural inlining, dead-code elimination, and loop vectorization across instrument boundaries.core.exe, ~1.2 MB) linked directly against operating system system-call boundaries (kernel32). It requires zero runtime dependencies, interpreters, or shared libraries.Byte and Float memory regions) without disk roundtrips.dispatch.kn captures invocation context via GetCommandLineA(). It operates as a subcommand suite (core <tool> [args...]) or as a multi-call binary (copying or linking core.exe to <tool>.exe executes that instrument directly).The core engine comprises 14 specialized instruments spanning the complete RF analysis chain:
| Instrument | Module | Domain | Operational Contract | Sensitivity / Gate Floor |
|---|---|---|---|---|
slice | slice.kn | Baseband Ingest | GUPPI .raw (2-bit / 8-bit) $\to$ .f32 complex/power voltage | Layout-aware, 67M samples in 2.3 s |
fil_reader | fil_reader.kn | Spectral Ingest | Sigproc .fil (8/16/32-bit) $\to$ calibrated .f32 | Header validation, band-mean extraction |
config | config.kn | Geodesy / Config | Resolves 40 telemetry, RF geometry, and search bounds | CLI $\gt$ Header $\gt$ Preset arbitration |
sk_gate | sk_gate.kn | RFI Excision | Spectral Kurtosis ($SK$) estimator over 4096/2048 STFT | Excision threshold: $\vert SK - 1 \vert \ge 0.50$ |
xeno_scan | xeno_scan.kn | Anomaly Screening | 6-marker battery: SK, coherence, comb, dispersion, tail | $\ge 20.0$ ladder ratio, $6.0\sigma$ zero-crossing |
boxcar_bank | boxcar_bank.kn | Dispersed Pulses | $O(N)$ prefix-sum matched filtering over DM space | Threshold default: $14.0\sigma$ |
fold_sum | fold_sum.kn | Epoch Folding | Hann-windowed STFT + sub-band 8-harmonic folder | Multi-harmonic threshold: $16.0\sigma$ |
fam_god | fam_god.kn | Cyclostationary | 3-decade FFT Accumulation Method (SCD estimation) | Regularized Gamma $p$-value, FWE trials correction |
frame_hunt | frame_hunt.kn | Periodic Modulation | Envelope periodogram + 6-subharmonic comb search | Harmonic family acceptance within 5% |
drift_hunt | drift_hunt.kn | Chirped Carriers | Taylor dedoppler shift-and-add over $(\dot{f}, f)$ space | Sidereal and topocentric chirp acceleration |
lag_hunt | lag_hunt.kn | Autocorrelation | Direct lag microscope ($0.01\text{ ms} - 10\text{ s}$) | 4-lens lattice (phase/power/cadence/event) |
bitslice | bitslice.kn | Stream Conversion | Floating-point voltage $\to$ packed bitstreams (sign/diff/mag) | Coherent integrate-and-dump at baud rate $\alpha$ |
xvm_sandbox | xvm_sandbox.kn | Symbolic Execution | Subleq, Rule 110 cellular automata, LZ/Berlekamp-Massey | Complexity threshold, TAG steps gate ($2200$) |
cadence_pair | cadence_pair.kn | Spatial Filtering | Pointing corroboration gate (ON vs. OFF beam triage) | Formal law gates: WATCH, COMMON, CLEAN |
For $M$ spectral power estimates across channel bins, the estimator evaluates departures from Gaussianity: $$V_k = \frac{\sum_{m=1}^M P_{m,k}^2}{\left( \sum_{m=1}^M P_{m,k} \right)^2}, \quad SK_k = \frac{M+1}{M-1} \left( M \cdot V_k - 1 \right)$$ For Gaussian white noise, $\mathbb{E}[SK_k] = 1$ with variance $\sigma_{SK}^2 \approx \frac{4}{M}$. RFI contamination is excised when $\vert SK_k - 1 \vert \ge 0.50$ across evaluated bins.
Phase-modulated digital communications (BPSK, QPSK, FSK) exhibit non-zero spectral correlation at cyclic frequency $\alpha$: $$S_x^\alpha(f) = \lim_{T \to \infty} \frac{1}{T} \mathbb{E}\left[ X_T\left(f + \frac{\alpha}{2}\right) X_T^*\left(f - \frac{\alpha}{2}\right) \right]$$ The FFT Accumulation Method evaluates complex channelizer outputs over channel pairs $(f_k, f_l)$ where $f_k - f_l = \alpha$. Detection significances are evaluated via exact regularized lower incomplete Gamma integrals: $$P(\chi^2 \ge 2 \cdot \text{SNR} \mid 2M) = 1 - \frac{\gamma(M, \text{SNR})}{\Gamma(M)}$$ corrected for Family-Wise Error (FWE) rate across the trial grid.
Cold plasma dispersion delays lower frequencies according to the dispersion measure ($DM$): $$\Delta t = k_{\text{DM}} \cdot DM \cdot \left( f_{\text{low}}^{-2} - f_{\text{high}}^{-2} \right), \quad k_{\text{DM}} \approx 4.148808 \times 10^3 \text{ MHz}^2 \text{ pc}^{-1} \text{ cm}^3 \text{ s}$$ For continuous carrier emissions, Doppler drift rates induced by orbital acceleration are parameterized via linear chirps: $$f(t) = f_0 + \dot{f}_0 \cdot t$$ integrated via the Taylor tree algorithm across $(\dot{f}, f)$ resolution elements.
Demodulated bitstreams are evaluated for computational density and non-random state transitions:
TurboKain compiles directly from source through the native Kain compiler:
# 1. Synthesize the amalgamated single-file core
kain amalgamate --raw kain/core -o kain/core.kn
# 2. Compile to native executable
kain build kain/core.kn --target llvm -o core.exe
Every instrument contains mathematical self-tests verifying analytical bounds against synthetic Gaussian noise and injected reference signals. Run the full battery natively:
tkc prove
# or: core prove
Verification output demonstrates zero-divergence against analytical ground truths:
================================================================================
TurboKain Core Suite — Unified Native Prove Battery (9 instruments)
================================================================================
[1/9] bitslice --prove -> receipt=PASS prove=4/4
[2/9] boxcar_bank --prove -> receipt=PASS prove=4/4
[3/9] config --prove -> receipt=PASS prove=6/6
[4/9] drift_hunt --prove -> receipt=PASS prove=4/4
[5/9] fil_reader --prove -> receipt=PASS prove=4/4
[6/9] frame_hunt --prove -> receipt=PASS prove=9/9
[7/9] lag_hunt --prove -> receipt=PASS prove=9/9
[8/9] xeno_scan --selftest -> [selftest] ALL PASS
[9/9] xvm_sandbox --selftest-> receipt=PASS selftest=24/24
================================================================================
Core Battery Receipt: ALL 9 PROVE BATTERIES PASSED (receipt=PASS)
================================================================================
tkc / core)The binary is aliased as tkc (TurboKain Core), core, and turbokain_core. Tool shorthands (fam, lag, boxcar, drift, frame, sk, xeno, xvm, bits, cad, cfg, fil) are supported out of the box.
# Master directory of all 14 tools and data flows
tkc help
# Detailed mathematical parameters, flags, and contracts for an instrument
tkc help slice
tkc help fam
tkc help boxcar
tkc help xvm
tkc sweep)Execute the complete 7-stage screening and detection battery on a voltage slice in a single pass:
tkc sweep <path_to_voltage.f32> --out-dir reports/target_sweep/ --fs 2929687.5
This executes in sequence:
sk_gate (Spectral kurtosis RFI screening)xeno_scan (Statistical anomaly lattice)boxcar_bank (Transient dispersed pulse detection)drift_hunt (Chirped carrier dedoppler extraction)frame_hunt (Harmonic comb and periodicity identification)lag_hunt (Direct time-domain autocorrelation lattice)fam_god (Cyclostationary spectral correlation density mapping)Individual instruments execute directly with explicit argument contracts:
# Ingest 128 blocks of channel 44 from a raw GUPPI baseband file
tkc slice /data/raw/blc00_guppi.raw 44 /data/slices/ch44.f32 128 --pol 0
# Run multi-decade cyclostationary baud rate estimation
tkc fam --in /data/slices/ch44.f32 --fs 2929687.5 --segbank --out reports/fam.md
# Decimate and slice bits at detected baud rate
tkc bits --in /data/slices/ch44.f32 --alpha 11090.0 --out /data/bits/ch44_b11090
# Evaluate computational complexity in the symbolic execution sandbox
tkc xvm --in /data/bits/ch44_b11090.head.sign.bin --out reports/xvm.md
# Gate spatial persistence against an off-target reference observation
tkc cad --on reports/on_target.md --off reports/off_target.md --out reports/cadence.md
memory.tsv (change log) and catalog.tsv (instrument ledger).config.kn).CLEAN, WATCH, COMMON, CANDIDATE) are governed by formal logical invariants (law blocks in Kain). Automated tools generate candidate metrics and evidence receipts; promotion to interstellar candidate status requires multi-epoch verification and human analyst adjudication.TurboKain ingests raw baseband recordings from major radio observatories:
All signal processing algorithms are validated against Python and C oracle benchmarks (SetiYeti) and verified across sky observations including FRB 121102, TRAPPIST-1, Sagittarius B2, and interstellar interloper 1I/'Oumuamua.
20 commits
Rust
98.1%
Python
1.9%