@e04/ft8ts 0.0.8 → 0.0.9
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/README.md +29 -11
- package/dist/cli.js +1451 -603
- package/dist/cli.js.map +1 -1
- package/dist/ft8ts.cjs +1464 -567
- package/dist/ft8ts.cjs.map +1 -1
- package/dist/ft8ts.d.ts +43 -9
- package/dist/ft8ts.mjs +1462 -567
- package/dist/ft8ts.mjs.map +1 -1
- package/package.json +1 -1
- package/src/cli.ts +15 -2
- package/src/ft4/constants.ts +41 -0
- package/src/ft4/decode.ts +1018 -0
- package/src/ft4/encode.ts +40 -0
- package/src/ft4/scramble.ts +9 -0
- package/src/ft8/constants.ts +18 -0
- package/src/ft8/decode.ts +19 -30
- package/src/ft8/encode.ts +6 -5
- package/src/index.ts +6 -0
- package/src/util/constants.ts +4 -13
- package/src/util/waveform.ts +92 -20
package/README.md
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://github.com/e04/ft8ts/actions/workflows/test.yml)
|
|
4
4
|
|
|
5
|
-
FT8 encoder and decoder in TypeScript. A port of the Fortran implementation from [WSJT-X](https://wsjt.sourceforge.io/wsjtx.html) v2.7.0.
|
|
5
|
+
FT8 and FT4 encoder and decoder in pure TypeScript. A port of the Fortran implementation from [WSJT-X](https://wsjt.sourceforge.io/wsjtx.html) v2.7.0.
|
|
6
6
|
|
|
7
7
|
## Overview
|
|
8
8
|
|
|
9
|
-
FT8
|
|
9
|
+
FT8 and FT4 are digital amateur radio modes designed for weak-signal communication, developed by Joe Taylor (K1JT) and Steve Franke (K9AN).
|
|
10
10
|
|
|
11
|
-
This library provides pure TypeScript implementations of both encoding and decoding, suitable for use in Node.js or the browser.
|
|
11
|
+
This library provides pure TypeScript implementations of both encoding and decoding for FT8 and FT4, suitable for use in Node.js or the browser.
|
|
12
12
|
|
|
13
13
|
## Demo
|
|
14
14
|
|
|
@@ -19,8 +19,8 @@ https://e04.github.io/ft8ts/example/browser/index.html
|
|
|
19
19
|
### CLI
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
# Decode WAV file
|
|
23
|
-
npx @e04/ft8ts decode foo.wav [--low 200] [--high 3000] [--depth 2]
|
|
22
|
+
# Decode WAV file (FT8 or FT4)
|
|
23
|
+
npx @e04/ft8ts decode foo.wav [--mode ft8|ft4] [--low 200] [--high 3000] [--depth 2]
|
|
24
24
|
|
|
25
25
|
# Encode message to WAV file
|
|
26
26
|
npx @e04/ft8ts encode "CQ JK1IFA PM95" [--out output.wav] [--df 1000]
|
|
@@ -63,7 +63,7 @@ At its maximum depth mode (Depth 3), it successfully decodes 14 messages, outper
|
|
|
63
63
|
### API
|
|
64
64
|
|
|
65
65
|
```typescript
|
|
66
|
-
import { encodeFT8, decodeFT8, HashCallBook } from "@e04/ft8ts";
|
|
66
|
+
import { encodeFT8, decodeFT8, encodeFT4, decodeFT4, HashCallBook } from "@e04/ft8ts";
|
|
67
67
|
|
|
68
68
|
// Encode a message to audio samples (Float32Array)
|
|
69
69
|
const samples = encodeFT8("CQ JK1IFA PM95", {
|
|
@@ -90,6 +90,28 @@ for (const d of decoded) {
|
|
|
90
90
|
}
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
+
### FT4
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
import { encodeFT4, decodeFT4, HashCallBook } from "@e04/ft8ts";
|
|
97
|
+
|
|
98
|
+
// Encode FT4 message
|
|
99
|
+
const samples = encodeFT4("CQ JK1IFA PM95", {
|
|
100
|
+
sampleRate: 12000,
|
|
101
|
+
baseFrequency: 1000,
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
// Decode FT4
|
|
105
|
+
const book = new HashCallBook();
|
|
106
|
+
const decoded = decodeFT4(samples, {
|
|
107
|
+
sampleRate: 12000,
|
|
108
|
+
freqLow: 200,
|
|
109
|
+
freqHigh: 3000,
|
|
110
|
+
depth: 2,
|
|
111
|
+
hashCallBook: book,
|
|
112
|
+
});
|
|
113
|
+
```
|
|
114
|
+
|
|
93
115
|
### Decode Options
|
|
94
116
|
|
|
95
117
|
| Option | Default | Description |
|
|
@@ -99,13 +121,9 @@ for (const d of decoded) {
|
|
|
99
121
|
| `freqHigh` | 3000 | Upper frequency bound (Hz) |
|
|
100
122
|
| `syncMin` | 1.2 | Minimum sync threshold |
|
|
101
123
|
| `depth` | 2 | Decoding depth: 1=fast BP only, 2=BP+OSD, 3=deep |
|
|
102
|
-
| `maxCandidates` | 300 | Maximum candidates to process |
|
|
124
|
+
| `maxCandidates` | 300 (FT8) / 100 (FT4) | Maximum candidates to process |
|
|
103
125
|
| `hashCallBook` | — | `HashCallBook` instance for resolving hashed callsigns |
|
|
104
126
|
|
|
105
|
-
## ToDo
|
|
106
|
-
|
|
107
|
-
- [ ] FT4 Support
|
|
108
|
-
|
|
109
127
|
## Build
|
|
110
128
|
|
|
111
129
|
```bash
|