This commit is contained in:
2026-05-31 18:53:31 +02:00
parent 818acf844a
commit 8034fc44f2
3 changed files with 10693 additions and 12112 deletions

View File

@ -406,22 +406,25 @@
accent: black,
titre_taille: 1.13em,
corps_taille: 1.2em,
compact: false,
contenu,
) = {
let largeur = if compact { auto } else { 100% }
let colonne = if compact { (5pt, auto) } else { (5pt, 1fr) }
block(
width: 100%,
width: largeur,
fill: rgb("#f8f9fa"),
stroke: 0.5pt + gray.lighten(60%),
radius: 8pt,
clip: true,
grid(
columns: (5pt, 1fr),
columns: colonne,
rows: auto,
fill: (col, row) => if col == 0 { accent },
[],
block(
width: 100%,
width: largeur,
inset: (x: 16pt, y: 15pt),
{
{
@ -615,6 +618,7 @@
let col-code-long = blue.darken(20%)
let col-code-short = gray.lighten(10%)
set text(size: 11pt)
let label_size = 18pt
move(dx: -5pt, dy: 0pt)[
#cetz.canvas({
@ -644,14 +648,16 @@
stroke: 0.5pt + gray,
fill: white,
padding: 0.2,
offset: (-161.4pt, -45.1pt),
offset: (-204.8pt, -66.1pt),
spacing: 0.4,
),
{
// 1. Limite de Shannon
plot.add(
((1.5, -8.5), (1.5, 0.2)),
style: (stroke: (paint: col-shannon, thickness: 2.5pt, dash: "dashed")),
label: [Limite de Shannon],
label: text(size: label_size)[Limite de Shannon],
)
// 2. Code court (n ≈ 100)
@ -675,7 +681,7 @@
style: (stroke: (paint: col-code-short, thickness: 1.5pt, dash: "dashed")),
mark: "+",
mark-style: (stroke: (paint: col-code-short, thickness: 0.08), size: 0.6),
label: [$n approx 100$],
label: text(size: label_size)[$n approx 100$],
)
// 3. Code long (n = 64 800)
@ -699,7 +705,7 @@
style: (stroke: (paint: col-code-long, thickness: 2.5pt)),
mark: "square",
mark-style: (stroke: (paint: col-code-long, thickness: 0.08), fill: white, size: 0.5),
label: [$n = 64\,800$],
label: text(size: label_size)[$n = 64800$],
)
},
)
@ -1230,6 +1236,156 @@
})
}
#let hldpc_col24(row1: 0, row2: 9, row3: 14, col: 24) = {
import cetz.draw
let points = (
(7, 0),
(10, 0),
(15, 0),
(22, 0),
(24, 0),
(29, 0),
(3, 1),
(6, 1),
(18, 1),
(19, 1),
(25, 1),
(27, 1),
(5, 2),
(9, 2),
(13, 2),
(14, 2),
(17, 2),
(28, 2),
(0, 3),
(8, 3),
(11, 3),
(16, 3),
(20, 3),
(26, 3),
(1, 4),
(2, 4),
(4, 4),
(12, 4),
(21, 4),
(23, 4),
(5, 5),
(6, 5),
(8, 5),
(10, 5),
(21, 5),
(29, 5),
(14, 6),
(15, 6),
(16, 6),
(18, 6),
(22, 6),
(28, 6),
(0, 7),
(1, 7),
(4, 7),
(9, 7),
(20, 7),
(26, 7),
(2, 8),
(3, 8),
(11, 8),
(12, 8),
(17, 8),
(19, 8),
(7, 9),
(13, 9),
(23, 9),
(24, 9),
(25, 9),
(27, 9),
(0, 10),
(6, 10),
(15, 10),
(18, 10),
(21, 10),
(26, 10),
(2, 11),
(7, 11),
(10, 11),
(17, 11),
(22, 11),
(27, 11),
(8, 12),
(11, 12),
(14, 12),
(20, 12),
(23, 12),
(29, 12),
(4, 13),
(5, 13),
(9, 13),
(13, 13),
(16, 13),
(19, 13),
(1, 14),
(3, 14),
(12, 14),
(24, 14),
(25, 14),
(28, 14),
)
cetz.canvas(length: 0.35cm, {
let nx = 30
let ny = 15
let col_1 = orange
let col_2 = green.darken(15%)
let col_3 = blue
let col_v = red
draw.content((-3.4, -7.5), text(size: 1.6em)[$H =$])
// Fonds de lignes horizontales
draw.rect((0, -row1), (nx, -row1 - 1), fill: col_1.lighten(90%), stroke: none)
draw.rect((0, -row2), (nx, -row2 - 1), fill: col_2.lighten(90%), stroke: none)
draw.rect((0, -row3), (nx, -row3 - 1), fill: col_3.lighten(90%), stroke: none)
// Fond de colonne verticale rouge
draw.rect((col, 0.3), (col + 1, -ny - 0.3), fill: col_v.lighten(88%), stroke: none)
// Label r_24 sous la colonne
draw.content(
(col + 0.5, -ny - 1.0),
text(size: 0.85em, fill: col_v)[$r_(24)$],
)
// Crochets
draw.set-style(stroke: (thickness: 1.2pt))
draw.line((0.5, 0.3), (0, 0.3), (0, -ny - 0.3), (0.5, -ny - 0.3))
draw.line((nx - 0.5, 0.3), (nx, 0.3), (nx, -ny - 0.3), (nx - 0.5, -ny - 0.3))
// Points
for (x, y) in points {
let d_col = gray.darken(30%)
let r = 0.15
let is_highlighted_row = (y == row1 or y == row2 or y == row3)
let is_col = (x == col)
if is_col and is_highlighted_row {
// Intersection : rouge, plus gros, prioritaire
d_col = col_v
r = 0.30
} else if y == row1 {
d_col = col_1
r = 0.22
} else if y == row2 {
d_col = col_2
r = 0.22
} else if y == row3 {
d_col = col_3
r = 0.22
}
draw.circle((x + 0.5, -y - 0.5), radius: r, fill: d_col, stroke: none)
}
})
}
// Données de H partagées (mêmes points que hldpc / hldpc_dual)
#let _h_pts = (
(7, 0),
@ -3110,7 +3266,7 @@
line((0.8, 0), "verdict.west", stroke: (paint: black, thickness: 1.3pt, dash: "dotted"))
})
// Schéma Min-Sum : comparaison SP vs MS + highlight du terme minimum
// Schéma Min-Sum : comparaison SP vs MS + highlight du terme minimum
// #let schema_min_sum_vis() = {
// cetz.canvas(length: 1cm, {
// import cetz.draw: *
@ -3205,7 +3361,7 @@
}
rect((-2.5, -0.5), (-1.5, 0.5), name: "cn", stroke: 2pt + orange, fill: orange.lighten(92%))
content((-2.0, 0), text(size: 1.2em, fill: orange, weight: "bold")[$c$])
content((-2.01, 0.07), text(size: 1.2em, fill: orange, weight: "bold")[$c$])
for i in (0, 1, 2, 3) {
let y_pos = 2.25 - i * 1.5
@ -3253,66 +3409,6 @@
])
})
#let waterfall_plot(pts_uncoded, pts_bf) = {
cetz.canvas({
import cetz.draw
plot.plot(
size: (23, 14.5),
x-label: pad(top: 5cm)[],
y-label: [BER],
x-min: 0,
x-max: 8,
y-min: -9,
y-max: 0.2,
x-tick-step: 1,
y-tick-step: 1,
x-grid: true,
y-grid: true,
y-format: y => $10^(#int(y))$,
x-format: x => pad(top: 1cm)[#x],
legend: (2, 6),
legend-style: (
padding: 0.3,
stroke: gray.lighten(50%),
fill: white,
),
{
plot.annotate({
// for decade in range(-9, 0) {
// for minor in (2, 3, 4, 5, 6, 7, 8, 9) {
// let y_pos = decade + (calc.log(minor) / calc.log(10))
// if y_pos >= -9 and y_pos <= 0 {
// draw.line(
// (0, y_pos),
// (8, y_pos),
// stroke: (paint: gray.lighten(70%), thickness: 0.3pt),
// )
// }
// }
// }
draw.content((4, -10), text(size: 1.2em)[$E_b/N_0$ (dB)])
})
plot.add(
pts_uncoded,
label: [Signal non codé],
style: (stroke: (paint: orange, thickness: 2pt, dash: "dashed")),
mark: "+",
mark-style: (stroke: orange, size: 0.5),
)
plot.add(
pts_bf,
label: [Bit-Flipping],
style: (stroke: (paint: blue, thickness: 2.5pt)),
mark: "square",
mark-style: (stroke: blue, fill: white, size: 0.25),
)
},
)
})
}
#let convergence_plot(iters, syndrms) = {
let n = iters.len()
let max_s = 160.0
@ -3360,8 +3456,8 @@
import cetz.draw: *
plot.plot(
size: (22, 15),
x-label: none,
y-label: none,
x-label: pad(bottom: 30pt)[#move(dy: 90pt)[#text(size: 1.3em)[$E_b/N_0$ (dB)]]],
y-label: move(dx: -20pt, dy: -10pt)[#text(size: 1.3em)[BER]],
x-min: 0,
x-max: 10,
y-min: -9,
@ -3370,28 +3466,14 @@
y-tick-step: 1,
x-grid: true,
y-grid: true,
style: (
axes: (
bottom: (tick: (label: (offset: 0.2))), // Chiffres plus proches de l'axe
left: (tick: (label: (offset: 0.2))),
),
),
y-format: y => $10^(#int(y))$,
x-format: x => [#x],
y-format: y => move(dx: -5pt)[$10^(#int(y))$],
x-format: x => move(dy: 14pt)[#text(size: 16pt)[#int(x)]],
legend: (14.4, 12.9),
legend-style: (padding: 0.3, stroke: gray.lighten(50%), fill: white),
{
plot.annotate({
// for decade in range(-9, 0) {
// for minor in (2, 3, 4, 5, 6, 7, 8, 9) {
// let y_pos = decade + (calc.log(minor) / calc.log(10))
// if y_pos >= -9 and y_pos <= 0 {
// line((0, y_pos), (8, y_pos), stroke: (paint: gray.lighten(60%), thickness: 0.3pt))
// }
// }
// }
content((4, -9.9), text(size: 1.3em)[$E_b/N_0$ (dB)])
content((-1, -4.5), angle: 90deg, text(size: 1.3em)[BER])
// content((4, -9.9), text(size: 1.3em)[$E_b/N_0$ (dB)])
// content((-1, -4.5), angle: 90deg, text(size: 1.3em)[BER])
})
plot.add(
pts_uncoded,
@ -3412,6 +3494,63 @@
})
}
// #let waterfall_plot(pts_uncoded, pts_bf) = {
// cetz.canvas({
// import cetz.draw: *
// plot.plot(
// size: (22, 15),
// x-label: none,
// y-label: none,
// x-min: 0,
// x-max: 10,
// y-min: -9,
// y-max: 0.2,
// x-tick-step: 1,
// y-tick-step: 1,
// x-grid: true,
// y-grid: true,
// style: (
// axes: (
// bottom: (tick: (label: (offset: 0.2))), // Chiffres plus proches de l'axe
// left: (tick: (label: (offset: 0.2))),
// ),
// ),
// y-format: y => $10^(#int(y))$,
// x-format: x => [#x],
// legend: (14.4, 12.9),
// legend-style: (padding: 0.3, stroke: gray.lighten(50%), fill: white),
// {
// plot.annotate({
// // for decade in range(-9, 0) {
// // for minor in (2, 3, 4, 5, 6, 7, 8, 9) {
// // let y_pos = decade + (calc.log(minor) / calc.log(10))
// // if y_pos >= -9 and y_pos <= 0 {
// // line((0, y_pos), (8, y_pos), stroke: (paint: gray.lighten(60%), thickness: 0.3pt))
// // }
// // }
// // }
// content((4, -9.9), text(size: 1.3em)[$E_b/N_0$ (dB)])
// content((-1, -4.5), angle: 90deg, text(size: 1.3em)[BER])
// })
// plot.add(
// pts_uncoded,
// label: [Signal non codé],
// style: (stroke: (paint: orange, thickness: 2pt, dash: "dashed")),
// mark: "+",
// mark-style: (stroke: orange, size: 0.5),
// )
// plot.add(
// pts_bf,
// label: [Bit-Flipping LDPC],
// style: (stroke: (paint: blue, thickness: 2.5pt)),
// mark: "square",
// mark-style: (stroke: blue, fill: white, size: 0.25),
// )
// },
// )
// })
// }
#let simulation_image_flow(img_orig, img_noisy, img_r05, img_r66, img_r75, img_w: 150pt, gap_top: 3.0, gap_bot: 4.0) = {
cetz.canvas({
import cetz.draw: *
@ -3491,8 +3630,8 @@
import cetz.draw: *
plot.plot(
size: (21, 15),
x-label: none,
y-label: none,
x-label: pad(bottom: 30pt)[#move(dy: 80pt)[#text(size: 16pt)[$E_b/N_0$ (dB)]]],
y-label: move(dx: -20pt, dy: -10pt)[#text(size: 16pt)[BER]],
x-min: 0,
x-max: 11,
y-min: -8,
@ -3501,33 +3640,11 @@
y-tick-step: 1,
x-grid: true,
y-grid: true,
style: (
axes: (
bottom: (tick: (label: (offset: 0.2))),
left: (tick: (label: (offset: 0.2))),
),
),
y-format: y => $10^(#int(y))$,
x-format: x => [#x],
y-format: y => move(dx: -5pt)[$10^(#int(y))$],
x-format: x => move(dy: 14pt)[#text(size: 16pt)[#int(x)]],
legend: (13.2, 11.4),
legend-style: (padding: 0.3, stroke: gray.lighten(50%), fill: white),
{
plot.annotate({
// Grille logarithmique étendue jusqu'à x=11
// for decade in range(-8, 0) {
// for minor in (2, 3, 4, 5, 6, 7, 8, 9) {
// let y_pos = decade + (calc.log(minor) / calc.log(10))
// if y_pos >= -8 and y_pos <= 0 {
// line((0, y_pos), (11, y_pos), stroke: (paint: gray.lighten(75%), thickness: 0.3pt))
// }
// }
// }
// Label X centré sur 11 unités (environ 5.5)
content((5.5, -8.7), text(size: 1.3em)[$E_b/N_0$ (dB)])
// Label Y
content((-1.2, -4.0), angle: 90deg, text(size: 1.3em)[BER])
})
plot.add(
pts_unc,
label: [Signal non codé],
@ -3535,7 +3652,6 @@
mark: "+",
mark-style: (stroke: orange, size: 1),
)
plot.add(
pts_bf,
label: [Bit-Flipping (Hard)],
@ -3543,7 +3659,6 @@
mark: "x",
mark-style: (stroke: red, size: 1),
)
plot.add(
pts_ms,
label: [Min-Sum (Soft)],
@ -3551,7 +3666,6 @@
mark: "triangle",
mark-style: (stroke: green.darken(20%), fill: white, size: 0.3),
)
plot.add(
pts_sp,
label: [Sum-Product (Soft)],