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
//! JT65 interleaver: 7×9 matrix transpose over the 63 RS symbols.
//!
//! Ported from WSJT-X `interleave63.f90`. The encoder writes the
//! linear 63-symbol array into a 7×9 matrix in row-major order and
//! reads back in column-major order (equivalently: transposes to a
//! 9×7 matrix). The decoder performs the inverse transpose.
/// Interleave 63 symbols: write as 7 rows × 9 cols, read as 9 rows ×
/// 7 cols. Invertible by [`deinterleave`].
///
/// Matches WSJT-X `interleave63(d1, idir=1)`, called at TX time
/// (`gen65.f90`, `jt65sim.f90`) to go from RS-codeword order to
/// channel order. Fortran's column-major `d1(0:6,0:8)` /
/// `d2(0:8,0:6)` gives `output[9*i+j] = input[7*j+i]`.
/// Inverse of [`interleave`].
///
/// Matches WSJT-X `interleave63(d1, idir=-1)`, called at RX time
/// (`extract.f90`) to go from channel order back to RS-codeword
/// order.