Skip to content

Commit dd8ea13

Browse files
authored
Merge pull request #1 from Asmithcodes/log-Faster
feat(protocol): double FSK baud rate to 30 bps
2 parents aed5ec8 + bdfcc8f commit dd8ea13

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/services/protocol.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,15 @@ export const FSK_FREQUENCIES = [
2828
] as const;
2929

3030
// Duration of each FSK symbol in seconds.
31-
// 200 ms → ~15 bps at 3 bits/symbol.
31+
// 100 ms → ~30 bps at 3 bits/symbol.
3232
//
3333
// Timing math (must stay in sync with RX_POLL_INTERVAL_MS below):
3434
// pollsPerSymbol = SYMBOL_DURATION_S * 1000 / RX_POLL_INTERVAL_MS
35-
// = 200 / 40 = 5
35+
// = 100 / 20 = 5
3636
//
37-
// With 5 polls per symbol, a ±40ms phase offset causes at most 1 poll to
37+
// With 5 polls per symbol, a ±20ms phase offset causes at most 1 poll to
3838
// straddle the boundary. The remaining 4 always win the majority vote.
39-
// The previous 120ms (3 polls) was fragile — a 40ms offset caused ties.
40-
export const SYMBOL_DURATION_S = 0.20;
39+
export const SYMBOL_DURATION_S = 0.10;
4140

4241
// --- Handshake Tones ---
4342
// Transmitted before the data to synchronise the receiver.
@@ -90,7 +89,7 @@ export const FFT_SIZE = 8192;
9089

9190
// How often (ms) the receiver polls the AnalyserNode for a new symbol.
9291
// Should be ≤ SYMBOL_DURATION_S * 1000 to avoid missing symbols.
93-
export const RX_POLL_INTERVAL_MS = 40;
92+
export const RX_POLL_INTERVAL_MS = 20;
9493

9594
// --- Utility: Text ↔ Binary ↔ Trits (3-bit groups) ---
9695

0 commit comments

Comments
 (0)