libSDRForge
Loading...
Searching...
No Matches
sdrforge.weather.same_afsk Namespace Reference

Experimental NOAA SAME AFSK demodulator for captured mono audio. More...

Classes

class  SameDecodeResult
 Provide SameDecodeResult behavior. More...

Functions

np.ndarray synthesize_same_audio (bytes payload, int sample_rate=24000, *, float amplitude=0.7, float baud=BAUD)
 Generate continuous-phase AFSK with 8N1 framing for testing.
np.ndarray _classify_bits (np.ndarray audio, int sample_rate, float offset, float baud=BAUD)
np.ndarray _symbol_confidences (np.ndarray audio, int sample_rate, float offset, float baud=BAUD)
float _uart_confidence (np.ndarray metrics)
bytes _uart_bytes (np.ndarray bits)
tuple[int, int, int, int] _candidate_score (bytes candidate)
SameDecodeResult decode_same_audio_diagnostic (np.ndarray audio, int sample_rate, *, tuple[float,...] baud_offsets=(0.0,))
 Return selected candidate and clock hypothesis for diagnostics.
bytes decode_same_audio (np.ndarray audio, int sample_rate, *, tuple[float,...] baud_offsets=(0.0,))
 Return decoded bytes; candidates are NOT validated emergency alerts.

Variables

float BAUD = 520.8333333333334
float SPACE_HZ = 1562.5
float MARK_HZ = 2083.3333333333335

Detailed Description

Experimental NOAA SAME AFSK demodulator for captured mono audio.

Function Documentation

◆ _candidate_score()

tuple[int, int, int, int] sdrforge.weather.same_afsk._candidate_score ( bytes candidate)
protected
Rank structurally complete headers above partial sync words.

This is candidate ranking only, NOT repeated-header alert confirmation.
Avoid treating incidental printable bytes as equivalent to a valid header.

◆ _classify_bits()

np.ndarray sdrforge.weather.same_afsk._classify_bits ( np.ndarray audio,
int sample_rate,
float offset,
float baud = BAUD )
protected
Noncoherent matched-tone energy per symbol, no phase assumptions.

◆ _symbol_confidences()

np.ndarray sdrforge.weather.same_afsk._symbol_confidences ( np.ndarray audio,
int sample_rate,
float offset,
float baud = BAUD )
protected
Signed normalized mark-minus-space energies, one value per symbol.

Positive means mark (1), negative means space (0). Values near zero
indicate an ambiguous decision. These are not calibrated probabilities.

◆ _uart_bytes()

bytes sdrforge.weather.same_afsk._uart_bytes ( np.ndarray bits)
protected
Recover 8N1 bytes, resynchronizing at each valid start bit.

◆ _uart_confidence()

float sdrforge.weather.same_afsk._uart_confidence ( np.ndarray metrics)
protected
Average confidence of UART framing and data decisions.

Uses observed magnitudes, not any assumed header payload. Start/stop
symbols must agree with UART framing. No bits are corrected here.

◆ decode_same_audio()

bytes sdrforge.weather.same_afsk.decode_same_audio ( np.ndarray audio,
int sample_rate,
* ,
tuple[float, ...] baud_offsets = (0.0,) )

Return decoded bytes; candidates are NOT validated emergency alerts.

Parameters
audioThe audio value.
sample_rateThe sample rate value.
baud_offsetsThe baud offsets value.
Returns
The operation result.

◆ decode_same_audio_diagnostic()

SameDecodeResult sdrforge.weather.same_afsk.decode_same_audio_diagnostic ( np.ndarray audio,
int sample_rate,
* ,
tuple[float, ...] baud_offsets = (0.0,) )

Return selected candidate and clock hypothesis for diagnostics.

Parameters
audioThe audio value.
sample_rateThe sample rate value.
baud_offsetsThe baud offsets value.
Returns
The operation result.

◆ synthesize_same_audio()

np.ndarray sdrforge.weather.same_afsk.synthesize_same_audio ( bytes payload,
int sample_rate = 24000,
* ,
float amplitude = 0.7,
float baud = BAUD )

Generate continuous-phase AFSK with 8N1 framing for testing.

Parameters
payloadThe payload value.
sample_rateThe sample rate value.
amplitudeThe amplitude value.
baudThe baud value.
Returns
The operation result.

Variable Documentation

◆ BAUD

float sdrforge.weather.same_afsk.BAUD = 520.8333333333334

◆ MARK_HZ

float sdrforge.weather.same_afsk.MARK_HZ = 2083.3333333333335

◆ SPACE_HZ

float sdrforge.weather.same_afsk.SPACE_HZ = 1562.5