@e04/ft8ts 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/README.md +69 -0
- package/dist/ft8js.cjs +2119 -0
- package/dist/ft8js.cjs.map +1 -0
- package/dist/ft8js.mjs +2116 -0
- package/dist/ft8js.mjs.map +1 -0
- package/dist/ft8ts.cjs +2119 -0
- package/dist/ft8ts.cjs.map +1 -0
- package/dist/ft8ts.d.ts +36 -0
- package/dist/ft8ts.mjs +2116 -0
- package/dist/ft8ts.mjs.map +1 -0
- package/example/browser/index.html +251 -0
- package/example/decode-ft8-wav.ts +78 -0
- package/example/generate-ft8-wav.ts +82 -0
- package/package.json +53 -0
- package/src/__test__/190227_155815.wav +0 -0
- package/src/__test__/decode.test.ts +117 -0
- package/src/__test__/encode.test.ts +52 -0
- package/src/__test__/test_vectors.ts +221 -0
- package/src/__test__/wav.test.ts +45 -0
- package/src/__test__/waveform.test.ts +28 -0
- package/src/ft8/decode.ts +713 -0
- package/src/ft8/encode.ts +85 -0
- package/src/index.ts +2 -0
- package/src/util/constants.ts +118 -0
- package/src/util/crc.ts +39 -0
- package/src/util/decode174_91.ts +375 -0
- package/src/util/fft.ts +108 -0
- package/src/util/ldpc_tables.ts +91 -0
- package/src/util/pack_jt77.ts +531 -0
- package/src/util/unpack_jt77.ts +237 -0
- package/src/util/wav.ts +129 -0
- package/src/util/waveform.ts +120 -0
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# ft8ts
|
|
2
|
+
|
|
3
|
+
FT8 encoder and decoder in TypeScript. A port of the Fortran implementation from [WSJT-X](https://wsjt.sourceforge.io/wsjtx.html) v2.7.0.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
FT8 is a digital amateur radio mode designed for weak-signal communication. This library provides pure TypeScript implementations of both encoding and decoding, suitable for use in Node.js or the browser.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
`npm i @e04/ft8ts`
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
### API
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { encodeFT8, decodeFT8 } from "@e04/ft8ts";
|
|
19
|
+
|
|
20
|
+
// Encode a message to audio samples (Float32Array)
|
|
21
|
+
const samples = encodeFT8("CQ JK1IFA PM95", {
|
|
22
|
+
sampleRate: 12000,
|
|
23
|
+
baseFrequency: 1000,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// Decode audio samples to messages
|
|
27
|
+
const decoded = decodeFT8(samples, 12000, {
|
|
28
|
+
freqLow: 200,
|
|
29
|
+
freqHigh: 3000,
|
|
30
|
+
depth: 2,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
for (const d of decoded) {
|
|
34
|
+
console.log(`${d.freq} Hz SNR ${d.snr} dB ${d.msg}`);
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Decode Options
|
|
39
|
+
|
|
40
|
+
| Option | Default | Description |
|
|
41
|
+
|--------|---------|-------------|
|
|
42
|
+
| `freqLow` | 200 | Lower frequency bound (Hz) |
|
|
43
|
+
| `freqHigh` | 3000 | Upper frequency bound (Hz) |
|
|
44
|
+
| `syncMin` | 1.2 | Minimum sync threshold |
|
|
45
|
+
| `depth` | 2 | Decoding depth: 1=fast BP only, 2=BP+OSD, 3=deep |
|
|
46
|
+
| `maxCandidates` | 300 | Maximum candidates to process |
|
|
47
|
+
|
|
48
|
+
### CLI (WAV file decoding)
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npx tsx example/decode-ft8-wav.ts recording.wav [--low 200] [--high 3000] [--depth 2]
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Browser Demo
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
## Build
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npm run build
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## License
|
|
64
|
+
|
|
65
|
+
GPL-3.0
|
|
66
|
+
|
|
67
|
+
## References
|
|
68
|
+
|
|
69
|
+
- [WSJT-X](https://wsjt.sourceforge.io/wsjtx.html) — Original Fortran implementation (v2.7.0), licensed under [GPL v3](https://www.gnu.org/licenses/gpl-3.0.html)
|