| 1 |
.PS |
| 2 |
# Trellis.m4 |
| 3 |
# Some trellis diagrams using pic alone without m4 |
| 4 |
# https://tex.stackexchange.com/questions/253458/latex-trellis-diagrams-for-stbcs |
| 5 |
# https://web.archive.org/web/20150926144231/http://www.ee2.caltech.edu/Faculty/babak/courses/ee161/papers/tsc.pdf |
| 6 |
|
| 7 |
define trellis {[ # ( nstates, psk, width, ydistance ) |
| 8 |
ngroups = ($1)/($2) |
| 9 |
for s=1 to $1 do { |
| 10 |
A[s]: circle rad 0.02 fill 0 at (0,-s*($4)) |
| 11 |
B[s]: circle rad 0.02 fill 0 at ($3,-s*($4)) } |
| 12 |
for g=1 to ngroups do { |
| 13 |
for i=1 to $2 do { |
| 14 |
for j=1 to $2 do { line from A[g+(i-1)*ngroups] to B[(g-1)*($2)+j] } |
| 15 |
} } |
| 16 |
]} |
| 17 |
|
| 18 |
trellis(4,4,1/2,1/2) |
| 19 |
trellis(8,8,1,1/2) with .nw at last [].ne+(1/2,0) |
| 20 |
trellis(16,4,3/4,1/4) with .nw at last [].ne+(1/2,0) |
| 21 |
trellis(16,8,5/4,1/4) with .nw at last [].ne+(1/2,0) |
| 22 |
trellis(32,4,5/4,1/8) with .nw at last [].ne+(1/2,0) |
| 23 |
|
| 24 |
.PE |