@e04/ft8ts 0.0.9 → 0.0.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e04/ft8ts",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "FT8 encoder/decoder in pure TypeScript",
5
5
  "keywords": [
6
6
  "ft8",
package/src/cli.ts CHANGED
@@ -26,6 +26,7 @@ Decode options:
26
26
  --low <hz> Lower frequency bound (default: 200)
27
27
  --high <hz> Upper frequency bound (default: 3000)
28
28
  --depth <1|2|3> Decoding depth (default: 2)
29
+ --max-candidates <n> Max candidate signals to decode (default: 300)
29
30
 
30
31
  Encode options:
31
32
  --out <file> Output WAV file (default: output.wav)
@@ -66,6 +67,8 @@ function runDecode(argv: string[]): void {
66
67
  options.freqHigh = Number(argv[++i]);
67
68
  } else if (arg === "--depth") {
68
69
  options.depth = Number(argv[++i]);
70
+ } else if (arg === "--max-candidates") {
71
+ options.maxCandidates = Number(argv[++i]);
69
72
  } else {
70
73
  throw new Error(`Unknown argument: ${arg}`);
71
74
  }
@@ -1,41 +1,3 @@
1
1
  /** FT4-specific constants (lib/ft4/ft4_params.f90). */
2
2
 
3
- import { SAMPLE_RATE } from "../util/constants.js";
4
-
5
- export const COSTAS_A = [0, 1, 3, 2] as const;
6
- export const COSTAS_B = [1, 0, 2, 3] as const;
7
- export const COSTAS_C = [2, 3, 1, 0] as const;
8
- export const COSTAS_D = [3, 2, 0, 1] as const;
9
3
  export const GRAYMAP = [0, 1, 3, 2] as const;
10
-
11
- // Message scrambling vector (rvec) from WSJT-X.
12
- export const RVEC = [
13
- 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1,
14
- 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0,
15
- 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1,
16
- ] as const;
17
-
18
- export const NSPS = 576;
19
- export const NFFT1 = 4 * NSPS; // 2304
20
- export const NH1 = NFFT1 / 2; // 1152
21
- export const NSTEP = NSPS;
22
- export const NMAX = 21 * 3456; // 72576
23
- export const NHSYM = Math.floor((NMAX - NFFT1) / NSTEP); // 122
24
- export const NDOWN = 18;
25
- export const ND = 87;
26
- export const NS = 16;
27
- export const NN = NS + ND; // 103
28
-
29
- export const NFFT2 = NMAX / NDOWN; // 4032
30
- export const NSS = NSPS / NDOWN; // 32
31
- export const FS2 = SAMPLE_RATE / NDOWN; // 666.67 Hz
32
- export const MAX_FREQ = 4910;
33
- export const SYNC_PASS_MIN = 1.2;
34
- export const TWO_PI = 2 * Math.PI;
35
-
36
- export const HARD_SYNC_PATTERNS = [
37
- { offset: 0, bits: [0, 0, 0, 1, 1, 0, 1, 1] as const },
38
- { offset: 66, bits: [0, 1, 0, 0, 1, 1, 1, 0] as const },
39
- { offset: 132, bits: [1, 1, 1, 0, 0, 1, 0, 0] as const },
40
- { offset: 198, bits: [1, 0, 1, 1, 0, 0, 0, 1] as const },
41
- ] as const;