1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
// SPDX-License-Identifier: GPL-3.0-or-later
//! Protocol markers + trait wiring for the four uvpacket modes.
//!
//! Phase 2 modulation pivot (see `docs/0.3.1_PLAN.md`): the modem
//! is **single-carrier coherent QPSK at 1200 baud + RRC pulse + 31-
//! bit m-sequence preamble + periodic pilots**. The first 0.3.1
//! attempt with non-coherent 4-FSK at h=0.5 broke down on tone
//! orthogonality; QPSK's I/Q axes are orthogonal by construction.
//!
//! All four modes share the same modem (1200 baud QPSK, 1500 Hz
//! audio centre, RRC α=0.5), the same FEC mother code
//! (`Ldpc240_101`), the same preamble + pilot scheme, and the same
//! per-LDPC-block frame layout at the [`Protocol`] trait level.
//! They differ only in the puncturing applied to the FEC parity
//! bits, which lives outside the trait constants in
//! [`crate::uvpacket::puncture`].
//!
//! ## Scope boundary: decorative trait constants
//!
//! The `mfsk-core` `Protocol` trait surface was designed to express
//! the WSJT-X family of M-ary tone-FSK modes. uvpacket lives at
//! the boundary of that abstraction: it reuses the FEC layer but
//! its modulation (single-carrier coherent QPSK + RRC) and demod
//! (matched filter + pilot-aided phase track) bypass the generic
//! mfsk-core TX / RX pipeline entirely. The natural consequence is
//! that several `ModulationParams` constants — `NTONES = 4`,
//! `TONE_SPACING_HZ`, `GFSK_BT`, `GFSK_HMOD` — are **decorative**
//! for this module: they exist solely to satisfy the trait signature
//! and the `protocol_invariants` test. They are **not** consulted
//! by [`crate::uvpacket::tx::encode`] or
//! [`crate::uvpacket::rx::decode_known_layout`].
//!
//! See [`crate::uvpacket`]'s module docs for the full scope-note
//! table and the rationale for keeping uvpacket in-tree as an
//! "applied example of FEC reuse" rather than a peer WSJT-family
//! mode.
//!
//! | ZST | rate | net bps (at 4-GFSK 2400 ch bps) | use |
//! |----------------|-----:|--------------------------------:|-----|
//! | [`UvRobust`] | 0.42 | 1008 | mountain / weak signal / deep fading |
//! | [`UvStandard`] | 0.50 | 1200 | typical NFM with fading |
//! | [`UvUltraRobust`] | 0.42 | 504 (half baud) | marathon / weakest-signal posture |
//! | [`UvExpress`] | 0.75 | 1800 | strong-signal headline-fast mode (OSD-2 essentially mandatory) |
//!
//! Higher-rate modes use kSR-greedy puncture-set selection (see
//! [`crate::uvpacket::puncture`]) — the empirical AWGN sweep showed
//! ~1–3 dB Eb/N0 gain over uniform-spread at the deeper puncture
//! rates, which makes `UvExpress` (76 % parity puncturing) viable.
//!
//! Note: at the [`Protocol`] level, all four ZSTs claim the same
//! `N_DATA = 120` (= unpunctured codeword 240 ch bits / 2 bits/sym).
//! The actual on-air block length post-puncture is shorter for
//! Standard / Fast / Express and is handled by the bespoke TX/RX
//! paths in [`crate::uvpacket::tx`] / [`crate::uvpacket::rx`]. The
//! Protocol-level constants describe the *unpunctured* codeword so
//! the standard mfsk-core invariants (FEC fits in N_DATA × bits/sym)
//! hold.
use crate;
use crateLdpc240_101;
use UvPacketRawMessage;
use Mode;
use UVPACKET_SYNC_BLOCKS;
/// Identity Gray map for 4-FSK (FT4 uses the same).
const GRAY_4: = ;
/// Audio-domain centre frequency at synth time (Hz). Tones land at
/// 800 / 1400 / 2000 / 2600 Hz, comfortably inside the typical NFM
/// HT audio passband while clearing the 300–500 Hz HPF found on
/// cheaper handhelds.
pub const AUDIO_CENTRE_HZ: f32 = 1700.0;
/// Define a uvpacket sub-mode ZST with all four trait impls.
///
/// All sub-modes share modulation, frame layout, FEC, message codec,
/// and sync. The only per-mode datum is the inherent `MODE` constant
/// pointing at the puncturing variant.
uvpacket_submode!
uvpacket_submode!
uvpacket_submode!
uvpacket_submode!