← Commit history

Delete explorer/amfm-explorer-widget.js

noah ·608ed14c3f · ·parent 2923614
1 file changed −4892
explorer/amfm-explorer-widget.jsdeleted−4892
@@ -1,4892 +0,0 @@-/* AM/FM Receiver Explorer, the wiki widget <adom-amfm-explorer>. Generated by widget.py from-   amfm_receiver/wiki_pages/explorer (the same sources as the artifact); edit those, not this file. */-(function () {-  if (!window.customElements || customElements.get('adom-amfm-explorer')) return;-  var CSS = "/* Schematic styling. Colors come from tokens the page defines; the defaults keep previews readable. */\nsvg.sch { --ink: #1d2a3a; --ink2: #5b6b80; --wire: #2f4a6b; --spaper: #fbfcfd; --grid: rgba(40, 80, 120, .06);\n  --val: #0c6f6b; --flag: #6c4fd6; --flagbg: rgba(108, 79, 214, .08); --tp: #0b8f88; --hl: #e0750b; --region: rgba(47, 74, 107, .35);\n  overflow: visible; font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }\nsvg.sch .sym path, svg.sch .sym .body { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }\nsvg.sch .sym path.fill, svg.sch .sym .dot { fill: var(--ink); stroke: none; }\nsvg.sch .part.tp .sym circle { stroke: var(--tp); fill: var(--spaper); }\nsvg.sch .part.tp .sym path, svg.sch .part.mc .sym path { stroke: var(--tp); }\nsvg.sch .part.mc .sym path.fill { fill: var(--tp); }\nsvg.sch .wire { fill: none; stroke: var(--wire); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }\nsvg.sch .junction { fill: var(--wire); }\nsvg.sch .gnd, svg.sch .rail path { fill: none; stroke: var(--ink2); stroke-width: 1.4; stroke-linecap: round; }\nsvg.sch text { font-size: 9px; fill: var(--ink2); }\nsvg.sch .ref { fill: var(--ink2); font-size: 8.5px; }\nsvg.sch .val { fill: var(--val); font-size: 9px; font-weight: 600; }\nsvg.sch .pinname { font-size: 7.5px; fill: var(--ink2); }\nsvg.sch .inner { font-size: 7.5px; fill: var(--ink); font-weight: 600; }\nsvg.sch .tpl { fill: var(--tp); font-size: 8.5px; font-weight: 700; }\nsvg.sch .rail text { fill: var(--ink); font-size: 8.5px; font-weight: 600; }\nsvg.sch .flag path { fill: var(--flagbg); stroke: var(--flag); stroke-width: 1.2; }\nsvg.sch .flag text { fill: var(--flag); font-size: 8.5px; font-weight: 600; }\nsvg.sch .note { fill: var(--ink2); font-size: 8.5px; font-style: italic; font-family: inherit; }\nsvg.sch .region { fill: none; stroke: var(--region); stroke-width: 1; stroke-dasharray: 4 3; }\nsvg.sch .region-t { fill: var(--ink2); font-size: 8.5px; font-weight: 600; letter-spacing: .02em; }\nsvg.sch .hit { fill: transparent; stroke: none; }\nsvg.sch .wire-hit { fill: none; stroke: transparent; stroke-width: 9; pointer-events: stroke; cursor: crosshair; }\n/* interaction */\nsvg.sch .part, svg.sch .flag { cursor: pointer; }\nsvg.sch .wire, svg.sch .junction { cursor: crosshair; }\nsvg.sch .hl.wire, svg.sch .hl.gnd, svg.sch .rail.hl path { stroke: var(--hl); stroke-width: 2.4; }\nsvg.sch .hl.junction { fill: var(--hl); }\nsvg.sch .flag.hl path { stroke: var(--hl); stroke-width: 2; }\nsvg.sch .part.hot .sym path, svg.sch .part.hot .sym .body { stroke: var(--hl); }\nsvg.sch .part.hot .sym path.fill { fill: var(--hl); }\nsvg.sch .part.hot .ref { fill: var(--hl); }\nsvg.sch .part.dim { opacity: .28; }\n\n/* Layout: a header strip, a station tuner, the full-width signal flowchart, then a two-column\n   detail view (schematic | explanation) for the selected block. Adom palette: teal = FM, purple = AM. */\n:host {\n  --bg: #f3f6f8; --surface: #ffffff; --surface-2: #eaf0f4; --line: #d3dde5; --line-2: #b9c7d3;\n  --text: #0e1b2b; --text-2: #46586c; --text-3: #758597;\n  --accent: #00837d; --accent-fill: #00b8b1; --on-accent: #ffffff;\n  --fm: #00968f; --fm-soft: rgba(0, 150, 143, .11);\n  --am: #7552e6; --am-soft: rgba(117, 82, 230, .10);\n  --if: #2d6cd0; --if-soft: rgba(45, 108, 208, .09);\n  --ctrl: #a86b10; --ctrl-soft: rgba(168, 107, 16, .10);\n  --dig: #52657a; --dig-soft: rgba(82, 101, 122, .10);\n  --warn: #b4460c; --warn-soft: rgba(212, 98, 26, .08); --warn-line: rgba(180, 70, 12, .35);\n  --hl: #e0750b;\n  --sig-fm: #00968f; --sig-am: #7552e6; --sig-img: #b5179e; --sig-sub: #a86b10; --sig-other: #8b98a7;\n  --paper: #fbfcfd; --grid: rgba(40, 80, 120, .055);\n  --s-ink: #1d2a3a; --s-ink2: #5b6b80; --s-wire: #2f4a6b; --s-val: #0a6c67; --s-flag: #6142d4; --s-flagbg: rgba(97, 66, 212, .07); --s-tp: #008a83; --s-region: rgba(47, 74, 107, .32);\n  --f-display: 'Familjen Grotesk', 'Figtree', system-ui, sans-serif;\n  --f-body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;\n  --f-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n  --r: 8px;\n}\n\n\n\n* { box-sizing: border-box; }\n.app { background: var(--bg); color: var(--text); font: 15px/1.55 var(--f-body); margin: 0; }\n.wrap { max-width: 1240px; margin: 0 auto; grid-template-columns: minmax(0, 1fr); padding-block: 28px 64px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 22px; }\nh1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; letter-spacing: -.01em; }\ncode, .mono { font-family: var(--f-mono); font-size: .86em; }\ncode { background: var(--surface-2); padding: .05em .35em; border-radius: 4px; white-space: nowrap; }\na { color: var(--accent); }\nbutton { font: inherit; color: inherit; }\n:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 2px; }\n\n/* header */\n.top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; align-items: end; }\n.eyebrow { font: 600 11.5px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }\n.top h1 { font-size: clamp(28px, 4.2vw, 42px); line-height: 1.05; font-weight: 700; margin-top: 8px; }\n.top h1 .fm { color: var(--fm); } .top h1 .am { color: var(--am); }\n.lede { color: var(--text-2); max-width: 68ch; margin: 10px 0 0; }\n.toplinks { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; font-size: 13.5px; }\n.check { font: 500 12px var(--f-mono); color: var(--text-3); }\n.check b { color: var(--fm); font-weight: 600; }\n\n/* panels */\n.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }\n.panel-h { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); }\n.panel-h h2 { font-size: 16px; font-weight: 650; }\n.hint { color: var(--text-3); font-size: 13px; }\n\n/* tuner */\n.tuner { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); }\n.tuner-ctl { padding: 16px; display: grid; gap: 14px; align-content: start; border-right: 1px solid var(--line); }\n.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 7px; overflow: hidden; }\n.seg button { border: 0; background: transparent; padding: 6px 13px; font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--text-2); }\n.seg button + button { border-left: 1px solid var(--line-2); }\n.seg button[aria-pressed=\"true\"] { background: var(--text); color: var(--bg); }\n.seg.band button[data-band=\"fm\"][aria-pressed=\"true\"] { background: var(--fm); color: #fff; }\n.seg.band button[data-band=\"am\"][aria-pressed=\"true\"] { background: var(--am); color: #fff; }\n.ctl-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }\n.ctl-label { font: 600 11px var(--f-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }\n.station { display: grid; gap: 6px; }\n.station-read { display: flex; align-items: baseline; gap: 8px; }\n.station-read input { font: 700 30px var(--f-display); width: 5.2ch; border: 0; border-bottom: 2px solid var(--line-2); background: transparent; color: var(--text); padding: 0; font-variant-numeric: tabular-nums; }\n.station-read span { font: 600 15px var(--f-display); color: var(--text-2); }\ninput[type=range] { width: 100%; accent-color: var(--accent-fill); }\n.presets { display: flex; flex-wrap: wrap; gap: 6px; }\n.presets button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 2px 9px; font: 500 12px var(--f-mono); cursor: pointer; color: var(--text-2); }\n.presets button:hover { border-color: var(--accent-fill); color: var(--text); }\n.tuner-out { padding: 14px 16px 12px; display: grid; gap: 10px; min-width: 0; }\n.freqs { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }\n.freq { border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; background: var(--surface-2); min-width: 0; }\n.freq .k { font: 600 10.5px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }\n.freq .v { font: 600 16px var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }\n.freq.rf .k::before, .freq.lo .k::before, .freq.img .k::before { content: ''; display: inline-block; width: 12px; height: 2px; margin-right: 6px; vertical-align: middle; background: var(--sig-fm); }\n.band-am .freq.rf .k::before { background: var(--sig-am); } .freq.lo .k::before { background: var(--text-2); } .freq.img .k::before { background: var(--sig-img); }\n.verdict { font-size: 13.5px; color: var(--text-2); min-height: 2.6em; }\n.verdict b { color: var(--text); }\n.verdict.bad b { color: var(--warn); }\n.spec-wrap { overflow-x: auto; }\nsvg.spec { width: 100%; min-width: 520px; height: auto; display: block; }\nsvg.spec text { font: 500 10px var(--f-mono); fill: var(--text-3); }\nsvg.spec .axis { stroke: var(--line-2); stroke-width: 1; }\nsvg.spec .tick { stroke: var(--line-2); }\nsvg.spec .bandfill { fill: var(--fm-soft); } .band-am svg.spec .bandfill { fill: var(--am-soft); }\nsvg.spec .airfill { fill: var(--dig-soft); }\nsvg.spec .resp { fill: var(--fm-soft); stroke: var(--fm); stroke-width: 1.4; } .band-am svg.spec .resp { fill: var(--am-soft); stroke: var(--am); }\nsvg.spec .m-rf { stroke: var(--sig-fm); stroke-width: 2; } .band-am svg.spec .m-rf { stroke: var(--sig-am); }\nsvg.spec .m-lo { stroke: var(--text-2); stroke-width: 2; }\nsvg.spec .m-img { stroke: var(--sig-img); stroke-width: 2; stroke-dasharray: 4 3; }\nsvg.spec .lorange { fill: var(--if-soft); stroke: var(--if); stroke-width: 1; }\nsvg.spec .lbl-rf, svg.spec .lbl-lo, svg.spec .lbl-img { fill: var(--text); font-weight: 700; }\n\n/* flowchart */\n.flow-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-2); }\n.flow-legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }\n.flow-legend .ctrl i { background: repeating-linear-gradient(90deg, var(--ctrl) 0 4px, transparent 4px 7px); }\n.flow-scroll { overflow-x: auto; padding: 8px 8px 4px; }\nsvg.flow { display: block; width: 100%; min-width: 860px; height: auto; font-family: var(--f-body); }\nsvg.flow .sec { font: 700 11px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; fill: var(--text-3); }\nsvg.flow .divider { stroke: var(--line); stroke-dasharray: 2 4; }\nsvg.flow .edge { fill: none; stroke-width: 2; stroke-linejoin: round; }\nsvg.flow .edge.fm { stroke: var(--fm); } svg.flow .edge.am { stroke: var(--am); } svg.flow .edge.if { stroke: var(--if); } svg.flow .edge.dig { stroke: var(--dig); }\nsvg.flow .edge.ctrl { stroke: var(--ctrl); stroke-width: 1.5; stroke-dasharray: 5 4; }\nsvg.flow .pulse { fill: none; stroke-width: 2.6; stroke-dasharray: 3 21; stroke-linecap: round; animation: run 1.1s linear infinite; opacity: 0; }\nsvg.flow .pulse.fm { stroke: var(--fm); } svg.flow .pulse.am { stroke: var(--am); } svg.flow .pulse.if { stroke: var(--if); } svg.flow .pulse.dig { stroke: var(--dig); }\nsvg.flow .live .pulse { opacity: .95; }\n@keyframes run { to { stroke-dashoffset: -24; } }\n@media (prefers-reduced-motion: reduce) { svg.flow .pulse { animation: none; } }\nsvg.flow .elabel { font: 500 9.5px var(--f-mono); fill: var(--text-2); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }\nsvg.flow .elabel.dyn { font-weight: 700; fill: var(--text); }\nsvg.flow .egroup.off { opacity: .16; }\nsvg.flow .node { cursor: pointer; }\nsvg.flow .node rect.box { fill: var(--surface); stroke-width: 1.4; }\nsvg.flow .node.fm rect.box { stroke: var(--fm); } svg.flow .node.am rect.box { stroke: var(--am); } svg.flow .node.if rect.box { stroke: var(--if); }\nsvg.flow .node.ctrl rect.box { stroke: var(--ctrl); } svg.flow .node.dig rect.box { stroke: var(--dig); }\nsvg.flow .node.term rect.box { stroke: var(--line-2); stroke-dasharray: 3 3; fill: transparent; }\nsvg.flow .node .t { font: 650 12px var(--f-display); fill: var(--text); }\nsvg.flow .node .s { font: 500 9.5px var(--f-mono); fill: var(--text-2); }\nsvg.flow .node .pin { font: 500 9px var(--f-mono); fill: var(--text-3); }\nsvg.flow .node .pin tspan.p { fill: var(--text-2); font-weight: 600; }\nsvg.flow .node .dot { stroke: none; }\nsvg.flow .node.fm .dot { fill: var(--fm); } svg.flow .node.am .dot { fill: var(--am); } svg.flow .node.if .dot { fill: var(--if); } svg.flow .node.ctrl .dot { fill: var(--ctrl); } svg.flow .node.dig .dot { fill: var(--dig); }\nsvg.flow .node .warn { fill: var(--warn); }\nsvg.flow .node:hover rect.box, svg.flow .node.rel rect.box { stroke-width: 2.4; }\nsvg.flow .node.sel rect.box { stroke-width: 2.6; }\nsvg.flow .node.sel.fm rect.box { fill: var(--fm-soft); } svg.flow .node.sel.am rect.box { fill: var(--am-soft); } svg.flow .node.sel.if rect.box { fill: var(--if-soft); }\nsvg.flow .node.sel.ctrl rect.box { fill: var(--ctrl-soft); } svg.flow .node.sel.dig rect.box { fill: var(--dig-soft); }\nsvg.flow .node.off { opacity: .32; }\nsvg.flow .node:focus-visible { outline: none; } svg.flow .node:focus-visible rect.box { stroke-width: 3; }\n\n/* detail */\n.detail { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); }\n.detail-h { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }\n.detail-h h2 { font-size: 22px; font-weight: 700; }\n.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }\n.chip { font: 600 11px var(--f-mono); letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; border: 1px solid; }\n.chip.fm { color: var(--fm); border-color: var(--fm); background: var(--fm-soft); }\n.chip.am { color: var(--am); border-color: var(--am); background: var(--am-soft); }\n.chip.if { color: var(--if); border-color: var(--if); background: var(--if-soft); }\n.chip.ctrl { color: var(--ctrl); border-color: var(--ctrl); background: var(--ctrl-soft); }\n.chip.dig { color: var(--dig); border-color: var(--dig); background: var(--dig-soft); }\n.chip.src { color: var(--text-3); border-color: var(--line-2); background: transparent; }\n.nav { display: flex; gap: 6px; }\n.nav button, .zoom button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 7px; padding: 5px 11px; font-size: 13px; font-weight: 600; cursor: pointer; }\n.nav button:hover, .zoom button:hover { border-color: var(--accent-fill); }\n.nav button:disabled { opacity: .4; cursor: default; }\n.sch-col { min-width: 0; display: grid; grid-template-rows: auto auto auto auto; align-self: start; }\n.info { border-left: 1px solid var(--line); }\n.sch-bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--line); }\n.zoom { display: flex; gap: 4px; }\n.zoom button { padding: 3px 9px; font-family: var(--f-mono); }\n.find { display: flex; gap: 6px; align-items: center; }\n.find input { font: 500 13px var(--f-mono); border: 1px solid var(--line-2); border-radius: 7px; padding: 4px 8px; width: 15ch; background: var(--surface); color: var(--text); }\n.find .msg { font-size: 12px; color: var(--warn); }\n.sch-view { position: relative; overflow: hidden; background-color: var(--paper);\n  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);\n  background-size: 12px 12px; min-height: 300px; touch-action: none; cursor: grab; }\n.sch-view.dragging { cursor: grabbing; }\n.sch-view svg.sch { display: block; width: 100%; height: auto; max-height: 70vh; }\nsvg.sch { --ink: var(--s-ink); --ink2: var(--s-ink2); --wire: var(--s-wire); --val: var(--s-val); --flag: var(--s-flag); --flagbg: var(--s-flagbg); --tp: var(--s-tp); --region: var(--s-region); --spaper: var(--paper); }\n.sch-key { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); }\n.sch-key b { font-family: var(--f-mono); font-weight: 700; }\n.sch-key .k-tp { color: var(--s-tp); } .sch-key .k-flag { color: var(--s-flag); } .sch-key .k-hl { color: var(--hl); }\n.info { padding: 16px; display: grid; gap: 16px; align-content: start; min-width: 0; }\n.role { font: 600 16px/1.4 var(--f-display); }\n.info p { margin: 0; color: var(--text-2); }\n.info .text { display: grid; gap: 10px; }\n.info h3 { font: 700 11px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }\n.facts { margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; }\n.facts li { font-size: 13.5px; color: var(--text-2); padding-left: 14px; position: relative; }\n.facts li::before { content: ''; position: absolute; left: 2px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--line-2); }\n.board { border: 1px solid var(--warn-line); background: var(--warn-soft); border-radius: 7px; padding: 10px 12px; }\n.board h3 { color: var(--warn); }\n.board p { color: var(--text); font-size: 14px; }\n.parts { width: 100%; border-collapse: collapse; font-size: 12.5px; }\n.parts td { padding: 3px 6px 3px 0; border-bottom: 1px solid var(--line); vertical-align: top; }\n.parts td:first-child { font-family: var(--f-mono); font-weight: 600; white-space: nowrap; }\n.parts td:nth-child(2) { font-family: var(--f-mono); color: var(--s-val); white-space: nowrap; }\n.parts td:last-child { color: var(--text-3); }\n.parts tr { cursor: pointer; }\n.parts tr:hover td, .parts tr.hot td { background: var(--surface-2); }\n.parts-wrap { max-height: 300px; overflow: auto; }\n.card { border: 1px solid var(--line-2); border-radius: 7px; padding: 10px 12px; display: grid; gap: 6px; background: var(--surface-2); }\n.card .ct { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }\n.card .ct b { font: 700 16px var(--f-mono); }\n.card .ct button { border: 0; background: transparent; cursor: pointer; color: var(--text-3); font-size: 16px; line-height: 1; }\n.card .cv { font: 600 13px var(--f-mono); color: var(--s-val); }\n.card .cd { font-size: 13px; color: var(--text-2); }\n.card .cl { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }\n.card .pins { display: flex; flex-wrap: wrap; gap: 4px; }\n.card .pins button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 5px; padding: 1px 6px; font: 500 11.5px var(--f-mono); cursor: pointer; color: var(--text-2); }\n.card .pins button:hover { border-color: var(--hl); color: var(--text); }\n.src { font: 500 12px var(--f-mono); color: var(--text-3); }\n\n/* tooltip & menus */\n.tip { position: fixed; z-index: 20; pointer-events: none; max-width: 300px; background: var(--text); color: var(--bg); border-radius: 6px; padding: 7px 9px; font-size: 12.5px; line-height: 1.4; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }\n.tip b { font-family: var(--f-mono); }\n.tip .tv { font-family: var(--f-mono); opacity: .85; }\n.tip .td { opacity: .8; }\n.menu { position: fixed; z-index: 21; background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 4px; display: grid; min-width: 200px; box-shadow: 0 8px 22px rgba(0, 0, 0, .18); }\n.menu .mh { font: 600 11px var(--f-mono); color: var(--text-3); padding: 5px 8px 3px; }\n.menu button { border: 0; background: transparent; text-align: left; padding: 6px 8px; border-radius: 5px; cursor: pointer; font-size: 13.5px; }\n.menu button:hover, .menu button:focus-visible { background: var(--surface-2); }\n\n@container xp (max-width: 900px) {\n  .tuner { grid-template-columns: minmax(0, 1fr); }\n  .tuner-ctl { border-right: 0; border-bottom: 1px solid var(--line); }\n  .detail { grid-template-columns: minmax(0, 1fr); }\n  .sch-col { border-bottom: 1px solid var(--line); position: static; }\n  .info { border-left: 0; }\n  .top { grid-template-columns: minmax(0, 1fr); }\n  .toplinks { align-items: flex-start; }\n}\n@container xp (max-width: 560px) {\n  .detail-h { grid-template-columns: minmax(0, 1fr); }\n  .find input { width: 11ch; }\n}\n\n/* tabs */\n.tabs { display: inline-flex; gap: 2px; background: var(--surface-2); border-radius: 8px; padding: 3px; }\n.tabs button { border: 0; background: transparent; padding: 5px 12px; border-radius: 6px; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }\n.tabs button[aria-selected=\"true\"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }\n.view-note { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; padding: 10px 16px 0; }\n.spec-note { display: grid; gap: 8px; padding: 12px 16px 4px; }\n.spec-note p { margin: 0; color: var(--text-2); max-width: 90ch; font-size: 14px; }\n.spec-note p.hint { font-size: 12.5px; color: var(--text-3); }\n.spec-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--text-2); }\n.spec-legend span { display: inline-flex; align-items: center; gap: 6px; }\n.spec-legend i { display: inline-block; width: 16px; height: 0; border-top: 2px solid var(--sc); }\n.spec-legend i.dash { border-top-style: dashed; }\n.spec-legend i.fill { height: 9px; border: 0; background: var(--text-3); opacity: .3; }\n.spec-legend i.ghost { border-top: 1.5px dashed var(--text-3); opacity: .8; }\n.spec-legend i.ref { border-top: 1px dashed var(--text-2); }\n.spec-legend i.trace { height: 9px; border: 0; border-top: 1.5px solid var(--text-2); background: color-mix(in srgb, var(--text-3) 22%, transparent); }\n.spec-legend i.band { height: 9px; border: 0; background: color-mix(in srgb, var(--text) 9%, transparent); }\n.band-fm, .spec-grid.band-fm { --sig-st: var(--sig-fm); }\n.band-am, .spec-grid.band-am { --sig-st: var(--sig-am); }\n\n/* stage cards */\n.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 14px; padding: 12px 16px 16px; }\n.stage { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px 8px; display: grid; gap: 4px; align-content: start; min-width: 0; background: var(--surface); }\n.stage header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }\n.stage .step { font: 700 12px var(--f-mono); color: var(--text-3); min-width: 1.6em; }\n.stage .sh { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 0; }\n.stage h3 { font-size: 15px; font-weight: 650; }\n.stage .parts { font: 500 11.5px var(--f-mono); color: var(--text-3); }\n.stage .est { font: 600 10.5px var(--f-mono); color: var(--text-3); border: 1px solid var(--line-2); border-radius: 999px; padding: 0 7px; }\n.stage .open { border: 1px solid var(--line-2); background: var(--surface); border-radius: 6px; padding: 2px 9px; font-size: 12px; font-weight: 600; cursor: pointer; }\n.stage .open:hover { border-color: var(--accent-fill); }\n.stage .cap { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.5; }\n.stage details { font-size: 12.5px; color: var(--text-3); }\n.stage summary { cursor: pointer; width: max-content; }\n.stage table { border-collapse: collapse; margin-top: 4px; width: 100%; font-variant-numeric: tabular-nums; }\n.stage th { text-align: left; font-weight: 600; color: var(--text-3); padding: 2px 8px 2px 0; border-bottom: 1px solid var(--line); }\n.stage td { padding: 2px 8px 2px 0; border-bottom: 1px solid var(--line); color: var(--text-2); }\n.stage td.n { font-family: var(--f-mono); white-space: nowrap; text-align: right; }\n.spec-end { grid-column: 1 / -1; color: var(--text-3); font-size: 13px; padding: 4px 2px; }\nsvg.stg { display: block; width: 100%; height: auto; font-family: var(--f-mono); overflow: visible; }\nsvg.stg .grid { stroke: var(--line); stroke-width: 1; }\nsvg.stg .grid.zero { stroke: var(--line-2); }\nsvg.stg .axis { stroke: var(--line-2); stroke-width: 1; }\nsvg.stg .tk { font-size: 9.5px; fill: var(--text-3); font-variant-numeric: tabular-nums; }\nsvg.stg .pl { font: 600 10px var(--f-mono); fill: var(--text-3); }\nsvg.stg .rline { fill: none; stroke: var(--text-2); stroke-width: 2; stroke-linejoin: round; }\nsvg.stg .rarea { fill: var(--text-2); opacity: .07; }\nsvg.stg .noise { fill: var(--text-3); opacity: .16; }\nsvg.stg .ref { stroke: var(--text-3); stroke-width: 1; }\nsvg.stg .refl { font-size: 9px; fill: var(--text-3); }\nsvg.stg .k-station { --sc: var(--sig-st); } svg.stg .k-image { --sc: var(--sig-img); } svg.stg .k-sub { --sc: var(--sig-sub); } svg.stg .k-other { --sc: var(--sig-other); }\nsvg.stg .sg .line { fill: none; stroke: var(--sc); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }\nsvg.stg .sg .fillp { fill: var(--sc); opacity: .1; }\nsvg.stg .sg .cap { fill: var(--sc); stroke: var(--surface); stroke-width: 2; }\nsvg.stg .sg.k-image .line { stroke-dasharray: 5 3; }\nsvg.stg .gh .line { fill: none; stroke: var(--text-3); stroke-width: 1.2; opacity: .5; }\nsvg.stg .gh .fillp { fill: var(--text-3); opacity: .05; }\nsvg.stg .dl { font: 600 10.5px var(--f-body); fill: var(--text); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }\nsvg.stg .xhair { stroke: var(--text-2); stroke-width: 1; }\nsvg.stg .hov { fill: transparent; cursor: crosshair; }\n.focus svg.stg .sg { opacity: .3; } .focus svg.stg .sg.on { opacity: 1; } .focus svg.stg .sg.on .line { stroke-width: 3; }\nsvg.stg foreignObject div { font-family: var(--f-body); }\nsvg.stg .strip { font-size: 12.5px; line-height: 1.4; color: var(--text-2); }\nsvg.stg .fault { font-size: 12px; line-height: 1.35; color: var(--text); background: var(--surface); border: 1px solid var(--warn-line); border-left-width: 1px; border-radius: 6px; padding: 5px 8px; box-shadow: 0 0 0 3px var(--warn-soft); }\n.info .stages { display: grid; gap: 10px; }\n.info .stages .stage { padding: 8px 10px 6px; }\n.tip .tval { font: 700 13px var(--f-mono); }\n.tip .trow { display: flex; align-items: center; gap: 6px; }\n.tip .tkey { display: inline-block; width: 12px; height: 0; border-top: 2px solid var(--sc); }\n.info .stage h3 { font: 650 14px var(--f-display); letter-spacing: normal; text-transform: none; color: var(--text); margin: 0; }\n.info #stage-slot > h3 { margin-bottom: 8px; }\n.stage .sfault { margin: 2px 0 0; font-size: 13px; line-height: 1.45; color: var(--text); border: 1px solid var(--warn-line); background: var(--warn-soft); border-radius: 6px; padding: 6px 9px; }\n.stage .sfault::before { content: 'First board  '; font: 700 10.5px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--warn); }\n\n/* the big chart under the schematic */\n.sd { border-top: 1px solid var(--line); display: grid; gap: 8px; padding: 12px 0 0; min-width: 0; }\n.sd-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 0 12px; }\n.sd-head { display: grid; gap: 6px; min-width: 0; }\n.sd-head h3 { font-size: 15.5px; font-weight: 650; }\n.sd-tabs { display: flex; flex-wrap: wrap; gap: 4px; }\n.sd-tabs:empty { display: none; }\n.sd-tabs button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 2px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--text-2); }\n.sd-tabs button[aria-pressed=\"true\"] { background: var(--text); color: var(--bg); border-color: var(--text); }\n.sd .zoom button:disabled { opacity: .45; cursor: default; }\n.sd-note { margin: 0 12px; font-size: 13px; color: var(--text-2); }\n.sd-legend { padding: 0 12px; }\n.sd-view { min-width: 0; overflow: hidden; background: var(--surface); cursor: crosshair; touch-action: pan-y; }\n.sd-view.dragging, .sd-view.dragging .hov { cursor: grabbing; }\n.sd-view svg.stg { width: 100%; height: auto; }\n.sd-cap { display: grid; gap: 8px; padding: 0 12px; }\n.sd-cap p { margin: 0; font-size: 14px; color: var(--text-2); line-height: 1.55; max-width: 80ch; }\n.sd-cap p.hint { font-size: 12.5px; color: var(--text-3); }\n.sd-cap .sfault, .stage .sfault { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--text); border: 1px solid var(--warn-line); background: var(--warn-soft); border-radius: 6px; padding: 6px 9px; }\n.sd-cap .sfault::before { content: 'First board  '; font: 700 10.5px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--warn); }\n.sd-follow { padding: 0 12px; }\n.sd-follow:empty { display: none; }\n.follow { border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface-2); padding: 8px 10px; display: grid; gap: 6px; }\n.follow .fh { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }\n.follow .fh b { color: var(--text); }\n.follow .fh button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 6px; padding: 2px 9px; font-size: 12px; font-weight: 600; cursor: pointer; }\n.follow .fwrap { overflow-x: auto; }\n.follow table { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }\n.follow th { text-align: left; font-weight: 600; color: var(--text-3); padding: 3px 10px 3px 0; border-bottom: 1px solid var(--line); font-size: 12px; }\n.follow td { padding: 3px 10px 3px 0; border-bottom: 1px solid var(--line); color: var(--text-2); }\n.follow .n { font-family: var(--f-mono); text-align: right; white-space: nowrap; }\n.follow th.n { text-align: right; }\n.follow td.gone { color: var(--text-3); font-family: var(--f-body); }\n.follow tr[data-st] { cursor: pointer; }\n.follow tr[data-st]:hover td, .follow tr.cur td { background: var(--surface); }\n.follow tr.cur td:first-child { box-shadow: inset 3px 0 0 var(--sig-st, var(--accent-fill)); }\nsvg.stg.big .tk { font-size: 12px; }\n/* waveform view (scope.js): what an oscilloscope on the node shows */\nsvg.stg.scope .tr { fill: none; stroke: var(--sig-st); stroke-width: 1.6; stroke-linejoin: round; }\nsvg.stg.scope .tr.soft { stroke-width: 1.3; }\nsvg.stg.scope .tr.faint { stroke: var(--text-3); stroke-dasharray: 4 3; }\nsvg.stg.scope .tr.ghost { stroke: var(--text-3); stroke-width: 1.2; stroke-dasharray: 5 3; opacity: .8; }\nsvg.stg.scope .band { fill: var(--sig-st); opacity: .32; }\nsvg.stg.scope .ghostband { fill: none; stroke: var(--text-3); stroke-width: 1.2; stroke-dasharray: 5 3; }\nsvg.stg.scope .dot { fill: var(--sig-st); stroke: var(--surface); stroke-width: 1; }\nsvg.stg.scope .dot.sm { fill: var(--text-2); stroke: none; }\nsvg.stg.scope .pk { fill: var(--sig-st); opacity: .85; }\nsvg.stg.scope .ref.thr { stroke: var(--text-2); stroke-dasharray: 5 3; }\nsvg.stg.scope .sweep { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 2 3; }\nsvg.stg.scope .pkt { fill: var(--sig-st); fill-opacity: .07; stroke: var(--line-2); }\nsvg.stg.scope .refl { paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }\nsvg.stg.scope .dl.rd { font-family: var(--f-mono); }\nsvg.stg.scope .pktt { stroke: var(--sig-st); stroke-width: 1.4; opacity: .7; }\n.seg.dom button { padding: 3px 10px; font-size: 12.5px; }\nsvg.stg.big .pl { font-size: 12.5px; }\nsvg.stg.big .refl { font-size: 11.5px; }\nsvg.stg.big .dl { font-size: 13px; stroke-width: 4px; }\nsvg.stg.big .dl.minor { font-weight: 500; fill: var(--text-2); font-size: 12px; }\nsvg.stg.big .strip { font-size: 14px; line-height: 1.45; }\nsvg.stg.big .sg .line { stroke-width: 2.2; }\nsvg.stg .dl.minor { font-weight: 500; fill: var(--text-2); }\n.pinned svg.stg .sg { opacity: .3; } .pinned svg.stg .sg.pin { opacity: 1; } .pinned svg.stg .sg.pin .line { stroke-width: 3.2; }\n.focus svg.stg .sg.on { opacity: 1; }\n.tip .hintline { opacity: .65; font-size: 11.5px; margin-top: 2px; }\n@container xp (max-width: 900px) { .sd-view svg.stg { max-width: 100%; } }\n/* mixers: before and after, joined by where each signal moved */\nsvg.stg path.map { fill: none; stroke: var(--sc); stroke-width: 1.4; opacity: .55; }\nsvg.stg.big path.map { stroke-width: 1.8; }\nsvg.stg path.map.k-other { opacity: .28; }\nsvg.stg path.map.k-station { opacity: .9; }\nsvg.stg path.map.k-image { opacity: .85; stroke-dasharray: 5 3; }\n.focus svg.stg path.map.on, .pinned svg.stg path.map.pin { opacity: 1; stroke-width: 2.8; }\nsvg.stg .ref.lo { stroke: var(--text-2); stroke-width: 1.5; }\nsvg.stg .refl.lo { fill: var(--text); font-weight: 600; }\nsvg.stg.mixer .pl { paint-order: stroke; stroke: var(--surface); stroke-width: 5px; stroke-linejoin: round; }\n.spec-legend i.curve { width: 16px; height: 9px; border: 0; border-top: 2px solid var(--sc); border-radius: 50% 50% 0 0 / 100% 100% 0 0; }\n\n/* RF block diagram */\nsvg.flow { min-width: 900px; }\nsvg.flow .rf { --gc: var(--dig); --gs: var(--dig-soft); cursor: pointer; }\nsvg.flow .rf.fm { --gc: var(--fm); --gs: var(--fm-soft); } svg.flow .rf.am { --gc: var(--am); --gs: var(--am-soft); }\nsvg.flow .rf.if { --gc: var(--if); --gs: var(--if-soft); } svg.flow .rf.ctrl { --gc: var(--ctrl); --gs: var(--ctrl-soft); }\nsvg.flow .rf.term { --gc: var(--text-3); cursor: default; }\nsvg.flow .rf .s { fill: var(--surface); stroke: var(--gc); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }\nsvg.flow .rf .sf { fill: var(--gc); stroke: none; }\nsvg.flow .rf .g { fill: none; stroke: var(--gc); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }\nsvg.flow .rf .gx { fill: none; stroke: var(--line-2); stroke-width: 1; }\nsvg.flow .rf .st { font: 600 9.5px var(--f-mono); fill: var(--text-2); }\nsvg.flow .rf .st.sm { font-size: 8.5px; font-weight: 500; }\nsvg.flow .rf .st.big { font: 400 19px 'STIX Two Text', serif; fill: var(--gc); }\nsvg.flow .rf .hit { fill: transparent; }\nsvg.flow .rf .mcubox { fill: none; stroke: var(--dig); stroke-width: 1.4; }\nsvg.flow .lt { font: 650 12px var(--f-display); fill: var(--text); }\nsvg.flow .le { font: 400 12.5px 'STIX Two Text', 'Cambria Math', 'Times New Roman', serif; fill: var(--text-2); }\nsvg.flow .le .mv { font-style: italic; }\nsvg.flow .le .ms { font-size: 9px; }\nsvg.flow .lv { font: 600 10.5px var(--f-mono); fill: var(--text); }\nsvg.flow .rfw .w { fill: none; stroke-width: 2; stroke-linejoin: round; }\nsvg.flow .rfw .w.fm { stroke: var(--fm); } svg.flow .rfw .w.am { stroke: var(--am); } svg.flow .rfw .w.if { stroke: var(--if); } svg.flow .rfw .w.dig { stroke: var(--dig); }\nsvg.flow .rfw .w.ctrl { stroke: var(--ctrl); stroke-width: 1.5; stroke-dasharray: 5 4; }\nsvg.flow .rfw.loop .w { stroke-dasharray: 6 4; }\nsvg.flow .rfw .wl { font: 500 9.5px var(--f-mono); fill: var(--text-2); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }\nsvg.flow .rfw .wl.dyn { font-weight: 700; fill: var(--text); }\nsvg.flow .jn { fill: var(--text-2); }\nsvg.flow .rf:hover .s, svg.flow .rf.rel .s, svg.flow .rf:focus-visible .s { stroke-width: 2.6; }\nsvg.flow .rf.sel .s { stroke-width: 2.8; fill: var(--gs); }\nsvg.flow .rf.sel .lt { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }\nsvg.flow .rf.off { opacity: .3; } svg.flow .rfw.off { opacity: .15; }\nsvg.flow .rfw.hot .w { stroke-width: 3.2; }\nsvg.flow .rf .warn { fill: var(--warn); }\nsvg.flow .rf:focus { outline: none; }\n.tip .teq { font: 14px/1.5 'STIX Two Text', 'Cambria Math', serif; margin: 1px 0 4px; }\n.tip .teq .frac .fn { border-bottom-color: var(--bg); }\n\n/* the math in each block */\n.mathbox { border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; display: grid; gap: 10px; background: var(--surface-2); min-width: 0; }\n.mathbox:empty { display: none; }\n.mathbox h3 { margin: 0; }\n.mrow { display: grid; gap: 4px; min-width: 0; }\n.mk { font: 600 11px var(--f-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }\n.mv { min-width: 0; overflow-x: auto; }\n.mv p { margin: 0; color: var(--text); font-size: 14px; line-height: 1.55; }\n.eq { font: 17px/1.9 'STIX Two Text', 'Cambria Math', 'Times New Roman', serif; color: var(--text); white-space: nowrap; }\n.eq i, .mnums i { font-style: italic; }\n.eq sub, .mnums sub { font-size: .68em; }\n.frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; margin: 0 .2em; line-height: 1.25; text-indent: 0; }\n.frac .fn { border-bottom: 1px solid currentColor; padding: 0 .25em .05em; }\n.frac .fd { padding: .05em .25em 0; }\n.mnums { margin: 0; padding-left: 18px; display: grid; gap: 4px; font: 15px/1.5 'STIX Two Text', 'Cambria Math', serif; color: var(--text); }\n.mnums .frac { font-size: .9em; }\n/* the math as a derivation: In, numbered steps on a rail, Out */\n.sch-col > .mathbox { margin: 14px 12px 16px; }\n.sch-col > .mathbox h3 { font: 700 11px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin: 0; }\n.eq sup { font-size: .7em; }\n.msub { margin: -4px 0 0; font-size: 13px; color: var(--text-2); }\n.chain { list-style: none; margin: 0; padding: 0; display: grid; }\n.chain li { position: relative; min-width: 0; }\n.chain .cin, .chain .cout { border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); padding: 8px 10px 8px; }\n.chain .cout { border-left: 3px solid var(--sig-st, var(--accent-fill)); }\n.chain .cin { border-left: 3px solid var(--text-3); }\n.chain .ctag { display: block; font: 600 10.5px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 1px; }\n.chain .cop { padding: 10px 4px 10px 36px; }\n.chain .cop::before { content: ''; position: absolute; left: 13px; top: 0; bottom: 0; width: 2px; background: var(--line-2); }\n.chain .cn { position: absolute; left: 3px; top: 9px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--text-3); display: grid; place-items: center; font: 600 11px var(--f-mono); color: var(--text); }\n.chain .chead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 2px; }\n.chain .cname { font: 600 14px/1.35 var(--f-body); color: var(--text); }\n.chain .cby { font: 500 11px var(--f-mono); color: var(--text-2); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; }\n.chain .cdom { font: 600 10.5px var(--f-body); color: var(--text-2); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; }\n.chain .eq { font-size: 16.5px; line-height: 1.75; white-space: normal; padding-left: 1em; text-indent: -1em; }\n.chain .cnote { margin: 2px 0 0; font-size: 13px; line-height: 1.45; color: var(--text-2); }\n.chain .cnote i { font-family: 'STIX Two Text', 'Cambria Math', serif; font-size: 1.08em; }\n.drop { color: var(--text-3); text-decoration: line-through; text-decoration-thickness: 1.5px; }\n.drop .fn, .drop .fd { text-decoration: line-through; text-decoration-thickness: 1.5px; }\n.mhow { border-top: 1px solid var(--line); padding-top: 8px; }\n.mhow summary { cursor: pointer; font: 600 12px var(--f-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); }\n.mhow p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--text); }\n@container xp (max-width: 600px) { .chain .eq { font-size: 15px; } .chain .cop { padding-left: 32px; } .sch-col > .mathbox { margin-inline: 8px; } }\n\n/* STM32 controls */\n.ctl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 12px; padding: 12px 16px 16px; }\n.ccard { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 8px; align-content: start; background: var(--surface); min-width: 0; }\n.ccard .ch { display: grid; gap: 2px; }\n.ccard .ch b { font: 650 14px var(--f-display); }\n.ccard .pin { font: 500 11px var(--f-mono); color: var(--text-3); }\n.ccard .ro { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--text-2); }\n.seg.sm button { padding: 3px 10px; font-size: 12.5px; }\n.seg button:disabled { opacity: .4; cursor: default; }\n.sl { display: grid; grid-template-columns: auto minmax(0, 1fr) 4.5em; gap: 8px; align-items: center; font-size: 12.5px; color: var(--text-2); }\n.sl input[type=range] { width: 100%; accent-color: var(--accent-fill); }\n.sl input:disabled { opacity: .4; }\n.sl output { font: 600 12.5px var(--f-mono); color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }\n.ck { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--text); cursor: pointer; }\n.ck input { accent-color: var(--accent-fill); }\n.ck input:disabled + * { opacity: .5; }\n.ckrow { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }\n.ckrow .lbl { font-size: 12.5px; color: var(--text-2); }\n.sd-ctl { padding: 0 12px; }\n.sd-ctl:empty { display: none; }\n.sdc-h { font: 600 11px var(--f-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }\n.sdc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; }\n.sd-ctl .ccard { background: var(--surface-2); border-color: var(--line-2); }\n\n/* step player */\n.sd-play { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; padding: 0 12px; }\n.sd-play .play { border: 0; background: var(--accent-fill); color: var(--on-accent); border-radius: 7px; padding: 6px 14px; font-weight: 700; font-size: 13.5px; cursor: pointer; }\n.sd-play .play:hover { filter: brightness(1.06); }\n.sd-steps { display: flex; flex-wrap: wrap; gap: 4px; }\n.sd-steps button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 3px 10px 3px 4px; font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }\n.sd-steps button .n { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--surface-2); font: 700 10.5px var(--f-mono); color: var(--text-2); }\n.sd-steps button[aria-pressed=\"true\"] { border-color: var(--text); color: var(--text); }\n.sd-steps button[aria-pressed=\"true\"] .n { background: var(--text); color: var(--bg); }\n\n/* the part being applied, laid over the spectrum */\nsvg.stg .maskfill { fill: var(--text); opacity: .07; }\nsvg.stg .maskline { fill: none; stroke: var(--text-2); stroke-width: 1.6; stroke-dasharray: 6 4; }\nsvg.stg .masklabel { font: 600 12px var(--f-body); fill: var(--text); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }\nsvg.stg .strip.stepnow { font-weight: 600; color: var(--text); }\nsvg.stg .mapdot { stroke: var(--surface); stroke-width: 2; fill: var(--sc); }\nsvg.stg .k-mark { --sc: var(--sig-img); }\n/* the continuous analyser trace: neutral base, coloured where one signal dominates */\nsvg.stg .tline { fill: none; stroke: var(--text-2); stroke-width: 1.2; stroke-linejoin: round; }\nsvg.stg .tfill { fill: var(--text-3); opacity: .13; }\nsvg.stg .gtrace { fill: none; stroke: var(--text-3); stroke-width: 1.2; stroke-dasharray: 4 3; stroke-linejoin: round; opacity: .75; }\nsvg.stg .bandmark { fill: var(--text); opacity: .05; }\nsvg.stg .bandlbl { font: 600 10px var(--f-body); fill: var(--text-2); letter-spacing: .02em; }\n/* mixer: the box the bottom panel magnifies, and the lines down to it */\nsvg.stg .zoombox { fill: var(--text); fill-opacity: .045; stroke: var(--text-2); stroke-width: 1.2; }\nsvg.stg .zoomline { fill: none; stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }\n.spec-legend i.zoombox { width: 11px; height: 9px; border: 1.2px solid var(--text-2); background: color-mix(in srgb, var(--text) 5%, transparent); }\nsvg.stg.big .bandlbl { font-size: 12px; }\nsvg.stg .sg.k-mark .line { stroke-width: 1.4; }\n.ccard .seg { justify-self: start; }\n.sd-steps .nosteps { font-size: 13px; color: var(--text-2); }\n/* monochrome icons: they take the text colour */\n.ico { width: 1.05em; height: 1.05em; flex: none; vertical-align: -0.17em; }\n.sd-play .play { display: inline-flex; align-items: center; gap: 6px; }\n.sd-steps button .n .ico { width: 12px; height: 12px; }\n.card .ct button .ico { width: 16px; height: 16px; }\n.sch-key .ico { width: 11px; height: 11px; vertical-align: -1px; }\n\n/* The wiki widget's brand layer (Adom brand guide, adom/brand): dark always, teal primary, purple for the AM\n   group, blue for the shared IF, Familjen Grotesk / Satoshi / JetBrains Mono (the wiki page already loads them).\n   widget.py puts it after sch.css and page.css, inside the element's shadow root. */\n:host {\n  display: block;\n  color-scheme: dark;\n  font-synthesis: none;              /* the wiki loads Satoshi 400/500 only: no faux bold */\n  --bg: #0d1117; --surface: #161b22; --surface-2: #1c2128; --line: #30363d; --line-2: #484f58;\n  --text: #e6edf3; --text-2: #8b949e; --text-3: color-mix(in srgb, #8b949e 82%, #0d1117);\n  --accent: #00b8b1; --accent-fill: #00b8b1; --accent-bright: #00e6dc; --on-accent: #0d1117;\n  --fm: #00b8b1; --fm-soft: rgba(0, 184, 177, .12);\n  --am: #8c6bf7; --am-soft: rgba(140, 107, 247, .13);\n  --if: #64abff; --if-soft: rgba(100, 171, 255, .11);\n  --ctrl: #8fd3d4; --ctrl-soft: rgba(143, 211, 212, .10);\n  --dig: #8b949e; --dig-soft: rgba(139, 148, 158, .10);\n  --warn: #d29922; --warn-soft: rgba(210, 153, 34, .10); --warn-line: rgba(210, 153, 34, .45);\n  --hl: #00e6dc;\n  --sig-fm: #00b8b1; --sig-am: #8c6bf7; --sig-img: #c5b3ff; --sig-sub: #64abff; --sig-other: #8b949e;\n  --paper: #0d1117; --grid: rgba(139, 148, 158, .07);\n  --s-ink: #e6edf3; --s-ink2: #8b949e; --s-wire: #64abff; --s-val: #00b8b1; --s-flag: #c5b3ff;\n  --s-flagbg: rgba(140, 107, 247, .12); --s-tp: #8fd3d4; --s-region: rgba(139, 148, 158, .35);\n  --f-display: 'Familjen Grotesk', -apple-system, 'Segoe UI', sans-serif;\n  --f-body: 'Satoshi', -apple-system, 'Segoe UI', sans-serif;\n  --f-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n  --r: 10px;\n  --glass: rgba(22, 27, 34, .92);\n  --glass-line: rgba(0, 184, 177, .2);\n}\n/* the artifact's page skeleton supplies this; a shadow root does not inherit it, and the code toggles .hidden */\n[hidden] { display: none !important; }\n.band-am { --sig-img: #8fd3d4; }\nsvg.sch { --hl: #00e6dc; }            /* sch.css sets its own highlight on the svg: the brand's hover teal instead */      /* the calibration marker, kept apart from the AM station's purple */\n\n/* the widget sits in the README column: the README's own heading names it, the page scrolls, not the widget */\n.app { container: xp / inline-size; background: var(--bg); color: var(--text); font: 15px/1.55 var(--f-body); }\n.app .wrap { max-width: none; padding: 0; gap: 16px; }\n.top .title { font: 700 24px/1.1 var(--f-display); letter-spacing: -.01em; margin-top: 6px; text-wrap: balance; }\n.top .title .fm { color: var(--fm); } .top .title .am { color: var(--am); }\n.lede { max-width: 72ch; }\n\n/* type: Familjen for headings, Satoshi (400/500) for text, JetBrains Mono for numbers and parts */\nh1, h2, h3, .role, .stage h3, .sd-head h3 { font-family: var(--f-display); }\nb, strong, .seg button, .tabs button, .presets button, .stage .open, .sd-tabs button, .sd-steps button, .chip, .play { font-weight: 500; }\n\n/* links and focus */\na { color: var(--accent); text-decoration: none; transition: color .15s ease; }\na:hover { color: var(--accent-bright); text-decoration: underline; }\n:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }\ncode { border-radius: 6px; background: var(--surface-2); }\n\n/* every hover eases at 0.15 s */\nbutton, .seg button, .tabs button, .presets button, .chip, .sd-steps button, .sd-tabs button, .card .pins button, .menu button, .nav button, .zoom button, .stage .open, .follow tr td, .parts tr td {\n  transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;\n}\n\n/* cards: 10 px corners, buttons at least 6 px */\n.panel, .stage, .ccard, .card, .mathbox, .follow, .board, .sd-ctl .ccard { border-radius: 10px; }\n.freq, .chain .cin, .chain .cout { border-radius: 8px; }\n.nav button, .zoom button, .stage .open, .follow .fh button, .card .pins button, .find input { border-radius: 6px; }\n\n/* segmented controls and tabs: teal for the chosen one */\n.seg { border-color: var(--line-2); border-radius: 8px; }\n.seg button:hover { color: var(--text); background: rgba(0, 184, 177, .06); }\n.seg button[aria-pressed=\"true\"] { background: rgba(0, 184, 177, .16); color: var(--accent-bright); }\n.seg.band button[data-band=\"fm\"][aria-pressed=\"true\"] { background: var(--fm); color: #0d1117; }\n.seg.band button[data-band=\"am\"][aria-pressed=\"true\"] { background: var(--am); color: #0d1117; }\n.tabs { background: var(--bg); border: 1px solid var(--line); }\n.tabs button[aria-selected=\"true\"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px rgba(0, 184, 177, .35); }\n.tabs button:hover { color: var(--text); }\n.presets button:hover, .nav button:hover, .zoom button:hover, .stage .open:hover, .card .pins button:hover { border-color: var(--accent); color: var(--text); }\n.sd-tabs button[aria-pressed=\"true\"] { background: rgba(0, 184, 177, .16); color: var(--accent-bright); border-color: rgba(0, 184, 177, .45); }\n\n/* the step player: the brand's primary button */\n.sd-play .play { background: var(--accent-fill); color: var(--on-accent); border-radius: 6px; }\n.sd-play .play:hover { background: var(--accent-bright); filter: none; }\n.sd-steps button[aria-pressed=\"true\"] { border-color: var(--accent); color: var(--text); }\n.sd-steps button[aria-pressed=\"true\"] .n { background: var(--accent-fill); color: var(--on-accent); }\n.sd-steps button:hover { border-color: var(--accent); }\n\n/* frosted-glass tooltips and menus */\n.tip { background: var(--glass); color: var(--text); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);\n  border: 1px solid var(--glass-line); border-radius: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, .55); }\n.tip .teq .frac .fn { border-bottom-color: currentColor; }\n.menu { background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);\n  border: 1px solid var(--glass-line); border-radius: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, .55); }\n.menu button:hover, .menu button:focus-visible { background: rgba(0, 184, 177, .10); }\n\n/* panels: a quiet teal inner edge, as the brand's viewers do */\n.panel { box-shadow: inset 0 0 0 1px rgba(0, 184, 177, .04); }\n.chip.ctrl { color: var(--ctrl); }\n.stage .sfault::before, .sd-cap .sfault::before { color: var(--warn); }\n";-  var HTML = "<div class=\"app\"><div class=\"wrap\">\n  <header class=\"top\">\n    <div>\n      <div class=\"eyebrow\">Adom Molecule \u00b7 rev B \u00b7 4 layers, 102.5 mm square</div>\n      <div class=\"title\" role=\"heading\" aria-level=\"3\">AM/FM Receiver Explorer</div>\n      <p class=\"lede\">Follow a station from the antenna to the USB audio. Pick a band and a station, then click any block to see its schematic, what each part does, where to probe it, and what the first board actually did.</p>\n    </div>\n    <div class=\"toplinks\">\n      <span class=\"check\" id=\"check\"></span>\n    </div>\n  </header>\n\n  <section class=\"panel tuner\" id=\"tuner\" aria-label=\"Station tuner\">\n    <div class=\"tuner-ctl\">\n      <div class=\"ctl-row\">\n        <span class=\"ctl-label\">Band</span>\n        <div class=\"seg band\" id=\"band\"><button type=\"button\" data-band=\"fm\" aria-pressed=\"true\">FM</button><button type=\"button\" data-band=\"am\" aria-pressed=\"false\">AM</button></div>\n      </div>\n      <div class=\"ctl-row\">\n        <span class=\"ctl-label\">Show</span>\n        <div class=\"seg\" id=\"mode\"><button type=\"button\" data-mode=\"design\" aria-pressed=\"true\">As designed</button><button type=\"button\" data-mode=\"board\" aria-pressed=\"false\">First board</button></div>\n      </div>\n      <div class=\"station\">\n        <label class=\"ctl-label\" for=\"f-in\">Station</label>\n        <div class=\"station-read\"><input id=\"f-in\" inputmode=\"decimal\" autocomplete=\"off\" aria-label=\"Station frequency\"><span id=\"f-unit\">MHz</span></div>\n        <input type=\"range\" id=\"f-range\" aria-label=\"Station frequency slider\">\n        <div class=\"presets\" id=\"presets\"></div>\n      </div>\n    </div>\n    <div class=\"tuner-out\">\n      <div class=\"freqs\" id=\"freqs\"></div>\n      <p class=\"verdict\" id=\"verdict\"></p>\n      <div class=\"spec-wrap\"><svg class=\"spec\" id=\"spec\" role=\"img\" aria-label=\"Where the station, oscillator and image sit on the frequency axis\"></svg></div>\n    </div>\n  </section>\n\n  <section class=\"panel ctlpanel\" id=\"ctl-panel\" aria-label=\"STM32 controls\">\n    <div class=\"panel-h\">\n      <h2>STM32 controls</h2>\n      <span class=\"hint\">What the firmware sets, from the pins out. The spectra, the block diagram and the math follow every change.</span>\n    </div>\n    <div class=\"ctl-grid\" id=\"ctl-grid\"></div>\n  </section>\n\n  <section class=\"panel\" id=\"flow-panel\" aria-label=\"Signal path\">\n    <div class=\"panel-h\">\n      <h2>Signal path</h2>\n      <div class=\"tabs\" role=\"tablist\" aria-label=\"View\">\n        <button type=\"button\" role=\"tab\" id=\"tab-flow\" aria-controls=\"view-flow\" aria-selected=\"true\">Block diagram</button>\n        <button type=\"button\" role=\"tab\" id=\"tab-spec\" aria-controls=\"view-spec\" aria-selected=\"false\">Signal at each stage</button>\n      </div>\n    </div>\n    <div id=\"view-flow\" role=\"tabpanel\" aria-labelledby=\"tab-flow\">\n      <div class=\"view-note\">\n        <div class=\"flow-legend\">\n          <span><i style=\"background:var(--fm)\"></i>FM path</span>\n          <span><i style=\"background:var(--am)\"></i>AM path</span>\n          <span><i style=\"background:var(--if)\"></i>shared IF</span>\n          <span class=\"ctrl\"><i></i>tuning &amp; control</span>\n          <span><i style=\"background:var(--dig)\"></i>digital</span>\n        </div>\n        <span class=\"hint\">Standard RF symbols, with each step\u2019s equation. Hover a symbol for its time- and s-domain equations; click it for the schematic, the spectrum and the full math.</span>\n      </div>\n      <div class=\"flow-scroll\"><svg class=\"flow\" id=\"flow\" role=\"group\" aria-label=\"Block diagram of the receiver\"></svg></div>\n    </div>\n    <div id=\"view-spec\" role=\"tabpanel\" aria-labelledby=\"tab-spec\" hidden>\n      <div class=\"view-note spec-note\">\n        <p>Each stage in signal order, for the band and station in the tuner. The top panel is what the stage applies (its gain at each frequency); the bottom panel is the signal coming out. Hover a peak to follow that signal through every stage.</p>\n        <div class=\"spec-legend\" id=\"spec-legend\"></div>\n        <p class=\"hint\">A model, not a measurement. The signals at the antenna are examples. Filter shapes come from the component values and the filters\u2019 datasheets; the RF-amplifier and mixer gains are estimates, marked on their stages.</p>\n      </div>\n      <div class=\"spec-grid\" id=\"spec-grid\"></div>\n    </div>\n  </section>\n\n  <section class=\"panel detail\" id=\"detail\" aria-live=\"polite\">\n    <div class=\"detail-h\">\n      <div>\n        <h2 id=\"d-title\"></h2>\n        <div class=\"chips\" id=\"d-chips\"></div>\n      </div>\n      <div class=\"nav\">\n        <button type=\"button\" id=\"to-flow\">Flowchart</button>\n        <button type=\"button\" id=\"prev\">Previous</button>\n        <button type=\"button\" id=\"next\">Next</button>\n      </div>\n    </div>\n    <div class=\"sch-col\">\n      <div class=\"sch-bar\">\n        <div class=\"zoom\"><button type=\"button\" id=\"z-in\" aria-label=\"Zoom in\">+</button><button type=\"button\" id=\"z-out\" aria-label=\"Zoom out\">\u2212</button><button type=\"button\" id=\"z-fit\">Fit</button></div>\n        <form class=\"find\" id=\"find\" role=\"search\">\n          <input id=\"find-in\" list=\"find-list\" placeholder=\"R303, VT_FM\u2026\" aria-label=\"Find a part or net\" autocomplete=\"off\">\n          <datalist id=\"find-list\"></datalist>\n          <button type=\"submit\" class=\"zoomish\" hidden>Find</button>\n          <span class=\"msg\" id=\"find-msg\"></span>\n        </form>\n      </div>\n      <div class=\"sch-view\" id=\"sch-view\"></div>\n      <div class=\"sch-key\">\n        <span>Hover a part or wire for details; click a part for its card</span>\n        <span><b class=\"k-flag\"><svg class=\"ico\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M4 7h11l5 5-5 5H4z\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linejoin=\"round\"/></svg> NET</b> continues in another block (click)</span>\n        <span><svg class=\"ico k-tp\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><circle cx=\"12\" cy=\"12\" r=\"6\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.2\"/></svg> test pad \u00b7 <svg class=\"ico k-tp\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><rect x=\"6\" y=\"6\" width=\"12\" height=\"12\" fill=\"currentColor\"/></svg> machine contact</span>\n        <span>Drag to pan \u00b7 ctrl + scroll to zoom</span>\n      </div>\n      <section class=\"sd\" id=\"sd\" aria-label=\"What this stage does to the signal\" hidden>\n        <div class=\"sd-bar\">\n          <div class=\"sd-head\">\n            <h3 id=\"sd-title\">What this stage does to the signal</h3>\n            <div class=\"sd-tabs\" id=\"sd-tabs\"></div>\n          </div>\n          <div class=\"seg sm dom\" id=\"sd-dom\" role=\"group\" aria-label=\"Show this stage as\" hidden><button type=\"button\" data-dom=\"time\">Waveform</button><button type=\"button\" data-dom=\"freq\">Spectrum</button></div>\n          <div class=\"zoom\"><button type=\"button\" id=\"sz-in\" aria-label=\"Zoom in\">+</button><button type=\"button\" id=\"sz-out\" aria-label=\"Zoom out\">\u2212</button><button type=\"button\" id=\"sz-fit\">Fit</button><button type=\"button\" id=\"sz-st\">Your station</button></div>\n        </div>\n        <p class=\"sd-note\" id=\"sd-note\" hidden></p>\n        <div class=\"sd-ctl\" id=\"sd-ctl\"></div>\n        <div class=\"sd-play\" id=\"sd-play\" hidden>\n          <button type=\"button\" class=\"play\" id=\"sp-play\" aria-label=\"Play the steps\"><svg class=\"ico\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8 5.5v13l10.5-6.5z\" fill=\"currentColor\"/></svg>Play the steps</button>\n          <div class=\"sd-steps\" id=\"sd-steps\" role=\"group\" aria-label=\"Steps\"></div>\n        </div>\n        <div class=\"sd-legend spec-legend\" id=\"sd-legend\"></div>\n        <div class=\"sd-view\" id=\"sd-view\"></div>\n        <div class=\"sd-cap\" id=\"sd-cap\"></div>\n        <div class=\"sd-follow\" id=\"sd-follow\"></div>\n        <div class=\"sch-key\">\n          <span>Hover to read levels; click a peak to follow that signal through every stage</span>\n          <span>Double-click a peak to zoom on it \u00b7 drag to pan \u00b7 ctrl + scroll to zoom</span>\n        </div>\n      </section>\n      <div class=\"mathbox\" id=\"mathbox\"></div>\n    </div>\n    <div class=\"info\" id=\"info\"></div>\n  </section>\n</div>\n<div class=\"tip\" id=\"tip\" hidden></div>\n<div class=\"menu\" id=\"menu\" hidden role=\"menu\"></div></div>";-  function boot(EXPLORER_ROOT, EXPLORER_HOST) {-var DESIGN = {"parts":{"J101":{"value":"USB-C","lib":"Connector:USB_C_Receptacle_USB2.0_16P","desc":"USB 2.0 Type-C receptacle, 16P","lcsc":"C165948","mpn":"TYPE-C-31-M-12","sheet":"power","block":"usb","pins":{"A1":"GND","A12":"GND","B1":"GND","B12":"GND","A4":"VBUS","A9":"VBUS","B4":"VBUS","B9":"VBUS","A5":"CC1","B5":"CC2","A6":"USB_DP","B6":"USB_DP","A7":"USB_DM","B7":"USB_DM","A8":null,"B8":null,"SH":"GND"},"wiki":"https://wiki.adom.inc/adom/type-c-31-m-12"},"R101":{"value":"5.1k","lib":"Device:R","desc":"CC1 pull-down (UFP)","lcsc":"C23186","mpn":"","sheet":"power","block":"usb","pins":{"1":"CC1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf5101t5e"},"R102":{"value":"5.1k","lib":"Device:R","desc":"CC2 pull-down (UFP)","lcsc":"C23186","mpn":"","sheet":"power","block":"usb","pins":{"1":"CC2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf5101t5e"},"U101":{"value":"USBLC6-2SC6","lib":"Power_Protection:USBLC6-2SC6","desc":"USB ESD protection","lcsc":"C7519","mpn":"USBLC6-2SC6","sheet":"power","block":"usb","pins":{"1":"USB_DP","6":"USB_DP","3":"USB_DM","4":"USB_DM","2":"GND","5":"VBUS"},"wiki":"https://wiki.adom.inc/ray/usblc6-2sc6"},"D105":{"value":"B5819W","lib":"Device:D_Schottky","desc":"OR-ing diode: USB-C VBUS -> 5 V rail","lcsc":"C8598","mpn":"B5819W","sheet":"power","block":"usb","pins":{"1":"VIN_OR","2":"VBUS"},"wiki":"https://wiki.adom.inc/adom/b5819w"},"D106":{"value":"B5819W","lib":"Device:D_Schottky","desc":"OR-ing diode: machine-pin VIN (Adom control panel 5 V) -> 5 V rail","lcsc":"C8598","mpn":"B5819W","sheet":"power","block":"usb","pins":{"1":"VIN_OR","2":"VIN"},"wiki":"https://wiki.adom.inc/adom/b5819w"},"F101":{"value":"500mA","lib":"Device:Polyfuse","desc":"Resettable fuse 500 mA hold, 1206","lcsc":"C70077","mpn":"nSMD050-33V","sheet":"power","block":"usb","pins":{"1":"VIN_OR","2":"+5V"},"wiki":"https://wiki.adom.inc/adom/nsmd050-33v"},"C101":{"value":"10u","lib":"Device:C","desc":"Capacitor","lcsc":"C15850","mpn":"","sheet":"power","block":"usb","pins":{"1":"+5V","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805"},"C102":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"power","block":"usb","pins":{"1":"+5V","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R107":{"value":"2.2k","lib":"Device:R","desc":"Power LED current limit","lcsc":"C4190","mpn":"","sheet":"power","block":"usb","pins":{"1":"+5V","2":"PWR_LED_A"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"D104":{"value":"RED","lib":"Device:LED","desc":"Power LED, red 0603","lcsc":"C2286","mpn":"KT-0603R","sheet":"power","block":"usb","pins":{"1":"GND","2":"PWR_LED_A"},"wiki":"https://wiki.adom.inc/barrett-land/kt-0603r"},"U102":{"value":"AP2112K-3.3","lib":"Regulator_Linear:AP2112K-3.3","desc":"600 mA 3.3 V LDO","lcsc":"C51118","mpn":"AP2112K-3.3TRG1","sheet":"power","block":"reg","pins":{"1":"+5V","2":"GND","3":"+5V","4":null,"5":"+3V3"},"wiki":"https://wiki.adom.inc/adom/ap2112k-3-3trg1"},"C103":{"value":"1u","lib":"Device:C","desc":"Capacitor","lcsc":"C15849","mpn":"","sheet":"power","block":"reg","pins":{"1":"+5V","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10a105kb8nnnc"},"C104":{"value":"10u","lib":"Device:C","desc":"Capacitor","lcsc":"C15850","mpn":"","sheet":"power","block":"reg","pins":{"1":"+3V3","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805"},"C105":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"power","block":"reg","pins":{"1":"+3V3","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"FB101":{"value":"600R@100MHz","lib":"Device:FerriteBead","desc":"Ferrite bead, 600 ohm @ 100 MHz, 0603","lcsc":"C1002","mpn":"GZ1608D601TF","sheet":"power","block":"reg","pins":{"1":"+5V","2":"+5VA"},"wiki":"https://wiki.adom.inc/adom/gz1608d601tf"},"C106":{"value":"22u","lib":"Device:C","desc":"Capacitor","lcsc":"C45783","mpn":"","sheet":"power","block":"reg","pins":{"1":"+5VA","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805"},"C107":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"power","block":"reg","pins":{"1":"+5VA","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"FB102":{"value":"600R@100MHz","lib":"Device:FerriteBead","desc":"Ferrite bead, 600 ohm @ 100 MHz, 0603","lcsc":"C1002","mpn":"GZ1608D601TF","sheet":"power","block":"reg","pins":{"1":"+3V3","2":"+3.3VA"},"wiki":"https://wiki.adom.inc/adom/gz1608d601tf"},"C108":{"value":"1u","lib":"Device:C","desc":"VREF+ bulk","lcsc":"C15849","mpn":"","sheet":"power","block":"reg","pins":{"1":"+3.3VA","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10a105kb8nnnc"},"C109":{"value":"10n","lib":"Device:C","desc":"VREF+ HF decoupling","lcsc":"C57112","mpn":"","sheet":"power","block":"reg","pins":{"1":"+3.3VA","2":"GND"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"U103":{"value":"STM32G0B1CCU7","lib":"MCU_ST_STM32G0:STM32G0B1CCUx","desc":"ARM Cortex-M0+ MCU, 256 KB flash, 144 KB RAM, USB FS + ROM DFU, 12-bit ADC + dual 12-bit DAC","lcsc":"C29759424","mpn":"STM32G0B1CCU7","sheet":"power","block":"mcu","pins":{"1":null,"2":null,"3":null,"4":"+3.3VA","5":"+3.3VA","6":"+3V3","7":"GND","8":"HSE_IN","9":"HSE_OUT","10":"NRST","11":"AM_AUDIO","12":"FM_AUDIO","13":"RSSI_AM","14":"FM_DC","15":"DAC_FM","16":"DAC_AM","17":"RSSI_FM","18":null,"19":null,"20":"PWM_RF","21":null,"22":null,"23":null,"24":null,"25":"LED_FM","26":"LED_AM","27":"LED_STAT","28":"CAL_MARK","29":null,"30":null,"31":null,"32":null,"33":"USB_DM","34":"USB_DP","35":"SWDIO","36":"SWCLK","37":"IF_CNT","38":null,"39":null,"40":null,"41":null,"42":null,"43":null,"44":null,"45":"UART_TX","46":"UART_RX","47":"FM_EN_N","48":"AM_EN_N","49":"GND"},"wiki":"https://wiki.adom.inc/adom/stm32g0b1ccu7"},"C110":{"value":"100n","lib":"Device:C","desc":"VBAT (tied to the VREF+ rail: they share an escape at the QFN)","lcsc":"C14663","mpn":"","sheet":"power","block":"mcu","pins":{"1":"+3.3VA","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"C111":{"value":"100n","lib":"Device:C","desc":"VDD decoupling","lcsc":"C14663","mpn":"","sheet":"power","block":"mcu","pins":{"1":"+3V3","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"C114":{"value":"4.7u","lib":"Device:C","desc":"MCU bulk","lcsc":"C1779","mpn":"","sheet":"power","block":"mcu","pins":{"1":"+3V3","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl21a475kaqnnng"},"C115":{"value":"100n","lib":"Device:C","desc":"Reset filter","lcsc":"C14663","mpn":"","sheet":"power","block":"mcu","pins":{"1":"NRST","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R103":{"value":"10k","lib":"Device:R","desc":"PA14 = SWCLK/BOOT0: keeps BOOT0 low (boot from flash)","lcsc":"C25804","mpn":"","sheet":"power","block":"mcu","pins":{"1":"SWCLK","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"Y101":{"value":"40MHz","lib":"Device:Crystal_GND24","desc":"40 MHz crystal, 12 pF load, 20 ohm ESR, SMD 3225 (MCU timebase)","lcsc":"C337678","mpn":"SX32Y040000BC1T001","sheet":"power","block":"mcu","pins":{"1":"HSE_IN","3":"HSE_OUT","2":"GND","4":"GND"},"wiki":"https://wiki.adom.inc/adom/sx32y040000bc1t001"},"C116":{"value":"18p","lib":"Device:C","desc":"Crystal load, C0G","lcsc":"C1647","mpn":"","sheet":"power","block":"mcu","pins":{"1":"HSE_IN","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10c180jb8nnnc"},"C117":{"value":"18p","lib":"Device:C","desc":"Crystal load, C0G","lcsc":"C1647","mpn":"","sheet":"power","block":"mcu","pins":{"1":"HSE_OUT","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10c180jb8nnnc"},"TP101":{"value":"VBUS","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): VBUS","lcsc":"","mpn":"","sheet":"power","block":"tp","pins":{"1":"VBUS"}},"TP102":{"value":"VIN","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): VIN","lcsc":"","mpn":"","sheet":"power","block":"tp","pins":{"1":"VIN"}},"TP103":{"value":"VOR","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): VIN_OR","lcsc":"","mpn":"","sheet":"power","block":"tp","pins":{"1":"VIN_OR"}},"TP104":{"value":"5V","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): +5V","lcsc":"","mpn":"","sheet":"power","block":"tp","pins":{"1":"+5V"}},"TP105":{"value":"3V3","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): +3V3","lcsc":"","mpn":"","sheet":"power","block":"tp","pins":{"1":"+3V3"}},"TP106":{"value":"3V3A","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): +3.3VA","lcsc":"","mpn":"","sheet":"power","block":"tp","pins":{"1":"+3.3VA"}},"TP107":{"value":"5VA","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): +5VA","lcsc":"","mpn":"","sheet":"power","block":"tp","pins":{"1":"+5VA"}},"TP108":{"value":"GND","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): GND","lcsc":"","mpn":"","sheet":"power","block":"tp","pins":{"1":"GND"}},"TP109":{"value":"GND","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): GND","lcsc":"","mpn":"","sheet":"power","block":"tp","pins":{"1":"GND"}},"TP110":{"value":"CAL","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): CAL_MARK","lcsc":"","mpn":"","sheet":"power","block":"tp","pins":{"1":"CAL_MARK"}},"U201":{"value":"TLV9062IDR","lib":"Amplifier_Operational:TLV9062xD","desc":"Dual 10 MHz rail-to-rail I/O op-amp","lcsc":"C398355","mpn":"TLV9062IDR","sheet":"tune","block":"vt","pins":{"3":"DAC_FM","2":"VTF_FB","1":"VTF_OUT","5":"DAC_AM","6":"VTA_FB","7":"VTA_OUT","8":"+5VA","4":"GND"},"wiki":"https://wiki.adom.inc/adom/tlv9062idr"},"R201":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"tune","block":"vt","pins":{"1":"VTF_OUT","2":"VTF_FB"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"R202":{"value":"22k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C31850","mpn":"","sheet":"tune","block":"vt","pins":{"1":"VTF_FB","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf2202t5e"},"R203":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"tune","block":"vt","pins":{"1":"VTF_OUT","2":"VTF_F1"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C201":{"value":"4.7u","lib":"Device:C","desc":"Capacitor","lcsc":"C1779","mpn":"","sheet":"tune","block":"vt","pins":{"1":"VTF_F1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl21a475kaqnnng"},"R204":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"tune","block":"vt","pins":{"1":"VTF_F1","2":"VT_FM"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C202":{"value":"1u","lib":"Device:C","desc":"Capacitor","lcsc":"C15849","mpn":"","sheet":"tune","block":"vt","pins":{"1":"VT_FM","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10a105kb8nnnc"},"R205":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"tune","block":"vt","pins":{"1":"VTA_OUT","2":"VTA_FB"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"R206":{"value":"22k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C31850","mpn":"","sheet":"tune","block":"vt","pins":{"1":"VTA_FB","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf2202t5e"},"R207":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"tune","block":"vt","pins":{"1":"VTA_OUT","2":"VTA_F1"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C203":{"value":"4.7u","lib":"Device:C","desc":"Capacitor","lcsc":"C1779","mpn":"","sheet":"tune","block":"vt","pins":{"1":"VTA_F1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl21a475kaqnnng"},"R208":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"tune","block":"vt","pins":{"1":"VTA_F1","2":"VT_AM"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C204":{"value":"1u","lib":"Device:C","desc":"Capacitor","lcsc":"C15849","mpn":"","sheet":"tune","block":"vt","pins":{"1":"VT_AM","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10a105kb8nnnc"},"C205":{"value":"100n","lib":"Device:C","desc":"U201 decoupling","lcsc":"C14663","mpn":"","sheet":"tune","block":"vt","pins":{"1":"+5VA","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R209":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"tune","block":"pwm","pins":{"1":"PWM_RF","2":"PWM_F1"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C206":{"value":"1u","lib":"Device:C","desc":"Capacitor","lcsc":"C15849","mpn":"","sheet":"tune","block":"pwm","pins":{"1":"PWM_F1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10a105kb8nnnc"},"R210":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"tune","block":"pwm","pins":{"1":"PWM_F1","2":"PWM_F2"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C207":{"value":"1u","lib":"Device:C","desc":"Capacitor","lcsc":"C15849","mpn":"","sheet":"tune","block":"pwm","pins":{"1":"PWM_F2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10a105kb8nnnc"},"U202":{"value":"TLV9062IDR","lib":"Amplifier_Operational:TLV9062xD","desc":"Dual 10 MHz rail-to-rail I/O op-amp","lcsc":"C398355","mpn":"TLV9062IDR","sheet":"tune","block":"pwm","pins":{"3":"PWM_F2","2":"VTR_FB","1":"VTR_OUT","5":"VREF_DIV","6":"VREF_BUF","7":"VREF_BUF","8":"+5VA","4":"GND"},"wiki":"https://wiki.adom.inc/adom/tlv9062idr"},"R211":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"tune","block":"pwm","pins":{"1":"VTR_OUT","2":"VTR_FB"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"R212":{"value":"22k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C31850","mpn":"","sheet":"tune","block":"pwm","pins":{"1":"VTR_FB","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf2202t5e"},"R213":{"value":"1k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C21190","mpn":"","sheet":"tune","block":"pwm","pins":{"1":"VTR_OUT","2":"VT_RF"},"wiki":"https://wiki.adom.inc/adom/0603waf1001t5e"},"C208":{"value":"1u","lib":"Device:C","desc":"Capacitor","lcsc":"C15849","mpn":"","sheet":"tune","block":"pwm","pins":{"1":"VT_RF","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10a105kb8nnnc"},"R214":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"tune","block":"pwm","pins":{"1":"+3.3VA","2":"VREF_DIV"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"R215":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"tune","block":"pwm","pins":{"1":"VREF_DIV","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C209":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"tune","block":"pwm","pins":{"1":"VREF_DIV","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R216":{"value":"100","lib":"Device:R","desc":"Isolates op-amp from reservoir cap","lcsc":"C22775","mpn":"","sheet":"tune","block":"pwm","pins":{"1":"VREF_BUF","2":"VREF_1V65"},"wiki":"https://wiki.adom.inc/adom/0603waf1000t5e"},"C210":{"value":"1u","lib":"Device:C","desc":"Capacitor","lcsc":"C15849","mpn":"","sheet":"tune","block":"pwm","pins":{"1":"VREF_1V65","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10a105kb8nnnc"},"C211":{"value":"100n","lib":"Device:C","desc":"U202 decoupling","lcsc":"C14663","mpn":"","sheet":"tune","block":"pwm","pins":{"1":"+5VA","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"Q201":{"value":"MMBT3906","lib":"Transistor_BJT:MMBT3906","desc":"FM front-end power switch","lcsc":"C2143","mpn":"MMBT3906","sheet":"tune","block":"band","pins":{"1":"SWF_B","2":"+5VA","3":"+5V_FM"},"wiki":"https://wiki.adom.inc/adom/mmbt3906"},"R217":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"tune","block":"band","pins":{"1":"+5VA","2":"SWF_B"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"R218":{"value":"1k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C21190","mpn":"","sheet":"tune","block":"band","pins":{"1":"SWF_B","2":"FM_EN_N"},"wiki":"https://wiki.adom.inc/adom/0603waf1001t5e"},"C212":{"value":"10u","lib":"Device:C","desc":"Capacitor","lcsc":"C15850","mpn":"","sheet":"tune","block":"band","pins":{"1":"+5V_FM","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805"},"C213":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"tune","block":"band","pins":{"1":"+5V_FM","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"Q202":{"value":"MMBT3906","lib":"Transistor_BJT:MMBT3906","desc":"AM front-end power switch","lcsc":"C2143","mpn":"MMBT3906","sheet":"tune","block":"band","pins":{"1":"SWA_B","2":"+5VA","3":"+5V_AM"},"wiki":"https://wiki.adom.inc/adom/mmbt3906"},"R219":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"tune","block":"band","pins":{"1":"+5VA","2":"SWA_B"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"R220":{"value":"1k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C21190","mpn":"","sheet":"tune","block":"band","pins":{"1":"SWA_B","2":"AM_EN_N"},"wiki":"https://wiki.adom.inc/adom/0603waf1001t5e"},"C214":{"value":"10u","lib":"Device:C","desc":"Capacitor","lcsc":"C15850","mpn":"","sheet":"tune","block":"band","pins":{"1":"+5V_AM","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805"},"C215":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"tune","block":"band","pins":{"1":"+5V_AM","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R224":{"value":"220","lib":"Device:R","desc":"Green LED has ~2.8 V Vf: small resistor from 3.3 V","lcsc":"C22962","mpn":"","sheet":"tune","block":"ui","pins":{"1":"LED_FM","2":"LEDF_A"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"D201":{"value":"GREEN (FM)","lib":"Device:LED","desc":"FM band LED","lcsc":"C12624","mpn":"KT-0603G","sheet":"tune","block":"ui","pins":{"1":"GND","2":"LEDF_A"},"wiki":"https://wiki.adom.inc/adom/kt-0603g"},"R225":{"value":"1k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C21190","mpn":"","sheet":"tune","block":"ui","pins":{"1":"LED_AM","2":"LEDA_A"},"wiki":"https://wiki.adom.inc/adom/0603waf1001t5e"},"D202":{"value":"YELLOW (AM)","lib":"Device:LED","desc":"AM band LED","lcsc":"C2287","mpn":"KT-0603Y","sheet":"tune","block":"ui","pins":{"1":"GND","2":"LEDA_A"},"wiki":"https://wiki.adom.inc/adom/kt-0603y"},"R226":{"value":"220","lib":"Device:R","desc":"Blue LED has ~2.8 V Vf: small resistor from 3.3 V","lcsc":"C22962","mpn":"","sheet":"tune","block":"ui","pins":{"1":"LED_STAT","2":"LEDS_A"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"D203":{"value":"BLUE (USB/stereo)","lib":"Device:LED","desc":"Status LED","lcsc":"C2288","mpn":"KT-0603B","sheet":"tune","block":"ui","pins":{"1":"GND","2":"LEDS_A"},"wiki":"https://wiki.adom.inc/barrett-land/kt-0603b"},"TP201":{"value":"DACF","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): DAC_FM","lcsc":"","mpn":"","sheet":"tune","block":"tp","pins":{"1":"DAC_FM"}},"TP202":{"value":"DACA","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): DAC_AM","lcsc":"","mpn":"","sheet":"tune","block":"tp","pins":{"1":"DAC_AM"}},"TP203":{"value":"PWM","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): PWM_RF","lcsc":"","mpn":"","sheet":"tune","block":"tp","pins":{"1":"PWM_RF"}},"TP204":{"value":"VTF1","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): VTF_OUT","lcsc":"","mpn":"","sheet":"tune","block":"tp","pins":{"1":"VTF_OUT"}},"TP205":{"value":"VTA1","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): VTA_OUT","lcsc":"","mpn":"","sheet":"tune","block":"tp","pins":{"1":"VTA_OUT"}},"TP206":{"value":"VTR1","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): VTR_OUT","lcsc":"","mpn":"","sheet":"tune","block":"tp","pins":{"1":"VTR_OUT"}},"TP207":{"value":"VREF","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): VREF_1V65","lcsc":"","mpn":"","sheet":"tune","block":"tp","pins":{"1":"VREF_1V65"}},"TP208":{"value":"5VFM","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): +5V_FM","lcsc":"","mpn":"","sheet":"tune","block":"tp","pins":{"1":"+5V_FM"}},"TP209":{"value":"5VAM","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): +5V_AM","lcsc":"","mpn":"","sheet":"tune","block":"tp","pins":{"1":"+5V_AM"}},"TP210":{"value":"GND","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): GND","lcsc":"","mpn":"","sheet":"tune","block":"tp","pins":{"1":"GND"}},"TP211":{"value":"GND","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): GND","lcsc":"","mpn":"","sheet":"tune","block":"tp","pins":{"1":"GND"}},"J301":{"value":"ANT (SMA)","lib":"Connector:Conn_Coaxial","desc":"SMA right-angle PCB jack at the board edge (antenna)","lcsc":"C496551","mpn":"BWSMA-KWE-Z001","sheet":"fmfe","block":"ant","pins":{"1":"ANT","2":"GND"},"wiki":"https://wiki.adom.inc/adom/bwsma-kwe-z001"},"R301":{"value":"100k","lib":"Device:R","desc":"Static bleed","lcsc":"C25803","mpn":"","sheet":"fmfe","block":"ant","pins":{"1":"ANT","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R317":{"value":"47k","lib":"Device:R","desc":"Calibration marker: MCU TIM1 square wave, about -60 dBm per harmonic","lcsc":"C25819","mpn":"","sheet":"fmfe","block":"ant","pins":{"1":"CAL_MARK","2":"CAL_INJ"},"wiki":"https://wiki.adom.inc/adom/0603waf4702t5e"},"C323":{"value":"100p","lib":"Device:C","desc":"C0G, DC block; marker idles low (quiet) outside calibration","lcsc":"C14858","mpn":"","sheet":"fmfe","block":"ant","pins":{"1":"CAL_INJ","2":"ANT"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"L301":{"value":"2.2u","lib":"Device:L","desc":"Inductor","lcsc":"C89016","mpn":"NLV32T-2R2J-PF","sheet":"fmfe","block":"ant","pins":{"1":"ANT","2":"AMLPF_1"},"wiki":"https://wiki.adom.inc/adom/nlv32t-2r2j-pf"},"C301":{"value":"2.7n","lib":"Device:C","desc":"C0G","lcsc":"C77034","mpn":"","sheet":"fmfe","block":"ant","pins":{"1":"AMLPF_1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/murata-grm18-gcm18-c0g-0603"},"L302":{"value":"8.2u","lib":"Device:L","desc":"Inductor","lcsc":"C52259800","mpn":"YSCM322522-8R2J","sheet":"fmfe","block":"ant","pins":{"1":"AMLPF_1","2":"AMLPF_2"},"wiki":"https://wiki.adom.inc/adom/yscm322522-8r2j"},"C302":{"value":"2.7n","lib":"Device:C","desc":"C0G","lcsc":"C77034","mpn":"","sheet":"fmfe","block":"ant","pins":{"1":"AMLPF_2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/murata-grm18-gcm18-c0g-0603"},"L303":{"value":"2.2u","lib":"Device:L","desc":"Inductor","lcsc":"C89016","mpn":"NLV32T-2R2J-PF","sheet":"fmfe","block":"ant","pins":{"1":"AMLPF_2","2":"AM_RFIN"},"wiki":"https://wiki.adom.inc/adom/nlv32t-2r2j-pf"},"C303":{"value":"47p","lib":"Device:C","desc":"C0G","lcsc":"C1671","mpn":"","sheet":"fmfe","block":"ant","pins":{"1":"ANT","2":"FMHP_1"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"L304":{"value":"56n","lib":"Device:L","desc":"Wire-wound, Q>30 @100 MHz","lcsc":"C98079","mpn":"LQW18AN56NG00D","sheet":"fmfe","block":"ant","pins":{"1":"FMHP_1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/murata-lqw18an"},"C304":{"value":"47p","lib":"Device:C","desc":"C0G","lcsc":"C1671","mpn":"","sheet":"fmfe","block":"ant","pins":{"1":"FMHP_1","2":"FMHP_2"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"C305":{"value":"22p","lib":"Device:C","desc":"C0G","lcsc":"C1653","mpn":"","sheet":"fmfe","block":"ant","pins":{"1":"FMHP_2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"L305":{"value":"120n","lib":"Device:L","desc":"Wire-wound","lcsc":"C86138","mpn":"LQW18ANR12G00D","sheet":"fmfe","block":"ant","pins":{"1":"FMHP_2","2":"FM_BPF"},"wiki":"https://wiki.adom.inc/adom/murata-lqw18an"},"C306":{"value":"22p","lib":"Device:C","desc":"C0G","lcsc":"C1653","mpn":"","sheet":"fmfe","block":"ant","pins":{"1":"FM_BPF","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"R302":{"value":"56","lib":"Device:R","desc":"Filter termination","lcsc":"C25196","mpn":"","sheet":"fmfe","block":"fmrf","pins":{"1":"FM_BPF","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C307":{"value":"1n","lib":"Device:C","desc":"Capacitor","lcsc":"C1588","mpn":"","sheet":"fmfe","block":"fmrf","pins":{"1":"FM_BPF","2":"FMRF_B"},"wiki":"https://wiki.adom.inc/adom/cl10b102kb8nnnc"},"Q301":{"value":"MMBTH10","lib":"Transistor_BJT:MMBT3904","desc":"FM RF amplifier","lcsc":"C545531","mpn":"MMBTH10","sheet":"fmfe","block":"fmrf","pins":{"1":"FMRF_B","2":"FMRF_E","3":"FMRF_C"},"wiki":"https://wiki.adom.inc/adom/mmbth10"},"R303":{"value":"4.7k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23162","mpn":"","sheet":"fmfe","block":"fmrf","pins":{"1":"V_RF1","2":"FMRF_B"},"wiki":"https://wiki.adom.inc/adom/0603waf4701t5e"},"R304":{"value":"1.8k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C4177","mpn":"","sheet":"fmfe","block":"fmrf","pins":{"1":"FMRF_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R305":{"value":"22","lib":"Device:R","desc":"Unbypassed degeneration","lcsc":"C23345","mpn":"","sheet":"fmfe","block":"fmrf","pins":{"1":"FMRF_E","2":"FMRF_E2"},"wiki":"https://wiki.adom.inc/adom/0603waf220jt5e"},"R306":{"value":"82","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23255","mpn":"","sheet":"fmfe","block":"fmrf","pins":{"1":"FMRF_E2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C308":{"value":"1n","lib":"Device:C","desc":"Capacitor","lcsc":"C1588","mpn":"","sheet":"fmfe","block":"fmrf","pins":{"1":"FMRF_E2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10b102kb8nnnc"},"L306":{"value":"150n","lib":"Device:L","desc":"Tank inductor, wire-wound","lcsc":"C113131","mpn":"LQW18ANR15G00D","sheet":"fmfe","block":"fmrf","pins":{"1":"FMRF_C","2":"V_RF1"},"wiki":"https://wiki.adom.inc/adom/murata-lqw18an"},"C309":{"value":"3.3p","lib":"Device:C","desc":"C0G","lcsc":"C282249","mpn":"","sheet":"fmfe","block":"fmrf","pins":{"1":"FMRF_C","2":"GND"},"wiki":"https://wiki.adom.inc/adom/yageo-cc0603-npo"},"C310":{"value":"22p","lib":"Device:C","desc":"C0G, varactor series cap","lcsc":"C1653","mpn":"","sheet":"fmfe","block":"fmrf","pins":{"1":"FMRF_C","2":"VAR_RF"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"D301":{"value":"BB910","lib":"Device:D_Capacitance","desc":"Low-voltage tuning varactor, 45 pF @ 0.5 V, C0.5/C5 = 5","lcsc":"C475628","mpn":"BB910","sheet":"fmfe","block":"fmrf","pins":{"1":"VAR_RF","2":"GND"},"wiki":"https://wiki.adom.inc/adom/bb910"},"R307":{"value":"100k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25803","mpn":"","sheet":"fmfe","block":"fmrf","pins":{"1":"VT_RF","2":"VAR_RF"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R308":{"value":"47","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23182","mpn":"","sheet":"fmfe","block":"fmrf","pins":{"1":"+5V_FM","2":"V_RF1"},"wiki":"https://wiki.adom.inc/adom/0603waf470jt5e"},"C311":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"fmfe","block":"fmrf","pins":{"1":"V_RF1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"C312":{"value":"1n","lib":"Device:C","desc":"Capacitor","lcsc":"C1588","mpn":"","sheet":"fmfe","block":"fmrf","pins":{"1":"V_RF1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10b102kb8nnnc"},"C313":{"value":"4.7p","lib":"Device:C","desc":"C0G, tank tap to mixer","lcsc":"C1669","mpn":"","sheet":"fmfe","block":"fmrf","pins":{"1":"FMRF_C","2":"FM_MIX_B"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"Q302":{"value":"MMBTH10","lib":"Transistor_BJT:MMBT3904","desc":"FM VCO","lcsc":"C545531","mpn":"MMBTH10","sheet":"fmfe","block":"fmlo","pins":{"1":"FMLO_B","2":"FMLO_E","3":"FMLO_C"},"wiki":"https://wiki.adom.inc/adom/mmbth10"},"R309":{"value":"47","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23182","mpn":"","sheet":"fmfe","block":"fmlo","pins":{"1":"+5V_FM","2":"V_LO1"},"wiki":"https://wiki.adom.inc/adom/0603waf470jt5e"},"C314":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"fmfe","block":"fmlo","pins":{"1":"V_LO1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"C315":{"value":"1n","lib":"Device:C","desc":"Capacitor","lcsc":"C1588","mpn":"","sheet":"fmfe","block":"fmlo","pins":{"1":"V_LO1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10b102kb8nnnc"},"R310":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"fmfe","block":"fmlo","pins":{"1":"V_LO1","2":"FMLO_B"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"R311":{"value":"4.7k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23162","mpn":"","sheet":"fmfe","block":"fmlo","pins":{"1":"FMLO_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf4701t5e"},"C316":{"value":"1n","lib":"Device:C","desc":"Base AC ground","lcsc":"C1588","mpn":"","sheet":"fmfe","block":"fmlo","pins":{"1":"FMLO_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10b102kb8nnnc"},"R312":{"value":"330","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23138","mpn":"","sheet":"fmfe","block":"fmlo","pins":{"1":"FMLO_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf3300t5e"},"C317":{"value":"15p","lib":"Device:C","desc":"C0G","lcsc":"C1644","mpn":"","sheet":"fmfe","block":"fmlo","pins":{"1":"FMLO_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"C318":{"value":"4.7p","lib":"Device:C","desc":"C0G feedback","lcsc":"C1669","mpn":"","sheet":"fmfe","block":"fmlo","pins":{"1":"FMLO_C","2":"FMLO_E"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"L307":{"value":"110n","lib":"Device:L","desc":"Tank inductor, wire-wound","lcsc":"C113130","mpn":"LQW18ANR11G00D","sheet":"fmfe","block":"fmlo","pins":{"1":"FMLO_C","2":"V_LO1"},"wiki":"https://wiki.adom.inc/adom/murata-lqw18an"},"C319":{"value":"3.3p","lib":"Device:C","desc":"C0G","lcsc":"C282249","mpn":"","sheet":"fmfe","block":"fmlo","pins":{"1":"FMLO_C","2":"GND"},"wiki":"https://wiki.adom.inc/adom/yageo-cc0603-npo"},"C320":{"value":"22p","lib":"Device:C","desc":"C0G, varactor series cap","lcsc":"C1653","mpn":"","sheet":"fmfe","block":"fmlo","pins":{"1":"FMLO_C","2":"VAR_LO"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"D302":{"value":"BB910","lib":"Device:D_Capacitance","desc":"Low-voltage tuning varactor, 45 pF @ 0.5 V, C0.5/C5 = 5","lcsc":"C475628","mpn":"BB910","sheet":"fmfe","block":"fmlo","pins":{"1":"VAR_LO","2":"GND"},"wiki":"https://wiki.adom.inc/adom/bb910"},"R313":{"value":"100k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25803","mpn":"","sheet":"fmfe","block":"fmlo","pins":{"1":"VT_FM","2":"VAR_LO"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C321":{"value":"2.2p","lib":"Device:C","desc":"C0G, LO injection","lcsc":"C1651","mpn":"","sheet":"fmfe","block":"fmlo","pins":{"1":"FMLO_C","2":"FM_MIX_B"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"Q303":{"value":"MMBTH10","lib":"Transistor_BJT:MMBT3904","desc":"FM mixer","lcsc":"C545531","mpn":"MMBTH10","sheet":"fmfe","block":"fmmix","pins":{"1":"FM_MIX_B","2":"FMMIX_E","3":"IF_MIX"},"wiki":"https://wiki.adom.inc/adom/mmbth10"},"R314":{"value":"22k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C31850","mpn":"","sheet":"fmfe","block":"fmmix","pins":{"1":"+5V_FM","2":"FM_MIX_B"},"wiki":"https://wiki.adom.inc/adom/0603waf2202t5e"},"R315":{"value":"6.8k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23212","mpn":"","sheet":"fmfe","block":"fmmix","pins":{"1":"FM_MIX_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf6801t5e"},"R316":{"value":"150","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C22808","mpn":"","sheet":"fmfe","block":"fmmix","pins":{"1":"FMMIX_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C322":{"value":"10n","lib":"Device:C","desc":"Capacitor","lcsc":"C57112","mpn":"","sheet":"fmfe","block":"fmmix","pins":{"1":"FMMIX_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"TP301":{"value":"VRF","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): V_RF1","lcsc":"","mpn":"","sheet":"fmfe","block":"tp","pins":{"1":"V_RF1"}},"TP302":{"value":"VLO","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): V_LO1","lcsc":"","mpn":"","sheet":"fmfe","block":"tp","pins":{"1":"V_LO1"}},"TP303":{"value":"FLO","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): FMLO_E","lcsc":"","mpn":"","sheet":"fmfe","block":"tp","pins":{"1":"FMLO_E"}},"TP304":{"value":"MIX","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): IF_MIX","lcsc":"","mpn":"","sheet":"fmfe","block":"tp","pins":{"1":"IF_MIX"}},"TP305":{"value":"GND","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): GND","lcsc":"","mpn":"","sheet":"fmfe","block":"tp","pins":{"1":"GND"}},"R401":{"value":"51","lib":"Device:R","desc":"LPF termination","lcsc":"C23197","mpn":"","sheet":"amfe","block":"amrf","pins":{"1":"AM_RFIN","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C401":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"amfe","block":"amrf","pins":{"1":"AM_RFIN","2":"AMRF_B"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"Q401":{"value":"MMBT3904","lib":"Transistor_BJT:MMBT3904","desc":"AM RF preamp","lcsc":"C20526","mpn":"MMBT3904","sheet":"amfe","block":"amrf","pins":{"1":"AMRF_B","2":"AMRF_E","3":"AMRF_C"},"wiki":"https://wiki.adom.inc/adom/mmbt3904"},"R402":{"value":"47","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23182","mpn":"","sheet":"amfe","block":"amrf","pins":{"1":"+5V_AM","2":"V_AM1"},"wiki":"https://wiki.adom.inc/adom/0603waf470jt5e"},"C402":{"value":"10u","lib":"Device:C","desc":"Capacitor","lcsc":"C15850","mpn":"","sheet":"amfe","block":"amrf","pins":{"1":"V_AM1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805"},"C403":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"amfe","block":"amrf","pins":{"1":"V_AM1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R403":{"value":"22k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C31850","mpn":"","sheet":"amfe","block":"amrf","pins":{"1":"V_AM1","2":"AMRF_B"},"wiki":"https://wiki.adom.inc/adom/0603waf2202t5e"},"R404":{"value":"6.8k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23212","mpn":"","sheet":"amfe","block":"amrf","pins":{"1":"AMRF_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf6801t5e"},"R405":{"value":"22","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23345","mpn":"","sheet":"amfe","block":"amrf","pins":{"1":"AMRF_E","2":"AMRF_E2"},"wiki":"https://wiki.adom.inc/adom/0603waf220jt5e"},"R406":{"value":"56","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25196","mpn":"","sheet":"amfe","block":"amrf","pins":{"1":"AMRF_E2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C404":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"amfe","block":"amrf","pins":{"1":"AMRF_E2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R407":{"value":"470","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23179","mpn":"","sheet":"amfe","block":"amrf","pins":{"1":"V_AM1","2":"AMRF_C"},"wiki":"https://wiki.adom.inc/adom/0603waf4700t5e"},"C405":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"amfe","block":"amrf","pins":{"1":"AMRF_C","2":"AM_MIX_B"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"Q402":{"value":"MMBT3904","lib":"Transistor_BJT:MMBT3904","desc":"AM VCO","lcsc":"C20526","mpn":"MMBT3904","sheet":"amfe","block":"amlo","pins":{"1":"AMLO_B","2":"AMLO_E","3":"V_AM2"},"wiki":"https://wiki.adom.inc/adom/mmbt3904"},"R408":{"value":"47","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23182","mpn":"","sheet":"amfe","block":"amlo","pins":{"1":"+5V_AM","2":"V_AM2"},"wiki":"https://wiki.adom.inc/adom/0603waf470jt5e"},"C406":{"value":"10u","lib":"Device:C","desc":"Capacitor","lcsc":"C15850","mpn":"","sheet":"amfe","block":"amlo","pins":{"1":"V_AM2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805"},"C407":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"amfe","block":"amlo","pins":{"1":"V_AM2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R409":{"value":"22k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C31850","mpn":"","sheet":"amfe","block":"amlo","pins":{"1":"V_AM2","2":"AMLO_B"},"wiki":"https://wiki.adom.inc/adom/0603waf2202t5e"},"R410":{"value":"22k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C31850","mpn":"","sheet":"amfe","block":"amlo","pins":{"1":"AMLO_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf2202t5e"},"R411":{"value":"1.5k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C22843","mpn":"","sheet":"amfe","block":"amlo","pins":{"1":"AMLO_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C408":{"value":"220p","lib":"Device:C","desc":"C0G","lcsc":"C388907","mpn":"","sheet":"amfe","block":"amlo","pins":{"1":"AMLO_B","2":"AMLO_E"},"wiki":"https://wiki.adom.inc/adom/murata-grm18-gcm18-c0g-0603"},"C409":{"value":"470p","lib":"Device:C","desc":"C0G","lcsc":"C106211","mpn":"","sheet":"amfe","block":"amlo","pins":{"1":"AMLO_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/yageo-cc0603-npo"},"L401":{"value":"8.2u","lib":"Device:L","desc":"High-Q wire-wound","lcsc":"C52259800","mpn":"YSCM322522-8R2J","sheet":"amfe","block":"amlo","pins":{"1":"AMLO_B","2":"AMLO_T"},"wiki":"https://wiki.adom.inc/adom/yscm322522-8r2j"},"C410":{"value":"15p","lib":"Device:C","desc":"C0G","lcsc":"C1644","mpn":"","sheet":"amfe","block":"amlo","pins":{"1":"AMLO_T","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"C411":{"value":"33p","lib":"Device:C","desc":"C0G, varactor series cap","lcsc":"C1663","mpn":"","sheet":"amfe","block":"amlo","pins":{"1":"AMLO_T","2":"VAR_AM"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"D401":{"value":"BB910","lib":"Device:D_Capacitance","desc":"Low-voltage tuning varactor, 45 pF @ 0.5 V, C0.5/C5 = 5","lcsc":"C475628","mpn":"BB910","sheet":"amfe","block":"amlo","pins":{"1":"VAR_AM","2":"GND"},"wiki":"https://wiki.adom.inc/adom/bb910"},"R412":{"value":"100k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25803","mpn":"","sheet":"amfe","block":"amlo","pins":{"1":"VT_AM","2":"VAR_AM"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C412":{"value":"47p","lib":"Device:C","desc":"C0G, LO injection","lcsc":"C1671","mpn":"","sheet":"amfe","block":"amlo","pins":{"1":"AMLO_E","2":"AM_MIX_B"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"Q403":{"value":"MMBT3904","lib":"Transistor_BJT:MMBT3904","desc":"AM mixer","lcsc":"C20526","mpn":"MMBT3904","sheet":"amfe","block":"ammix","pins":{"1":"AM_MIX_B","2":"AMMIX_E","3":"IF_MIX"},"wiki":"https://wiki.adom.inc/adom/mmbt3904"},"R413":{"value":"22k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C31850","mpn":"","sheet":"amfe","block":"ammix","pins":{"1":"+5V_AM","2":"AM_MIX_B"},"wiki":"https://wiki.adom.inc/adom/0603waf2202t5e"},"R414":{"value":"6.8k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23212","mpn":"","sheet":"amfe","block":"ammix","pins":{"1":"AM_MIX_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf6801t5e"},"R415":{"value":"150","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C22808","mpn":"","sheet":"amfe","block":"ammix","pins":{"1":"AMMIX_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C413":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"amfe","block":"ammix","pins":{"1":"AMMIX_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"TP401":{"value":"VAM1","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): V_AM1","lcsc":"","mpn":"","sheet":"amfe","block":"tp","pins":{"1":"V_AM1"}},"TP402":{"value":"VAM2","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): V_AM2","lcsc":"","mpn":"","sheet":"amfe","block":"tp","pins":{"1":"V_AM2"}},"TP403":{"value":"AMIN","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): AM_RFIN","lcsc":"","mpn":"","sheet":"amfe","block":"tp","pins":{"1":"AM_RFIN"}},"TP404":{"value":"ARF","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): AMRF_C","lcsc":"","mpn":"","sheet":"amfe","block":"tp","pins":{"1":"AMRF_C"}},"TP405":{"value":"ALO","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): AMLO_E","lcsc":"","mpn":"","sheet":"amfe","block":"tp","pins":{"1":"AMLO_E"}},"TP406":{"value":"GND","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): GND","lcsc":"","mpn":"","sheet":"amfe","block":"tp","pins":{"1":"GND"}},"R501":{"value":"330","lib":"Device:R","desc":"Mixer load = filter source impedance","lcsc":"C23138","mpn":"","sheet":"if","block":"cf1","pins":{"1":"V_IF1","2":"IF_MIX"},"wiki":"https://wiki.adom.inc/adom/0603waf3300t5e"},"C501":{"value":"10n","lib":"Device:C","desc":"Capacitor","lcsc":"C57112","mpn":"","sheet":"if","block":"cf1","pins":{"1":"IF_MIX","2":"CF1_IN"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"C502":{"value":"22p","lib":"Device:C","desc":"Shunts VHF LO feed-through","lcsc":"C1653","mpn":"","sheet":"if","block":"cf1","pins":{"1":"IF_MIX","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"FL501":{"value":"HCCF3-10.700-LTCVS3L","lib":"AMFM:CeramicFilter_3pin","desc":"10.7 MHz SMD ceramic filter, 180 kHz BW, 330 ohm","lcsc":"C19191232","mpn":"HCCF3-10.700-LTCVS3L","sheet":"if","block":"cf1","pins":{"1":"CF1_IN","2":"GND","3":"CF1_OUT"},"wiki":"https://wiki.adom.inc/adom/hccf3-10-700-ltcvs3l"},"R502":{"value":"22","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23345","mpn":"","sheet":"if","block":"cf1","pins":{"1":"+5VA","2":"V_IF1"},"wiki":"https://wiki.adom.inc/adom/0603waf220jt5e"},"C503":{"value":"10u","lib":"Device:C","desc":"Capacitor","lcsc":"C15850","mpn":"","sheet":"if","block":"cf1","pins":{"1":"V_IF1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805"},"C504":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"if","block":"cf1","pins":{"1":"V_IF1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R503":{"value":"330","lib":"Device:R","desc":"Filter termination","lcsc":"C23138","mpn":"","sheet":"if","block":"cf1","pins":{"1":"CF1_OUT","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf3300t5e"},"C505":{"value":"10n","lib":"Device:C","desc":"Capacitor","lcsc":"C57112","mpn":"","sheet":"if","block":"cf1","pins":{"1":"CF1_OUT","2":"IF_B1"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"Q501":{"value":"MMBT3904","lib":"Transistor_BJT:MMBT3904","desc":"10.7 MHz IF amplifier","lcsc":"C20526","mpn":"MMBT3904","sheet":"if","block":"ifamp","pins":{"1":"IF_B1","2":"IF_E1","3":"IF_C1"},"wiki":"https://wiki.adom.inc/adom/mmbt3904"},"R504":{"value":"15k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C22809","mpn":"","sheet":"if","block":"ifamp","pins":{"1":"V_IF1","2":"IF_B1"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R505":{"value":"5.6k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23189","mpn":"","sheet":"if","block":"ifamp","pins":{"1":"IF_B1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R506":{"value":"22","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23345","mpn":"","sheet":"if","block":"ifamp","pins":{"1":"IF_E1","2":"IF_E2"},"wiki":"https://wiki.adom.inc/adom/0603waf220jt5e"},"R507":{"value":"120","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C22787","mpn":"","sheet":"if","block":"ifamp","pins":{"1":"IF_E2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C506":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"if","block":"ifamp","pins":{"1":"IF_E2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R508":{"value":"330","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23138","mpn":"","sheet":"if","block":"ifamp","pins":{"1":"V_IF1","2":"IF_C1"},"wiki":"https://wiki.adom.inc/adom/0603waf3300t5e"},"C507":{"value":"10n","lib":"Device:C","desc":"Capacitor","lcsc":"C57112","mpn":"","sheet":"if","block":"ifamp","pins":{"1":"IF_C1","2":"CF2_IN"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"FL502":{"value":"HCCF3-10.700-LTCVS3L","lib":"AMFM:CeramicFilter_3pin","desc":"10.7 MHz SMD ceramic filter, 180 kHz BW, 330 ohm","lcsc":"C19191232","mpn":"HCCF3-10.700-LTCVS3L","sheet":"if","block":"ifamp","pins":{"1":"CF2_IN","2":"GND","3":"CF2_OUT"},"wiki":"https://wiki.adom.inc/adom/hccf3-10-700-ltcvs3l"},"R509":{"value":"330","lib":"Device:R","desc":"Filter termination","lcsc":"C23138","mpn":"","sheet":"if","block":"ifamp","pins":{"1":"CF2_OUT","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf3300t5e"},"C508":{"value":"10n","lib":"Device:C","desc":"Capacitor","lcsc":"C57112","mpn":"","sheet":"if","block":"ifamp","pins":{"1":"CF2_OUT","2":"MIX2_B"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"Q502":{"value":"MMBT3904","lib":"Transistor_BJT:MMBT3904","desc":"2nd mixer","lcsc":"C20526","mpn":"MMBT3904","sheet":"if","block":"mix2","pins":{"1":"MIX2_B","2":"MIX2_E","3":"IF2_OUT"},"wiki":"https://wiki.adom.inc/adom/mmbt3904"},"R510":{"value":"22k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C31850","mpn":"","sheet":"if","block":"mix2","pins":{"1":"V_IF2","2":"MIX2_B"},"wiki":"https://wiki.adom.inc/adom/0603waf2202t5e"},"R511":{"value":"6.8k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23212","mpn":"","sheet":"if","block":"mix2","pins":{"1":"MIX2_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf6801t5e"},"R512":{"value":"220","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C22962","mpn":"","sheet":"if","block":"mix2","pins":{"1":"MIX2_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C510":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"if","block":"mix2","pins":{"1":"MIX2_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R513":{"value":"1.5k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C22843","mpn":"","sheet":"if","block":"mix2","pins":{"1":"V_IF2","2":"IF2_OUT"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C511":{"value":"100p","lib":"Device:C","desc":"Rolls off 10 MHz LO feed-through","lcsc":"C14858","mpn":"","sheet":"if","block":"mix2","pins":{"1":"IF2_OUT","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"R514":{"value":"22","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23345","mpn":"","sheet":"if","block":"mix2","pins":{"1":"+5VA","2":"V_IF2"},"wiki":"https://wiki.adom.inc/adom/0603waf220jt5e"},"C512":{"value":"10u","lib":"Device:C","desc":"Capacitor","lcsc":"C15850","mpn":"","sheet":"if","block":"mix2","pins":{"1":"V_IF2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805"},"C513":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"if","block":"mix2","pins":{"1":"V_IF2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"Q503":{"value":"MMBT3904","lib":"Transistor_BJT:MMBT3904","desc":"Crystal oscillator","lcsc":"C20526","mpn":"MMBT3904","sheet":"if","block":"xo","pins":{"1":"XO_B","2":"XO_E","3":"V_IF2"},"wiki":"https://wiki.adom.inc/adom/mmbt3904"},"R515":{"value":"47k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25819","mpn":"","sheet":"if","block":"xo","pins":{"1":"V_IF2","2":"XO_B"},"wiki":"https://wiki.adom.inc/adom/0603waf4702t5e"},"R516":{"value":"47k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25819","mpn":"","sheet":"if","block":"xo","pins":{"1":"XO_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf4702t5e"},"R517":{"value":"1.5k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C22843","mpn":"","sheet":"if","block":"xo","pins":{"1":"XO_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C514":{"value":"100p","lib":"Device:C","desc":"C0G","lcsc":"C14858","mpn":"","sheet":"if","block":"xo","pins":{"1":"XO_B","2":"XO_E"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"C515":{"value":"220p","lib":"Device:C","desc":"C0G","lcsc":"C388907","mpn":"","sheet":"if","block":"xo","pins":{"1":"XO_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/murata-grm18-gcm18-c0g-0603"},"Y501":{"value":"10.24MHz","lib":"Device:Crystal_GND24","desc":"10.240 MHz crystal, 12 pF load, SMD 3225","lcsc":"C51822681","mpn":"0132M4-10.240F12DZNG","sheet":"if","block":"xo","pins":{"1":"XO_B","3":"XO_X","2":"GND","4":"GND"},"wiki":"https://wiki.adom.inc/adom/0132m4-10-240f12dzng"},"C516":{"value":"15p","lib":"Device:C","desc":"C0G, crystal load trim (12 pF crystal)","lcsc":"C1644","mpn":"","sheet":"if","block":"xo","pins":{"1":"XO_X","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"C509":{"value":"22p","lib":"Device:C","desc":"C0G, LO injection","lcsc":"C1653","mpn":"","sheet":"if","block":"xo","pins":{"1":"XO_E","2":"MIX2_B"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"TP501":{"value":"VIF1","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): V_IF1","lcsc":"","mpn":"","sheet":"if","block":"tp","pins":{"1":"V_IF1"}},"TP502":{"value":"VIF2","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): V_IF2","lcsc":"","mpn":"","sheet":"if","block":"tp","pins":{"1":"V_IF2"}},"TP503":{"value":"CF1","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): CF1_OUT","lcsc":"","mpn":"","sheet":"if","block":"tp","pins":{"1":"CF1_OUT"}},"TP504":{"value":"IF1","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): IF_C1","lcsc":"","mpn":"","sheet":"if","block":"tp","pins":{"1":"IF_C1"}},"TP505":{"value":"XO","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): XO_E","lcsc":"","mpn":"","sheet":"if","block":"tp","pins":{"1":"XO_E"}},"TP506":{"value":"GND","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): GND","lcsc":"","mpn":"","sheet":"if","block":"tp","pins":{"1":"GND"}},"R602":{"value":"22","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23345","mpn":"","sheet":"amif","block":"amf","pins":{"1":"+5VA","2":"V_IF3"},"wiki":"https://wiki.adom.inc/adom/0603waf220jt5e"},"C603":{"value":"10u","lib":"Device:C","desc":"Capacitor","lcsc":"C15850","mpn":"","sheet":"amif","block":"amf","pins":{"1":"V_IF3","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805"},"C604":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"amif","block":"amf","pins":{"1":"V_IF3","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"C601":{"value":"10n","lib":"Device:C","desc":"Capacitor","lcsc":"C57112","mpn":"","sheet":"amif","block":"amf","pins":{"1":"IF2_OUT","2":"AMF_IN"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"FL601":{"value":"HCCF2-455.000-LTWCGL","lib":"AMFM:CeramicFilter_4pin","desc":"455 kHz SMD ceramic filter, +/-4.5 kHz, 2 kohm","lcsc":"C19186014","mpn":"HCCF2-455.000-LTWCGL","sheet":"amif","block":"amf","pins":{"1":"AMF_IN","2":"AMF_OUT","3":"GND","4":"GND"},"wiki":"https://wiki.adom.inc/adom/hccf2-455-000-ltwcgl"},"R601":{"value":"2.7k","lib":"Device:R","desc":"Termination (with VGA input ~2 kohm total)","lcsc":"C13167","mpn":"","sheet":"amif","block":"amf","pins":{"1":"AMF_OUT","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C602":{"value":"10n","lib":"Device:C","desc":"Capacitor","lcsc":"C57112","mpn":"","sheet":"amif","block":"amf","pins":{"1":"AMF_OUT","2":"VGA1_IN"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"R603":{"value":"6.8k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23212","mpn":"","sheet":"amif","block":"amf","pins":{"1":"V_IF3","2":"VBIAS"},"wiki":"https://wiki.adom.inc/adom/0603waf6801t5e"},"R604":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"amif","block":"amf","pins":{"1":"VBIAS","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C605":{"value":"10u","lib":"Device:C","desc":"Capacitor","lcsc":"C15850","mpn":"","sheet":"amif","block":"amf","pins":{"1":"VBIAS","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805"},"C606":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"amif","block":"amf","pins":{"1":"VBIAS","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R605":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"amif","block":"vga","pins":{"1":"VBIAS","2":"VGA1_IN"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"Q601":{"value":"BC847BS","lib":"Transistor_BJT:BC847BS","desc":"VGA1 differential pair","lcsc":"C5380687","mpn":"BC847BS","sheet":"amif","block":"vga","pins":{"1":"VGA1_E","2":"VGA1_IN","6":"V_IF3","3":"VGA1_OUT","4":"VGA1_E","5":"VBIAS"},"wiki":"https://wiki.adom.inc/adom/bc847bs"},"Q602":{"value":"MMBT3904","lib":"Transistor_BJT:MMBT3904","desc":"VGA1 tail current source","lcsc":"C20526","mpn":"MMBT3904","sheet":"amif","block":"vga","pins":{"1":"AGC_B","2":"VGA1_T","3":"VGA1_E"},"wiki":"https://wiki.adom.inc/adom/mmbt3904"},"R606":{"value":"2.2k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C4190","mpn":"","sheet":"amif","block":"vga","pins":{"1":"V_IF3","2":"VGA1_OUT"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R607":{"value":"2k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C22975","mpn":"","sheet":"amif","block":"vga","pins":{"1":"VGA1_T","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C608":{"value":"10n","lib":"Device:C","desc":"Capacitor","lcsc":"C57112","mpn":"","sheet":"amif","block":"vga","pins":{"1":"VGA1_OUT","2":"VGA2_IN"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"R610":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"amif","block":"vga","pins":{"1":"VBIAS","2":"VGA2_IN"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"Q603":{"value":"BC847BS","lib":"Transistor_BJT:BC847BS","desc":"VGA2 differential pair","lcsc":"C5380687","mpn":"BC847BS","sheet":"amif","block":"vga","pins":{"1":"VGA2_E","2":"VGA2_IN","6":"V_IF3","3":"VGA2_OUT","4":"VGA2_E","5":"VBIAS"},"wiki":"https://wiki.adom.inc/adom/bc847bs"},"Q604":{"value":"MMBT3904","lib":"Transistor_BJT:MMBT3904","desc":"VGA2 tail current source","lcsc":"C20526","mpn":"MMBT3904","sheet":"amif","block":"vga","pins":{"1":"AGC_B","2":"VGA2_T","3":"VGA2_E"},"wiki":"https://wiki.adom.inc/adom/mmbt3904"},"R611":{"value":"2.2k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C4190","mpn":"","sheet":"amif","block":"vga","pins":{"1":"V_IF3","2":"VGA2_OUT"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R612":{"value":"2k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C22975","mpn":"","sheet":"amif","block":"vga","pins":{"1":"VGA2_T","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R608":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"amif","block":"vga","pins":{"1":"V_AGC","2":"AGC_B"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"R609":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"amif","block":"vga","pins":{"1":"AGC_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C607":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"amif","block":"vga","pins":{"1":"AGC_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"C609":{"value":"10n","lib":"Device:C","desc":"Capacitor","lcsc":"C57112","mpn":"","sheet":"amif","block":"det","pins":{"1":"VGA2_OUT","2":"AMP_B"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"Q605":{"value":"MMBT3904","lib":"Transistor_BJT:MMBT3904","desc":"455 kHz post-amp","lcsc":"C20526","mpn":"MMBT3904","sheet":"amif","block":"det","pins":{"1":"AMP_B","2":"AMP_E","3":"AM_IFOUT"},"wiki":"https://wiki.adom.inc/adom/mmbt3904"},"R613":{"value":"33k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C4216","mpn":"","sheet":"amif","block":"det","pins":{"1":"V_IF3","2":"AMP_B"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R614":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"amif","block":"det","pins":{"1":"AMP_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"R615":{"value":"47","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23182","mpn":"","sheet":"amif","block":"det","pins":{"1":"AMP_E","2":"AMP_E2"},"wiki":"https://wiki.adom.inc/adom/0603waf470jt5e"},"R616":{"value":"330","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23138","mpn":"","sheet":"amif","block":"det","pins":{"1":"AMP_E2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf3300t5e"},"C610":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"amif","block":"det","pins":{"1":"AMP_E2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R617":{"value":"2.2k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C4190","mpn":"","sheet":"amif","block":"det","pins":{"1":"V_IF3","2":"AM_IFOUT"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C611":{"value":"10n","lib":"Device:C","desc":"Capacitor","lcsc":"C57112","mpn":"","sheet":"amif","block":"det","pins":{"1":"AM_IFOUT","2":"DET_A"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"R618":{"value":"47k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25819","mpn":"","sheet":"amif","block":"det","pins":{"1":"DET_A","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf4702t5e"},"D601":{"value":"BAT54WS","lib":"Device:D_Schottky","desc":"Schottky diode 30 V 200 mA, SOD-323","lcsc":"C124205","mpn":"BAT54WS-7-F","sheet":"amif","block":"det","pins":{"1":"AM_DET","2":"DET_A"},"wiki":"https://wiki.adom.inc/adom/bat54ws-7-f"},"C612":{"value":"2.2n","lib":"Device:C","desc":"Capacitor","lcsc":"C296055","mpn":"","sheet":"amif","block":"det","pins":{"1":"AM_DET","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603n222j500ct"},"R619":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"amif","block":"det","pins":{"1":"AM_DET","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"U601":{"value":"TLV9062IDR","lib":"Amplifier_Operational:TLV9062xD","desc":"Dual 10 MHz rail-to-rail I/O op-amp","lcsc":"C398355","mpn":"TLV9062IDR","sheet":"amif","block":"agc","pins":{"3":"AGC_REF","2":"AGC_N","1":"V_AGC","5":"AMA_P","6":"AMA_OUT","7":"AMA_OUT","8":"+5VA","4":"GND"},"wiki":"https://wiki.adom.inc/adom/tlv9062idr"},"R620":{"value":"100k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25803","mpn":"","sheet":"amif","block":"agc","pins":{"1":"AM_DET","2":"AGC_N"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R623":{"value":"4.7k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23162","mpn":"","sheet":"amif","block":"agc","pins":{"1":"V_AGC","2":"AGC_RC"},"wiki":"https://wiki.adom.inc/adom/0603waf4701t5e"},"C614":{"value":"1u","lib":"Device:C","desc":"Capacitor","lcsc":"C15849","mpn":"","sheet":"amif","block":"agc","pins":{"1":"AGC_RC","2":"AGC_N"},"wiki":"https://wiki.adom.inc/adom/cl10a105kb8nnnc"},"R621":{"value":"39k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23153","mpn":"","sheet":"amif","block":"agc","pins":{"1":"V_IF3","2":"AGC_REF"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R622":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"amif","block":"agc","pins":{"1":"AGC_REF","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C613":{"value":"1u","lib":"Device:C","desc":"Capacitor","lcsc":"C15849","mpn":"","sheet":"amif","block":"agc","pins":{"1":"AGC_REF","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10a105kb8nnnc"},"R624":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"amif","block":"agc","pins":{"1":"V_AGC","2":"RSSI_AM"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"R625":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"amif","block":"agc","pins":{"1":"RSSI_AM","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C615":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"amif","block":"agc","pins":{"1":"RSSI_AM","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"C616":{"value":"1u","lib":"Device:C","desc":"Capacitor","lcsc":"C15849","mpn":"","sheet":"amif","block":"agc","pins":{"1":"AM_DET","2":"AMA_IN"},"wiki":"https://wiki.adom.inc/adom/cl10a105kb8nnnc"},"R626":{"value":"100k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25803","mpn":"","sheet":"amif","block":"agc","pins":{"1":"AMA_IN","2":"VREF_1V65"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R627":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"amif","block":"agc","pins":{"1":"AMA_IN","2":"AMA_N1"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"R628":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"amif","block":"agc","pins":{"1":"AMA_N1","2":"AMA_P"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C617":{"value":"4.7n","lib":"Device:C","desc":"C0G","lcsc":"C576818","mpn":"","sheet":"amif","block":"agc","pins":{"1":"AMA_N1","2":"AMA_OUT"},"wiki":"https://wiki.adom.inc/adom/yageo-cc0603-npo"},"C618":{"value":"2.2n","lib":"Device:C","desc":"C0G","lcsc":"C296055","mpn":"","sheet":"amif","block":"agc","pins":{"1":"AMA_P","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603n222j500ct"},"R629":{"value":"1k","lib":"Device:R","desc":"Limits injection into the 3.3 V ADC pin if the 5 V op-amp swings high","lcsc":"C21190","mpn":"","sheet":"amif","block":"agc","pins":{"1":"AMA_OUT","2":"AM_AUDIO"},"wiki":"https://wiki.adom.inc/adom/0603waf1001t5e"},"C619":{"value":"1n","lib":"Device:C","desc":"ADC sampling reservoir","lcsc":"C1588","mpn":"","sheet":"amif","block":"agc","pins":{"1":"AM_AUDIO","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10b102kb8nnnc"},"C620":{"value":"100n","lib":"Device:C","desc":"U601 decoupling","lcsc":"C14663","mpn":"","sheet":"amif","block":"agc","pins":{"1":"+5VA","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"TP601":{"value":"VIF3","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): V_IF3","lcsc":"","mpn":"","sheet":"amif","block":"tp","pins":{"1":"V_IF3"}},"TP602":{"value":"VB","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): VBIAS","lcsc":"","mpn":"","sheet":"amif","block":"tp","pins":{"1":"VBIAS"}},"TP603":{"value":"AMF","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): AMF_OUT","lcsc":"","mpn":"","sheet":"amif","block":"tp","pins":{"1":"AMF_OUT"}},"TP604":{"value":"VGA1","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): VGA1_OUT","lcsc":"","mpn":"","sheet":"amif","block":"tp","pins":{"1":"VGA1_OUT"}},"TP605":{"value":"VGA2","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): VGA2_OUT","lcsc":"","mpn":"","sheet":"amif","block":"tp","pins":{"1":"VGA2_OUT"}},"TP606":{"value":"AIF","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): AM_IFOUT","lcsc":"","mpn":"","sheet":"amif","block":"tp","pins":{"1":"AM_IFOUT"}},"TP607":{"value":"AGC","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): V_AGC","lcsc":"","mpn":"","sheet":"amif","block":"tp","pins":{"1":"V_AGC"}},"TP608":{"value":"RSA","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): RSSI_AM","lcsc":"","mpn":"","sheet":"amif","block":"tp","pins":{"1":"RSSI_AM"}},"TP609":{"value":"AMA","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): AMA_OUT","lcsc":"","mpn":"","sheet":"amif","block":"tp","pins":{"1":"AMA_OUT"}},"TP610":{"value":"GND","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): GND","lcsc":"","mpn":"","sheet":"amif","block":"tp","pins":{"1":"GND"}},"TP611":{"value":"GND","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): GND","lcsc":"","mpn":"","sheet":"amif","block":"tp","pins":{"1":"GND"}},"R701":{"value":"22","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23345","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"+5VA","2":"V_IF4"},"wiki":"https://wiki.adom.inc/adom/0603waf220jt5e"},"C701":{"value":"10u","lib":"Device:C","desc":"Capacitor","lcsc":"C15850","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"V_IF4","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805"},"C702":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"V_IF4","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"C703":{"value":"1n","lib":"Device:C","desc":"Capacitor","lcsc":"C1588","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"IF2_OUT","2":"FMF_1"},"wiki":"https://wiki.adom.inc/adom/cl10b102kb8nnnc"},"R702":{"value":"2.2k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C4190","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"FMF_1","2":"FMF_2"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C704":{"value":"150p","lib":"Device:C","desc":"Capacitor","lcsc":"C107038","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"FMF_2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/yageo-cc0603-npo"},"C705":{"value":"10n","lib":"Device:C","desc":"Capacitor","lcsc":"C57112","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"FMF_2","2":"LIM1_B"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"Q701":{"value":"MMBT3904","lib":"Transistor_BJT:MMBT3904","desc":"Limiter stage 1","lcsc":"C20526","mpn":"MMBT3904","sheet":"fmif","block":"lim","pins":{"1":"LIM1_B","2":"LIM1_E","3":"LIM1_C"},"wiki":"https://wiki.adom.inc/adom/mmbt3904"},"R703":{"value":"33k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C4216","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"V_IF4","2":"LIM1_B"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R704":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"LIM1_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"R705":{"value":"470","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23179","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"LIM1_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf4700t5e"},"C706":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"LIM1_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R706":{"value":"2.2k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C4190","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"V_IF4","2":"LIM1_C"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C707":{"value":"47p","lib":"Device:C","desc":"Capacitor","lcsc":"C1671","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"LIM1_C","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"C708":{"value":"10n","lib":"Device:C","desc":"Capacitor","lcsc":"C57112","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"LIM1_C","2":"LIM2_B"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"Q702":{"value":"MMBT3904","lib":"Transistor_BJT:MMBT3904","desc":"Limiter stage 2","lcsc":"C20526","mpn":"MMBT3904","sheet":"fmif","block":"lim","pins":{"1":"LIM2_B","2":"LIM2_E","3":"LIM2_C"},"wiki":"https://wiki.adom.inc/adom/mmbt3904"},"R707":{"value":"33k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C4216","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"V_IF4","2":"LIM2_B"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R708":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"LIM2_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"R709":{"value":"470","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23179","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"LIM2_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf4700t5e"},"C709":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"LIM2_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R710":{"value":"2.2k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C4190","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"V_IF4","2":"LIM2_C"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C710":{"value":"47p","lib":"Device:C","desc":"Capacitor","lcsc":"C1671","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"LIM2_C","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"C711":{"value":"10n","lib":"Device:C","desc":"Capacitor","lcsc":"C57112","mpn":"","sheet":"fmif","block":"rssi","pins":{"1":"LIM1_C","2":"RS_A"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"R711":{"value":"47k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25819","mpn":"","sheet":"fmif","block":"rssi","pins":{"1":"RS_A","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf4702t5e"},"D701":{"value":"BAT54WS","lib":"Device:D_Schottky","desc":"Schottky diode 30 V 200 mA, SOD-323","lcsc":"C124205","mpn":"BAT54WS-7-F","sheet":"fmif","block":"rssi","pins":{"1":"RSSI_FM","2":"RS_A"},"wiki":"https://wiki.adom.inc/adom/bat54ws-7-f"},"C712":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"fmif","block":"rssi","pins":{"1":"RSSI_FM","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R712":{"value":"100k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25803","mpn":"","sheet":"fmif","block":"rssi","pins":{"1":"RSSI_FM","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R713":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"fmif","block":"sq","pins":{"1":"LIM2_C","2":"SQ_B"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C713":{"value":"100p","lib":"Device:C","desc":"Speed-up capacitor","lcsc":"C14858","mpn":"","sheet":"fmif","block":"sq","pins":{"1":"LIM2_C","2":"SQ_B"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"R714":{"value":"4.7k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23162","mpn":"","sheet":"fmif","block":"sq","pins":{"1":"SQ_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf4701t5e"},"Q703":{"value":"MMBT3904","lib":"Transistor_BJT:MMBT3904","desc":"Squarer","lcsc":"C20526","mpn":"MMBT3904","sheet":"fmif","block":"sq","pins":{"1":"SQ_B","2":"GND","3":"LIM_SQ"},"wiki":"https://wiki.adom.inc/adom/mmbt3904"},"R715":{"value":"1k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C21190","mpn":"","sheet":"fmif","block":"sq","pins":{"1":"V_IF4","2":"LIM_SQ"},"wiki":"https://wiki.adom.inc/adom/0603waf1001t5e"},"R716":{"value":"4.7k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23162","mpn":"","sheet":"fmif","block":"sq","pins":{"1":"LIM_SQ","2":"IF_CNT"},"wiki":"https://wiki.adom.inc/adom/0603waf4701t5e"},"R717":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"fmif","block":"sq","pins":{"1":"IF_CNT","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C714":{"value":"22p","lib":"Device:C","desc":"C0G, pump capacitor (sets detector gain)","lcsc":"C1653","mpn":"","sheet":"fmif","block":"pump","pins":{"1":"LIM_SQ","2":"PUMP"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"D702":{"value":"BAT54S","lib":"Diode:BAT54S","desc":"Dual series Schottky (diode pump)","lcsc":"C408389","mpn":"","sheet":"fmif","block":"pump","pins":{"1":"VREF_FM","2":"SUMJ","3":"PUMP"},"wiki":"https://wiki.adom.inc/adom/bat54s"},"U701":{"value":"TLV9062IDR","lib":"Amplifier_Operational:TLV9062xD","desc":"Dual 10 MHz rail-to-rail I/O op-amp","lcsc":"C398355","mpn":"TLV9062IDR","sheet":"fmif","block":"pump","pins":{"3":"VREF_FM","2":"SUMJ","1":"FM_DEMOD","5":"FMA_P","6":"FMA_OUT","7":"FMA_OUT","8":"+5VA","4":"GND"},"wiki":"https://wiki.adom.inc/adom/tlv9062idr"},"R718":{"value":"51k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23196","mpn":"","sheet":"fmif","block":"pump","pins":{"1":"FM_DEMOD","2":"SUMJ"},"wiki":"https://wiki.adom.inc/adom/0603waf5102t5e"},"C715":{"value":"1.5n","lib":"Device:C","desc":"C0G, de-emphasis 75 us","lcsc":"C107039","mpn":"","sheet":"fmif","block":"pump","pins":{"1":"FM_DEMOD","2":"SUMJ"},"wiki":"https://wiki.adom.inc/adom/yageo-cc0603-npo"},"R725":{"value":"1.2k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C22765","mpn":"","sheet":"fmif","block":"pump","pins":{"1":"V_IF4","2":"VREF_FM"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R726":{"value":"4.3k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23159","mpn":"","sheet":"fmif","block":"pump","pins":{"1":"VREF_FM","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C722":{"value":"10u","lib":"Device:C","desc":"Capacitor","lcsc":"C15850","mpn":"","sheet":"fmif","block":"pump","pins":{"1":"VREF_FM","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805"},"C723":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"fmif","block":"pump","pins":{"1":"VREF_FM","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"C721":{"value":"100n","lib":"Device:C","desc":"U701 decoupling","lcsc":"C14663","mpn":"","sheet":"fmif","block":"pump","pins":{"1":"+5VA","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R719":{"value":"100k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25803","mpn":"","sheet":"fmif","block":"fmaud","pins":{"1":"FM_DEMOD","2":"FM_DC"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R720":{"value":"200k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25811","mpn":"","sheet":"fmif","block":"fmaud","pins":{"1":"FM_DC","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C716":{"value":"1u","lib":"Device:C","desc":"Capacitor","lcsc":"C15849","mpn":"","sheet":"fmif","block":"fmaud","pins":{"1":"FM_DC","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10a105kb8nnnc"},"C717":{"value":"1u","lib":"Device:C","desc":"Capacitor","lcsc":"C15849","mpn":"","sheet":"fmif","block":"fmaud","pins":{"1":"FM_DEMOD","2":"FMA_IN"},"wiki":"https://wiki.adom.inc/adom/cl10a105kb8nnnc"},"R721":{"value":"100k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25803","mpn":"","sheet":"fmif","block":"fmaud","pins":{"1":"FMA_IN","2":"VREF_1V65"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R722":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"fmif","block":"fmaud","pins":{"1":"FMA_IN","2":"FMA_N1"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"R723":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"fmif","block":"fmaud","pins":{"1":"FMA_N1","2":"FMA_P"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C718":{"value":"1.5n","lib":"Device:C","desc":"C0G","lcsc":"C107039","mpn":"","sheet":"fmif","block":"fmaud","pins":{"1":"FMA_N1","2":"FMA_OUT"},"wiki":"https://wiki.adom.inc/adom/yageo-cc0603-npo"},"C719":{"value":"680p","lib":"Device:C","desc":"C0G","lcsc":"C107055","mpn":"","sheet":"fmif","block":"fmaud","pins":{"1":"FMA_P","2":"GND"},"wiki":"https://wiki.adom.inc/adom/yageo-cc0603-npo"},"R724":{"value":"1k","lib":"Device:R","desc":"Limits injection into the 3.3 V ADC pin if the 5 V op-amp swings high","lcsc":"C21190","mpn":"","sheet":"fmif","block":"fmaud","pins":{"1":"FMA_OUT","2":"FM_AUDIO"},"wiki":"https://wiki.adom.inc/adom/0603waf1001t5e"},"C720":{"value":"1n","lib":"Device:C","desc":"ADC sampling reservoir","lcsc":"C1588","mpn":"","sheet":"fmif","block":"fmaud","pins":{"1":"FM_AUDIO","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10b102kb8nnnc"},"TP701":{"value":"VIF4","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): V_IF4","lcsc":"","mpn":"","sheet":"fmif","block":"tp","pins":{"1":"V_IF4"}},"TP702":{"value":"LIM1","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): LIM1_C","lcsc":"","mpn":"","sheet":"fmif","block":"tp","pins":{"1":"LIM1_C"}},"TP703":{"value":"LIM2","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): LIM2_C","lcsc":"","mpn":"","sheet":"fmif","block":"tp","pins":{"1":"LIM2_C"}},"TP704":{"value":"RSF","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): RSSI_FM","lcsc":"","mpn":"","sheet":"fmif","block":"tp","pins":{"1":"RSSI_FM"}},"TP705":{"value":"CNT","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): IF_CNT","lcsc":"","mpn":"","sheet":"fmif","block":"tp","pins":{"1":"IF_CNT"}},"TP706":{"value":"VRFM","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): VREF_FM","lcsc":"","mpn":"","sheet":"fmif","block":"tp","pins":{"1":"VREF_FM"}},"TP707":{"value":"FMDC","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): FM_DC","lcsc":"","mpn":"","sheet":"fmif","block":"tp","pins":{"1":"FM_DC"}},"TP708":{"value":"FMA","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): FMA_OUT","lcsc":"","mpn":"","sheet":"fmif","block":"tp","pins":{"1":"FMA_OUT"}},"TP709":{"value":"GND","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): GND","lcsc":"","mpn":"","sheet":"fmif","block":"tp","pins":{"1":"GND"}},"TP710":{"value":"GND","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): GND","lcsc":"","mpn":"","sheet":"fmif","block":"tp","pins":{"1":"GND"}},"MP1":{"value":"MachinePinLargeStandard","lib":"AdomMachine:MachinePinLargeStandard","desc":"Adom machine pin, large / standard (corner: pincer grip + GND)","lcsc":"","mpn":"MachinePinLargeStandard","sheet":"mol","block":"pins","pins":{"1":"GND"},"wiki":"https://wiki.adom.inc/adom/machinepinlargestandard"},"MP2":{"value":"MachinePinLargeStandard","lib":"AdomMachine:MachinePinLargeStandard","desc":"Adom machine pin, large / standard (corner: pincer grip + GND)","lcsc":"","mpn":"MachinePinLargeStandard","sheet":"mol","block":"pins","pins":{"1":"GND"},"wiki":"https://wiki.adom.inc/adom/machinepinlargestandard"},"MP3":{"value":"MachinePinLargeStandard","lib":"AdomMachine:MachinePinLargeStandard","desc":"Adom machine pin, large / standard (corner: pincer grip + GND)","lcsc":"","mpn":"MachinePinLargeStandard","sheet":"mol","block":"pins","pins":{"1":"GND"},"wiki":"https://wiki.adom.inc/adom/machinepinlargestandard"},"MP4":{"value":"MachinePinLargeStandard","lib":"AdomMachine:MachinePinLargeStandard","desc":"Adom machine pin, large / standard (corner: pincer grip + GND)","lcsc":"","mpn":"MachinePinLargeStandard","sheet":"mol","block":"pins","pins":{"1":"GND"},"wiki":"https://wiki.adom.inc/adom/machinepinlargestandard"},"MC1":{"value":"5V","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: VIN","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"VIN"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC2":{"value":"GND","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: GND","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"GND"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC3":{"value":"D+","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: USB_DP","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"USB_DP"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC4":{"value":"D-","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: USB_DM","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"USB_DM"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC5":{"value":"GND","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: GND","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"GND"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC6":{"value":"3V3","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: +3V3","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"+3V3"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC7":{"value":"CLK","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: SWCLK","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"SWCLK"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC8":{"value":"RST","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: NRST","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"NRST"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC9":{"value":"GND","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: GND","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"GND"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC10":{"value":"DIO","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: SWDIO","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"SWDIO"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC11":{"value":"GND","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: GND","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"GND"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC12":{"value":"TX","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: UART_TX","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"UART_TX"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC13":{"value":"RX","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: UART_RX","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"UART_RX"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC14":{"value":"GND","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: GND","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"GND"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC15":{"value":"AM","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: AM_AUDIO","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"AM_AUDIO"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC16":{"value":"FM","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: FM_AUDIO","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"FM_AUDIO"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC17":{"value":"GND","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: GND","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"GND"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC18":{"value":"ANT","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: ANT","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"ANT"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC19":{"value":"GND","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: GND","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"GND"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC20":{"value":"10M7","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: CF2_OUT","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"probe","pins":{"1":"CF2_OUT"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC21":{"value":"455K","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: IF2_OUT","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"probe","pins":{"1":"IF2_OUT"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC22":{"value":"DET","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: AM_DET","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"probe","pins":{"1":"AM_DET"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC23":{"value":"DEM","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: FM_DEMOD","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"probe","pins":{"1":"FM_DEMOD"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC24":{"value":"SQ","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: LIM_SQ","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"probe","pins":{"1":"LIM_SQ"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC25":{"value":"VTF","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: VT_FM","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"probe","pins":{"1":"VT_FM"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC26":{"value":"VTA","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: VT_AM","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"probe","pins":{"1":"VT_AM"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC27":{"value":"VTR","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: VT_RF","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"probe","pins":{"1":"VT_RF"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC28":{"value":"5VA","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: +5VA","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"probe","pins":{"1":"+5VA"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"}}};-var BLOCK_SRC = {"usb": [301, 326], "reg": [328, 341], "mcu": [343, 370], "vt": [378, 393], "pwm": [395, 411], "band": [413, 424], "ui": [426, 437], "ant": [446, 465], "fmrf": [467, 485], "fmlo": [487, 504], "fmmix": [506, 512], "amrf": [521, 535], "amlo": [537, 553], "ammix": [555, 561], "cf1": [570, 581], "ifamp": [583, 596], "mix2": [598, 608], "xo": [610, 622], "amf": [631, 645], "vga": [647, 662], "det": [664, 677], "agc": [679, 700], "lim": [709, 731], "rssi": [733, 738], "sq": [740, 748], "pump": [750, 762], "fmaud": [764, 776], "pins": [811, 813], "edge": [814, 818], "probe": [819, 822]};-// sch.js registers SCH on `self`: give it a local one, not the wiki page's window-var self = {};-/* sch.js: a small schematic renderer and netlist checker for the AM/FM circuit explorer.- *- * One file shared by the page (window.SCH) and by check.js (node). A block drawing is plain data:- *- *   {- *     id: 'fmrf', sheet: 'fmfe', w: 520, h: 360,        // id = the design.py block key; w/h in px- *     parts: [['Q301', 160, 200], ['R303', 130, 150, 'r90'], ['U201A', 200, 100, 'my lt'], ...],- *     wires: [['C307.2', 'Q301.b'], ['Q301.c', [170, 150], 'vh', 'L306.1'], ...],- *     gnd:   ['R304.2', ['C308.2', 'down']],- *     rails: [['R308.1', '+5V_FM', 'right']],           // supply symbol with the net name- *     flags: [['C313.2', 'FM_MIX_B', 'right']],         // off-block net label (click = go to the other block)- *     notes: [[300, 290, 'LC tank, tuned by VT_RF']],   // [x, y, text, anchor?]- *     boxes: [[100, 35, 230, 100, 'AM: 2 MHz low-pass']],- *   }- *- * Part options (string tokens): r90 r180 r270 (clockwise), mx / my (mirror before rotating),- * lt lb ll lr (label top / bottom / left / right), ln (no label). An optional object after the- * string may carry {label: [dx, dy, anchor], text: 'inner text', box: BOXSPEC}.- * Pin references are 'PART.pin'. Pin names: R C L FB F crystal: 1 2; diodes: k a; BJT: b c e;- * op-amp unit (U201A / U201B): + - o; ceramic filter: in out g (4-pin: g1 g2); BAT54S: a k m;- * coax: sig sh; test point / machine contact: p; boxes: the names in their spec.- * Wire items are pin references or [x, y] points; 'hv' (default) or 'vh' between two points sets- * which way the corner goes.- */-(function (root, factory) {-  if (typeof module === 'object' && module.exports) module.exports = factory();-  else root.SCH = factory();-})(typeof self !== 'undefined' ? self : this, function () {-  'use strict';--  // ------------------------------------------------------------------ symbols (local coords, rot 0)-  const TWO = { '1': [-20, 0], '2': [20, 0] };-  const DIO = { k: [-20, 0], a: [20, 0] };-  const TRI_L = 'M6,-6L6,6L-6,0Z';                    // diode body, pointing at the cathode (left)-  const SYM = {-    R: { pins: TWO, d: 'M-20,0H-12l2,-5l4,10l4,-10l4,10l4,-10l4,10l2,-5H20', bb: [-13, -6, 13, 6] },-    C: { pins: TWO, d: 'M-20,0H-3M-3,-8V8M3,-8V8M3,0H20', bb: [-4, -9, 4, 9] },-    L: { pins: TWO, d: 'M-20,0H-14a3.5,3.5 0 0 1 7,0a3.5,3.5 0 0 1 7,0a3.5,3.5 0 0 1 7,0a3.5,3.5 0 0 1 7,0H20', bb: [-14, -5, 14, 2] },-    FB: { pins: TWO, d: 'M-20,0H-10M10,0H20', f: 'M-10,-4.5h20v9h-20z', bb: [-10, -5, 10, 5] },-    F: { pins: TWO, d: 'M-20,0H20M-10,-4.5h20v9h-20zM-14,8H-8L8,-8', bb: [-14, -9, 10, 9] },-    D: { pins: DIO, d: 'M-20,0H-6M6,0H20M-6,-6V6', f: TRI_L, bb: [-7, -7, 7, 7] },-    DS: { pins: DIO, d: 'M-20,0H-6M6,0H20M-3,-4V-6H-6V6H-9V4', f: TRI_L, bb: [-9, -7, 7, 7] },-    DV: { pins: DIO, d: 'M-20,0H-10M6,0H20M-6,-6V6M-10,-6V6', f: TRI_L, bb: [-11, -7, 7, 7] },-    LED: { pins: DIO, d: 'M-20,0H-6M6,0H20M-6,-6V6M-1,-8L3,-13M4,-8L8,-13', f: TRI_L + 'M4.5,-15l-0.5,4l-2.6,-2zM9.5,-15l-0.5,4l-2.6,-2z', bb: [-7, -15, 10, 7] },-    XTAL: { pins: TWO, d: 'M-20,0H-8M-8,-7V7M8,-7V7M8,0H20M-4,-9h8v18h-8z', bb: [-9, -10, 9, 10] },-    NPN: { pins: { b: [-20, 0], c: [10, -20], e: [10, 20] }, d: 'M-20,0H-6M-6,-10V10M-6,-4L10,-14V-20M-6,4L10,14V20',-      f: 'M7.6,12.5L2,12L4.7,7.7Z', circle: [2, 0, 15], bb: [-13, -15, 17, 15] },-    PNP: { pins: { b: [-20, 0], c: [10, -20], e: [10, 20] }, d: 'M-20,0H-6M-6,-10V10M-6,-4L10,-14V-20M-6,4L10,14V20',-      f: 'M-1.2,7L4.3,7.3L1.7,11.6Z', circle: [2, 0, 15], bb: [-13, -15, 17, 15] },-    OPAMP: { pins: { '-': [-30, -10], '+': [-30, 10], o: [30, 0] },-      d: 'M-20,-22L-20,22L22,0ZM-30,-10H-20M-30,10H-20M22,0H30M-17,-10H-11M-17,10H-11M-14,7V13', bb: [-20, -22, 22, 22] },-    CF3: { pins: { in: [-30, 0], out: [30, 0], g: [0, 20] }, d: 'M-30,0H-16M16,0H30M0,9V20M-16,-9h32v18h-32z', bb: [-16, -9, 16, 9] },-    CF4: { pins: { in: [-30, 0], out: [30, 0], g1: [-8, 20], g2: [8, 20] }, d: 'M-30,0H-16M16,0H30M-8,9V20M8,9V20M-16,-9h32v18h-32z', bb: [-16, -9, 16, 9] },-    BAT54S: { pins: { a: [-40, 0], k: [40, 0], m: [0, -20] }, d: 'M-40,0H-26M-14,0H14M26,0H40M-14,-6V6M26,-6V6M0,0V-20',-      f: 'M-26,-6L-26,6L-14,0ZM14,-6L14,6L26,0Z', dots: [[0, 0]], bb: [-27, -7, 27, 7] },-    COAX: { pins: { sig: [20, 0], sh: [0, 20] }, d: 'M2.5,0H20M0,9V20', circle: [0, 0, 9], f: 'M-2.5,0a2.5,2.5 0 1 0 5,0a2.5,2.5 0 1 0 -5,0z', bb: [-10, -10, 10, 10] },-    TP: { pins: { p: [0, 0] }, d: 'M0,0V-6', circle: [0, -10, 4], bb: [-5, -15, 5, 0], tp: true },-    MC: { pins: { p: [0, 0] }, d: 'M0,0V-6', f: 'M-4,-14h8v8h-8z', bb: [-5, -15, 5, 0], tp: true, mc: true },-  };--  // design.py lib id -> [symbol, {symbol pin: [part pin numbers]} | {units}, hidden pins allowed]-  const P2 = { '1': ['1'], '2': ['2'] };-  const PD = { k: ['1'], a: ['2'] };-  const PBJT = { b: ['1'], e: ['2'], c: ['3'] };-  const LIB = {-    'Device:R': ['R', P2], 'Device:C': ['C', P2], 'Device:L': ['L', P2],-    'Device:FerriteBead': ['FB', P2], 'Device:Polyfuse': ['F', P2],-    'Device:D_Schottky': ['DS', PD], 'Device:D_Capacitance': ['DV', PD], 'Device:LED': ['LED', PD],-    'Device:Crystal_GND24': ['XTAL', { '1': ['1'], '2': ['3'] }, ['2', '4']],-    'Transistor_BJT:MMBT3904': ['NPN', PBJT], 'Transistor_BJT:MMBT3906': ['PNP', PBJT],-    'Transistor_BJT:BC847BS': ['NPN', { A: { b: ['2'], c: ['6'], e: ['1'] }, B: { b: ['5'], c: ['3'], e: ['4'] } }],-    'Amplifier_Operational:TLV9062xD': ['OPAMP', { A: { '+': ['3'], '-': ['2'], o: ['1'] }, B: { '+': ['5'], '-': ['6'], o: ['7'] } }, ['8', '4']],-    'AMFM:CeramicFilter_3pin': ['CF3', { in: ['1'], g: ['2'], out: ['3'] }],-    'AMFM:CeramicFilter_4pin': ['CF4', { in: ['1'], out: ['2'], g1: ['3'], g2: ['4'] }],-    'Diode:BAT54S': ['BAT54S', { a: ['1'], k: ['2'], m: ['3'] }],-    'Connector:Conn_Coaxial': ['COAX', { sig: ['1'], sh: ['2'] }],-    'Connector:TestPoint': ['TP', { p: ['1'] }],-    'AdomMachine:MachineContactMedium': ['MC', { p: ['1'] }],-    'AdomMachine:MachinePinLargeStandard': ['MC', { p: ['1'] }],-  };-  const TWO_TERM = new Set(['R', 'C', 'L', 'FB', 'F', 'D', 'DS', 'DV', 'LED', 'XTAL']);--  // ------------------------------------------------------------------ geometry helpers-  function xf(pt, P) {-    let x = pt[0], y = pt[1];-    if (P.mx) x = -x;-    if (P.my) y = -y;-    if (P.rot === 90) { const t = x; x = -y; y = t; }-    else if (P.rot === 180) { x = -x; y = -y; }-    else if (P.rot === 270) { const t = x; x = y; y = -t; }-    return [P.x + x, P.y + y];-  }-  function bbox(bb, P) {-    const a = xf([bb[0], bb[1]], P), b = xf([bb[2], bb[3]], P);-    return [Math.min(a[0], b[0]), Math.min(a[1], b[1]), Math.max(a[0], b[0]), Math.max(a[1], b[1])];-  }-  const K = (p) => Math.round(p[0] * 10) / 10 + ',' + Math.round(p[1] * 10) / 10;-  const esc = (s) => String(s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');-  const CW = 5.6;   // mono glyph width at the label size, for flag widths--  function parseOpts(s, o) {-    if (typeof o === 'string') { s = (s || '') + ' ' + o; o = null; }-    const P = { rot: 0, mx: false, my: false, lab: null, text: null, box: null, labxy: null };-    for (const t of String(s || '').split(/\s+/).filter(Boolean)) {-      if (/^r(90|180|270|0)$/.test(t)) P.rot = +t.slice(1);-      else if (t === 'mx') P.mx = true;-      else if (t === 'my') P.my = true;-      else if (/^l[tblrn]$/.test(t)) P.lab = t[1];-      else throw new Error('unknown part option ' + t);-    }-    if (o) { if (o.label) P.labxy = o.label; if (o.text) P.text = o.text; if (o.box) P.box = o.box; }-    return P;-  }--  // Box symbols (connectors, ICs): spec {w, h, title, pins: [[name, side L|R|T|B, offset, [nums]]]}-  function boxSym(spec) {-    const pins = {}, map = {}, d = [], txt = [];-    const hw = spec.w / 2, hh = spec.h / 2;-    for (const [name, side, off, nums] of spec.pins) {-      let p, q, t, anchor;-      if (side === 'L') { p = [-hw - 10, -hh + off]; q = [-hw, -hh + off]; t = [-hw + 4, -hh + off + 3]; anchor = 'start'; }-      else if (side === 'R') { p = [hw + 10, -hh + off]; q = [hw, -hh + off]; t = [hw - 4, -hh + off + 3]; anchor = 'end'; }-      else if (side === 'T') { p = [-hw + off, -hh - 10]; q = [-hw + off, -hh]; t = [-hw + off, -hh + 11]; anchor = 'middle'; }-      else { p = [-hw + off, hh + 10]; q = [-hw + off, hh]; t = [-hw + off, hh - 5]; anchor = 'middle'; }-      pins[name] = p; map[name] = nums;-      d.push('M' + p[0] + ',' + p[1] + 'L' + q[0] + ',' + q[1]);-      txt.push([t[0], t[1], name, anchor]);-    }-    d.push('M' + -hw + ',' + -hh + 'h' + spec.w + 'v' + spec.h + 'h' + -spec.w + 'z');-    return { sym: { pins, d: d.join(''), bb: [-hw, -hh, hw, hh], boxText: txt, title: spec.title }, map };-  }--  // ------------------------------------------------------------------ analysis (placement + connectivity + checks)-  function analyze(block, design) {-    const errors = [], warns = [];-    const err = (m) => errors.push(block.id + ': ' + m);-    const parts = [], pinAt = {};          // pinAt['Q301.b'] = {x, y, ref, nums, key}-    for (const entry of block.parts || []) {-      const [key, x, y, opt, obj] = entry;-      let ref = key, unit = null;-      if (!design.parts[ref] && /[AB]$/.test(key) && design.parts[key.slice(0, -1)]) { ref = key.slice(0, -1); unit = key.slice(-1); }-      const dp = design.parts[ref];-      if (!dp) { err('unknown part ' + key); continue; }-      let P;-      try { P = parseOpts(opt, obj); } catch (e) { err(key + ': ' + e.message); continue; }-      P.x = x; P.y = y;-      let symName, sym, map, hidden = [];-      if (P.box) { const b = boxSym(P.box); sym = b.sym; map = b.map; symName = 'BOX'; }-      else {-        const lib = LIB[dp.lib];-        if (!lib) { err(key + ': no symbol for ' + dp.lib + ' (pass a box spec)'); continue; }-        symName = lib[0]; sym = SYM[symName]; map = lib[1]; hidden = lib[2] || [];-        if (map.A) {-          if (!unit) { err(key + ': ' + dp.lib + ' needs a unit suffix (A/B)'); continue; }-          map = map[unit];-        }-      }-      const part = { key, ref, unit, dp, P, symName, sym, map, hidden, pins: {} };-      for (const [pn, lp] of Object.entries(sym.pins)) {-        const nums = map[pn];-        if (!nums) { err(key + ': symbol pin ' + pn + ' has no part pin'); continue; }-        const nets = new Set(nums.map((n) => dp.pins[n]));-        if (nums.some((n) => !(n in dp.pins))) err(key + '.' + pn + ': part has no pin ' + nums.join('/'));-        if (nets.size > 1) err(key + '.' + pn + ': pins ' + nums.join('/') + ' are on different nets ' + [...nets].join(', '));-        const pos = xf(lp, P);-        const info = { x: pos[0], y: pos[1], key, ref, pin: pn, nums, net: dp.pins[nums[0]] };-        part.pins[pn] = info;-        pinAt[key + '.' + pn] = info;-      }-      parts.push(part);-    }--    const pt = (item) => {-      if (Array.isArray(item)) {-        if (item.length !== 2 || !Number.isFinite(item[0]) || !Number.isFinite(item[1])) { err('bad point ' + JSON.stringify(item)); return null; }-        return item;-      }-      const p = pinAt[item];-      if (!p) { err('unknown pin ' + item); return null; }-      return [p.x, p.y];-    };--    // wires -> polylines (absolute points)-    const wires = [];-    for (const w of block.wires || []) {-      const pts = [];-      let route = 'hv';-      let ok = true;-      for (const item of w) {-        if (item === 'hv' || item === 'vh') { route = item; continue; }-        const q = pt(item);-        if (!q) { ok = false; break; }-        if (pts.length) {-          const p = pts[pts.length - 1];-          if (p[0] !== q[0] && p[1] !== q[1]) pts.push(route === 'hv' ? [q[0], p[1]] : [p[0], q[1]]);-        }-        pts.push(q);-        route = 'hv';-      }-      if (ok && pts.length >= 2) wires.push({ pts, src: w });-      else if (ok) err('wire with one point: ' + JSON.stringify(w));-    }--    // anchors: ground, rails, flags-    const anchors = [];-    const dirOf = (a, d) => a || d;-    for (const g of block.gnd || []) {-      const [at, dir] = Array.isArray(g) && typeof g[1] === 'string' ? g : [g, null];-      const p = pt(at); if (p) anchors.push({ kind: 'gnd', name: 'GND', p, dir: dirOf(dir, 'down') });-    }-    for (const [at, name, dir] of block.rails || []) { const p = pt(at); if (p) anchors.push({ kind: 'rail', name, p, dir: dir || 'up' }); }-    for (const [at, name, dir] of block.flags || []) { const p = pt(at); if (p) anchors.push({ kind: 'flag', name, p, dir: dir || 'right' }); }--    // union-find over point keys-    const parent = {};-    const find = (a) => { while (parent[a] !== a) { parent[a] = parent[parent[a]]; a = parent[a]; } return a; };-    const add = (a) => { if (!(a in parent)) parent[a] = a; };-    const union = (a, b) => { add(a); add(b); parent[find(a)] = find(b); };--    const segs = [];-    wires.forEach((w, wi) => {-      for (let i = 0; i < w.pts.length; i++) add(K(w.pts[i]));-      for (let i = 1; i < w.pts.length; i++) { union(K(w.pts[i - 1]), K(w.pts[i])); segs.push({ a: w.pts[i - 1], b: w.pts[i], wi }); }-    });-    const keyPts = [];-    for (const w of wires) for (const p of w.pts) keyPts.push(p);-    for (const p of Object.values(pinAt)) { add(K([p.x, p.y])); keyPts.push([p.x, p.y]); }-    for (const a of anchors) { add(K(a.p)); keyPts.push(a.p); }--    const onSeg = (p, s) => {   // strictly inside an axis-aligned segment-      const [x, y] = p, [ax, ay] = s.a, [bx, by] = s.b;-      if (ax === bx) return x === ax && y > Math.min(ay, by) && y < Math.max(ay, by);-      if (ay === by) return y === ay && x > Math.min(ax, bx) && x < Math.max(ax, bx);-      return false;-    };-    const tees = {};-    for (const s of segs) {-      for (const p of keyPts) if (onSeg(p, s)) { union(K(p), K(s.a)); tees[K(p)] = (tees[K(p)] || 0) + 2; }-    }-    for (let i = 0; i < segs.length; i++) for (let j = i + 1; j < segs.length; j++) {   // collinear overlap-      const s = segs[i], t = segs[j];-      if (s.wi === t.wi) continue;-      const vert = s.a[0] === s.b[0] && t.a[0] === t.b[0] && s.a[0] === t.a[0];-      const hor = s.a[1] === s.b[1] && t.a[1] === t.b[1] && s.a[1] === t.a[1];-      if (!vert && !hor) continue;-      const ix = vert ? 1 : 0;-      const lo = Math.max(Math.min(s.a[ix], s.b[ix]), Math.min(t.a[ix], t.b[ix]));-      const hi = Math.min(Math.max(s.a[ix], s.b[ix]), Math.max(t.a[ix], t.b[ix]));-      if (hi > lo) { union(K(s.a), K(t.a)); warns.push(block.id + ': overlapping wires at ' + K(s.a) + ' / ' + K(t.a)); }-    }--    // group contents-    const groups = {};-    const G = (k) => (groups[find(k)] = groups[find(k)] || { pins: [], names: new Set(), ends: 0 });-    for (const p of Object.values(pinAt)) G(K([p.x, p.y])).pins.push(p);-    for (const a of anchors) G(K(a.p)).names.add(a.name);-    const degree = {};-    const bump = (k, n) => { degree[k] = (degree[k] || 0) + n; };-    for (const w of wires) {-      for (let i = 0; i < w.pts.length; i++) {-        const k = K(w.pts[i]);-        G(k).ends++;-        bump(k, i === 0 || i === w.pts.length - 1 ? 1 : 2);-      }-    }-    for (const p of Object.values(pinAt)) bump(K([p.x, p.y]), 1);-    for (const a of anchors) bump(K(a.p), 1);-    for (const [k, n] of Object.entries(tees)) bump(k, n);--    const netOfGroup = {};-    for (const [root, g] of Object.entries(groups)) {-      const nets = new Set(g.pins.map((p) => p.net));-      for (const n of g.names) nets.add(n);-      const real = [...nets];-      if (real.includes(null) || real.includes(undefined)) {-        if (g.pins.length > 1 || g.ends || g.names.size) err('no-connect pin wired: ' + g.pins.filter((p) => p.net == null).map((p) => p.key + '.' + p.pin).join(', '));-      }-      const named = real.filter((n) => n != null);-      if (named.length > 1) err('short: ' + named.join(' + ') + ' joined at ' + g.pins.map((p) => p.key + '.' + p.pin).concat([...g.names]).join(', '));-      netOfGroup[root] = named[0] || null;-      if (g.pins.length === 1 && !g.ends && !g.names.size && g.pins[0].net != null) err('unconnected pin ' + g.pins[0].key + '.' + g.pins[0].pin + ' (' + g.pins[0].net + ')');-      if (!g.pins.length && !g.names.size && g.ends) err('floating wire near ' + root);-    }-    // dangling wire ends-    for (const w of wires) for (const p of [w.pts[0], w.pts[w.pts.length - 1]]) {-      if ((degree[K(p)] || 0) < 2) err('dangling wire end at ' + K(p));-    }-    const netAt = (p) => netOfGroup[find(K(p))] || null;-    const junctions = Object.keys(degree).filter((k) => degree[k] >= 3).map((k) => k.split(',').map(Number));-    return { errors, warns, parts, wires, anchors, junctions, netAt, pinAt };-  }--  // ------------------------------------------------------------------ rendering-  function partLabel(part) {-    const { P, sym, symName, dp, key } = part;-    if (P.lab === 'n') return '';-    const ref = key, val = symName === 'TP' || symName === 'MC' ? '' : (P.text && symName.startsWith('CF') ? '' : dp.value);-    const lines = [];-    const vertical = (P.rot === 90 || P.rot === 270);-    let x, y, anchor, stack = true;-    if (P.labxy) { x = P.x + P.labxy[0]; y = P.y + P.labxy[1]; anchor = P.labxy[2] || 'start'; stack = P.labxy[3] !== 'line'; }-    else if (sym.tp) {-      const tip = xf([0, -19], P);-      const dx = tip[0] - P.x, dy = tip[1] - P.y;-      x = tip[0]; y = tip[1] + (dy > 0 ? 8 : dy < 0 ? -1 : 3);-      anchor = dx > 0 ? 'start' : dx < 0 ? 'end' : 'middle';-      return '<text class="tpl' + (sym.mc ? ' mcl' : '') + '" x="' + x + '" y="' + y + '" text-anchor="' + anchor + '">' + esc(dp.value) + '</text>';-    } else if (TWO_TERM.has(symName)) {-      const side = P.lab || (vertical ? 'r' : 't');-      if (side === 't') { x = P.x; y = P.y - 10; anchor = 'middle'; stack = false; if (symName === 'LED') y -= 6; }-      else if (side === 'b') { x = P.x; y = P.y + 17; anchor = 'middle'; stack = false; }-      else if (side === 'r') { x = P.x + 9; y = P.y - 1; anchor = 'start'; }-      else { x = P.x - 9; y = P.y - 1; anchor = 'end'; }-    } else if (symName === 'NPN' || symName === 'PNP') {-      const side = P.lab || (P.mx !== (P.rot === 180) ? 'l' : 'r');-      if (side === 'l') { x = P.x - 17; anchor = 'end'; } else { x = P.x + 20; anchor = 'start'; }-      y = P.y - 2;-      if (side === 't') { x = P.x; y = P.y - 26; anchor = 'middle'; stack = false; }-      if (side === 'b') { x = P.x; y = P.y + 34; anchor = 'middle'; stack = false; }-    } else if (symName === 'OPAMP') {-      x = P.x; y = P.y - 27; anchor = 'middle'; stack = false;-      if (P.lab === 'b') y = P.y + 34;-      return '<text class="ref" x="' + x + '" y="' + y + '" text-anchor="middle">' + esc(key) + '</text>';-    } else if (symName === 'CF3' || symName === 'CF4') {-      x = P.x; y = P.y - 13; anchor = 'middle';-      if (P.lab === 'b') y = P.y + 32;-      return '<text class="ref" x="' + x + '" y="' + y + '" text-anchor="middle">' + esc(key) + '</text>';-    } else if (symName === 'BAT54S') { x = P.x; y = P.y + 18; anchor = 'middle'; stack = false; }-    else if (symName === 'COAX') { x = P.x - 13; y = P.y - 2; anchor = 'end'; }-    else if (symName === 'BOX') { return ''; }-    else { x = P.x + 12; y = P.y; anchor = 'start'; }-    if (stack) {-      return '<text class="ref" x="' + x + '" y="' + y + '" text-anchor="' + anchor + '">' + esc(ref) + '</text>' +-        (val ? '<text class="val" x="' + x + '" y="' + (y + 10.5) + '" text-anchor="' + anchor + '">' + esc(val) + '</text>' : '');-    }-    return '<text x="' + x + '" y="' + y + '" text-anchor="' + anchor + '"><tspan class="ref">' + esc(ref) + '</tspan>' +-      (val ? ' <tspan class="val">' + esc(val) + '</tspan>' : '') + '</text>';-  }--  function drawPart(part) {-    const { P, sym, key, ref, symName } = part;-    const tr = 'translate(' + P.x + ',' + P.y + ')' + (P.rot ? ' rotate(' + P.rot + ')' : '') + (P.mx || P.my ? ' scale(' + (P.mx ? -1 : 1) + ',' + (P.my ? -1 : 1) + ')' : '');-    let g = '<g class="sym" transform="' + tr + '">';-    if (sym.circle) g += '<circle class="body" cx="' + sym.circle[0] + '" cy="' + sym.circle[1] + '" r="' + sym.circle[2] + '"/>';-    g += '<path d="' + sym.d + '"/>';-    if (sym.f) g += '<path class="fill" d="' + sym.f + '"/>';-    for (const dt of sym.dots || []) g += '<circle class="dot" cx="' + dt[0] + '" cy="' + dt[1] + '" r="2.2"/>';-    g += '</g>';-    if (sym.boxText) {-      for (const [tx, ty, s, an] of sym.boxText) g += '<text class="pinname" x="' + (P.x + tx) + '" y="' + (P.y + ty) + '" text-anchor="' + an + '">' + esc(s) + '</text>';-      if (sym.title) {-        const t = Array.isArray(sym.title) ? sym.title : [sym.title];-        t.forEach((s, i) => { g += '<text class="' + (i ? 'val' : 'ref') + '" x="' + P.x + '" y="' + (P.y + sym.bb[1] - 6 - (t.length - 1 - i) * 11) + '" text-anchor="middle">' + esc(s) + '</text>'; });-      }-    }-    if (P.text) g += '<text class="inner" x="' + P.x + '" y="' + (P.y + 3) + '" text-anchor="middle">' + esc(P.text) + '</text>';-    const b = bbox(sym.bb, P);-    const pad = 4;-    g += '<rect class="hit" x="' + (b[0] - pad) + '" y="' + (b[1] - pad) + '" width="' + (b[2] - b[0] + 2 * pad) + '" height="' + (b[3] - b[1] + 2 * pad) + '"/>';-    const cls = 'part' + (sym.tp ? (sym.mc ? ' mc' : ' tp') : '');-    return '<g class="' + cls + '" data-ref="' + esc(ref) + '" data-key="' + esc(key) + '">' + g + partLabel(part) + '</g>';-  }--  function drawAnchor(a, net) {-    const [x, y] = a.p, n = esc(net || a.name);-    if (a.kind === 'gnd') {-      const v = { down: [0, 1], up: [0, -1], left: [-1, 0], right: [1, 0] }[a.dir];-      const px = (s, t) => [x + v[0] * s + v[1] * t, y + v[1] * s + v[0] * t];-      const L = (s, t1, t2) => { const p = px(s, t1), q = px(s, t2); return 'M' + p[0] + ',' + p[1] + 'L' + q[0] + ',' + q[1]; };-      const e = px(6, 0);-      return '<path class="gnd" data-net="GND" d="M' + x + ',' + y + 'L' + e[0] + ',' + e[1] + L(6, -7, 7) + L(9, -4.5, 4.5) + L(12, -2, 2) + '"/>';-    }-    if (a.kind === 'rail') {-      const tw = a.name.length * CW;-      let d, tx, ty, an;-      if (a.dir === 'up') { d = 'M' + x + ',' + y + 'V' + (y - 9) + 'M' + (x - 6) + ',' + (y - 9) + 'H' + (x + 6); tx = x; ty = y - 13; an = 'middle'; }-      else if (a.dir === 'down') { d = 'M' + x + ',' + y + 'V' + (y + 9) + 'M' + (x - 6) + ',' + (y + 9) + 'H' + (x + 6); tx = x; ty = y + 20; an = 'middle'; }-      else if (a.dir === 'right') { d = 'M' + x + ',' + y + 'H' + (x + 9) + 'M' + (x + 9) + ',' + (y - 6) + 'V' + (y + 6); tx = x + 13; ty = y + 3.5; an = 'start'; }-      else { d = 'M' + x + ',' + y + 'H' + (x - 9) + 'M' + (x - 9) + ',' + (y - 6) + 'V' + (y + 6); tx = x - 13; ty = y + 3.5; an = 'end'; }-      void tw;-      return '<g class="rail" data-net="' + n + '"><path d="' + d + '"/><text x="' + tx + '" y="' + ty + '" text-anchor="' + an + '">' + esc(a.name) + '</text></g>';-    }-    // flag-    const tw = a.name.length * CW + 10, h = 7;-    let pts, tx, ty;-    if (a.dir === 'right') { pts = [[x, y], [x + 6, y - h], [x + 6 + tw, y - h], [x + 6 + tw, y + h], [x + 6, y + h]]; tx = x + 6 + tw / 2; ty = y + 3.3; }-    else if (a.dir === 'left') { pts = [[x, y], [x - 6, y - h], [x - 6 - tw, y - h], [x - 6 - tw, y + h], [x - 6, y + h]]; tx = x - 6 - tw / 2; ty = y + 3.3; }-    else if (a.dir === 'up') { pts = [[x, y], [x + h, y - 6], [x + h, y - 6 - tw], [x - h, y - 6 - tw], [x - h, y - 6]]; tx = x; ty = y - 6 - tw / 2; }-    else { pts = [[x, y], [x + h, y + 6], [x + h, y + 6 + tw], [x - h, y + 6 + tw], [x - h, y + 6]]; tx = x; ty = y + 6 + tw / 2; }-    const vert = a.dir === 'up' || a.dir === 'down';-    return '<g class="flag" data-net="' + n + '" tabindex="0" role="button"><path d="M' + pts.map((p) => p.join(',')).join('L') + 'Z"/>' +-      '<text x="' + tx + '" y="' + ty + '" text-anchor="middle"' + (vert ? ' transform="rotate(-90 ' + tx + ' ' + ty + ')" dy="3.3"' : '') + '>' + esc(a.name) + '</text></g>';-  }--  function render(block, design, opts) {-    opts = opts || {};-    const A = analyze(block, design);-    const out = [];-    const W = block.w, H = block.h;-    out.push('<svg class="sch" viewBox="0 0 ' + W + ' ' + H + '" width="' + W + '" height="' + H + '" data-block="' + esc(block.id) + '" xmlns="http://www.w3.org/2000/svg">');-    if (opts.style) out.push('<style>' + opts.style + '</style>');-    out.push('<g class="boxes">');-    for (const [x, y, w, h, title] of block.boxes || []) {-      out.push('<rect class="region" x="' + x + '" y="' + y + '" width="' + w + '" height="' + h + '" rx="4"/>');-      if (title) out.push('<text class="region-t" x="' + (x + 4) + '" y="' + (y - 4) + '">' + esc(title) + '</text>');-    }-    out.push('</g><g class="wires">');-    for (const w of A.wires) {-      const net = A.netAt(w.pts[0]);-      const d = 'M' + w.pts.map((p) => p.join(',')).join('L');-      out.push('<path class="wire" data-net="' + esc(net || '') + '" d="' + d + '"/><path class="wire-hit" data-net="' + esc(net || '') + '" d="' + d + '"/>');-    }-    for (const j of A.junctions) out.push('<circle class="junction" data-net="' + esc(A.netAt(j) || '') + '" cx="' + j[0] + '" cy="' + j[1] + '" r="2.6"/>');-    out.push('</g><g class="anchors">');-    for (const a of A.anchors) out.push(drawAnchor(a, A.netAt(a.p)));-    out.push('</g><g class="parts">');-    for (const p of A.parts) out.push(drawPart(p));-    out.push('</g><g class="notes">');-    for (const [x, y, s, an] of block.notes || []) {-      String(s).split('\n').forEach((line, i) => out.push('<text class="note" x="' + x + '" y="' + (y + i * 11) + '" text-anchor="' + (an || 'start') + '">' + esc(line) + '</text>'));-    }-    out.push('</g></svg>');-    return { svg: out.join(''), analysis: A };-  }--  return { SYM, LIB, analyze, render, xf };-});--var SCH = self.SCH;-var SCH_BLOCKS = [];-// Sheet 4: AM front end, up-conversion to 10.7 MHz (tools/design.py lines 517-563)--SCH_BLOCKS.push({-  id: 'amrf', sheet: 'amfe', w: 500, h: 360,-  parts: [-    ['R401', 90, 220, 'r90'],-    ['TP403', 90, 200],-    ['C401', 130, 200],-    ['Q401', 190, 200],-    ['R403', 160, 150, 'r90'],-    ['R404', 160, 240, 'r90'],-    ['R405', 200, 250, 'r90'],-    ['R406', 200, 310, 'r90', 'll'],-    ['C404', 240, 310, 'r90'],-    ['R407', 200, 110, 'r90'],-    ['TP404', 250, 150],-    ['C405', 330, 150],-    ['R402', 420, 60, 'r180'],-    ['C402', 290, 90, 'r90'],-    ['C403', 340, 90, 'r90'],-    ['TP401', 240, 60],-  ],-  wires: [-    [[70, 200], 'C401.1'],-    ['C401.2', 'Q401.b'],-    ['R403.2', [160, 200]], ['R404.1', [160, 200]],-    ['Q401.e', 'R405.1'],-    ['R405.2', 'R406.1'], [[200, 280], [240, 280], 'C404.1'],-    ['Q401.c', 'R407.2'],-    [[200, 150], 'C405.1'],-    ['R403.1', [160, 60], 'R402.2'],-    ['R407.1', [200, 60]],-    ['C402.1', [290, 60]], ['C403.1', [340, 60]],-  ],-  gnd: ['R401.2', 'R404.2', 'R406.2', 'C404.2', 'C402.2', 'C403.2'],-  rails: [['R402.1', '+5V_AM', 'right']],-  flags: [[[70, 200], 'AM_RFIN', 'left'], ['C405.2', 'AM_MIX_B', 'right']],-  notes: [[170, 54, 'V_AM1'], [20, 290, 'R401: 51 Ω load\nfor the AM low-pass'], [290, 290, 'gain ~24 dB: R407 over\nthe unbypassed R405']],-});--SCH_BLOCKS.push({-  id: 'amlo', sheet: 'amfe', w: 550, h: 350,-  parts: [-    ['R412', 80, 260],-    ['C411', 120, 230, 'r90'],-    ['D401', 120, 290, 'r90'],-    ['C410', 170, 230, 'r90'],-    ['L401', 210, 190, 'r180'],-    ['R409', 260, 130, 'r90'],-    ['R410', 260, 240, 'r90'],-    ['C408', 310, 230, 'r90'],-    ['C409', 310, 290, 'r90'],-    ['Q402', 370, 190],-    ['R411', 380, 290, 'r90'],-    ['TP405', 410, 240],-    ['C412', 450, 240],-    ['C406', 160, 90, 'r90'],-    ['C407', 210, 90, 'r90'],-    ['TP402', 320, 60],-    ['R408', 450, 60, 'r180'],-  ],-  wires: [-    ['R412.2', [120, 260]],-    ['C411.2', 'D401.k'],-    ['C411.1', [120, 190], 'L401.2'],-    ['C410.1', [170, 190]],-    ['L401.1', 'Q402.b'],-    ['R409.2', [260, 190]], ['R410.1', [260, 190]],-    ['C408.1', [310, 190]],-    ['C408.2', 'C409.1'], [[310, 260], [380, 260]],-    ['Q402.e', 'R411.1'],-    [[380, 240], 'C412.1'],-    ['C406.1', [160, 60], 'R408.2'],-    ['C407.1', [210, 60]], ['R409.1', [260, 60]],-    ['Q402.c', [380, 60]],-  ],-  gnd: ['D401.a', 'C410.2', 'R410.2', 'C409.2', 'R411.2', 'C406.2', 'C407.2'],-  rails: [['R408.1', '+5V_AM', 'right']],-  flags: [['R412.1', 'VT_AM', 'left'], ['C412.2', 'AM_MIX_B', 'right']],-  notes: [[170, 54, 'V_AM2'], [20, 145, 'Clapp: L401 in series with\nC410 and the varactor'], [425, 290, 'C408 / C409:\nfeedback divider;\noutput at the emitter']],-});--SCH_BLOCKS.push({-  id: 'ammix', sheet: 'amfe', w: 420, h: 290,-  parts: [-    ['Q403', 200, 170],-    ['R413', 140, 120, 'r90'],-    ['R414', 140, 220, 'r90'],-    ['R415', 210, 230, 'r90', 'll'],-    ['C413', 250, 230, 'r90'],-    ['TP406', 310, 250],-  ],-  wires: [-    [[80, 170], 'Q403.b'],-    ['R413.2', [140, 170]], ['R414.1', [140, 170]],-    ['Q403.e', 'R415.1'], [[210, 200], [250, 200], 'C413.1'],-    ['Q403.c', [210, 110], [310, 110]],-  ],-  gnd: ['R414.2', 'R415.2', 'C413.2', 'TP406.p'],-  rails: [['R413.1', '+5V_AM', 'up']],-  flags: [[[80, 170], 'AM_MIX_B', 'left'], [[310, 110], 'IF_MIX', 'right']],-  notes: [[20, 195, 'RF in via C405\nLO in via C412'], [228, 140, 'difference product\nat 10.7 MHz'], [300, 76, 'load: R501 330 Ω\n(shared with FM)']],-});--// Sheet 6: AM 455 kHz IF, AGC & envelope detector (tools/design.py lines 627-702)--SCH_BLOCKS.push({-  id: 'amf', sheet: 'amif', w: 480, h: 310,-  parts: [-    // supplies: +5VA -> 22 ohm -> V_IF3 bus; V_IF3 -> 6.8k/10k -> VBIAS bus-    ['R602', 80, 50],-    ['C603', 130, 90, 'r90'], ['C604', 180, 90, 'r90'],-    ['TP601', 440, 50],-    ['R603', 280, 90, 'r90'], ['R604', 280, 160, 'r90'],-    ['C605', 330, 160, 'r90'], ['C606', 380, 160, 'r90'],-    ['TP602', 440, 130],-    // signal: IF2_OUT -> C601 -> FL601 -> termination -> C602 -> VGA1_IN-    ['C601', 100, 230],-    ['FL601', 170, 230, '', { text: '455k' }],-    ['R601', 240, 260, 'r90'],-    ['TP603', 280, 230],-    ['C602', 330, 230],-    ['TP610', 440, 280],-  ],-  wires: [-    ['R602.2', [440, 50]],-    ['C603.1', [130, 50]], ['C604.1', [180, 50]], ['R603.1', [280, 50]],-    ['R603.2', 'R604.1'],-    [[280, 130], [440, 130]],-    ['C605.1', [330, 130]], ['C606.1', [380, 130]],-    ['C601.2', 'FL601.in'],-    ['FL601.g1', [162, 260], [178, 260], 'FL601.g2'],-    ['FL601.out', 'C602.1'],-    ['R601.1', [240, 230]],-  ],-  gnd: ['C603.2', 'C604.2', 'R604.2', 'C605.2', 'C606.2', [[170, 260], 'down'], 'R601.2', 'TP610.p'],-  rails: [['R602.1', '+5VA', 'left']],-  flags: [['C601.1', 'IF2_OUT', 'left'], ['C602.2', 'VGA1_IN', 'right']],-  notes: [[300, 44, 'V_IF3: AM IF supply'], [300, 124, 'VBIAS ≈ 2.9 V'], [200, 300, 'R601 ∥ VGA input ≈ 2 kΩ termination']],-});--SCH_BLOCKS.push({-  id: 'vga', sheet: 'amif', w: 610, h: 320,-  parts: [-    // stage 1-    ['R605', 90, 120, 'r90'],-    ['Q601A', 150, 160, '', { label: [-17, 22, 'end'] }],-    ['Q601B', 230, 160, 'mx', { label: [17, 22, 'start'] }],-    ['R606', 220, 100, 'r90'],-    ['Q602', 200, 220, 'mx', { label: [-21, -2, 'end'] }],-    ['R607', 190, 270, 'r90'],-    ['TP604', 270, 130],-    ['C608', 310, 130],-    // stage 2-    ['R610', 350, 90, 'r90'],-    ['Q603A', 400, 160, '', { label: [-17, 22, 'end'] }],-    ['Q603B', 480, 160, 'mx', { label: [17, 22, 'start'] }],-    ['R611', 470, 100, 'r90'],-    ['Q604', 430, 220],-    ['R612', 440, 270, 'r90'],-    ['TP605', 520, 130],-    // AGC_B = V_AGC / 2-    ['R609', 260, 250, 'r90'],-    ['C607', 310, 250, 'r90'],-    ['R608', 360, 250, 'r270'],-  ],-  wires: [-    // stage 1-    [[60, 160], 'Q601A.b'], ['R605.2', [90, 160]],-    ['Q601A.c', [160, 60], [220, 60], 'R606.1'],-    ['R606.2', 'Q601B.c'],-    ['Q601A.e', [160, 200], [220, 200], 'Q601B.e'],-    ['Q602.e', 'R607.1'],-    [[220, 130], 'C608.1'],-    // stage 2-    ['C608.2', [350, 130], [350, 160], 'Q603A.b'], ['R610.2', [350, 130]],-    ['Q603A.c', [410, 60], [470, 60], 'R611.1'],-    ['R611.2', 'Q603B.c'],-    ['Q603A.e', [410, 200], [470, 200], 'Q603B.e'],-    ['Q604.e', 'R612.1'],-    [[470, 130], [540, 130]],-    // tail bias-    ['Q602.b', 'Q604.b'],-    ['R609.1', [260, 220]], ['C607.1', [310, 220]], ['R608.2', [360, 220]],-    ['R608.1', [360, 290]],-  ],-  gnd: ['R607.2', 'R612.2', 'R609.2', 'C607.2'],-  rails: [-    [[190, 60], 'V_IF3', 'up'], [[440, 60], 'V_IF3', 'up'],-    ['R605.1', 'VBIAS', 'up'], ['R610.1', 'VBIAS', 'up'],-    ['Q601B.b', 'VBIAS', 'right'], ['Q603B.b', 'VBIAS', 'right'],-  ],-  flags: [[[60, 160], 'VGA1_IN', 'left'], [[540, 130], 'VGA2_OUT', 'right'], [[360, 290], 'V_AGC', 'right']],-  notes: [[20, 250, 'gain set by the\ntail current:\n0.9 mA → ×19\n10 µA → ×0.2'], [220, 305, 'AGC_B = V_AGC / 2']],-});--SCH_BLOCKS.push({-  id: 'det', sheet: 'amif', w: 590, h: 330,-  parts: [-    ['C609', 100, 170],-    ['Q605', 190, 170],-    ['R613', 140, 110, 'r90'],-    ['R614', 140, 220, 'r90'],-    ['R617', 200, 90, 'r90'],-    ['R615', 200, 220, 'r90'],-    ['R616', 200, 280, 'r90', 'll'],-    ['C610', 240, 280, 'r90'],-    ['TP606', 240, 130],-    ['C611', 290, 130],-    ['R618', 330, 160, 'r90'],-    ['D601', 370, 130, 'r180'],-    ['C612', 420, 160, 'r90'],-    ['R619', 470, 160, 'r90'],-    ['MC22', 510, 130],-    ['TP611', 540, 290],-  ],-  wires: [-    ['C609.2', 'Q605.b'],-    ['R613.2', [140, 170], 'R614.1'],-    ['R613.1', [140, 50], [200, 50], 'R617.1'],-    ['R617.2', 'Q605.c'],-    ['Q605.e', 'R615.1'],-    ['R615.2', 'R616.1'], [[200, 250], [240, 250], 'C610.1'],-    [[200, 130], 'C611.1'],-    ['C611.2', 'D601.a'], ['R618.1', [330, 130]],-    ['D601.k', [530, 130]],-    ['C612.1', [420, 130]], ['R619.1', [470, 130]],-  ],-  gnd: ['R614.2', 'R616.2', 'C610.2', 'R618.2', 'C612.2', 'R619.2', 'TP611.p'],-  rails: [[[170, 50], 'V_IF3', 'up']],-  flags: [['C609.1', 'VGA2_OUT', 'left'], [[530, 130], 'AM_DET', 'right']],-  notes: [[250, 210, 'post-amp:\nIc ≈ 1.1 mA,\ngain ≈ 30'], [390, 215, 'envelope detector:\nC612 · R619 = 22 µs']],-});--SCH_BLOCKS.push({-  id: 'agc', sheet: 'amif', w: 620, h: 400,-  parts: [-    // AGC integrator U601A: inverting PI integrator of AM_DET against AGC_REF-    ['R620', 140, 100],-    ['U601A', 240, 110],-    ['C614', 200, 60, 'r180'],-    ['R623', 260, 60, 'r180'],-    ['R621', 130, 160],-    ['R622', 170, 190, 'r90', 'll'],-    ['C613', 240, 190, 'r90'],-    ['TP607', 360, 110],-    ['R624', 320, 140, 'r90'],-    ['R625', 320, 200, 'r90'],-    ['C615', 370, 200, 'r90'],-    ['TP608', 400, 170],-    ['C620', 560, 90, 'r90'],-    // AM audio: AC coupling, re-bias to VREF_1V65, unity-gain Sallen-Key 5 kHz low-pass-    ['C616', 120, 310],-    ['R626', 160, 340, 'r90'],-    ['R627', 200, 310],-    ['R628', 270, 310],-    ['C617', 300, 260],-    ['C618', 310, 340, 'r90', 'll'],-    ['U601B', 370, 320, 'my'],-    ['TP609', 380, 260],-    ['R629', 460, 320],-    ['C619', 500, 350, 'r90'],-    ['MC15', 530, 320],-  ],-  wires: [-    ['R620.1', [60, 100], [60, 310], 'C616.1'],-    ['R620.2', 'U601A.-'],-    ['C614.2', [180, 100]],-    ['C614.1', 'R623.2'],-    ['R623.1', [280, 110]],-    ['U601A.o', [420, 110]],-    ['U601A.+', [200, 120], [200, 160]],-    ['R621.2', [240, 160], 'C613.1'],-    ['R622.1', [170, 160]],-    ['R624.1', [320, 110]],-    ['R624.2', 'R625.1'],-    [[320, 170], [420, 170]],-    ['C615.1', [370, 170]],-    // audio-    ['C616.2', 'R627.1'], ['R626.1', [160, 310]], ['R626.2', [160, 370], [140, 370]],-    ['R627.2', 'R628.1'],-    ['C617.1', [240, 260], [240, 310]],-    ['R628.2', 'U601B.+'], ['C618.1', [310, 310]],-    ['U601B.o', 'R629.1'],-    ['C617.2', [430, 260], [430, 320]],-    ['U601B.-', [340, 350], [410, 350], [410, 320]],-    ['R629.2', [550, 320]],-    ['C619.1', [500, 320]],-  ],-  gnd: ['R622.2', 'C613.2', 'R625.2', 'C615.2', 'C620.2', 'C618.2', 'C619.2'],-  rails: [['R621.1', 'V_IF3', 'left'], ['C620.1', '+5VA', 'up']],-  flags: [-    [[60, 200], 'AM_DET', 'left'],-    [[420, 110], 'V_AGC', 'right'], [[420, 170], 'RSSI_AM', 'right'],-    [[140, 370], 'VREF_1V65', 'left'], [[550, 320], 'AM_AUDIO', 'right'],-  ],-  notes: [[520, 140, 'U601: +5VA / GND'], [75, 245, 'integrator: holds AM_DET\nat AGC_REF ≈ 1 V'], [330, 385, '5 kHz Sallen-Key, gain 1']],-});--// Sheet 3: antenna, diplexer & FM front end (tools/design.py lines 441-514)--SCH_BLOCKS.push({-  id: 'ant', sheet: 'fmfe', w: 440, h: 340,-  parts: [-    ['J301', 40, 160, '', { label: [0, -24, 'middle'] }],-    ['MC18', 76, 160],-    ['R301', 110, 180, 'r90'],-    ['C323', 150, 160, 'r180'],-    ['R317', 210, 160, 'r180'],-    ['TP110', 250, 160],-    // AM leg: 5-pole low-pass, series L first-    ['L301', 130, 60], ['C301', 170, 90, 'r90'], ['L302', 210, 60], ['C302', 250, 90, 'r90'], ['L303', 290, 60],-    // FM leg: 3-pole high-pass (series C first), then 3-pole low-pass-    ['C303', 130, 250], ['L304', 170, 280, 'r90'], ['C304', 210, 250],-    ['C305', 250, 280, 'r90'], ['L305', 290, 250], ['C306', 330, 280, 'r90'],-  ],-  wires: [-    ['J301.sig', [90, 160]],-    [[90, 160], [90, 60], 'L301.1'],-    ['L301.2', 'L302.1'], ['C301.1', [170, 60]],-    ['L302.2', 'L303.1'], ['C302.1', [250, 60]],-    [[90, 160], [90, 250], 'C303.1'],-    ['C303.2', 'C304.1'], ['L304.1', [170, 250]],-    ['C304.2', 'L305.1'], ['C305.1', [250, 250]],-    ['L305.2', [360, 250]], ['C306.1', [330, 250]],-    ['C323.2', [90, 160]],-    ['C323.1', 'R317.2'],-    ['R317.1', [280, 160]],-  ],-  gnd: ['J301.sh', 'R301.2', 'C301.2', 'C302.2', 'L304.2', 'C305.2', 'C306.2'],-  flags: [['L303.2', 'AM_RFIN', 'right'], [[360, 250], 'FM_BPF', 'right'], [[280, 160], 'CAL_MARK', 'right']],-  boxes: [[100, 35, 225, 100, 'AM: 2 MHz low-pass, 5 poles'], [100, 225, 140, 100, 'FM: 70 MHz high-pass'], [242, 225, 105, 100, '130 MHz low-pass']],-});--SCH_BLOCKS.push({-  id: 'fmrf', sheet: 'fmfe', w: 520, h: 360,-  parts: [-    ['R302', 60, 220, 'r90'],-    ['C307', 100, 200],-    ['Q301', 160, 200],-    ['R303', 130, 150, 'r90'],-    ['R304', 130, 240, 'r90'],-    ['R305', 170, 250, 'r90'],-    ['R306', 170, 310, 'r90', 'll'],-    ['C308', 200, 310, 'r90'],-    ['L306', 170, 110, 'r270 ll'],-    ['C309', 240, 180, 'r90'],-    ['C310', 300, 180, 'r90'],-    ['D301', 300, 240, 'r90'],-    ['R307', 350, 210, 'r180'],-    ['C313', 410, 150],-    ['R308', 360, 60, 'r180'],-    ['C311', 250, 90, 'r90'],-    ['C312', 300, 90, 'r90'],-    ['TP301', 210, 60],-  ],-  wires: [-    [[40, 200], 'C307.1'], ['R302.1', [60, 200]],-    ['C307.2', 'Q301.b'],-    ['R303.2', [130, 200]], ['R304.1', [130, 200]],-    ['Q301.e', 'R305.1'],-    ['R305.2', 'R306.1'], [[170, 280], [200, 280], 'C308.1'],-    ['Q301.c', 'L306.1'],-    [[170, 150], 'C313.1'],-    ['C309.1', [240, 150]], ['C310.1', [300, 150]],-    ['C310.2', 'D301.k'], ['R307.2', [300, 210]],-    ['R303.1', [130, 60], 'R308.2'],-    ['L306.2', [170, 60]], ['C311.1', [250, 60]], ['C312.1', [300, 60]],-  ],-  gnd: ['R302.2', 'R304.2', 'R306.2', 'C308.2', 'C309.2', 'D301.a', 'C311.2', 'C312.2'],-  rails: [['R308.1', '+5V_FM', 'right']],-  flags: [[[40, 200], 'FM_BPF', 'left'], ['R307.1', 'VT_RF', 'right'], ['C313.2', 'FM_MIX_B', 'right']],-  notes: [[140, 54, 'V_RF1'], [330, 290, 'tank: L306 with C309 and\nthe varactor, tuned by VT_RF']],-});--SCH_BLOCKS.push({-  id: 'fmlo', sheet: 'fmfe', w: 540, h: 362,-  parts: [-    ['Q302', 160, 220],-    ['R310', 110, 170, 'r90'],-    ['R311', 110, 260, 'r90'],-    ['C316', 70, 260, 'r90', 'll'],-    ['R312', 170, 300, 'r90', 'll'],-    ['C317', 210, 300, 'r90'],-    ['C318', 250, 230, 'r90'],-    ['TP303', 220, 270],-    ['L307', 170, 110, 'r270 ll'],-    ['C319', 300, 190, 'r90'],-    ['C320', 350, 190, 'r90'],-    ['D302', 350, 250, 'r90'],-    ['R313', 400, 220, 'r180'],-    ['C321', 440, 160],-    ['R309', 420, 60, 'r180'],-    ['C314', 240, 90, 'r90'],-    ['C315', 290, 90, 'r90'],-    ['TP302', 200, 60],-  ],-  wires: [-    ['C316.1', [70, 220], 'Q302.b'],-    ['R310.2', [110, 220]], ['R311.1', [110, 220]],-    ['Q302.e', 'R312.1'],-    [[170, 270], [250, 270]], ['C317.1', [210, 270]], ['C318.2', [250, 270]],-    ['Q302.c', 'L307.1'],-    [[170, 160], 'C321.1'],-    ['C318.1', [250, 160]], ['C319.1', [300, 160]], ['C320.1', [350, 160]],-    ['C320.2', 'D302.k'], ['R313.2', [350, 220]],-    ['R310.1', [110, 60], 'R309.2'],-    ['L307.2', [170, 60]], ['C314.1', [240, 60]], ['C315.1', [290, 60]],-  ],-  gnd: ['C316.2', 'R311.2', 'R312.2', 'C317.2', 'C319.2', 'D302.a', 'C314.2', 'C315.2'],-  rails: [['R309.1', '+5V_FM', 'right']],-  flags: [['R313.1', 'VT_FM', 'right'], ['C321.2', 'FM_MIX_B', 'right']],-  notes: [[120, 54, 'V_LO1'], [20, 352, 'base grounded for RF by C316 (common base)'], [270, 300, 'C318 / C317: feedback divider\nthat keeps it oscillating']],-});--SCH_BLOCKS.push({-  id: 'fmmix', sheet: 'fmfe', w: 420, h: 290,-  parts: [-    ['Q303', 200, 170],-    ['R314', 140, 120, 'r90'],-    ['R315', 140, 220, 'r90'],-    ['R316', 210, 230, 'r90', 'll'],-    ['C322', 250, 230, 'r90'],-    ['TP304', 270, 110],-    ['TP305', 350, 240],-  ],-  wires: [-    [[80, 170], 'Q303.b'],-    ['R314.2', [140, 170]], ['R315.1', [140, 170]],-    ['Q303.e', 'R316.1'], [[210, 200], [250, 200], 'C322.1'],-    ['Q303.c', [210, 110], [310, 110]],-  ],-  gnd: ['R315.2', 'R316.2', 'C322.2', 'TP305.p'],-  rails: [['R314.1', '+5V_FM', 'up']],-  flags: [[[80, 170], 'FM_MIX_B', 'left'], [[310, 110], 'IF_MIX', 'right']],-  notes: [[20, 195, 'RF in via C313\nLO in via C321'], [228, 140, 'difference product\nat 10.7 MHz'], [300, 76, 'load: R501 330 Ω\n(shared with AM)']],-});--// Sheet 7: FM 455 kHz limiter & pulse-count discriminator (tools/design.py lines 705-778)--SCH_BLOCKS.push({-  id: 'lim', sheet: 'fmif', w: 620, h: 320,-  parts: [-    // V_IF4: +5VA through R701, decoupled by C701 / C702-    ['R701', 70, 60, 'lb'], ['C701', 120, 90, 'r90'], ['C702', 170, 90, 'r90'], ['TP701', 210, 60],-    // input low-pass-    ['C703', 80, 200], ['R702', 140, 200], ['C704', 180, 220, 'r90'], ['C705', 220, 200],-    // stage 1-    ['R703', 260, 100, 'r90', { label: [9, -9, 'start'] }], ['R704', 260, 250, 'r90'],-    ['Q701', 300, 200],-    ['R705', 310, 260, 'r90'], ['C706', 360, 260, 'r90'],-    ['R706', 310, 100, 'r90', { label: [9, -9, 'start'] }], ['C707', 350, 160, 'r90'], ['TP702', 330, 140],-    ['C708', 400, 140],-    // stage 2-    ['R707', 440, 100, 'r90', { label: [9, -9, 'start'] }], ['R708', 440, 250, 'r90'],-    ['Q702', 480, 200],-    ['R709', 490, 260, 'r90'], ['C709', 540, 260, 'r90'],-    ['R710', 490, 100, 'r90', { label: [9, -9, 'start'] }], ['C710', 540, 160, 'r90'], ['TP703', 515, 140],-    ['TP709', 40, 290],-  ],-  wires: [-    ['R701.2', [490, 60], 'R710.1'],-    ['C701.1', [120, 60]], ['C702.1', [170, 60]],-    ['R703.1', [260, 60]], ['R706.1', [310, 60]], ['R707.1', [440, 60]],-    ['C703.2', 'R702.1'], ['R702.2', 'C705.1'],-    ['C705.2', 'Q701.b'], ['R703.2', [260, 200]], ['R704.1', [260, 200]],-    ['Q701.e', 'R705.1'], [[310, 230], [360, 230], 'C706.1'],-    ['R706.2', 'Q701.c'], [[310, 140], 'C708.1'], [[370, 140], [370, 110]],-    ['C708.2', [440, 140]], ['R707.2', [440, 200]], ['R708.1', [440, 200]], [[440, 200], 'Q702.b'],-    ['Q702.e', 'R709.1'], [[490, 230], [540, 230], 'C709.1'],-    ['R710.2', 'Q702.c'], [[490, 140], [560, 140]],-  ],-  gnd: ['C701.2', 'C702.2', 'C704.2', 'R704.2', 'R705.2', 'C706.2', 'C707.2', 'R708.2', 'R709.2', 'C709.2', 'C710.2', 'TP709.p'],-  rails: [['R701.1', '+5VA', 'left']],-  flags: [['C703.1', 'IF2_OUT', 'left'], [[370, 110], 'LIM1_C', 'right'], [[560, 140], 'LIM2_C', 'right']],-  notes: [[100, 54, 'V_IF4'], [100, 250, 'R702 + C704:\n≈ 480 kHz low-pass'], [370, 305, 'each stage ≈ 33 dB at Ic ≈ 0.95 mA']],-});--SCH_BLOCKS.push({-  id: 'rssi', sheet: 'fmif', w: 420, h: 190,-  parts: [-    ['C711', 100, 80], ['R711', 150, 100, 'r90'], ['D701', 200, 80, 'r180'],-    ['C712', 250, 100, 'r90'], ['R712', 300, 100, 'r90'], ['TP704', 330, 80],-  ],-  wires: [['C711.2', 'D701.a'], ['D701.k', [350, 80]]],-  gnd: ['R711.2', 'C712.2', 'R712.2'],-  flags: [['C711.1', 'LIM1_C', 'left'], [[350, 80], 'RSSI_FM', 'right']],-  notes: [[140, 160, 'peak detector on limiter stage 1;\nR712 × C712 = 10 ms hold']],-});--SCH_BLOCKS.push({-  id: 'sq', sheet: 'fmif', w: 430, h: 270,-  parts: [-    ['R713', 110, 150, 'lb'], ['C713', 110, 110],-    ['R714', 160, 190, 'r90', 'll'],-    ['Q703', 200, 150],-    ['R715', 210, 70, 'r90'],-    ['MC24', 250, 110],-    ['R716', 290, 130, 'r90'], ['R717', 290, 210, 'r90'], ['TP705', 330, 170],-  ],-  wires: [-    ['R713.1', 'C713.1'], ['R713.2', 'C713.2'],-    ['R713.2', 'Q703.b'], ['R714.1', [160, 150]],-    ['R715.2', 'Q703.c'], [[210, 110], [340, 110]],-    ['R716.2', 'R717.1'], [[290, 170], [350, 170]],-  ],-  gnd: ['Q703.e', 'R714.2', 'R717.2'],-  rails: [['R715.1', 'V_IF4', 'up']],-  flags: [['R713.1', 'LIM2_C', 'left'], [[340, 110], 'LIM_SQ', 'right'], [[350, 170], 'IF_CNT', 'right']],-  notes: [[40, 240, 'Q703 switches when LIM2_C\ncrosses ≈ 2.2 V'], [330, 205, '≈ 3 V logic level\nfor the MCU timer']],-});--SCH_BLOCKS.push({-  id: 'pump', sheet: 'fmif', w: 550, h: 320,-  parts: [-    ['C714', 190, 110],-    ['D702', 250, 160],-    ['U701A', 380, 170],-    ['C715', 380, 70, 'r180'],-    ['R718', 380, 110, 'r180'],-    ['MC23', 450, 170],-    // VREF_FM: V_IF4 divided by R725 / R726-    ['R725', 60, 190, 'r90'], ['R726', 60, 270, 'r90'],-    ['C722', 110, 250, 'r90'], ['C723', 160, 250, 'r90'], ['TP706', 190, 230],-    ['C721', 460, 260, 'r90'],-    ['TP710', 510, 290],-  ],-  wires: [-    ['C714.2', [250, 110], 'D702.m'],-    ['D702.k', 'U701A.-'],-    [[320, 160], [320, 70], 'C715.2'], ['R718.2', [320, 110]],-    ['C715.1', [430, 70], [430, 170]], ['R718.1', [430, 110]],-    ['U701A.o', [470, 170]],-    ['R725.2', 'R726.1'],-    [[60, 230], [330, 230], [330, 180], 'U701A.+'],-    ['D702.a', [210, 230]],-  ],-  gnd: ['R726.2', 'C722.2', 'C723.2', 'C721.2', 'TP710.p'],-  rails: [['R725.1', 'V_IF4', 'up'], ['C721.1', '+5VA', 'up']],-  flags: [['C714.1', 'LIM_SQ', 'left'], [[470, 170], 'FM_DEMOD', 'right']],-  notes: [[225, 224, 'VREF_FM ≈ 3.5 V'], [110, 66, 'each IF cycle pumps a fixed\ncharge into the − input'],-    [442, 90, '51k ∥ 1.5n = 76 µs\nde-emphasis'], [360, 300, 'U701: +5VA / GND']],-});--SCH_BLOCKS.push({-  id: 'fmaud', sheet: 'fmif', w: 580, h: 300,-  parts: [-    ['C717', 90, 140],-    ['R721', 130, 160, 'r90', 'll'],-    ['R722', 170, 140], ['R723', 250, 140],-    ['C718', 290, 70], ['C719', 290, 160, 'r90', 'll'],-    ['U701B', 350, 150, 'my'],-    ['TP708', 370, 70],-    ['R724', 440, 150], ['C720', 480, 170, 'r90'], ['MC16', 480, 150],-    // AFC: FM_DC = 2/3 FM_DEMOD, smoothed-    ['R719', 110, 230], ['R720', 150, 250, 'r90'], ['C716', 200, 250, 'r90'], ['TP707', 230, 230],-  ],-  wires: [-    ['C717.2', 'R722.1'], ['R722.2', 'R723.1'], ['R723.2', 'U701B.+'],-    ['C718.1', [210, 70], [210, 140]], ['C718.2', [410, 70], [410, 150]],-    ['U701B.-', [320, 190], [390, 190], [390, 150]],-    ['U701B.o', 'R724.1'], ['R724.2', [500, 150]],-    ['C717.1', [70, 230], 'R719.1'], ['R719.2', [250, 230]],-  ],-  gnd: ['C719.2', 'C720.2', 'R720.2', 'C716.2'],-  flags: [['C717.1', 'FM_DEMOD', 'left'], ['R721.2', 'VREF_1V65', 'right'], [[500, 150], 'FM_AUDIO', 'right'], [[250, 230], 'FM_DC', 'right']],-  notes: [[430, 46, 'unity-gain Sallen-Key,\n15.8 kHz: removes the\n19 kHz stereo pilot'], [320, 234, 'FM_DC = 2/3 × FM_DEMOD,\nsmoothed for AFC']],-});--// Sheet 5: 10.7 MHz IF & second conversion to 455 kHz (tools/design.py lines 566-624)--SCH_BLOCKS.push({-  id: 'cf1', sheet: 'if', w: 490, h: 270,-  parts: [-    ['R502', 160, 50, 'r90'],-    ['C503', 210, 90, 'r90'],-    ['C504', 260, 90, 'r90'],-    ['TP501', 310, 70],-    ['R501', 100, 120, 'r90'],-    ['C502', 130, 190, 'r90'],-    ['C501', 190, 170],-    ['FL501', 260, 170, '', { text: '10.7M' }],-    ['R503', 320, 190, 'r90'],-    ['TP503', 350, 170],-    ['C505', 400, 170],-  ],-  wires: [-    ['R501.1', [100, 70], [420, 70]],-    [[60, 170], 'C501.1'], ['R501.2', [100, 170]],-    ['C501.2', 'FL501.in'],-    ['FL501.out', 'C505.1'],-  ],-  gnd: ['C503.2', 'C504.2', 'C502.2', 'FL501.g', 'R503.2'],-  rails: [['R502.1', '+5VA', 'up']],-  flags: [[[60, 170], 'IF_MIX', 'left'], [[420, 70], 'V_IF1', 'right'], ['C505.2', 'IF_B1', 'right']],-  notes: [[20, 246, 'C502 shunts VHF LO\nfeed-through'], [190, 246, '330 Ω source (R501) and load (R503):\nthe filter\'s design impedance']],-});--SCH_BLOCKS.push({-  id: 'ifamp', sheet: 'if', w: 520, h: 340,-  parts: [-    ['Q501', 160, 180],-    ['R504', 120, 110, 'r90'],-    ['R505', 120, 220, 'r90'],-    ['R508', 170, 90, 'r90'],-    ['R506', 170, 230, 'r90'],-    ['R507', 170, 290, 'r90'],-    ['C506', 220, 290, 'r90'],-    ['TP504', 200, 130],-    ['C507', 240, 130],-    ['FL502', 310, 130, '', { text: '10.7M' }],-    ['R509', 370, 150, 'r90'],-    ['MC20', 400, 130],-    ['C508', 440, 130],-  ],-  wires: [-    [[60, 50], [170, 50], 'R508.1'], ['R504.1', [120, 50]],-    [[60, 180], 'Q501.b'], ['R504.2', [120, 180]], ['R505.1', [120, 180]],-    ['R508.2', 'Q501.c'], [[170, 130], 'C507.1'],-    ['C507.2', 'FL502.in'],-    ['FL502.out', 'C508.1'],-    ['Q501.e', 'R506.1'], ['R506.2', 'R507.1'], [[170, 260], [220, 260], 'C506.1'],-  ],-  gnd: ['R505.2', 'R507.2', 'C506.2', 'FL502.g', 'R509.2'],-  flags: [[[60, 50], 'V_IF1', 'left'], [[60, 180], 'IF_B1', 'left'], ['C508.2', 'MIX2_B', 'right']],-  notes: [[230, 234, 'Ic ≈ 3.9 mA; the unbypassed\n22 Ω sets gain ≈ 15 dB'], [280, 200, 'R508 / R509 330 Ω:\nFL502 source and load']],-});--SCH_BLOCKS.push({-  id: 'mix2', sheet: 'if', w: 470, h: 310,-  parts: [-    ['R514', 230, 50, 'r90'],-    ['C512', 280, 90, 'r90'],-    ['C513', 330, 90, 'r90'],-    ['TP502', 370, 70],-    ['Q502', 160, 200],-    ['R510', 130, 130, 'r90'],-    ['R511', 130, 240, 'r90'],-    ['R513', 170, 110, 'r90'],-    ['R512', 170, 260, 'r90'],-    ['C510', 220, 260, 'r90'],-    ['C511', 250, 170, 'r90'],-    ['MC21', 290, 150],-  ],-  wires: [-    ['R510.1', [130, 70], [410, 70]], ['R513.1', [170, 70]],-    [[60, 200], 'Q502.b'], ['R510.2', [130, 200]], ['R511.1', [130, 200]],-    ['R513.2', 'Q502.c'], [[170, 150], [330, 150]],-    ['Q502.e', 'R512.1'], [[170, 230], [220, 230], 'C510.1'],-  ],-  gnd: ['C512.2', 'C513.2', 'R511.2', 'R512.2', 'C510.2', 'C511.2'],-  rails: [['R514.1', '+5VA', 'up']],-  flags: [[[60, 200], 'MIX2_B', 'left'], [[330, 150], 'IF2_OUT', 'right'], [[410, 70], 'V_IF2', 'right']],-  notes: [[20, 226, 'IF in via C508\nLO in via C509'], [270, 230, '10.695 MHz IF − 10.24 MHz LO\n= 455 kHz at the collector']],-});--SCH_BLOCKS.push({-  id: 'xo', sheet: 'if', w: 490, h: 310,-  parts: [-    ['Q503', 210, 170],-    ['R515', 120, 110, 'r90'],-    ['R516', 120, 210, 'r90'],-    ['Y501', 70, 190, 'r90', { label: [-14, -1, 'end'] }],-    ['C516', 70, 240, 'r90', { label: [-12, -1, 'end'] }],-    ['C514', 170, 200, 'r90'],-    ['R517', 270, 240, 'r90'],-    ['C515', 320, 240, 'r90'],-    ['TP505', 360, 220],-    ['C509', 410, 220],-    ['TP506', 450, 270],-  ],-  wires: [-    [[70, 60], [220, 60], 'Q503.c'], ['R515.1', [120, 60]],-    ['Y501.1', 'Q503.b'], ['R515.2', [120, 170]], ['R516.1', [120, 170]], [[170, 170], 'C514.1'],-    ['Y501.2', 'C516.1'],-    ['C514.2', 'C509.1'], ['Q503.e', [220, 220]],-  ],-  gnd: ['R516.2', 'C516.2', 'R517.2', 'C515.2', 'TP506.p'],-  flags: [[[70, 60], 'V_IF2', 'left'], ['C509.2', 'MIX2_B', 'right']],-  notes: [[240, 120, 'collector at RF ground;\nLO taken at the emitter'], [30, 296, 'crystal load: C516, C515, C514 in series ≈ 12 pF']],-});--// Sheet 1: power, USB & MCU (tools/design.py lines 296-371)--(function () {-  // ---------------------------------------------------------------- usb: USB-C / machine-pin input & ESD-  const J101 = { w: 60, h: 210, title: ['J101', 'USB-C'], pins: [-    ['VBUS', 'R', 20, ['A4', 'A9', 'B4', 'B9']],-    ['D+', 'R', 100, ['A6', 'B6']],-    ['D-', 'R', 120, ['A7', 'B7']],-    ['CC1', 'R', 160, ['A5']],-    ['CC2', 'R', 180, ['B5']],-    ['GND', 'B', 30, ['A1', 'A12', 'B1', 'B12', 'SH']],-  ] };-  // USBLC6 is flow-through: I/O1 = pins 1 and 6, I/O2 = pins 3 and 4. The right-hand names end in a-  // space only to keep the pin keys unique (SVG drops the space when drawing).-  const U101 = { w: 110, h: 60, title: ['U101', 'USBLC6-2SC6'], pins: [-    ['VBUS', 'T', 15, ['5']],-    ['I/O1', 'L', 20, ['1']], ['I/O2', 'L', 40, ['3']],-    ['I/O1 ', 'R', 20, ['6']], ['I/O2 ', 'R', 40, ['4']],-    ['GND', 'B', 55, ['2']],-  ] };--  SCH_BLOCKS.push({-    id: 'usb', sheet: 'power', w: 600, h: 340,-    parts: [-      ['J101', 60, 205, '', { box: J101 }],-      ['MC1', 40, 60, 'r270'],-      ['TP102', 100, 60],-      ['TP101', 130, 120],-      ['D106', 240, 60, 'r180'],-      ['D105', 240, 120, 'r180'],-      ['TP103', 300, 120],-      ['F101', 350, 120],-      ['C101', 400, 140, 'r90'],-      ['C102', 445, 140, 'r90'],-      ['R107', 490, 140, 'r90'],-      ['D104', 490, 180, 'r270'],-      ['TP104', 525, 120],-      ['U101', 215, 210, '', { box: U101 }],-      ['MC3', 300, 200],-      ['MC4', 300, 220, 'r180'],-      ['R102', 120, 300, 'r90'],-      ['R101', 170, 300, 'r90'],-    ],-    wires: [-      ['MC1.p', 'D106.a'],-      ['J101.VBUS', 'D105.a'],-      ['U101.VBUS', [175, 120]],-      ['D106.k', [280, 60], [280, 120]],-      ['D105.k', 'F101.1'],-      ['F101.2', [550, 120]],-      ['J101.D+', 'U101.I/O1'], ['J101.D-', 'U101.I/O2'],-      ['U101.I/O1 ', [340, 200]], ['U101.I/O2 ', [340, 220]],-      ['J101.CC1', [170, 260], 'R101.1'],-      ['J101.CC2', 'R102.1'],-    ],-    gnd: ['J101.GND', 'U101.GND', 'R101.2', 'R102.2', 'C101.2', 'C102.2', 'D104.k'],-    rails: [[[550, 120], '+5V', 'right']],-    flags: [[[340, 200], 'USB_DP', 'right'], [[340, 220], 'USB_DM', 'right']],-    notes: [[295, 52, 'B5819W OR-ing:\nUSB-C or VIN contact'], [215, 296, 'CC pull-downs mark\nthe board as a sink']],-  });--  // ---------------------------------------------------------------- reg: 3.3 V LDO & filtered analog rails-  const U102 = { w: 70, h: 50, title: ['U102', 'AP2112K-3.3'], pins: [-    ['VIN', 'L', 10, ['1']], ['EN', 'L', 30, ['3']], ['VOUT', 'R', 10, ['5']], ['GND', 'B', 35, ['2']],-  ] };--  SCH_BLOCKS.push({-    id: 'reg', sheet: 'power', w: 590, h: 280,-    parts: [-      ['C103', 60, 100, 'r90'],-      ['U102', 170, 95, '', { box: U102 }],-      ['TP105', 235, 80],-      ['C104', 265, 100, 'r90'],-      ['C105', 310, 100, 'r90'],-      ['FB102', 370, 80],-      ['C108', 420, 100, 'r90'],-      ['C109', 465, 100, 'r90'],-      ['TP106', 505, 80],-      ['FB101', 90, 200],-      ['C106', 140, 220, 'r90'],-      ['C107', 185, 220, 'r90'],-      ['TP107', 225, 200],-      ['TP108', 440, 250],-      ['TP109', 480, 250],-    ],-    wires: [-      [[30, 80], 'U102.VIN'],-      ['U102.EN', [105, 100], [105, 80]],-      [[30, 80], [30, 200], 'FB101.1'],-      ['U102.VOUT', 'FB102.1'],-      ['FB102.2', [530, 80]],-      ['FB101.2', [250, 200]],-    ],-    gnd: ['C103.2', 'U102.GND', 'C104.2', 'C105.2', 'C108.2', 'C109.2', 'C106.2', 'C107.2', 'TP108.p', 'TP109.p'],-    rails: [[[30, 80], '+5V', 'up'], ['C104.1', '+3V3', 'up'], [[530, 80], '+3.3VA', 'right'], [[250, 200], '+5VA', 'right']],-    notes: [[300, 197, '+5VA feeds every RF / IF\nstage and the op-amps'], [400, 150, '+3.3VA: MCU VREF+\n(ADC / DAC reference)']],-  });--  // ---------------------------------------------------------------- mcu: STM32G0B1-  // Right side: [pin name, offset, QFN pin, net]; every one leaves the block through a flag.-  const RIGHT = [-    ['PA0 ADC_IN0', 20, '11', 'AM_AUDIO'], ['PA1 ADC_IN1', 40, '12', 'FM_AUDIO'],-    ['PA2 ADC_IN2', 60, '13', 'RSSI_AM'], ['PA3 ADC_IN3', 80, '14', 'FM_DC'], ['PA6 ADC_IN6', 100, '17', 'RSSI_FM'],-    ['PA4 DAC1_OUT1', 130, '15', 'DAC_FM'], ['PA5 DAC1_OUT2', 150, '16', 'DAC_AM'],-    ['PA8 TIM1_CH1', 200, '28', 'CAL_MARK'], ['PB1 TIM3_CH4', 220, '20', 'PWM_RF'], ['PA15 TIM2_ETR', 240, '37', 'IF_CNT'],-    ['PB8 open-drain', 270, '47', 'FM_EN_N'], ['PB9 open-drain', 290, '48', 'AM_EN_N'],-    ['PB13 GPIO', 320, '25', 'LED_FM'], ['PB14 GPIO', 340, '26', 'LED_AM'], ['PB15 GPIO', 360, '27', 'LED_STAT'],-  ];-  const TOP = 110, FX = 440;   // box top edge, x of the right-hand flags-  const U103 = { w: 190, h: 380, title: ['U103', 'STM32G0B1CCU7'], pins: [-    ['VBAT', 'T', 15, ['4']], ['VREF+', 'T', 45, ['5']], ['VDD/VDDA', 'T', 160, ['6']],-    ['PA12 USB_DP', 'L', 20, ['34']], ['PA11 USB_DM', 'L', 40, ['33']],-    ['PB6 USART1_TX', 'L', 80, ['45']], ['PB7 USART1_RX', 'L', 100, ['46']],-    ['PA13 SWDIO', 'L', 140, ['35']], ['PA14 SWCLK/BOOT0', 'L', 160, ['36']],-    ['NRST', 'L', 250, ['10']],-    ['PF0 OSC_IN', 'B', 30, ['8']], ['PF1 OSC_OUT', 'B', 110, ['9']], ['VSS/EP', 'B', 160, ['7', '49']],-  ].concat(RIGHT.map((r) => [r[0], 'R', r[1], [r[2]]])) };--  SCH_BLOCKS.push({-    id: 'mcu', sheet: 'power', w: 570, h: 590,-    parts: [-      ['U103', 295, TOP + 190, '', { box: U103 }],-      // supplies-      ['C110', 170, 80, 'r90'],-      ['C111', 420, 80, 'r90'],-      ['C114', 465, 80, 'r90'],-      ['MC6', 500, 60],-      // debug / console contacts and their parts-      ['MC12', 60, 190, 'r270'],-      ['MC13', 60, 210, 'r270'],-      ['MC10', 60, 250, 'r270'],-      ['MC7', 60, 270, 'r270'],-      ['R103', 130, 290, 'r90'],-      ['MC8', 60, 360, 'r270'],-      ['C115', 130, 380, 'r90'],-      // crystal-      ['Y101', 270, 520],-      ['C116', 230, 540, 'r90'],-      ['C117', 310, 540, 'r90'],-      ['TP110', 420, TOP + 200],-    ],-    wires: [-      ['U103.VREF+', [245, 60], [130, 60]],-      ['U103.VBAT', [215, 60]],-      ['U103.VDD/VDDA', [360, 60], [520, 60]],-      ['U103.PA12 USB_DP', [120, 130]], ['U103.PA11 USB_DM', [120, 150]],-      ['U103.PB6 USART1_TX', 'MC12.p'], ['U103.PB7 USART1_RX', 'MC13.p'],-      ['U103.PA13 SWDIO', 'MC10.p'], ['U103.PA14 SWCLK/BOOT0', 'MC7.p'],-      ['U103.NRST', 'MC8.p'],-      ['U103.PF0 OSC_IN', 'C116.1'], ['C116.1', 'Y101.1'],-      ['U103.PF1 OSC_OUT', 'C117.1'], ['C117.1', 'Y101.2'],-    ].concat(RIGHT.map((r) => ['U103.' + r[0], [FX, TOP + r[1]]])),-    gnd: ['C110.2', 'C111.2', 'C114.2', 'R103.2', 'C115.2', 'C116.2', 'C117.2', 'U103.VSS/EP'],-    rails: [[[130, 60], '+3.3VA', 'up'], [[520, 60], '+3V3', 'right']],-    flags: [[[120, 130], 'USB_DP', 'left'], [[120, 150], 'USB_DM', 'left']]-      .concat(RIGHT.map((r) => [[FX, TOP + r[1]], r[3], 'right'])),-    notes: [[20, 300, 'BOOT0 is on PA14:\nR103 holds it low'], [360, 535, '40 MHz: timers and, since\nfirmware v0.3, USB too']],-  });-})();--// Sheet 2: tuning, band switching & user interface (tools/design.py lines 374-439)--SCH_BLOCKS.push({-  id: 'vt', sheet: 'tune', w: 480, h: 380,-  parts: [-    // FM: DAC1 -> x1.45 -> two RC poles -> VT_FM-    ['TP201', 80, 100],-    ['U201A', 140, 110, 'my'],-    ['R201', 140, 160, 'r180'],-    ['R202', 110, 180, 'r90', 'll'],-    ['TP204', 200, 110],-    ['R203', 240, 110], ['C201', 280, 130, 'r90'],-    ['R204', 320, 110], ['C202', 360, 130, 'r90'],-    ['MC25', 380, 110],-    // AM: DAC2 -> x1.45 -> two RC poles -> VT_AM-    ['TP202', 80, 250],-    ['U201B', 140, 260, 'my'],-    ['R205', 140, 310, 'r180'],-    ['R206', 110, 330, 'r90', 'll'],-    ['TP205', 200, 260],-    ['R207', 240, 260], ['C203', 280, 280, 'r90'],-    ['R208', 320, 260], ['C204', 360, 280, 'r90'],-    ['MC26', 380, 260],-    // supply decoupling-    ['C205', 440, 50, 'r90'],-  ],-  wires: [-    [[60, 100], 'U201A.+'],-    ['U201A.-', 'R202.1'], ['R201.2', 'R202.1'],-    ['U201A.o', 'R203.1'], ['R201.1', [180, 160], [180, 110]],-    ['R203.2', 'R204.1'], ['R204.2', [400, 110]],-    [[60, 250], 'U201B.+'],-    ['U201B.-', 'R206.1'], ['R205.2', 'R206.1'],-    ['U201B.o', 'R207.1'], ['R205.1', [180, 310], [180, 260]],-    ['R207.2', 'R208.1'], ['R208.2', [400, 260]],-  ],-  gnd: ['R202.2', 'C201.2', 'C202.2', 'R206.2', 'C203.2', 'C204.2', 'C205.2'],-  rails: [['C205.1', '+5VA', 'up']],-  flags: [[[60, 100], 'DAC_FM', 'left'], [[400, 110], 'VT_FM', 'right'],-    [[60, 250], 'DAC_AM', 'left'], [[400, 260], 'VT_AM', 'right']],-  notes: [[130, 190, 'gain 1 + 10k/22k = 1.45'], [262, 340, 'two RC poles per channel: a quiet\nvaractor voltage keeps the LO clean'],-    [425, 54, 'U201: +5VA / GND', 'end']],-});--SCH_BLOCKS.push({-  id: 'pwm', sheet: 'tune', w: 560, h: 340,-  parts: [-    // PB1 PWM -> 2-pole RC -> x1.45 -> VT_RF-    ['TP203', 80, 80],-    ['R209', 120, 80], ['C206', 160, 100, 'r90'],-    ['R210', 200, 80], ['C207', 240, 100, 'r90'],-    ['U202A', 320, 90, 'my'],-    ['R211', 320, 140, 'r180'],-    ['R212', 290, 160, 'r90', 'll'],-    ['TP206', 380, 90],-    ['R213', 420, 90], ['C208', 460, 110, 'r90'],-    ['MC27', 480, 90],-    // VDDA / 2 -> unity buffer -> VREF_1V65-    ['R214', 100, 230, 'r90'], ['R215', 100, 270, 'r90', 'll'], ['C209', 140, 270, 'r90'],-    ['U202B', 230, 260, 'my'],-    ['R216', 310, 260], ['C210', 350, 280, 'r90'],-    ['TP207', 370, 260],-    // supply decoupling-    ['C211', 500, 250, 'r90'],-  ],-  wires: [-    [[60, 80], 'R209.1'],-    ['R209.2', 'R210.1'], ['R210.2', 'U202A.+'],-    ['U202A.-', 'R212.1'], ['R211.2', 'R212.1'],-    ['U202A.o', 'R213.1'], ['R211.1', [360, 140], [360, 90]],-    ['R213.2', [500, 90]],-    ['R214.2', 'U202B.+'],-    ['U202B.o', 'R216.1'], ['U202B.-', [200, 290], [270, 290], [270, 260]],-    ['R216.2', [390, 260]],-  ],-  gnd: ['C206.2', 'C207.2', 'R212.2', 'C208.2', 'R215.2', 'C209.2', 'C210.2', 'C211.2'],-  rails: [['R214.1', '+3.3VA', 'up'], ['C211.1', '+5VA', 'up']],-  flags: [[[60, 80], 'PWM_RF', 'left'], [[500, 90], 'VT_RF', 'right'], [[390, 260], 'VREF_1V65', 'right']],-  notes: [[100, 150, '2-pole RC low-pass, 16 Hz'], [310, 180, 'gain 1 + 10k/22k = 1.45'], [500, 300, 'U202: +5VA / GND', 'middle']],-});--SCH_BLOCKS.push({-  id: 'band', sheet: 'tune', w: 400, h: 390,-  parts: [-    // FM front-end supply switch-    ['R217', 140, 80, 'r90'],-    ['MC28', 170, 60],-    ['R218', 100, 120, 'r180'],-    ['Q201', 190, 120, 'my'],-    ['C212', 240, 180, 'r90'], ['C213', 290, 180, 'r90'],-    ['TP208', 320, 160],-    // AM front-end supply switch-    ['R219', 140, 250, 'r90'],-    ['R220', 100, 290, 'r180'],-    ['Q202', 190, 290, 'my'],-    ['C214', 240, 350, 'r90'], ['C215', 290, 350, 'r90'],-    ['TP209', 320, 330],-  ],-  wires: [-    ['R217.1', [200, 60], 'Q201.e'],-    ['R218.1', 'Q201.b'], ['R217.2', [140, 120]],-    ['Q201.c', [200, 160], [340, 160]],-    ['R219.1', [200, 230], 'Q202.e'],-    ['R220.1', 'Q202.b'], ['R219.2', [140, 290]],-    ['Q202.c', [200, 330], [340, 330]],-  ],-  gnd: ['C212.2', 'C213.2', 'C214.2', 'C215.2'],-  rails: [['R217.1', '+5VA', 'up'], ['R219.1', '+5VA', 'up'], [[340, 160], '+5V_FM', 'right'], [[340, 330], '+5V_AM', 'right']],-  flags: [['R218.2', 'FM_EN_N', 'left'], ['R220.2', 'AM_EN_N', 'left']],-  notes: [[25, 142, 'low = band on\nhigh-Z = off'], [210, 82, 'R217 pulls the base to\n5 V: off at reset']],-});--SCH_BLOCKS.push({-  id: 'ui', sheet: 'tune', w: 360, h: 300,-  parts: [-    ['R224', 120, 50], ['D201', 160, 70, 'r270'],-    ['R225', 120, 130], ['D202', 160, 150, 'r270'],-    ['R226', 120, 210], ['D203', 160, 230, 'r270'],-    ['TP210', 290, 150], ['TP211', 330, 150],-  ],-  wires: [-    ['R224.2', 'D201.a'], ['R225.2', 'D202.a'], ['R226.2', 'D203.a'],-    ['TP210.p', 'TP211.p'],-  ],-  gnd: ['D201.k', 'D202.k', 'D203.k', [310, 150]],-  flags: [['R224.1', 'LED_FM', 'left'], ['R225.1', 'LED_AM', 'left'], ['R226.1', 'LED_STAT', 'left']],-  notes: [[40, 274, 'GPIO high = LED on.  Green and blue drop\n~2.8 V, so their resistors are only 220 Ω']],-});--/* spectrum.js: a stage-by-stage spectrum model of the AM/FM receiver, and its SVG renderer.- *- * Example signals at the antenna are followed through every stage: linear stages add their gain- * curve (dB) at each signal's frequency, mixers move every signal to |f - LO| (and f + LO), the limiter- * and squarer clip, the detectors turn the IF into audio. Responses come from the component values- * (L/C ladders, Sallen-Key, de-emphasis) or the datasheets (ceramic filters); the RF-amp and mixer gains- * are estimates and are labelled as such. Frequencies are MHz throughout.- */-var SPECTRUM = (function () {-  'use strict';-  const IF1 = 10.695, LO2 = 10.240, IF2 = 0.455;-  const lg = (x) => Math.log10(Math.max(x, 1e-30));-  const psum = (...v) => 10 * lg(v.reduce((s, x) => s + Math.pow(10, x / 10), 0));--  // ---------------------------------------------------------------- responses-  const cx = (re, im) => ({ re, im: im || 0 });-  const add = (a, b) => cx(a.re + b.re, a.im + b.im);-  const mul = (a, b) => cx(a.re * b.re - a.im * b.im, a.re * b.im + a.im * b.re);-  const div = (a, b) => { const d = b.re * b.re + b.im * b.im; return cx((a.re * b.re + a.im * b.im) / d, (a.im * b.re - a.re * b.im) / d); };-  // |S21| in dB of an L/C ladder between Rs and Rl. elems: [series|shunt, 'L'|'C', value, inductor Q]-  function ladder(elems, f, Rs, Rl) {-    const w = 2 * Math.PI * Math.max(f, 1e-4) * 1e6;-    let A = cx(1), B = cx(0), C = cx(0), D = cx(1);-    for (const [kind, type, val, q] of elems) {-      let Z = type === 'L' ? cx(q ? w * val / q : 0, w * val) : cx(0, -1 / (w * val));-      const m = kind === 's' ? [cx(1), Z, cx(0), cx(1)] : [cx(1), cx(0), div(cx(1), Z), cx(1)];-      [A, B, C, D] = [add(mul(A, m[0]), mul(B, m[2])), add(mul(A, m[1]), mul(B, m[3])), add(mul(C, m[0]), mul(D, m[2])), add(mul(C, m[1]), mul(D, m[3]))];-    }-    const den = add(add(mul(A, cx(Rl)), B), add(mul(C, cx(Rs * Rl)), mul(D, cx(Rs))));-    return 20 * lg(2 * Math.sqrt(Rs * Rl) / Math.hypot(den.re, den.im));-  }-  const FM_LEG = [['s', 'C', 47e-12], ['p', 'L', 56e-9, 35], ['s', 'C', 47e-12], ['p', 'C', 22e-12], ['s', 'L', 120e-9, 35], ['p', 'C', 22e-12]];-  const AM_LEG = [['s', 'L', 2.2e-6, 30], ['p', 'C', 2.7e-9], ['s', 'L', 8.2e-6, 30], ['p', 'C', 2.7e-9], ['s', 'L', 2.2e-6, 30]];-  const fmLeg = (f) => Math.max(-150, ladder(FM_LEG, f, 50, 54));-  const amLeg = (f) => Math.max(-150, ladder(AM_LEG, f, 50, 48));-  // single tuned circuit-  const tank = (f, f0, Q) => -10 * lg(1 + Q * Q * Math.pow(f / f0 - f0 / f, 2));-  // ceramic filters, shaped to the datasheet points (HCCF3 10.7: 180 kHz at -3 dB, 470 kHz at -20 dB, 35 dB floor, 4 dB loss;-  // HCCF2 455: +/-4.5 kHz at -6 dB, +/-10 kHz at -45 dB, 6 dB loss)-  const cer10 = (f) => -4 - Math.min(35, 10 * lg(1 + Math.pow(Math.abs(f - 10.7) * 1000 / 90, 4.8)));-  const cer455 = (f) => -6 - Math.min(45, 10 * lg(1 + Math.pow(Math.abs(f - 0.455) * 1000 / 4.09, 11.6)));-  const rc1 = (f, fc) => -10 * lg(1 + Math.pow(f / fc, 2));                          // first-order low-pass-  const sallenKey = (f, f0, Q) => { const x = f / f0; return -10 * lg(Math.pow(1 - x * x, 2) + Math.pow(x / Q, 2)); };-  const deemph = (f) => rc1(f, 1 / (2 * Math.PI * 51e3 * 1.5e-9) / 1e6);              // 76.5 us-  const fir = (f) => { const k = f * 1000; return k <= 15 ? 0 : k >= 30 ? -60 : -60 * Math.pow((k - 15) / 15, 1.6); };-  const notch19 = (f) => -52 * Math.exp(-Math.pow((f * 1000 - 19) / 0.35, 2));--  // ---------------------------------------------------------------- the antenna scene (example signals)-  function plan(band, mode, fFm, fAm) {-    if (band === 'fm') {-      const f0 = fFm;-      if (mode === 'design') return { f0, lo: f0 + IF1, side: 'above', ok: f0 + IF1 >= 98.7 - 1e-9 && f0 + IF1 <= 118.7 + 1e-9 };-      if (f0 + IF1 <= 99.2) return { f0, lo: f0 + IF1, side: 'above', ok: f0 + IF1 >= 91.5 };-      if (f0 - IF1 >= 91.5 && f0 - IF1 <= 99.2) return { f0, lo: f0 - IF1, side: 'below', ok: true };-      return { f0, lo: null, side: 'none', ok: false };-    }-    const f0 = fAm / 1000;-    if (mode === 'design') return { f0, lo: f0 + IF1, side: 'above', ok: f0 + IF1 >= 11.23 - 1e-9 && f0 + IF1 <= 12.4 + 1e-9 };-    const lo = IF1 - f0;-    return { f0, lo, side: 'sum', ok: lo >= 9.547 && lo <= 10.162 };-  }-  // ---------------------------------------------------------------- what the STM32 sets: tuning DAC, RF-tracking PWM, marker, DSP-  const VREF = 3.3, GVT = 1.45;-  const dacV = (code) => Math.max(0, Math.min(4095, code)) / 4095 * VREF;          // PA4 / PA5, 12-bit-  const pwmV = (code) => GVT * Math.max(0, Math.min(4096, code)) / 4096 * VREF;     // PB1 averaged, then x1.45-  // BB910 varactor fitted to its datasheet: about 39 pF at 0.5 V and 13.5 pF at 5 V-  const Cv = (v) => 56e-12 * Math.pow(1 + Math.max(0, v) / 0.7, -0.678);-  const ser = (a, b) => a * b / (a + b);-  const fRes = (L, C) => 1 / (2 * Math.PI * Math.sqrt(L * C)) / 1e6;-  // as designed: the varactor curve's shape, spanning the design's stated LO ranges over 0-4.8 V-  function designVco(band, vt) {-    const shape = band === 'fm' ? (v) => fRes(110e-9, 7.84e-12 + ser(22e-12, Cv(v)))-      : (v) => fRes(8.2e-6, 1 / (1 / (15e-12 + ser(33e-12, Cv(v))) + 1 / 220e-12 + 1 / 470e-12));-    const [f0, f1] = band === 'fm' ? [98.7, 118.7] : [11.23, 12.4];-    const a = shape(0), b = shape(4.8);-    return f0 + (f1 - f0) * (shape(Math.min(4.8, vt)) - a) / (b - a);-  }-  // first board: the measured calibration tables (firmware/README.md), DAC code -> LO in MHz; the ends are extrapolated-  const BOARD_FM = [[0, 91.46], [107, 91.5604], [919, 92.3153], [1152, 92.7418], [1302, 92.9999], [2237, 94.7116], [3347, 97.1143], [3674, 97.985], [3927, 98.7136], [4095, 99.2]];-  const BOARD_AM = [[0, 9.5474], [147, 9.6066], [360, 9.6955], [628, 9.7885], [887, 9.8673], [1169, 9.9442], [1495, 10.0282], [1776, 10.0952], [2063, 10.1622], [4095, 10.2]];-  const interp = (tab, x) => {-    for (let i = 1; i < tab.length; i++) if (x <= tab[i][0]) { const [x0, y0] = tab[i - 1], [x1, y1] = tab[i]; return y0 + (y1 - y0) * (x - x0) / (x1 - x0); }-    return tab[tab.length - 1][1];-  };-  const vco = (band, mode, code) => (mode === 'board' ? interp(band === 'fm' ? BOARD_FM : BOARD_AM, Math.max(0, Math.min(4095, code))) : designVco(band, GVT * dacV(code)));-  function invert(fn, target, lo, hi) {   // fn rising on [lo, hi]-    if (target < fn(lo) - 1e-9 || target > fn(hi) + 1e-9) return null;-    for (let i = 0; i < 44; i++) { const m = (lo + hi) / 2; if (fn(m) < target) lo = m; else hi = m; }-    return Math.round((lo + hi) / 2);-  }-  // RF tank (a model): L306 150 nH with C309 and ~1.7 pF of strays (5 pF), and the varactor through C310 22 pF-  const tankF = (vt) => fRes(150e-9, 5e-12 + ser(22e-12, Cv(vt)));-  const CTL0 = { tune: 'station', dac: 2000, pwmMode: 'track', pwm: 2400, marker: false, markerN: 13, notch: true, nf: 'auto', gain: 0, mute: false, hum: true };-  // the effective settings: which LO the DAC gives, where the station lands, where the RF tank sits-  function control(S) {-    const c = Object.assign({}, CTL0, S.ctl || {});-    const P0 = plan(S.band, S.mode, S.f.fm, S.f.am);-    let lo = P0.lo, side = P0.side, dac;-    if (c.tune === 'dac') {-      dac = c.dac;-      lo = vco(S.band, S.mode, dac);-      side = S.band === 'fm' ? (lo >= P0.f0 ? 'above' : 'below') : S.mode === 'board' ? 'sum' : 'above';-    } else {-      dac = lo == null ? null : invert((x) => vco(S.band, S.mode, x), lo, 0, 4095);-    }-    const if1 = lo == null ? null : side === 'sum' ? lo + P0.f0 : Math.abs(lo - P0.f0);-    const if2 = if1 == null ? null : Math.abs(if1 - LO2);-    let pwm = c.pwm;-    if (c.pwmMode === 'track') {-      if (S.mode === 'board') pwm = 2400;        // the first board's firmware parks it here-      else { const p = invert((x) => tankF(pwmV(x)), P0.f0, 0, 4096); pwm = p == null ? (P0.f0 < tankF(0) ? 0 : 4096) : p; }-    }-    return { c, P: Object.assign({}, P0, { lo, side, ok: c.tune === 'dac' ? lo != null : P0.ok }), dac, vt: dac == null ? null : GVT * dacV(dac), vdac: dac == null ? null : dacV(dac),-      if1, if2, pwm, vtRf: pwmV(pwm), tank: tankF(pwmV(pwm)), tankRange: [tankF(0), tankF(4.8)], markerF: 48 / c.markerN };-  }--  function scene(S, K) {-    const P = K.P;-    const fmBand = S.band === 'fm', sig = [];-    const push = (id, label, kind, f, db, bw) => { if (f > 0) sig.push({ id, label, kind, f, db, bw }); };-    // FM broadcast band, placed around the FM station-    const ffm = S.f.fm;-    const wrap = (f) => (f > 107.9 ? f - 20.2 : f < 87.7 ? f + 20.2 : f);-    push('fm0', fmBand ? 'Your station' : 'FM station', fmBand ? 'station' : 'other', ffm, -65, 0.2);-    const sideSign = fmBand && P.side === 'below' ? -1 : 1;-    const fmOthers = [['fmU', 0.4, -58, 'Station 400 kHz up'], ['fmD', -0.4, -72, 'Station 400 kHz down'],-      ['fm2i', 0.91 * sideSign, -60, sideSign > 0 ? 'Station 910 kHz up' : 'Station 910 kHz down'],-      ['fmL', -3.1, -48, 'Strong local station'], ['fmA', 5.3, -66, 'FM station'], ['fmB', -7.7, -60, 'FM station'], ['fmC', 9.9, -70, 'FM station']];-    for (const [id, off, db, label] of fmOthers) push(id, label, 'other', wrap(ffm + off), db, 0.2);-    // medium wave, placed around the AM station-    const fam = S.f.am / 1000;-    push('am0', fmBand ? 'AM station' : 'Your station', fmBand ? 'other' : 'station', fam, -55, 0.01);-    const amNb = [['amU', 0.01, -63, 'Station 10 kHz up'], ['amD', -0.01, -67, 'Station 10 kHz down'], ['amU2', 0.02, -61, 'Station 20 kHz up']];-    for (const [id, off, db, label] of amNb) if (fam + off >= 0.53 && fam + off <= 1.71) push(id, label, 'other', fam + off, db, 0.01);-    const amFixed = [0.62, 0.82, 0.97, 1.08, 1.31, 1.5];-    amFixed.forEach((f, i) => { if (Math.abs(f - fam) > 0.025) push('amF' + i, 'AM station', 'other', f, [-52, -48, -56, -58, -62, -57][i], 0.01); });-    // the calibration marker: TIM1 on PA8 puts a 48 MHz / N square wave on the antenna through R317 and C323-    if (K.c.marker) for (let k = 1; k * K.markerF <= 300; k++) push('mk' + k, 'Calibration marker, harmonic ' + k + ' (' + k + ' \u00d7 48/' + K.c.markerN + ' MHz)', 'mark', k * K.markerF, -40 - 10 * lg(k), 0.002);-    return { P, sig };-  }-  // man-made and atmospheric noise rises below 30 MHz; -125 dBm is the display floor (10 kHz bandwidth)-  const antNoise = (f) => -125 + 30 * Math.max(0, lg(30 / Math.max(f, 0.3)));--  // ---------------------------------------------------------------- stage helpers-  const shift = (s, H) => (s.lev ? Object.assign({}, s, { lev: ((L0) => (f) => L0(f) + H(f))(s.lev), db: s.db + H(s.f) }) : Object.assign({}, s, { db: s.db + H(s.f) }));-  const offset = (s, d) => shift(s, () => d);-  const linear = (prev, H, self) => ({-    sig: prev.sig.map((s) => shift(s, H)),-    nf: (f) => psum(prev.nf(f) + H(f), self == null ? -300 : self + H(f)),-  });-  function mixer(prev, lo, sumOnly, G, self) {-    const out = [];-    for (const s of prev.sig) {-      const d = Math.abs(s.f - lo), u = s.f + lo;-      if (!sumOnly) out.push(Object.assign({}, s, { f: d, db: s.db + G, from: s.f, db0: s.db, sum: false }));-      out.push(Object.assign({}, s, { id: s.id + ':sum', f: u, db: s.db + G, from: s.f, db0: s.db, sum: true, kind: sumOnly ? s.kind : 'other', label: sumOnly ? s.label : s.label + ' (sum product)' }));-    }-    return {-      sig: out,-      nf: (f) => psum(prev.nf(Math.abs(lo - f) || 1e-6) + G, prev.nf(lo + f) + G, f > lo ? prev.nf(f - lo) + G : -300, self),-    };-  }-  // the mixer's whole output for the wide view: both copies of your station keep its colour-  const products = (sig, stId) => sig.map((s) => (s.id.split(':')[0] === stId ? Object.assign({}, s, { kind: 'station' }) : s));-  const within = (sig, ax) => sig.filter((s) => s.f + (s.bw || 0) >= ax.min && s.f - (s.bw || 0) <= ax.max);-  const fmtF = (f, unit) => (unit === 'kHz' ? +(f * 1000).toFixed(f * 1000 < 10 ? 2 : 1) + ' kHz' : +f.toFixed(f < 1 ? 4 : 3) + ' MHz');-  // programme audio: most energy below 1 kHz, falling above; broadcasters pre-emphasise above 2.1 kHz-  const prog = (f) => -10 * lg(1 + Math.pow(f / 0.001, 2));-  const preemph = (f) => -deemph(f);-  const dB = (x) => (x >= 0 ? '+' : '−') + Math.abs(x).toFixed(Math.abs(x) < 10 ? 1 : 0) + ' dB';-  const mag = (x) => Math.abs(x).toFixed(Math.abs(x) < 10 ? 1 : 0) + ' dB';--  // ---------------------------------------------------------------- the chain-  // the firmware's DSP, part by part, as the STM32 controls set it-  function dspParts(K, fm) {-    const c = K.c, parts = [{ name: 'FIR \u00f74', title: '32-tap FIR: flat to 15 kHz, 58 dB down by 30 kHz, then every 4th sample (48 kHz)', kind: 'filter', H: fir }];-    if (fm && c.notch) parts.push({ name: '19 kHz notch', title: 'The pilot notch: \u221252 dB at 19 kHz', kind: 'filter', H: notch19 });-    if (c.nf === 'strong') parts.push({ name: 'Noise filter', title: 'Noise filter, strong: a low-pass from 10 kHz', kind: 'filter', H: (f) => sallenKey(f, 0.010, 0.707) });-    if (c.hum) parts.push({ name: 'Hum canceller', title: 'The 1 kHz template canceller: \u221239 \u2192 \u221260 dBFS', kind: 'filter', H: (f) => (Math.abs(f * 1000 - 1) < 0.15 || Math.abs(f * 1000 - 3) < 0.15 ? -21 : 0) });-    if (c.gain) parts.push({ name: 'Gain', title: 'Gain ' + dB(c.gain) + ' (and the soft limiter above \u22124 dBFS)', kind: 'gain', H: () => c.gain });-    if (c.mute) parts.push({ name: 'Mute', title: 'Muted: nothing goes to the PC', kind: 'convert', to: { sig: [], nf: () => -200 } });-    return parts;-  }-  const humTones = () => [{ id: 'hum1', label: '1 kHz tone from the DSP\u2019s own 1 ms activity (through VREF+)', kind: 'other', f: 0.001, bw: 0, db: -39 },-    { id: 'hum3', label: '3 kHz harmonic of that tone', kind: 'other', f: 0.003, bw: 0, db: -50 }];-  function runParts(start, parts) {-    let cur = start;-    for (const p of parts) cur = p.kind === 'convert' ? p.to : linear(cur, p.H, -300);-    return cur;-  }-  // animation steps: one per part of a stage. Each step has what it applies (H) and the spectrum before and after.-  function mkSteps(start, parts, end) {-    const steps = start ? [{ name: 'In', kind: 'in', title: 'The signal coming in', to: start }] : [];-    let cur = start || { sig: [], nf: () => -300 };-    parts.forEach((p, i) => {-      let nxt = p.kind === 'convert' ? p.to : linear(cur, p.H, -300);-      if (i === parts.length - 1 && end) nxt = end;-      steps.push(Object.assign({}, p, { from: cur, to: nxt }));-      cur = nxt;-    });-    return steps;-  }-  function build(S) {-    const K = control(S);-    const { P, sig } = scene(S, K);-    const fm = S.band === 'fm';-    const st = (x) => x.sig.find((s) => s.kind === 'station' && !s.sum);-    const img = (x) => x.sig.find((s) => s.kind === 'image' && !s.sum);-    const stages = [];-    const LOGAX = { min: 0.1, max: 3000, log: true, unit: 'MHz', ticks: [0.1, 0.3, 1, 3, 10, 30, 100, 300, 1000, 3000] };-    let cur = { sig, nf: antNoise };-    stages.push({ id: 'ant-in', block: 'ant', title: 'Antenna', parts: 'J301 SMA', ax: LOGAX, y: [-160, -10], yUnit: 'dBm', out: cur,-      strip: 'Example stations at the antenna (not a measurement): the medium-wave (AM) band and the FM band. The noise rises toward low frequencies, as man-made and atmospheric noise do.',-      cap: 'Everything arrives at once. The station you want is at ' + fmtF(P.f0, fm ? 'MHz' : 'kHz') + '.' });--    // diplexer-    const legH = fm ? fmLeg : amLeg;-    const prevAnt = cur;-    cur = linear(cur, legH, -300);-    const legAtSt = legH(P.f0);-    const legEl = fm ? FM_LEG : AM_LEG, legRl = fm ? 54 : 48;-    const cum = (k) => (f) => (k ? Math.max(-150, ladder(legEl.slice(0, k), f, 50, legRl)) : 0);-    const legParts = fm ? [['High-pass', 'C303, L304 and C304: a 70 MHz high-pass', 3], ['Low-pass', 'C305, L305 and C306: a 130 MHz low-pass', 6]]-      : [['L301, C301', 'L301 (series) and C301 (shunt): the first two poles', 2], ['L302, C302', 'L302 and C302: two more poles', 4], ['L303', 'L303: the fifth pole', 5]];-    const legSteps = mkSteps(prevAnt, legParts.map(([name, title, k], i) => ({ name, title, kind: 'filter', H: ((a, b) => (f) => cum(b)(f) - cum(a)(f))(i ? legParts[i - 1][2] : 0, k) })), cur);-    const otherBand = fm ? 1.0 : 100;-    stages.push({ id: 'ant-leg', block: 'ant', title: fm ? 'Diplexer, FM leg' : 'Diplexer, AM leg', parts: fm ? 'C303 L304 C304 / C305 L305 C306' : 'L301 C301 L302 C302 L303',-      ax: LOGAX, y: [-160, -10], yUnit: 'dBm', out: cur, ghost: prevAnt, resp: { H: legH, y: [-120, 10] }, steps: legSteps,-      cap: fm ? 'The 70 MHz high-pass and 130 MHz low-pass, computed from the six L/C values. The station loses ' + mag(legAtSt) + '; medium wave at 1 MHz drops ' + mag(legH(otherBand)) + ', so it is gone, and above 130 MHz the low-pass pulls the noise down too (' + mag(legH(1000)) + ' at 1 GHz).'-        : 'The 5-pole 2 MHz low-pass, computed from its L/C values. The station loses ' + mag(legAtSt) + '; FM at 100 MHz drops ' + mag(legH(otherBand)) + '.' });--    // RF amplifier-    if (fm) {-      const G = 16, Q = 10;-      const H = (f) => G + tank(f, K.tank, Q);-      const ax = { min: 60, max: 140, unit: 'MHz', ticks: [60, 70, 80, 90, 100, 110, 120, 130, 140] };-      const pin = cur;-      cur = linear(cur, H, -113 - G);-      const ii = img(cur);-      const tk = 'tuned to ' + fmtF(K.tank) + ' by VT_RF = ' + K.vtRf.toFixed(2) + ' V (PWM ' + K.pwm + ')';-      stages.push({ id: 'fmrf', block: 'fmrf', title: 'RF amplifier & tracking tank', parts: 'Q301, L306, D301', ax, y: [-120, -20], yUnit: 'dBm', out: cur, ghost: pin, est: true,-        resp: { H, y: [-30, 25] }, refs: [[K.tank, 'tank']],-        steps: mkSteps(pin, [{ name: 'Tank', title: 'L306, C309 and the varactor: a peak ' + tk, kind: 'filter', H: (f) => tank(f, K.tank, Q) }, { name: 'Q301 gain', title: '+' + G + ' dB from Q301', kind: 'gain', H: () => G }], cur),-        cap: 'About ' + G + ' dB of gain at the tank\u2019s peak, falling away either side: a loaded Q of about ' + Q + ' (both estimated from the component values). The tank is ' + tk + '; your station gets ' + dB(H(P.f0)) + '.' + (S.mode === 'board' ? ' On the first board the firmware parks it at PWM 2400.' : '') });-    } else {-      const G = 24, H = () => G;-      const ax = { min: 0, max: 2.5, unit: 'MHz', ticks: [0, 0.5, 1, 1.5, 2, 2.5] };-      const pin = cur;-      cur = linear(cur, H, -113);-      stages.push({ id: 'amrf', block: 'amrf', title: 'AM preamplifier', parts: 'Q401', ax, y: [-120, 0], yUnit: 'dBm', out: cur, ghost: pin,-        steps: mkSteps(pin, [{ name: 'Q401 gain', title: '+' + G + ' dB from Q401', kind: 'gain', H: () => G }], cur),-        resp: { H, y: [0, 40] }, cap: 'A flat ' + G + ' dB across medium wave (the design note’s figure). Nothing here is tuned.' });-    }--    // first mixer-    const IFAX = fm ? { min: 9.2, max: 12.2, unit: 'MHz', ticks: [9.5, 10, 10.5, 11, 11.5, 12] }-      : { min: 9.2, max: 12.2, unit: 'MHz', ticks: [9.5, 10, 10.5, 11, 11.5, 12] };-    const broken = P.lo == null || (S.mode === 'board' && !P.ok);-    if (!broken) {-      const sumOnly = P.side === 'sum';-      const G = 10;-      const pin = cur;-      cur = mixer(cur, P.lo, false, G, -110);-      if (sumOnly) cur.sig = cur.sig.map((s) => (s.sum ? Object.assign({}, s, { kind: pin.sig.find((x) => x.id === s.id.replace(':sum', '')).kind, label: s.label.replace(' (sum product)', '') }) : Object.assign({}, s, { kind: s.kind === 'image' ? 'image' : 'other', label: s.label + (s.kind === 'station' ? ' (difference product)' : '') })));-      if (sumOnly) cur.sig.forEach((s) => { if (s.kind === 'station' && !s.sum) s.kind = 'other'; });-      const how = P.side === 'sum' ? 'LO + f' : P.side === 'below' ? 'f − LO' : 'LO − f';-      const stOut = cur.sig.filter((s) => s.kind === 'station').sort((a, b) => Math.abs(a.f - IF1) - Math.abs(b.f - IF1))[0];-      const lands = stOut && Math.abs(stOut.f - IF1) < 0.002;-      const offTxt = stOut ? 'Your station comes out at ' + fmtF(stOut.f) + ', ' + Math.round(Math.abs(stOut.f - IF1) * 1000) + ' kHz from the 10.695 MHz centre (the AFC is off), so the filters will cut it.' : 'Your station does not land near the IF.';-      const il = cur.sig.find((s) => s.kind === 'image' && Math.abs(s.f - IF1) < 0.02);-      const stIn = pin.sig.find((x) => x.kind === 'station');-      const keep = sumOnly ? 'sum' : 'diff';-      const dTxt = P.side === 'below' ? 'f \u2212 LO' : 'LO \u2212 f', sTxt = 'LO + f';-      const q = fm ? 'Q303' : 'Q403';-      stages.push({ id: fm ? 'fmmix' : 'ammix', block: fm ? 'fmmix' : 'ammix', title: fm ? 'FM mixer' : 'AM mixer', parts: fm ? 'Q303, LO from Q302' : 'Q403, LO from Q402',-        ax: IFAX, y: [-120, -10], yUnit: 'dBm', out: { sig: within(cur.sig, IFAX), nf: cur.nf }, est: true,-        refs: [[IF1, '10.695 MHz IF']],-        inAx: fm ? { min: 0, max: 240, unit: 'MHz', ticks: [0, 40, 80, 120, 160, 200, 240] } : { min: 0, max: 16, unit: 'MHz', ticks: [0, 2, 4, 6, 8, 10, 12, 14, 16] },-        inp: { sig: pin.sig, nf: pin.nf }, lo: P.lo, map: how,-        prod: { sig: products(cur.sig, stIn && stIn.id), nf: cur.nf },-        notes: { diff: dTxt + (keep === 'diff' ? ': kept' : ': filtered out'), sum: sTxt + (keep === 'sum' ? ': kept' : ': filtered out') },-        steps: [{ name: 'In', kind: 'in', title: 'going in: ' + (fm ? 'the FM band' : 'medium wave') + ', and the LO at ' + fmtF(P.lo) },-          { name: '\u00d7 LO', kind: 'mix', title: q + ' \u00d7 LO: two copies, one down by the LO, one up' },-          { name: 'Zoom', kind: 'out', title: 'the box at 10.7 MHz, magnified below' }],-        strip: 'Multiplying by the LO makes two copies of everything: one at ' + dTxt + ', one at ' + sTxt + ', with LO = ' + fmtF(P.lo) + (P.side === 'below' ? ' (below the station, as on the first board)' : P.side === 'sum' ? ' (the first board\u2019s low AM LO, so the sum is the one kept)' : '') + '. Conversion gain about +' + G + ' dB (estimate).',-        cap: (lands ? 'Your station lands on 10.695 MHz.' : offTxt) + (fm ? ' The station 910 kHz up lands on 9.785 MHz, which the second mixer would also fold onto 455 kHz, so the 10.7 MHz filters must remove it.' : '') + (P.side === 'above' ? ' The difference copy is mirrored: a copy pushed past 0 Hz folds back (cos(\u2212x) = cos x), so the stations come out in reverse order.' : '') });-    } else {-      stages.push({ id: fm ? 'fmmix' : 'ammix', block: fm ? 'fmmix' : 'ammix', title: fm ? 'FM mixer' : 'AM mixer', parts: '', ax: IFAX, y: [-120, -10], yUnit: 'dBm', out: { sig: [], nf: () => -110 },-        fault: fm ? 'Out of reach: the LO covers 91.5 to 99.2 MHz, so no LO setting puts this station on the IF.' : 'Out of reach: the AM LO covers 9.55 to 10.16 MHz, which reaches about 533 to 1150 kHz.', strip: 'Every signal moves by the LO frequency.', cap: '' });-    }--    if (!broken) {-      // first 10.7 MHz filter-      const AX2 = fm ? IFAX : { min: 10.395, max: 10.995, unit: 'MHz', ticks: [10.45, 10.55, 10.65, 10.75, 10.85, 10.95] };-      let pin = cur;-      cur = linear(cur, cer10, -300);-      const near = (x, df) => x.sig.find((s) => s.kind === 'other' && !s.sum && Math.abs(s.f - (IF1 + df)) < 0.003);-      stages.push({ id: 'cf1', block: 'cf1', title: 'First 10.7 MHz filter', parts: 'FL501, R501 / R503', ax: AX2, y: [-120, -10], yUnit: 'dBm', out: { sig: within(cur.sig, AX2), nf: cur.nf },-        ghost: { sig: within(pin.sig, AX2) }, resp: { H: cer10, y: [-45, 5] },-        steps: mkSteps(pin, [{ name: 'FL501', title: 'FL501: the 10.7 MHz ceramic filter', kind: 'filter', H: cer10 }], cur),-        cap: 'The datasheet shape: 180 kHz wide at −3 dB, at most 470 kHz at −20 dB, 4 dB loss. ' + (fm ? 'FM’s ±75 kHz deviation fits; the neighbours 400 kHz away drop by about ' + mag(cer10(IF1 + 0.4) + 4) + '.' : 'For AM it is far too wide: stations within about ±90 kHz still pass. The 455 kHz filter does the AM channel selection later.') });--      // IF amplifier + second filter-      pin = cur;-      const H2 = (f) => 15 + cer10(f);-      cur = linear(cur, H2, -110 - 15);-      stages.push({ id: 'ifamp', block: 'ifamp', title: 'IF amplifier & second filter', parts: 'Q501, FL502', ax: AX2, y: [-120, -10], yUnit: 'dBm', out: { sig: within(cur.sig, AX2), nf: cur.nf },-        ghost: { sig: within(pin.sig, AX2) }, resp: { H: H2, y: [-30, 20] },-        steps: mkSteps(pin, [{ name: 'Q501 gain', title: '+15 dB from Q501', kind: 'gain', H: () => 15 }, { name: 'FL502', title: 'FL502: the same filter again', kind: 'filter', H: cer10 }], cur),-        cap: '+15 dB from Q501 (design note), then the same filter again. Two in cascade double the skirt: ' + (fm ? 'the station now at 9.785 MHz has lost ' + mag(2 * cer10(9.785)) + ' since the mixer.' : 'neighbours 100 kHz away are now ' + mag(2 * (cer10(IF1 + 0.1) + 4)) + ' down.') });--      // second mixer-      pin = cur;-      const G2 = 10;-      const mx = mixer(cur, LO2, false, G2, -105);-      const full = mx.sig.map((s) => Object.assign({}, s, { db: s.db + rc1(s.f, 1.06) }));-      mx.sig = full.filter((s) => !s.sum);-      const nf2 = mx.nf;-      const st2 = pin.sig.find((x) => x.kind === 'station');-      cur = { sig: mx.sig, nf: (f) => nf2(f) + rc1(f, 1.06) };-      const AX3 = fm ? { min: 0, max: 1.2, unit: 'kHz', ticks: [0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2] } : { min: 0.155, max: 0.755, unit: 'kHz', ticks: [0.2, 0.3, 0.4, 0.5, 0.6, 0.7] };-      const i2 = cur.sig.find((s) => s.id === 'fm2i');-      stages.push({ id: 'mix2', block: 'mix2', title: 'Second mixer', parts: 'Q502, crystal LO Q503 / Y501', ax: AX3, y: [-120, -10], yUnit: 'dBm', out: { sig: within(cur.sig, AX3), nf: cur.nf }, est: true,-        refs: [[IF2, '455 kHz']],-        inp: { sig: pin.sig, nf: pin.nf }, lo: LO2, map: '|f \u2212 10.240 MHz|', noBands: true,-        inAx: { min: 0, max: 24, unit: 'MHz', ticks: [0, 4, 8, 12, 16, 20, 24] },-        prod: { sig: products(full, st2 && st2.id), nf: (f) => nf2(f) + rc1(f, 1.06) },-        notes: { diff: '|f \u2212 10.24|: kept', sum: 'f + 10.24: rolled off by C511' },-        steps: [{ name: 'In', kind: 'in', title: 'going in: the 10.7 MHz IF, and the crystal at 10.240 MHz' },-          { name: '\u00d7 10.24 MHz', kind: 'mix', title: 'Q502 \u00d7 crystal: two copies, one down by 10.24 MHz, one up' },-          { name: 'Zoom', kind: 'out', title: 'the box below 1.2 MHz, magnified below' }],-        strip: 'Multiplying by the 10.240 MHz crystal makes two copies again: 10.695 − 10.240 = 0.455 MHz is kept, 10.695 + 10.240 = 20.935 MHz is rolled off. Conversion gain about +' + G2 + ' dB (estimate); C511 rolls off above 1 MHz.',-        cap: (fm && i2 ? 'The station 910 kHz away folds onto 455 kHz as well, but the two 10.7 MHz filters have already put it ' + mag(i2.db - (st(cur) ? st(cur).db : 0)) + ' below your station.' : 'Your station and its neighbours keep their spacing; only the centre frequency changes.') });--      if (fm) {-        // limiter (with its 480 kHz RC input filter)-        const rc = (f) => rc1(f, 0.482);-        const inp = cur.sig.map((s) => Object.assign({}, s, { db: s.db + rc(s.f) }));-        const inband = inp.filter((s) => Math.abs(s.f - IF2) < 0.12).sort((a, b) => b.db - a.db);-        const floorIn = cur.nf(IF2) + rc(IF2) + 10 * lg(180 / 10);-        const dom = inband[0] && inband[0].db > floorIn + 6 ? inband[0] : null;-        const AX4 = { min: 0, max: 2.5, unit: 'kHz', ticks: [0, 0.5, 1, 1.5, 2, 2.5] };-        const LOUT = 5;-        const out = [];-        const cRoll = (f) => rc1(f, 1.54);-        if (dom) {-          [1, 3, 5].forEach((k) => out.push(Object.assign({}, dom, { id: dom.id + (k > 1 ? ':h' + k : ''), f: dom.f * k, bw: dom.bw, harm: k > 1, db: LOUT - 20 * lg(k) + cRoll(dom.f * k) - cRoll(dom.f),-            label: k > 1 ? (k === 3 ? '3rd' : '5th') + ' harmonic from the clipping' : dom.label })));-          for (const s of inp) if (s !== dom && s.f > 0.05 && s.f < 1.0) { const v = LOUT + (s.db - dom.db) - 6; if (v > -80) out.push(Object.assign({}, s, { db: v })); }-        } else {-          out.push({ id: 'noise', label: 'Limited noise (no carrier)', kind: 'other', f: IF2, bw: 0.18, db: 0 });-        }-        const capt = dom && dom.kind !== 'station';-        const nfPre = cur.nf;-        const limIn = cur;-        // for the waveform view: levels at the limiter input, before its RC (dBV rms)-        const limTd = { carrier: !!dom, capt, fIF: dom ? dom.f : IF2, pre: dom ? dom.db - rc(dom.f) - 13 : null, noise: floorIn - rc(IF2) - 13 };-        cur = { sig: out, nf: (f) => Math.max(-80, dom ? nfPre(f) + rc(f) - dom.db + LOUT - 6 : -40) };-        stages.push({ id: 'lim', block: 'lim', title: 'Limiter', parts: 'R702 / C704, Q701, Q702', ax: AX4, y: [-80, 15], yUnit: 'dBV', out: cur, td: limTd,-          steps: mkSteps({ sig: limIn.sig.map((x) => offset(x, -13)), nf: (f) => limIn.nf(f) - 13 }, [{ name: 'RC 482 kHz', title: 'R702 and C704: a 482 kHz low-pass strips the last 10 MHz products', kind: 'filter', H: rc }, { name: 'Clip', title: 'Q701 and Q702: 66 dB of gain, then clipping. Constant amplitude, odd harmonics.', kind: 'convert', to: cur }], cur),-          strip: 'About 66 dB of gain, then hard clipping: the output sits at about +5 dBV whatever the input level. Amplitude is thrown away; only the frequency is kept.',-          cap: dom ? (capt ? 'The ' + dom.label.toLowerCase() + ' is stronger than your station, so it captures the limiter.' : 'Your station captures the limiter: weaker signals in the passband come out further down than they went in (the capture effect), and the clipping adds odd harmonics at 1.365 and 2.275 MHz.') + ' RSSI_FM taps stage 1, which already clips on noise alone, so it cannot rank stations.' : 'No carrier: the limiter clips the noise to full level, which is the hiss between stations.' });--        // squarer-        const AX5 = { min: 0, max: 3.5, unit: 'kHz', ticks: [0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5] };-        const sq = [];-        if (dom) [1, 3, 5, 7].forEach((k) => sq.push(Object.assign({}, dom, { id: dom.id + (k > 1 ? ':h' + k : ''), f: dom.f * k, bw: dom.bw, harm: k > 1, db: 6.3 - 20 * lg(k), label: k > 1 ? 'Harmonic ' + k : dom.label })));-        else sq.push({ id: 'noise', label: 'Random edges from noise', kind: 'other', f: IF2, bw: 0.25, db: 0 });-        const sqIn = cur;-        cur = { sig: sq, nf: () => -80 };-        stages.push({ id: 'sq', block: 'sq', title: 'Squarer', parts: 'Q703 → LIM_SQ, IF_CNT', ax: AX5, y: [-80, 15], yUnit: 'dBV', out: cur, td: limTd,-          steps: mkSteps(sqIn, [{ name: 'Switch', title: 'Q703 switches at 2.2 V: a clean 0 to 4.6 V square wave', kind: 'convert', to: cur }], cur),-          strip: 'Q703 switches at 2.2 V: a clean 0 to 4.6 V square wave (+6.3 dBV fundamental) with odd harmonics falling as 1/n. A divided copy, IF_CNT, goes to the MCU’s counter.',-          cap: 'The MCU counts these edges for AFC, seek and calibration. The detector only cares when the edges arrive.' });--        // pulse-count detector + de-emphasis: now in audio-        const AXA = { min: 0, max: 0.06, unit: 'kHz', ticks: [0, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06] };-        const k = 0.34 / 75 / Math.SQRT2;                    // volts rms per kHz of deviation-        const v = (devKHz) => 20 * lg(devKHz * k);-        const band = (id, label, kind, f1, f2, lev) => ({ id, label, kind, f: (f1 + f2) / 2, bw: f2 - f1, band: [f1, f2], lev, db: lev((f1 + f2) / 2) });-        const Lp = v(50) - 4;-        const mpx = dom ? [-          band(dom.id, (capt ? dom.label + ', now audio' : 'Your station’s audio') + ' (L+R)', dom.kind === 'station' ? 'station' : dom.kind, 0.00005, 0.015, (f) => Lp + prog(f) + preemph(f)),-          { id: 'pilot', label: '19 kHz stereo pilot', kind: 'sub', f: 0.019, bw: 0, db: v(7.5) },-          band('lmr', 'Stereo difference signal (L−R), 23 to 53 kHz', 'sub', 0.023, 0.053, (f) => Lp - 6 + prog(Math.abs(f - 0.038)) + preemph(Math.abs(f - 0.038))),-          band('rds', 'RDS data, 57 kHz', 'sub', 0.0546, 0.0594, (f) => v(2) - 3 * Math.pow((f - 0.057) / 0.0024, 2)),-        ] : [];-        const N0 = dom ? -95 : -45;-        const triNoise = (f) => N0 + 20 * lg(Math.max(f, 0.0003) / 0.001);-        const ghostA = { sig: mpx, nf: triNoise };-        cur = { sig: mpx.map((s) => shift(s, deemph)), nf: (f) => triNoise(f) + deemph(f) };-        stages.push({ id: 'pump', block: 'pump', title: 'Pulse-count detector & de-emphasis', parts: 'C714, D702, U701A', ax: AXA, y: [-110, 0], yUnit: 'dBV', out: cur, ghost: ghostA, td: { carrier: !!dom, N0 },-          steps: mkSteps(null, [{ name: 'f \u2192 V', title: 'The charge pump turns frequency into voltage: the broadcast\u2019s multiplex appears', kind: 'convert', to: ghostA }, { name: 'De-emphasis', title: 'R718 \u2225 C715: the 76.5 \u00b5s de-emphasis', kind: 'filter', H: deemph }], cur),-          resp: { H: deemph, y: [-40, 5] },-          cap: dom ? 'The charge pump turns frequency into voltage: out comes the broadcast’s whole multiplex (grey). R718 ∥ C715 is a 76.5 µs de-emphasis: it rolls off above 2.1 kHz, undoing the transmitter’s treble boost and flattening the noise, which leaves an FM detector rising with frequency.' : 'With no carrier the detector puts out loud noise that rises with frequency: the hiss.' });--        // audio filter-        const sk = (f) => sallenKey(f, 0.01576, 0.743);-        const pa = cur;-        cur = linear(cur, sk, -300);-        stages.push({ id: 'fmaud', block: 'fmaud', title: 'FM audio filter', parts: 'U701B Sallen-Key', ax: AXA, y: [-110, 0], yUnit: 'dBV', out: cur, ghost: pa, resp: { H: sk, y: [-40, 5] }, td: { carrier: !!dom, N0, pre: [deemph] },-          steps: mkSteps(pa, [{ name: 'Sallen-Key', title: 'U701B: a 15.8 kHz two-pole low-pass', kind: 'filter', H: sk }], cur),-          refs: [[0.024, 'half of 48 kHz']],-          cap: 'A 15.8 kHz two-pole low-pass (Q 0.74). The pilot drops only ' + mag(sk(0.019)) + ' and the stereo signal about ' + mag(sk(0.038)) + ': sampled at 48 kHz, everything right of the 24 kHz line would fold back into the audio. That was the first board’s “glitchy” sound.' });--        // ADC + DSP-        const AXD = { min: 0, max: 0.024, unit: 'kHz', ticks: [0, 0.004, 0.008, 0.012, 0.016, 0.02, 0.024] };-        const toFs = -1.3;-        const nfA = cur.nf;-        const pd = { sig: cur.sig.map((s) => offset(s, toFs)).filter((s) => (s.band ? s.band[0] : s.f) <= 0.024).map((s) => (s.band ? Object.assign({}, s, { band: [s.band[0], Math.min(s.band[1], 0.024)] }) : s)).concat(humTones()), nf: (f) => nfA(f) + toFs };-        const parts = dspParts(K, true);-        const dsp = runParts(pd, parts);-        const Hd = (f) => parts.reduce((a, p) => a + (p.H ? p.H(f) : 0), 0);-        cur = dsp;-        stages.push({ id: 'dsp', block: 'mcu', title: 'ADC & DSP, then USB', parts: 'STM32G0B1 firmware', ax: AXD, y: [-110, 0], yUnit: 'dBFS', out: { sig: cur.sig, nf: cur.nf }, ghost: pd, resp: { H: Hd, y: [-70, 15] }, td: { band: 'fm', carrier: !!dom, N0, pre: [deemph, sk], toFs },-          steps: mkSteps(pd, parts, cur),-          cap: 'Sampled at 192 kHz, a 32-tap FIR keeps 0 to 15 kHz and is 58 dB down by 30 kHz, so nothing folds when it decimates to 48 kHz.' + (K.c.notch ? ' A notch takes the pilot down 52 dB.' : ' The pilot notch is off, so the 19 kHz pilot reaches the PC.') + (K.c.hum ? ' The hum canceller removes the 1 kHz tone the DSP itself makes.' : ' The hum canceller is off: the 1 kHz tone from the DSP\u2019s own activity is in the audio at \u221239 dBFS.') + (K.c.mute ? ' Muted.' : ' What reaches the PC over USB is mono audio.') });-      } else {-        // AM: 455 kHz filter-        const AX5 = { min: 0.43, max: 0.48, unit: 'kHz', ticks: [0.43, 0.44, 0.45, 0.46, 0.47, 0.48] };-        const pin = cur;-        cur = linear(cur, cer455, -300);-        const nb = cur.sig.filter((s) => s.kind === 'other' && Math.abs(s.f - IF2) < 0.025);-        const amLater = S.mode === 'board' ? 'Nothing arrives here on the first board (see stage 8). Grey shows what the design expects.' : null;-        const amFault = S.mode === 'board' ? 'Nothing gets past this point. RSSI_AM stays at its 2.39 V rail even with a −40 dBm marker centred on 455 kHz; the fault is somewhere in FL601 → Q601/Q603 → Q605 → D601.' : null;-        stages.push({ id: 'amf', block: 'amf', title: '455 kHz AM filter', parts: 'FL601', ax: AX5, y: [-120, -10], yUnit: 'dBm', out: { sig: within(cur.sig, AX5), nf: cur.nf }, ghost: { sig: within(pin.sig, AX5) },-          resp: { H: cer455, y: [-55, 5] }, fault: amFault,-          steps: mkSteps({ sig: within(pin.sig, AX5), nf: pin.nf }, [{ name: 'FL601', title: 'FL601: \u00b14.5 kHz around 455 kHz', kind: 'filter', H: cer455 }], { sig: within(cur.sig, AX5), nf: cur.nf }),-          cap: 'The AM channel selection: ±4.5 kHz at −6 dB and 45 dB down by ±10 kHz (datasheet shape). ' + (nb.length ? 'Stations 10 kHz away lose ' + mag(cer455(IF2 + 0.01) + 6) + ' more than yours.' : '') });-        // AGC amplifiers-        const stIn = st(cur);-        const target = -30;-        const Gagc = stIn ? Math.max(-28, Math.min(51, target - (stIn.db - 13))) : 51;-        const pv = cur;-        cur = { sig: cur.sig.map((s) => offset(s, -13 + Gagc)), nf: (f) => pv.nf(f) - 13 + Gagc };-        const deadV = amFault ? { sig: [], nf: (f) => -100 } : null;-        stages.push({ id: 'vga', block: 'vga', title: 'AGC amplifiers', parts: 'Q601/Q602, Q603/Q604', ax: AX5, y: [-110, 0], yUnit: 'dBV', out: deadV || { sig: within(cur.sig, AX5), nf: cur.nf }, ghost: deadV ? { sig: within(cur.sig, AX5) } : null, fault: amLater,-          resp: { H: () => Gagc, y: [-30, 60] },-          steps: deadV ? null : mkSteps({ sig: within(pv.sig, AX5).map((x) => offset(x, -13)), nf: (f) => pv.nf(f) - 13 }, [{ name: 'AGC gain', title: 'The AGC sets the two pairs to ' + dB(Gagc), kind: 'gain', H: () => Gagc }], { sig: within(cur.sig, AX5), nf: cur.nf }),-          cap: 'Two differential pairs, each worth −14 to +26 dB depending on the tail current. The AGC loop sets them to ' + dB(Gagc) + ' here, so the carrier leaves at about −30 dBV however strong the station is.' });-        // post-amp + envelope detector: audio-        const AXA = { min: 0, max: 0.02, unit: 'kHz', ticks: [0, 0.004, 0.008, 0.012, 0.016, 0.02] };-        const detH = (f) => rc1(f, 1 / (2 * Math.PI * 22e-6) / 1e6);-        const audio = [];-        if (stIn) {-          audio.push({ id: stIn.id + ':dc', dc: true, label: 'Carrier, now DC (AGC holds it at 1 V)', kind: 'station', f: 0.0001, bw: 0, db: 0 });-          audio.push({ id: stIn.id, label: 'Your station’s audio (30 % modulation)', kind: 'station', f: 0.005, bw: 0.0099, band: [0.00005, 0.01], lev: (f) => -14 + prog(f), db: -14 + prog(0.005) });-          for (const s of nb) {-            const off = Math.abs(s.f - stIn.f);-            if (off > 0.003) audio.push({ id: s.id, label: 'Whistle: ' + s.label.toLowerCase() + '’s carrier beating with yours', kind: 'other', f: off, bw: 0, db: s.db - stIn.db - 3 });-          }-        }-        const detRaw = { sig: audio, nf: () => -95 };-        // for the waveform view: the carrier, the neighbours' whistles (Hz offset, dB below the carrier), the fault-        const amTd = { carrier: !!stIn, fault: !!amFault, wh: stIn ? nb.filter((s) => Math.abs(s.f - stIn.f) > 0.003).map((s) => ({ f: Math.abs(s.f - stIn.f) * 1e6, rel: s.db - stIn.db - 3 })) : [] };-        cur = { sig: audio.map((s) => shift(s, detH)), nf: (f) => -95 + detH(f) };-        stages.push({ id: 'det', block: 'det', title: 'Post-amp & envelope detector', parts: 'Q605, D601, C612 / R619', ax: AXA, y: [-110, 10], yUnit: 'dBV', out: amFault ? { sig: [], nf: () => -95 } : cur, ghost: amFault ? cur : null, resp: { H: detH, y: [-20, 5] }, fault: amLater, td: amTd,-          steps: amFault ? null : mkSteps(null, [{ name: 'Detect', title: 'D601 follows the envelope: the carrier becomes DC, the sidebands become audio', kind: 'convert', to: detRaw }, { name: 'RC 22 \u00b5s', title: 'C612 and R619: the detector\u2019s 22 \u00b5s time constant', kind: 'filter', H: detH }], cur),-          cap: 'The diode follows the peaks of the IF: the carrier becomes a DC level (which feeds the AGC) and the sidebands become the audio. Neighbours 10 kHz away become 10 kHz whistles. C612 / R619 (22 µs) start to roll off above 7.2 kHz.' });-        // AGC loop + 5 kHz filter-        const sk = (f) => sallenKey(f, 0.00495, 0.731);-        const pa = cur;-        cur = linear({ sig: cur.sig.filter((s) => !s.dc), nf: cur.nf }, sk, -300);-        stages.push({ id: 'agc', block: 'agc', title: 'AGC loop & 5 kHz audio filter', parts: 'U601A / U601B', ax: AXA, y: [-110, 10], yUnit: 'dBV', out: amFault ? { sig: [], nf: () => -95 } : cur, ghost: amFault ? cur : pa, resp: { H: sk, y: [-40, 5] }, fault: amLater, td: Object.assign({ pre: [detH] }, amTd),-          steps: amFault ? null : mkSteps(pa, [{ name: 'DC block', title: 'C616 blocks the DC, which goes to the AGC integrator instead', kind: 'convert', to: { sig: pa.sig.filter((x) => !x.dc), nf: pa.nf } }, { name: 'Sallen-Key', title: 'U601B: a 4.95 kHz two-pole low-pass', kind: 'filter', H: sk }], cur),-          cap: 'C616 blocks the DC (it goes to the AGC integrator instead), and a 4.95 kHz Sallen-Key low-pass trims the audio. The 10 kHz whistles drop another ' + mag(sk(0.01)) + '.' });-        // ADC + DSP-        const AXD = { min: 0, max: 0.024, unit: 'kHz', ticks: [0, 0.004, 0.008, 0.012, 0.016, 0.02, 0.024] };-        const nfB = cur.nf;-        const pd = { sig: cur.sig.map((s) => offset(s, -1.3)).concat(humTones()), nf: (f) => nfB(f) - 1.3 };-        const parts = dspParts(K, false);-        const dsp = runParts(pd, parts);-        const Hd = (f) => parts.reduce((a, p) => a + (p.H ? p.H(f) : 0), 0);-        stages.push({ id: 'dsp', block: 'mcu', title: 'ADC & DSP, then USB', parts: 'STM32G0B1 firmware', ax: AXD, y: [-110, 0], yUnit: 'dBFS', out: amFault ? { sig: [1, 2, 3].map((k) => ({ id: 'pick' + k, label: k + ' kHz pickup from the firmware\u2019s 1 ms activity (level not measured)', kind: 'other', f: k / 1000, bw: 0, db: -55 })), nf: () => -60 } : dsp, ghost: amFault ? dsp : pd, resp: { H: Hd, y: [-70, 15] }, td: Object.assign({ band: 'am', pre: [detH, sk], toFs: -1.3 }, amTd),-          steps: amFault ? null : mkSteps(pd, parts, dsp),-          fault: S.mode === 'board' ? 'Only noise (about \u221238 dBFS) and 1, 2 and 3 kHz pickup from the firmware\u2019s 1 ms activity reach the PC.' : null,-          cap: 'Sampled at 192 kHz and decimated to 48 kHz through the same 32-tap FIR, then the noise filter, the hum canceller and the gain.' + (K.c.mute ? ' Muted.' : ' What reaches the PC is the AM audio.') });-      }-    }-    return { P, stages, K };-  }--  // ---------------------------------------------------------------- rendering-  const esc = (s) => String(s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');-  // The small overview card or the big chart under a schematic, drawn at its real pixel width.-  // A mixer gets two spectra: before (IP, on its own axis) and after (SP), with connectors in between (MZ).-  function layout(opt, mix) {-    const big = !!(opt && opt.big);-    if (!big) {-      if (mix) return { W: 600, H: 316, L: 46, R: 590, IP: [26, 104], MZ: [124, 160], SP: [186, 284], tickDy: 15, step: 2, big: false };-      return { W: 600, H: 236, L: 46, R: 590, RP: [22, 74], SP: [100, 206], tickDy: 15, step: 2, big: false };-    }-    const W = Math.max(440, Math.round(opt.width || 760));-    if (mix) {-      const H = Math.round(Math.min(780, Math.max(600, W * 0.86)));-      const h = Math.round((H - 36 - 36 - 30 - 66 - 36) * 0.46);-      const IP = [36, 36 + h], MZ = [IP[1] + 30, IP[1] + 96];-      return { W, H, L: 64, R: W - 20, IP, MZ, SP: [MZ[1] + 36, H - 36], tickDy: 19, step: 1.5, big: true };-    }-    const H = Math.round(Math.min(560, Math.max(430, W * 0.62)));-    const rpTop = 34, rpH = Math.round((H - 110) * 0.27);-    return { W, H, L: 64, R: W - 20, RP: [rpTop, rpTop + rpH], SP: [rpTop + rpH + 54, H - 36], tickDy: 19, step: 1.5, big: true };-  }-  function niceStep(span, n) {-    const raw = span / n, p = Math.pow(10, Math.floor(lg(raw)));-    for (const m of [1, 2, 2.5, 5]) if (m * p >= raw) return m * p;-    return 10 * p;-  }-  // the axis for a zoom window opt.win = [min, max] (or the stage's own range), with ticks to suit the width-  function axisFor(stage, opt) {-    const base = stage.ax;-    if (!opt || (!opt.win && !opt.big)) return base;-    const [min, max] = opt.win || [base.min, base.max];-    const ax = { min, max, log: base.log, unit: base.unit, ticks: [] };-    const n = Math.max(4, Math.round(((opt.big ? opt.width || 760 : 600) - 90) / 105));-    if (base.log) {-      const span = lg(max) - lg(min);-      const mults = span > 2.2 ? [1, 3] : span > 1.1 ? [1, 2, 5] : span > 0.5 ? [1, 1.5, 2, 3, 5, 7] : null;-      if (mults) {-        for (let e = Math.floor(lg(min)) - 1; e <= Math.ceil(lg(max)); e++) for (const m of mults) { const t = +(m * Math.pow(10, e)).toPrecision(6); if (t >= min * 0.9999 && t <= max * 1.0001) ax.ticks.push(t); }-      } else {-        const st = niceStep(max - min, n);-        for (let t = Math.ceil(min / st) * st; t <= max * 1.0001; t += st) ax.ticks.push(+t.toPrecision(10));-      }-    } else {-      const st = niceStep(max - min, n);-      for (let t = Math.ceil(min / st - 1e-9) * st; t <= max + st * 1e-6; t += st) ax.ticks.push(+t.toPrecision(10));-    }-    return ax;-  }-  function scales(ax, lay) {-    const { L, R } = lay;-    if (ax.log) {-      const a = lg(ax.min), b = lg(ax.max);-      return { X: (f) => L + (lg(f) - a) / (b - a) * (R - L), F: (x) => Math.pow(10, a + (x - L) / (R - L) * (b - a)) };-    }-    return { X: (f) => L + (f - ax.min) / (ax.max - ax.min) * (R - L), F: (x) => ax.min + (x - L) / (R - L) * (ax.max - ax.min) };-  }-  const tickLabel = (t, ax) => (ax.unit === 'MHz' && t >= 1000 ? +(t / 1000).toFixed(3) + ' GHz' : String(+(ax.unit === 'kHz' ? t * 1000 : t).toFixed(3)));-  let uid = 0;--  // one spectrum panel: grid, x axis, noise, reference lines, ghost and signals, direct labels-  function panel(o, stage, c) {-    const { lay, ax, X, F, P, sigs, ghost, nf, refs, title, clip, labelsBig, mask } = c;-    const { L, R } = lay, yr = stage.y, tk = lay.big ? 4 : 3;-    const Y = (db) => P[1] - (Math.max(yr[0], Math.min(yr[1], db)) - yr[0]) / (yr[1] - yr[0]) * (P[1] - P[0]);-    o.push('<text class="pl" x="' + L + '" y="' + (P[0] - (lay.big ? 12 : 8)) + '">' + esc(title) + '</text>');-    const gstep = P[1] - P[0] < 90 ? 40 : 20;-    for (let g = Math.ceil(yr[0] / gstep) * gstep; g <= yr[1]; g += gstep) {-      o.push('<line class="grid" x1="' + L + '" x2="' + R + '" y1="' + Y(g) + '" y2="' + Y(g) + '"/><text class="tk" x="' + (L - 7) + '" y="' + (Y(g) + tk) + '" text-anchor="end">' + g + '</text>');-    }-    o.push('<line class="axis" x1="' + L + '" x2="' + R + '" y1="' + P[1] + '" y2="' + P[1] + '"/>');-    ax.ticks.forEach((t, i) => {-      const last = i === ax.ticks.length - 1, x = X(t), lbl = tickLabel(t, ax);-      if (x < L - 0.5 || x > R + 0.5) return;-      const an = last && x > R - 30 ? 'end' : 'middle';-      o.push('<line class="axis" x1="' + x + '" x2="' + x + '" y1="' + P[1] + '" y2="' + (P[1] + 4) + '"/><text class="tk" x="' + x + '" y="' + (P[1] + lay.tickDy) + '" text-anchor="' + an + '">' + lbl + (!/GHz/.test(lbl) && (last || (ax.unit === 'MHz' && ax.ticks[i + 1] >= 1000)) ? ' ' + ax.unit : '') + '</text>');-    });-    o.push('<g clip-path="url(#' + clip + ')">');-    // where the AM and FM broadcast bands are, on RF-scale charts-    const bandLabels = [];-    if (ax.unit === 'MHz' && !c.noBands) {-      for (const [a, b, name] of [[0.53, 1.7, 'AM band'], [87.5, 108, 'FM band']]) {-        if (b < ax.min || a > ax.max) continue;-        const x1 = X(Math.max(a, ax.min)), x2 = X(Math.min(b, ax.max));-        if (x2 - x1 < 12 || x2 - x1 > (R - L) * 0.9) continue;-        o.push('<rect class="bandmark" x="' + x1.toFixed(1) + '" y="' + P[0] + '" width="' + (x2 - x1).toFixed(1) + '" height="' + (P[1] - P[0]) + '"/>');-        bandLabels.push([(x1 + x2) / 2, name]);-      }-    }-    for (const [f, lab, cls] of refs || []) {-      if (f < ax.min || f > ax.max) continue;-      o.push('<line class="ref' + (cls ? ' ' + cls : '') + '" x1="' + X(f) + '" x2="' + X(f) + '" y1="' + P[0] + '" y2="' + P[1] + '"/><text class="refl' + (cls ? ' ' + cls : '') + '" x="' + (X(f) + 4) + '" y="' + (cls ? P[0] + (lay.big ? 12 : 9) : P[1] - 5) + '">' + esc(lab) + '</text>');-    }-    // the part being applied, laid over the spectrum: the shaded depth is how far the spectrum drops-    if (mask && mask.kind === 'filter') {-      const ppd = (P[1] - P[0]) / (yr[1] - yr[0]), pts = [];-      for (let x = L; x <= R + 0.01; x += lay.step) pts.push(x.toFixed(1) + ',' + (P[0] + Math.min(P[1] - P[0], Math.max(0, -mask.H(F(x))) * ppd)).toFixed(1));-      o.push('<g class="mask" style="opacity:' + mask.alpha.toFixed(2) + '"><path class="maskfill" d="M' + L + ',' + P[0] + 'L' + pts.join('L') + 'L' + R + ',' + P[0] + 'Z"/><path class="maskline" d="M' + pts.join('L') + '"/></g>');-    }-    let tr = [];-    // the continuous spectrum, as an analyser draws it: noise plus every signal, power-summed at each pixel.-    // A signal narrower than a few pixels is drawn a few pixels wide (the analyser's resolution bandwidth).-    const trace = (list, nfun) => {-      const comps = [];-      for (const s of list || []) {-        const op = s._op == null ? 1 : Math.max(0, s._op);-        if (op <= 0.001) continue;-        if (s.band) { if (s.band[1] >= ax.min && s.band[0] <= ax.max) comps.push({ s, op, b0: X(Math.max(s.band[0], ax.min)), b1: X(Math.min(s.band[1], ax.max)) }); continue; }-        if (s.f <= 0) continue;-        const xc = X(s.f), hw = Math.max(lay.big ? 3 : 2.5, s.bw ? Math.abs(X(s.f + s.bw / 2) - xc) : 0);-        if (xc + 8 * hw < L || xc - 8 * hw > R) continue;-        comps.push({ s, op, xc, hw });-      }-      const pts = [];-      for (let x = L; x <= R + 0.01; x += lay.step) {-        const f = F(x);-        const np = nfun ? Math.pow(10, nfun(f) / 10) : 1e-30;-        let tot = np, best = null, bp = 0;-        for (const c of comps) {-          let d;-          if (c.s.band) {-            const lev = (ff) => (c.s.lev ? c.s.lev(ff) : c.s.db);-            d = x < c.b0 ? lev(c.s.band[0]) - 3 - 10 * (c.b0 - x) : x > c.b1 ? lev(c.s.band[1]) - 3 - 10 * (x - c.b1) : lev(f);-          } else {-            const a = Math.abs(x - c.xc) / c.hw;-            if (a > 8) continue;-            d = c.s.db - (a <= 1 ? 3 * a * a : 3 + 30 * (a - 1));-          }-          const pw = Math.pow(10, d / 10) * c.op;-          tot += pw;-          if (pw > bp) { bp = pw; best = c.s; }-        }-        pts.push([x, Y(10 * lg(tot)), bp > np && bp > 0.2 * tot ? best : null]);-      }-      return pts;-    };-    const line = (pts) => 'M' + pts.map((p) => p[0].toFixed(1) + ',' + p[1].toFixed(1)).join('L');-    if (ghost && ghost.length) o.push('<path class="gtrace" d="' + line(trace(ghost, c.ghostNf || nf)) + '"/>');-    tr = trace(sigs, nf);-    if (tr.length) {-      o.push('<path class="tfill" d="M' + L + ',' + P[1] + 'L' + line(tr).slice(1) + 'L' + R + ',' + P[1] + 'Z"/>');-      o.push('<path class="tline" d="' + line(tr) + '"/>');-      // colour each stretch by the signal that dominates it-      let run = [], who = null;-      const flush = () => {-        if (who && run.length > 1) o.push('<g class="sg k-' + who.kind + '" data-sid="' + esc(who.id.split(':')[0]) + '"><path class="line" d="' + line(run) + '"/></g>');-        run = []; who = null;-      };-      for (let i = 0; i < tr.length; i++) {-        const p = tr[i];-        if (p[2] !== who) { const prev = tr[i - 1]; flush(); who = p[2]; if (who && prev) run.push(prev); }-        if (who) run.push(p);-      }-      flush();-      // a dot on top of your station's peak-      for (const s of sigs || []) {-        if (s.kind !== 'station' || s.harm || s.band || s.dc || s.f < ax.min || s.f > ax.max || s.db < yr[0] + 10 || (s._op != null && s._op < 0.5)) continue;-        o.push('<g class="sg k-station" data-sid="' + esc(s.id.split(':')[0]) + '"><circle class="cap" cx="' + X(s.f).toFixed(1) + '" cy="' + Y(s.db).toFixed(1) + '" r="' + (lay.big ? 4.5 : 3.5) + '"/></g>');-      }-    }-    const order = { other: 0, mark: 1, sub: 1, image: 2, station: 3 };-    const sorted = (sigs || []).slice().sort((a, b) => (order[a.kind] || 0) - (order[b.kind] || 0));-    o.push('</g>');-    for (const [x, name] of bandLabels) o.push('<text class="bandlbl" x="' + x.toFixed(1) + '" y="' + (P[0] + (lay.big ? 13 : 10)) + '" text-anchor="middle">' + name + '</text>');-    // direct labels: your station and the image (the big chart also names the other strong signals)-    const lab = [];-    const vis = (s) => (s.band ? s.band[1] >= ax.min && s.band[0] <= ax.max : s.f >= ax.min && s.f <= ax.max && s.db >= yr[0] + 10);-    const stS = sorted.filter((s) => s.kind === 'station' && !s.harm && !s.dc && vis(s)).sort((a, b) => b.db - a.db)[0];-    const imS = sorted.filter((s) => s.kind === 'image' && vis(s)).sort((a, b) => b.db - a.db)[0];-    const put = (s, text, side, cls) => {-      if (!s) return;-      const xc = s.band ? (Math.max(s.band[0], ax.min) + Math.min(s.band[1], ax.max)) / 2 : s.f;-      const x = X(xc);-      let yv = Y(s.lev ? s.lev(xc) : s.db);-      for (const p of tr) if (Math.abs(p[0] - x) <= 6 && p[1] < yv) yv = p[1];-      if (side) {-        o.push('<text class="dl' + (cls || '') + '" x="' + (x + 9) + '" y="' + Math.min(P[1] - 5, Math.max(P[0] + 10, yv + 4)) + '" text-anchor="start">' + esc(text) + '</text>');-        return;-      }-      let y = yv - (lay.big ? 11 : 9);-      // a band name already sits there: put the label beside the peak instead-      const by = P[0] + (lay.big ? 13 : 10);-      if (!cls && bandLabels.some(([bx, n]) => Math.abs(bx - x) < (n.length + text.length) * (lay.big ? 3.6 : 3) && Math.abs(Math.max(P[0] + 10, y) - by) < 13)) {-        o.push('<text class="dl" x="' + (x + 9) + '" y="' + Math.min(P[1] - 5, Math.max(by + 14, yv + 10)) + '" text-anchor="start">' + esc(text) + '</text>');-        return;-      }-      for (const p of lab) if (Math.abs(p[0] - x) < (lay.big ? 90 : 70) && Math.abs(p[1] - y) < (lay.big ? 15 : 12)) y = p[1] - (lay.big ? 16 : 13);-      lab.push([x, y]);-      const hw = text.length * (lay.big ? 3.4 : 2.8);-      const an = x < L + 50 ? 'start' : x > R - 50 ? 'end' : 'middle', xt = an === 'middle' ? Math.max(L + hw, Math.min(R - hw, x)) : x;-      o.push('<text class="dl' + (cls || '') + '" x="' + xt.toFixed(1) + '" y="' + Math.max(P[0] + 10, y) + '" text-anchor="' + an + '">' + esc(text) + '</text>');-    };-    if (!c.noStation) put(stS, stS && stS.band ? 'audio' : 'your station');-    // notes the caller pins to a frequency (the mixer's two copies)-    for (const [f, text, db] of c.notes || []) { if (f >= ax.min && f <= ax.max) put({ f, db, kind: 'note' }, text); }-    if (mask) {-      const txt = mask.kind === 'gain' ? mask.label + ': every signal moves up ' + (mask.H(0) >= 0 ? '+' : '\u2212') + Math.abs(mask.H(0)).toFixed(0) + ' dB'-        : mask.label + ': the shaded depth is how far the spectrum drops';-      o.push('<text class="masklabel" x="' + (L + 8) + '" y="' + (P[0] + (bandLabels.length ? (lay.big ? 34 : 26) : lay.big ? 16 : 12)) + '" style="opacity:' + mask.alpha.toFixed(2) + '">' + (mask.kind === 'gain' ? '\u2191 ' : '') + esc(txt) + '</text>');-    }-    put(imS, 'image', !!(stS && imS && Math.abs(X(stS.f) - X(imS.f)) < 30));-    if (labelsBig && lay.big) {-      const others = sorted.filter((s) => s !== stS && s !== imS && vis(s) && !s.sum && (s.kind === 'sub' || s.kind === 'other' || s.harm)).sort((a, b) => b.db - a.db).slice(0, 4);-      for (const s of others) {-        const x = X(s.band ? (Math.max(s.band[0], ax.min) + Math.min(s.band[1], ax.max)) / 2 : s.f);-        if (lab.some((p) => Math.abs(p[0] - x) < 110)) continue;-        put(s, s.label.length > 34 ? s.label.slice(0, 32) + '…' : s.label, false, ' minor');-      }-    }-  }--  const ease = (t) => (t <= 0 ? 0 : t >= 1 ? 1 : t * t * (3 - 2 * t));-  // between two spectra: matching signals move, new ones fade in, vanished ones fade out-  function lerpSigs(from, to, e) {-    const fm = new Map((from || []).map((x) => [x.id, x]));-    const out = [];-    for (const b of to || []) {-      const a = fm.get(b.id);-      if (!a) { out.push(Object.assign({}, b, { _op: e })); continue; }-      fm.delete(b.id);-      const o = Object.assign({}, b, { db: a.db + (b.db - a.db) * e });-      if (b.lev || a.lev) o.lev = ((la, lb) => (f) => la(f) + (lb(f) - la(f)) * e)(a.lev || (() => a.db), b.lev || (() => b.db));-      out.push(o);-    }-    for (const a of fm.values()) out.push(Object.assign({}, a, { _op: 1 - e }));-    return out;-  }-  // what to draw: the finished stage, or one step of its animation (opt.anim = { k, t })-  function viewOf(stage, opt) {-    const base = { sig: stage.out.sig, nf: stage.out.nf, ghost: stage.ghost && stage.ghost.sig, ghostNf: stage.ghost && stage.ghost.nf, mask: null, resp: stage.resp, step: null, mixT: 1 };-    const A = opt && opt.anim;-    if (!A || !stage.steps || !stage.steps[A.k]) return base;-    const step = stage.steps[A.k], t = A.t;-    if (stage.inp) {-      if (step.kind === 'in') return Object.assign(base, { mixT: 0, step });-      if (step.kind === 'mix') return Object.assign(base, { mixT: ease(t / 0.9), step });-      return Object.assign(base, { step });-    }-    if (step.kind === 'in') return { sig: step.to.sig, nf: step.to.nf, ghost: null, mask: null, resp: null, step, mixT: 1 };-    if (step.kind === 'filter' || step.kind === 'gain') {-      const e = ease((t - 0.35) / 0.45), fr = step.from, to = step.to;-      return { sig: lerpSigs(fr.sig, to.sig, e), nf: (f) => fr.nf(f) + (to.nf(f) - fr.nf(f)) * e, ghost: fr.sig, ghostNf: fr.nf, step, mixT: 1,-        mask: { H: step.H, alpha: Math.min(1, t / 0.3), kind: step.kind, label: step.name }, resp: { H: step.H, y: stage.resp ? stage.resp.y : [-60, 20] } };-    }-    const e = ease(t / 0.8), fr = step.from || { sig: [], nf: () => -300 }, to = step.to;-    return { sig: lerpSigs(fr.sig, to.sig, e), nf: (f) => fr.nf(f) + (to.nf(f) - fr.nf(f)) * e, ghost: null, mask: null, resp: null, step, mixT: 1 };-  }-  // the wide axis of a mixer's top panel, with ticks to suit the width-  function wideAx(stage, lay) {-    const b = stage.inAx;-    if (!lay.big) return b;-    const st = niceStep(b.max - b.min, Math.max(4, Math.round((lay.W - 90) / 95))), ticks = [];-    for (let t = Math.ceil(b.min / st) * st; t <= b.max + 1e-9; t += st) ticks.push(+t.toFixed(6));-    return Object.assign({}, b, { ticks });-  }-  // the mixer's copies part-way (e = 0 \u2192 1): the sum copy moves up by e\u00b7LO, the difference copy down, folding back at 0 Hz-  const moved = (stage, e) => stage.prod.sig.map((p) => {-    if (p.from == null) return p;-    const f = p.sum ? p.from + stage.lo * e : Math.abs(p.from - stage.lo * e);-    return Object.assign({}, p, { f, db: p.db0 - 3 + (p.db - p.db0 + 3) * e });-  });-  function render(stage, idx, opt) {-    const mix = !!stage.inp;-    const lay = layout(opt, mix), ax = axisFor(stage, opt), { X, F } = scales(ax, lay);-    const { W, H, L, R, SP } = lay;-    const V = viewOf(stage, opt);-    const clip = 'sc' + (++uid);-    const o = [];-    o.push('<svg class="stg' + (lay.big ? ' big' : '') + (mix ? ' mixer' : '') + '" viewBox="0 0 ' + W + ' ' + H + '"' + (lay.big ? ' width="' + W + '" height="' + H + '"' : '') + ' role="img" aria-label="' + esc(stage.title + (mix ? ': spectrum before and after the mixer' : ': spectrum after this stage')) + '" data-stage="' + esc(stage.id) + '">');-    o.push('<defs><clipPath id="' + clip + '"><rect x="' + L + '" y="0" width="' + (R - L) + '" height="' + H + '"/></clipPath></defs>');-    const tk = lay.big ? 4 : 3;-    let mixSig = null, mixNf = null;-    if (mix) {-      // the whole picture on one wide axis: what goes in, the LO, and the two copies the multiplication makes.-      // While it plays, every copy slides from its input frequency: down by the LO (folding back at 0 Hz) or up by it.-      const wax = wideAx(stage, lay), sw = scales(wax, lay), e = V.mixT;-      const sigs = e > 0 ? moved(stage, e) : stage.inp.sig;-      const nfW = e <= 0 ? stage.inp.nf : e >= 1 ? stage.prod.nf : (f) => stage.inp.nf(f) + (stage.prod.nf(f) - stage.inp.nf(f)) * e;-      const notes = [];-      if (e >= 1) {-        const d = stage.prod.sig.find((x) => x.kind === 'station' && !x.sum), u = stage.prod.sig.find((x) => x.kind === 'station' && x.sum);-        if (d) notes.push([d.f, stage.notes.diff, d.db]);-        if (u) notes.push([u.f, stage.notes.sum, u.db]);-      }-      const fit = (t) => { const n = Math.floor((R - L) / (lay.big ? 7.6 : 6.1)); return t.length > n ? t.slice(0, n - 1) + '\u2026' : t; };-      const title = fit(V.step ? 'Step ' + (stage.steps.indexOf(V.step) + 1) + ': ' + V.step.title-        : 'Everything the mixer makes (' + stage.yUnit + '): the input, copied down and up by the LO');-      panel(o, stage, { lay, ax: wax, X: sw.X, F: sw.F, P: lay.IP, sigs, ghost: e > 0 ? stage.inp.sig : null, ghostNf: stage.inp.nf, nf: nfW,-        refs: [[stage.lo, 'LO ' + fmtF(stage.lo), 'lo']], clip, labelsBig: false, noStation: e > 0, notes, noBands: stage.noBands, title });-      // the part the bottom panel magnifies, and the two lines that say so-      let x1 = sw.X(Math.max(ax.min, wax.min)), x2 = sw.X(Math.min(ax.max, wax.max));-      if (x2 - x1 < 5) { const xc = (x1 + x2) / 2; x1 = xc - 2.5; x2 = xc + 2.5; }-      const IP = lay.IP, yt = SP[0] - (lay.big ? 30 : 22), yd = IP[1] + lay.tickDy + 6;-      o.push('<g class="zoom"><rect class="zoombox" x="' + x1.toFixed(1) + '" y="' + IP[0] + '" width="' + (x2 - x1).toFixed(1) + '" height="' + (IP[1] - IP[0]) + '"/>' +-        '<path class="zoomline" d="M' + x1.toFixed(1) + ',' + IP[1] + 'V' + yd + 'L' + L + ',' + yt + 'M' + x2.toFixed(1) + ',' + IP[1] + 'V' + yd + 'L' + R + ',' + yt + '"/></g>');-      if (e < 1) { mixSig = moved(stage, e); mixNf = (f) => stage.inp.nf(f) + (stage.out.nf(f) - stage.inp.nf(f)) * e; }-    } else if (V.resp) {-      const RP = lay.RP, ry = V.resp.y, RY = (g) => RP[1] - (Math.max(ry[0], Math.min(ry[1], g)) - ry[0]) / (ry[1] - ry[0]) * (RP[1] - RP[0]);-      o.push('<text class="pl" x="' + L + '" y="' + (RP[0] - (lay.big ? 12 : 8)) + '">' + (V.step ? 'This step applies: ' + esc(V.step.title) + ' (dB)' : 'What this stage applies: gain (dB)') + '</text>');-      const rt = [ry[0], 0, ry[1]].filter((v, k, a) => a.indexOf(v) === k && v >= ry[0] && v <= ry[1] && (v === 0 || ry[0] > 0 || ry[1] < 0 || Math.abs(RY(v) - RY(0)) >= 12));-      for (const g of rt) {-        o.push('<line class="grid' + (g === 0 ? ' zero' : '') + '" x1="' + L + '" x2="' + R + '" y1="' + RY(g) + '" y2="' + RY(g) + '"/><text class="tk" x="' + (L - 7) + '" y="' + (RY(g) + tk) + '" text-anchor="end">' + (g > 0 ? '+' : '') + g + '</text>');-      }-      const pts = [];-      for (let x = L; x <= R + 0.01; x += lay.step) pts.push([x, RY(V.resp.H(F(x)))]);-      o.push('<g clip-path="url(#' + clip + ')"><path class="rarea" d="M' + L + ',' + RP[1] + 'L' + pts.map((p) => p[0].toFixed(1) + ',' + p[1].toFixed(1)).join('L') + 'L' + R + ',' + RP[1] + 'Z"/>');-      o.push('<path class="rline" d="M' + pts.map((p) => p[0].toFixed(1) + ',' + p[1].toFixed(1)).join('L') + '"/></g>');-    } else if (V.step || stage.strip) {-      const RP = lay.RP;-      o.push('<foreignObject x="' + L + '" y="' + (RP[0] - (lay.big ? 20 : 16)) + '" width="' + (R - L) + '" height="' + (RP[1] - RP[0] + (lay.big ? 30 : 22)) + '"><div xmlns="http://www.w3.org/1999/xhtml" class="strip' + (V.step ? ' stepnow' : '') + '">' + esc(V.step ? V.step.title : stage.strip) + '</div></foreignObject>');-    }-    panel(o, stage, { lay, ax, X, F, P: SP, sigs: mixSig || V.sig, ghost: V.ghost, ghostNf: V.ghostNf, nf: mixNf || V.nf, refs: stage.refs, clip, labelsBig: !V.step, mask: V.mask,-      title: mix ? 'Magnified: signal out around the IF (' + stage.yUnit + ')' : 'Signal out (' + stage.yUnit + ')' });-    const top = mix ? lay.IP[0] : lay.RP[0];-    o.push('<line class="xhair" x1="0" x2="0" y1="' + top + '" y2="' + SP[1] + '" visibility="hidden"/>');-    o.push('<rect class="hov" x="' + L + '" y="' + (top - 6) + '" width="' + (R - L) + '" height="' + (SP[1] - top + 12) + '" data-i="' + idx + '"/>');-    o.push('</svg>');-    return o.join('');-  }-  // nearest signal to a pointer (viewBox units). On a mixer, y picks the panel: above the connectors is the input.-  function pick(stage, x, opt, y) {-    const mix = !!stage.inp;-    const lay = layout(opt, mix);-    const inPanel = mix && y != null && y < lay.MZ[0] + (lay.MZ[1] - lay.MZ[0]) / 2;-    const ax = inPanel ? wideAx(stage, lay) : axisFor(stage, opt), { X, F } = scales(ax, lay);-    const list = inPanel ? stage.prod.sig : stage.out.sig;-    const lim = lay.big ? 22 : 18;-    const cand = [];-    for (const s of list || []) {-      if (!s.band && (s.db < stage.y[0] || s.f < ax.min || s.f > ax.max)) continue;-      const xc = s.band ? Math.min(Math.max(x, X(s.band[0])), X(s.band[1])) : X(s.f);-      const d = Math.abs(xc - x);-      if (d < lim) cand.push({ s, d, x: s.band ? x : xc });-    }-    cand.sort((a, b) => a.d - b.d);-    // signals within 3 px of the nearest one share the spot: the strongest leads, the rest are listed-    const near = cand.filter((c) => cand.length && c.d - cand[0].d < 3).sort((a, b) => b.s.db - a.s.db);-    const best = near[0] || null;-    const f = best ? (best.s.band ? F(x) : best.s.f) : F(x);-    const val = best ? (best.s.lev ? best.s.lev(f) : best.s.db) : null;-    const to = null;-    const nfun = inPanel ? stage.prod.nf : stage.out.nf;-    return { sig: best && best.s, also: near.slice(1).map((c) => c.s), val, x: best ? best.x : x, f, to, panel: inPanel ? 'in' : 'out', unit: ax.unit,-      y1: inPanel ? lay.IP[0] : mix ? lay.SP[0] : (lay.RP ? lay.RP[0] : lay.SP[0]), y2: inPanel ? lay.IP[1] : lay.SP[1],-      gain: !inPanel && stage.resp ? stage.resp.H(f) : null, floor: nfun ? nfun(f) : null };-  }-  // frequency at a viewBox x on the output axis (for zoom and pan)-  function fAt(stage, opt, x) { const lay = layout(opt, !!stage.inp); return scales(axisFor(stage, opt), lay).F(Math.max(lay.L, Math.min(lay.R, x))); }-  const layoutOf = (stage, opt) => layout(opt, !!stage.inp);-  return { build, render, pick, fAt, layout: layoutOf, fmtF, plan, IF1, control, vco, tankF, pwmV, dacV, CTL0,-    resp: { fmLeg, amLeg, tank, cer10, cer455, rc1, sallenKey, deemph, fir, notch19 } };-})();-if (typeof module === 'object' && module.exports) module.exports = SPECTRUM;--// Waveform view ("scope") for the stages after the last IF filter: what an oscilloscope on that node would show.-// The audio stages are built from the same signals the spectra use (programme tones, the 19 kHz pilot, the-// L−R stereo signal, RDS, noise), and each step applies the stage's own response H(f) to them, so the-// waveform and the spectrum always agree. The limiter and squarer are drawn at the real 455 kHz IF; where a-// window holds too many cycles to draw (the detector's input), the panel says how it is drawn.-var SCOPE = (function () {-  const TAU = 2 * Math.PI;-  const lg = (x) => Math.log10(Math.max(x, 1e-30));-  const db2a = (db) => Math.pow(10, db / 20);-  const ease = (t) => (t <= 0 ? 0 : t >= 1 ? 1 : t * t * (3 - 2 * t));-  const esc = (s) => String(s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');-  const rc1 = (fMHz, fcMHz) => -10 * lg(1 + Math.pow(fMHz / fcMHz, 2));-  const IDS = { fm: ['lim', 'sq', 'pump', 'fmaud', 'dsp'], am: ['det', 'agc', 'dsp'] };-  const has = (st) => !!(st && st.td && (IDS.fm.indexOf(st.id) >= 0 || IDS.am.indexOf(st.id) >= 0));--  // deterministic noise: the same picture every time-  function rng(seed) { let s = seed >>> 0 || 1; return () => { s ^= s << 13; s >>>= 0; s ^= s >>> 17; s ^= s << 5; s >>>= 0; return s / 4294967296; }; }--  // ------------------------------------------------------------------ signals as lists of tones-  // a tone: f in Hz, a = peak amplitude, ph = phase. Responses H take MHz, as in spectrum.js.-  const tone = (f, a, ph, kind) => ({ f, a, ph: ph || 0, kind: kind || 'station' });-  const sumAt = (cs, t) => { let v = 0; for (const c of cs) v += c.a * Math.cos(TAU * c.f * t + c.ph); return v; };-  const scaleBy = (cs, H, e) => cs.map((c) => Object.assign({}, c, { a: c.a * db2a(H(c.f / 1e6) * e) }));-  const times = (cs, k) => cs.map((c) => Object.assign({}, c, { a: c.a * k }));-  const chain = (cs, Hs) => (Hs || []).reduce((acc, H) => scaleBy(acc, H, 1), cs);-  // noise: many tones of random phase with a given spectral shape, scaled to an rms-  function noise(seed, f0, f1, n, shape, rms) {-    const r = rng(seed), cs = [];-    for (let i = 0; i < n; i++) { const f = f0 + (f1 - f0) * (i + r()) / n; cs.push(tone(f, shape(f), TAU * r(), 'noise')); }-    const p = cs.reduce((s, c) => s + c.a * c.a / 2, 0);-    return times(cs, rms / Math.sqrt(p || 1));-  }--  // the programme: a chord, the part that differs between left and right, normalised to a peak of 1-  const PROG = [[523.25, 1, 0.3], [784, 0.6, 1.1], [1568, 0.35, 2.0], [3136, 0.2, 0.7], [6272, 0.1, 2.6]];-  const PROG2 = [[659.3, 1, 0.9], [1975.5, 0.5, 2.2]];-  const PSUM = PROG.reduce((s, p) => s + p[1], 0), PSUM2 = PROG2.reduce((s, p) => s + p[1], 0);-  const prog = (peak, set, sum) => set.map(([f, a, ph]) => tone(f, peak * a / sum, ph));--  // FM: the multiplex out of the pulse-count detector, volts around FM_DEMOD's DC (1.8 V).-  // FM_DEMOD = VREF_FM − I·51k: more cycles per second, more current, a LOWER voltage (the integrator inverts).-  const K_FM = 0.34 / 75;                     // volts peak per kHz of deviation (as spectrum.js)-  const preemph = (fHz) => 10 * lg(1 + Math.pow(fHz * TAU * 76.5e-6, 2));  // the transmitter's 76.5 µs boost (dB)-  function fmMpx(td) {-    if (!td.carrier) return fmNoise(td);-    const cs = [];-    for (const c of prog(45, PROG, PSUM)) cs.push(tone(c.f, -K_FM * c.a * db2a(preemph(c.f)), c.ph));                // L+R-    cs.push(tone(19000, -K_FM * 7.5, 0.4, 'sub'));                                                                        // pilot-    for (const c of prog(14, PROG2, PSUM2)) {                                                                             // L−R on 38 kHz-      const a = -K_FM * c.a * db2a(preemph(c.f)) / 2;-      cs.push(tone(38000 - c.f, a, -c.ph + 0.8, 'sub'), tone(38000 + c.f, a, c.ph + 0.8, 'sub'));-    }-    cs.push(tone(57000 - 1187.5, -K_FM * 1, 1.3, 'sub'), tone(57000 + 1187.5, -K_FM * 1, 2.9, 'sub'));                    // RDS-    return cs.concat(fmNoise(td));-  }-  // the detector's noise rises with frequency (the FM triangle); spectrum.js puts it at N0 + 20·log(f / 1 kHz) per kHz-  function fmNoise(td) {-    let p = 0;-    for (let k = 1; k <= 60; k++) p += Math.pow(10, (td.N0 + 20 * lg(k)) / 10);-    return noise(7, 300, 60000, 120, (f) => f, Math.sqrt(p));-  }-  // AM: the audio on the detector output, volts around its 1.0 V DC: 30 % modulation, plus the neighbours' whistles-  function amAudio(td) {-    if (!td.carrier) return [];-    return prog(0.3, PROG.slice(0, 4), PSUM - 0.1).concat((td.wh || []).map((w, i) => tone(w.f, db2a(w.rel), 0.7 + i, 'other')));-  }--  // ------------------------------------------------------------------ where each step is-  // opt.anim = {k, t}: steps before k are applied, step k is part-way (e), later ones not yet. No anim: all applied.-  function progress(stage, opt) {-    const A = opt && opt.anim, steps = stage.steps || [];-    if (!A || !steps[A.k]) return { e: steps.map(() => 1), step: null, k: steps.length };-    const step = steps[A.k];-    const cur = step.kind === 'filter' || step.kind === 'gain' ? ease((A.t - 0.35) / 0.45) : step.kind === 'in' ? 1 : ease(A.t / 0.8);-    return { e: steps.map((_, j) => (j < A.k ? 1 : j === A.k ? cur : 0)), step, k: A.k };-  }-  const idxOf = (stage, kind, name) => (stage.steps || []).findIndex((s) => s.kind === kind && (!name || s.name === name));--  // ------------------------------------------------------------------ the stages-  // Each returns { T: window (s), unit, panels: [...], note }. A panel: { title, y: [lo, hi], unit, ticks?, refs, traces, label }.-  // A trace: { kind: 'line' | 'band' | 'dots' | 'pulses', t: [...], v: [...] (band: lo, hi), cls, upto }.-  function grid(T, n) { const t = new Float64Array(n); for (let i = 0; i < n; i++) t[i] = T * i / (n - 1); return t; }-  const sample = (t, fn) => Array.from(t, fn);--  // the IF at the limiter: the station, its noise, and what is left of the 10 MHz products before the RC-  function limInput(td) {-    const f = td.fIF * 1e6 + 30e3;            // the IF right now: 30 kHz of deviation at this instant-    const A = td.carrier ? Math.SQRT2 * db2a(td.pre) : 0;-    const N = db2a(td.noise);                // rms-    const cs = (td.carrier ? [tone(f, A, 0.2)] : []).concat(noise(11, 0.455e6 - 90e3, 0.455e6 + 90e3, 40, () => 1, N));-    const ref = td.carrier ? A : 2 * N;-    cs.push(tone(10.695e6, 0.6 * ref, 1.0, 'other'), tone(20.935e6, 0.4 * ref, 2.1, 'other'));-    return cs;-  }-  // the limiter: 66 dB of gain into Q702, which clips between saturation (0.7 V) and cut-off (4.9 V); C710 rounds the edges-  function limOut(x, G, dt) {-    const out = new Array(x.length);-    let y = null;-    const k = dt / 103e-9;-    for (let i = 0; i < x.length; i++) {-      const u = -G * x[i];-      const v = 2.6 + (u > 0 ? 2.3 * Math.tanh(u / 2.3) : 1.9 * Math.tanh(u / 1.9));-      y = y == null ? v : y + Math.min(1, k) * (v - y);-      out[i] = y;-    }-    return out;-  }-  function S_lim(stage, opt, n) {-    const td = stage.td, P = progress(stage, opt), T = 20e-6, t = grid(T, n * 4), dt = T / (t.length - 1);-    const iRc = idxOf(stage, 'filter'), iClip = idxOf(stage, 'convert');-    const cs0 = limInput(td);-    const raw = sample(t, (x) => sumAt(cs0, x));-    const filtered = scaleBy(cs0, (f) => rc1(f, 0.482), 1);-    const csNow = scaleBy(cs0, (f) => rc1(f, 0.482), iRc >= 0 ? P.e[iRc] : 1);-    const xin = sample(t, (x) => sumAt(csNow, x));-    const xf = iRc >= 0 && P.e[iRc] < 1 ? sample(t, (x) => sumAt(filtered, x)) : xin;-    const ec = iClip >= 0 ? P.e[iClip] : 1;-    const G = Math.pow(10, 66 / 20 * ec);-    const span = Math.max(...raw.map(Math.abs)) * 1.15;-    const mv = span < 0.5;-    const s = mv ? 1000 : 1;-    const out = ec > 0 ? limOut(xf, G, dt) : null;-    const panels = [-      { title: 'In: the IF on R702 / C704 (' + (mv ? 'mV' : 'V') + ')' + (P.k === 0 && P.step ? ', with the 10.7 and 20.9 MHz products still on it' : ''),-        y: [-span * s, span * s], unit: mv ? 'mV' : 'V',-        traces: [{ kind: 'line', t, v: xin.map((v) => v * s), cls: 'tr' }] },-      { title: 'Out: Q702 collector, LIM2_C (V)', y: [0, 5.2], unit: 'V',-        refs: [[4.9, 'cut off: V_IF4, 4.9 V'], [2.6, ec > 0 ? '' : 'at rest: 2.6 V'], [0.7, 'saturated: 0.7 V']],-        traces: out ? [{ kind: 'line', t, v: out, cls: 'tr' }] : [{ kind: 'line', t: [0, T], v: [2.6, 2.6], cls: 'tr faint' }],-        label: ec > 0 ? 'gain ×' + Math.round(G).toLocaleString('en-US') + ' (+' + (20 * lg(G)).toFixed(0) + ' dB)' : '' },-    ];-    const note = td.carrier ? (td.capt ? 'A stronger neighbour has captured the limiter: this is its IF.' : '') : 'No carrier: the limiter clips the noise itself, so it comes out at full level. That is the hiss between stations.';-    return { T, unit: 'µs', panels, note };-  }-  function S_sq(stage, opt, n) {-    const td = stage.td, P = progress(stage, opt), T = 20e-6, t = grid(T, n * 3), dt = T / (t.length - 1);-    const cs = scaleBy(limInput(td), (f) => rc1(f, 0.482), 1);-    const lim = limOut(sample(t, (x) => sumAt(cs, x)), Math.pow(10, 66 / 20), dt);-    // Q703: on above about 2.2 V, pulling LIM_SQ to 0.1 V; off, R715 and R716 + R717 leave 4.6 V. It inverts.-    let y = null;-    const sq = lim.map((v) => { const target = v > 2.2 ? 0.1 : 4.6; y = y == null ? target : y + Math.min(1, dt / 12e-9) * (target - y); return y; });-    const e = P.e[idxOf(stage, 'convert')];-    return { T, unit: 'µs', panels: [-      { title: 'In: LIM2_C, the limiter’s output (V)', y: [0, 5.2], unit: 'V', refs: [[2.2, 'Q703 switches at 2.2 V', 'thr']], traces: [{ kind: 'line', t, v: lim, cls: 'tr soft' }] },-      { title: 'Out: LIM_SQ (V): Q703 inverts, so LIM2_C high means LIM_SQ low', y: [0, 5.2], unit: 'V', refs: [[4.6, '4.6 V']],-        traces: [{ kind: 'line', t, v: sq, cls: 'tr', upto: e * T }], sweep: e > 0 && e < 1 ? e * T : null },-    ], note: td.carrier ? '' : 'No carrier: the edges come from noise, at random.' };-  }-  // the pulse-count detector. Its input has about 1,820 cycles in this 4 ms window, so the top two panels slow it down.-  function S_pump(stage, opt, n) {-    const td = stage.td, P = progress(stage, opt), T = 4e-3, t = grid(T, n * 2);-    const iConv = idxOf(stage, 'convert'), iDe = idxOf(stage, 'filter');-    const eC = iConv >= 0 ? P.e[iConv] : 1, eD = iDe >= 0 ? P.e[iDe] : 1;-    const mpx = fmMpx(td);-    const deemph = stage.steps && stage.steps[iDe] ? stage.steps[iDe].H : (f) => rc1(f, 0.00208);-    const cs = scaleBy(mpx, deemph, eD);-    const dem = sample(t, (x) => 1.8 + sumAt(cs, x));-    // slowed-down square wave: 6 cycles per ms at rest, swinging ±45 % with the programme (really ±16 % at most)-    const aud = td.carrier ? prog(1, PROG, PSUM) : noise(5, 200, 3000, 30, () => 1, 0.5);-    const r = rng(3);-    let ph = 0, prev = 0;-    const sqv = [], edges = [];-    for (let i = 0; i < t.length; i++) {-      const dtt = i ? t[i] - t[i - 1] : 0;-      const f = 6000 * (1 + 0.45 * Math.max(-1, Math.min(1, sumAt(aud, t[i]))) + (td.carrier ? 0 : 0.6 * (r() - 0.5)));-      ph += f * dtt;-      const hi = (ph % 1) < 0.5;-      sqv.push(hi ? 4.6 : 0.1);-      if (i && Math.floor(ph) > prev) edges.push(t[i]);-      prev = Math.floor(ph);-    }-    const upto = eC * T;-    const yc = Math.max(0.12, Math.max(...Array.from(t, (x) => Math.abs(sumAt(mpx, x)))) * 1.15);   // fixed while the de-emphasis plays-    return { T, unit: 'ms', panels: [-      { title: 'LIM_SQ, drawn about 75× slower: its frequency carries the audio', y: [0, 5.2], unit: 'V', traces: [{ kind: 'line', t, v: sqv, cls: 'tr soft', upto }] },-      { title: 'Charge packets through C714 and D702: the same size, one per cycle', y: [0, 1.2], unit: '', noTicks: true, traces: [{ kind: 'pulses', t: edges, h: 1, w: 0.18 / 6000, cls: 'pk', upto }] },-      { title: 'FM_DEMOD (V), to scale: more cycles, more current, a lower voltage', y: [1.8 - yc, 1.8 + yc], unit: 'V',-        refs: [[1.8, '1.8 V: the 455 kHz rest point']], traces: [{ kind: 'line', t, v: dem, cls: 'tr', upto }], sweep: eC > 0 && eC < 1 ? upto : null,-        label: P.step && P.step.kind === 'filter' ? 'de-emphasis ' + Math.round(eD * 100) + ' %' : '' },-    ], note: td.carrier ? 'The top two panels are slowed down to show the edges: the real IF has about 1,820 cycles in these 4 ms, and its spacing changes by ±16 % at most. The bottom panel is to scale.'-      : 'No carrier: the edges come at random, so the average is loud noise that rises with frequency: the hiss.' };-  }-  function S_fmaud(stage, opt, n) {-    const td = stage.td, P = progress(stage, opt), T = 4e-3, t = grid(T, n * 2);-    const iF = idxOf(stage, 'filter'), eF = iF >= 0 ? P.e[iF] : 1;-    const inp = chain(fmMpx(td), td.pre);-    const sk = stage.steps[iF].H;-    const a = sample(t, (x) => 1.8 + sumAt(inp, x));-    const outCs = scaleBy(inp, sk, eF);-    const b = sample(t, (x) => 1.65 + sumAt(outCs, x));-    const yc = Math.max(0.1, Math.max(...a.map((v) => Math.abs(v - 1.8))) * 1.15);-    return { T, unit: 'ms', panels: [-      { title: 'In: FM_DEMOD after the de-emphasis (V)', y: [1.8 - yc, 1.8 + yc], unit: 'V', traces: [{ kind: 'line', t, v: a, cls: 'tr' }] },-      { title: 'Out: FMA_OUT (V), re-centred on 1.65 V for the ADC', y: [1.65 - yc, 1.65 + yc], unit: 'V', refs: [[1.65, '1.65 V: mid-scale']],-        traces: [{ kind: 'line', t, v: b, cls: 'tr' }], label: P.step && P.step.kind === 'filter' ? 'Sallen-Key ' + Math.round(eF * 100) + ' %' : '' },-    ], note: 'The two-pole filter smooths the stereo signal but leaves most of the pilot; the microcontroller’s digital filter removes the rest.' };-  }-  // ADC + DSP: one millisecond is one USB packet-  const softLim = (x) => { const a = Math.abs(x), k = db2a(-4); return a <= k ? x : Math.sign(x) * (k + (a - k) / 4); };-  function S_dsp(stage, opt, n) {-    const td = stage.td, P = progress(stage, opt), T = 2e-3;-    const fsAmp = db2a(td.toFs) / Math.SQRT2;   // volts peak -> full scale (1.64 V peak = full scale)-    let vin, faultNoise = null;-    if (td.band === 'fm') vin = chain(fmMpx(td), td.pre);-    else if (td.fault) { vin = []; faultNoise = noise(9, 200, 20000, 60, () => 1, db2a(-38)).concat([1, 2, 3].map((k) => tone(k * 1000, db2a(-55) * Math.SQRT2, k, 'other'))); }-    else vin = chain(amAudio(td), td.pre);-    const hum = [tone(1000, db2a(-39) * Math.SQRT2, 0.5, 'other'), tone(3000, db2a(-50) * Math.SQRT2, 1.7, 'other')];-    const fsIn = times(vin, fsAmp).concat(hum).concat(faultNoise || []);    // what the ADC reads, in full scale-    let cs = fsIn, gainDb = 0, mute = 1;-    (stage.steps || []).forEach((s, j) => {-      const e = P.e[j];-      if (!e || s.kind === 'in') return;-      if (s.kind === 'convert') mute *= 1 - e;-      else if (s.kind === 'gain') gainDb += s.H(0.001) * e;-      else cs = scaleBy(cs, s.H, e);-    });-    const iFir = idxOf(stage, 'filter');-    const firOn = iFir < 0 || P.e[iFir] > 0;-    const ta = grid(T, n * 2), t192 = grid(T - 1 / 192000, 384), t48 = grid(T - 1 / 48000, 96);-    const g = db2a(gainDb) * mute;-    const out48 = Array.from(t48, (x) => softLim(sumAt(cs, x) * g));-    const ain = Array.from(ta, (x) => 1.65 + sumAt(vin, x) + (faultNoise ? sumAt(faultNoise, x) / fsAmp : 0));-    // the axes follow the signal (fixed through the steps): the whole ADC range would make it a flat line-    const va = Math.min(1.65, Math.max(0.12, Math.max(...ain.map((v) => Math.abs(v - 1.65))) * 1.25));-    const full = Array.from(t48, (x) => softLim(sumAt(fsIn, x) * db2a(Math.max(0, (stage.steps || []).reduce((a, q) => a + (q.kind === 'gain' ? q.H(0.001) : 0), 0)))));-    const vb = Math.min(1.05, Math.max(0.08, Math.max(...full.map(Math.abs)) * 1.25));-    return { T, unit: 'ms', panels: [-      { title: 'ADC input, PA0 (V), and its samples: 192,000 a second', y: [1.65 - va, 1.65 + va], unit: 'V', refs: [[1.65, '1.65 V: mid-scale']],-        traces: [{ kind: 'line', t: ta, v: ain, cls: 'tr soft' },-          { kind: 'dots', t: t192, v: Array.from(t192, (x) => 1.65 + sumAt(vin, x) + (faultNoise ? sumAt(faultNoise, x) / fsAmp : 0)), cls: 'dot sm' }] },-      { title: 'To the PC: 48,000 samples a second after the FIR' + (P.step && P.step.kind !== 'in' ? ' (' + P.step.name + ')' : '') + ', full scale ±1',-        y: [-vb, vb], unit: 'FS', refs: gainDb > 0 ? [[db2a(-4), '−4 dBFS: the soft limiter starts'], [-db2a(-4), ''], [0, '']] : [[0, '']],-        traces: firOn ? [{ kind: 'line', t: t48, v: out48, cls: 'tr' }, { kind: 'dots', t: t48, v: out48, cls: 'dot' }] : [] },-      { kind: 'usb', title: 'USB: one packet every millisecond, 48 samples × 16 bits, mono, to the PC', h: 34, packets: 2 },-    ], note: '' };-  }-  // AM: the 455 kHz IF has 910 cycles in this window, so it is drawn as the band between its peaks-  function S_det(stage, opt, n) {-    const td = stage.td, P = progress(stage, opt), T = 2e-3, t = grid(T, n * 2);-    const iC = idxOf(stage, 'convert'), iF = idxOf(stage, 'filter');-    const eC = iC >= 0 ? P.e[iC] : 1, eF = iF >= 0 ? P.e[iF] : 1;-    const design = Object.assign({}, td, { carrier: true });-    const audE = amAudio(td.fault ? design : td), live = td.carrier && !td.fault;-    const env = (cs, x) => Math.max(0, 1.25 * (1 + sumAt(cs, x)));-    const ghostEnv = td.fault ? Array.from(t, (x) => env(audE, x)) : null;-    const detH = stage.steps && stage.steps[iF] ? stage.steps[iF].H : (f) => rc1(f, 0.00723);-    const csOut = scaleBy(audE, detH, eF);-    const det = Array.from(t, (x) => (live ? 1 + sumAt(csOut, x) : 0));-    const envL = Array.from(t, (x) => (live ? env(audE, x) : 0.01));-    const panels = [-      { title: 'In: AM_IFOUT (V): 910 IF cycles here, so the band shows their peaks', y: [-2.2, 2.2], unit: 'V',-        traces: (ghostEnv ? [{ kind: 'band', t, lo: ghostEnv.map((v) => -v), hi: ghostEnv, cls: 'ghostband' }] : []).concat([{ kind: 'band', t, lo: envL.map((v) => -v), hi: envL, cls: 'band' }]) },-      { title: 'Out: AM_DET (V): D601 and C612 hold each peak, R619 lets it fall', y: [0, 1.8], unit: 'V', refs: [[1, live || td.fault ? 'the AGC holds the average at 1.0 V' : '']],-        traces: (td.fault ? [{ kind: 'line', t, v: Array.from(t, (x) => 1 + sumAt(scaleBy(audE, detH, 1), x)), cls: 'tr ghost' }] : [])-          .concat([{ kind: 'line', t, v: det, cls: 'tr', upto: eC * T }]), sweep: eC > 0 && eC < 1 ? eC * T : null },-    ];-    return { T, unit: 'ms', panels, note: td.fault ? '' : !td.carrier ? 'No station: nothing to detect.' : loudWh(td) ? 'The fast ripple on the envelope is a neighbour 10 kHz away, beating with your carrier: a whistle.' : '' };-  }-  function S_agc(stage, opt, n) {-    const td = stage.td, P = progress(stage, opt), T = 2e-3, t = grid(T, n * 2);-    const iC = idxOf(stage, 'convert'), iF = idxOf(stage, 'filter');-    const eC = iC >= 0 ? P.e[iC] : 1, eF = iF >= 0 ? P.e[iF] : 1;-    const design = Object.assign({}, td, { carrier: true });-    const inp = chain(amAudio(td.fault ? design : td), td.pre), live = td.carrier && !td.fault;-    const sk = stage.steps && stage.steps[iF] ? stage.steps[iF].H : (f) => 0;-    const outCs = scaleBy(inp, sk, eF);-    const a = Array.from(t, (x) => (live ? 1 + sumAt(inp, x) : 0));-    const b = Array.from(t, (x) => (live ? 1.65 + sumAt(outCs, x) : 1.65));-    const gh = (fn) => (td.fault ? [{ kind: 'line', t, v: Array.from(t, fn), cls: 'tr ghost' }] : []);-    return { T, unit: 'ms', panels: [-      { title: 'In: AM_DET (V)', y: td.fault ? [-0.1, 1.6] : [0.4, 1.6], unit: 'V', refs: [[1, 'DC 1.0 V: to the AGC loop']],-        traces: gh((x) => 1 + sumAt(inp, x)).concat([{ kind: 'line', t, v: a, cls: 'tr' }]) },-      { title: 'Out: AMA_OUT (V): DC removed, centred on 1.65 V, trimmed above 5 kHz', y: [1.05, 2.25], unit: 'V', refs: [[1.65, '1.65 V: mid-scale']],-        traces: gh((x) => 1.65 + sumAt(scaleBy(inp, sk, 1), x)).concat([{ kind: 'line', t, v: b, cls: 'tr', upto: eC * T }]), sweep: eC > 0 && eC < 1 ? eC * T : null },-    ], note: '' };-  }-  // what the waveforms show, in place of the spectrum's caption-  function caption(st) {-    const td = st.td || {}, names = (st.steps || []).map((x) => x.name);-    switch (st.id) {-      case 'lim': return !td.carrier ? 'No carrier: Q701 and Q702 amplify the noise until it clips, so it comes out at full level, as random edges. That is the hiss between stations.'-        : 'Q701 and Q702 give about 66 dB of gain, so a few millivolts drive LIM2_C all the way from saturation (0.7 V) to cut-off (4.9 V) on every cycle. A weak or strong station comes out the same size: only the timing of the edges, the frequency, is kept. C710 (47 pF) rounds the edges.' +-          (td.capt ? ' Here a stronger neighbour has captured the limiter, so these are its edges.' : '');-      case 'sq': return 'Q703 turns on whenever LIM2_C rises above about 2.2 V and pulls LIM_SQ to 0 V; off, R715 lifts it to 4.6 V. The result is a clean square wave at the IF, upside down. R716 and R717 divide it to 3.1 V as IF_CNT, whose edges TIM2 counts for the AFC, seek and calibration.';-      case 'pump': return !td.carrier ? 'No carrier: the edges come at random, so the packets arrive at random and FM_DEMOD is loud noise that rises with frequency: the hiss.'-        : 'Each cycle of LIM_SQ moves the same packet of charge through C714 (22 pF) and D702 into U701A. More cycles per second means more current, so FM_DEMOD = VREF_FM − I · 51 k falls as the frequency rises: frequency has become voltage. R718 ∥ C715 (76.5 µs) averages the packets and also undoes the transmitter’s treble boost, the de-emphasis.';-      case 'fmaud': return 'The fine ripple on the audio is the 19 kHz pilot and the stereo signal. U701B’s 15.8 kHz two-pole low-pass takes the stereo signal down about 15 dB but the pilot only 4.5 dB, so a 19 kHz ripple still reaches the ADC; the firmware removes it. C717 and R721 move the audio from FM_DEMOD’s 1.8 V to the ADC’s mid-scale, 1.65 V.';-      case 'det': return td.fault ? 'With no IF reaching D601, AM_DET sits near 0 V. The design expects the 455 kHz carrier\u2019s peaks above and, on AM_DET, the audio riding on 1.0 V.' : !td.carrier ? 'No station: no carrier, nothing to detect.'-        : 'The IF reaching D601 is a 455 kHz carrier whose peaks rise and fall with the audio. D601 charges C612 to each peak and R619 lets it fall a little before the next (22 µs), so AM_DET follows the peaks: the envelope. Its average is the carrier, the DC the AGC holds at 1.0 V; the audio rides on it.' +-          (loudWh(td) ? ' The fast ripple is a neighbour 10 kHz away beating with your carrier: a whistle.' : '');-      case 'agc': return td.fault ? 'With nothing on AM_DET, the AGC sits at full gain and AMA_OUT rests at its 1.65 V bias. The design expects the audio on 1.0 V coming in and centred on 1.65 V going out.'-        : 'U601A compares AM_DET’s average with V_REF = 1.0 V and sets the AGC amplifiers’ gain, so the carrier always arrives at the same size. C616 passes only the audio, R626 centres it on 1.65 V for the ADC, and U601B’s 4.95 kHz low-pass trims the treble and the 10 kHz whistles.';-      case 'dsp': {-        const fm = td.band === 'fm';-        let t = '';-        t += 'PA0 is sampled 192,000 times a second. The 32-tap FIR keeps 0 to 15 kHz, drops everything from 30 kHz, and keeps every 4th sample: 48,000 a second.';-        if (fm) t += names.indexOf('19 kHz notch') >= 0 ? ' The notch takes out the 19 kHz ripple.' : ' The pilot notch is off, so a 19 kHz ripple goes to the PC.';-        if (names.indexOf('Noise filter') >= 0) t += ' The strong noise filter rounds off the top end.';-        t += names.indexOf('Hum canceller') >= 0 ? ' The hum canceller removes the 1 kHz tone the DSP itself makes.' : ' The hum canceller is off, so the 1 kHz tone from the DSP’s own activity is in the audio.';-        if (names.indexOf('Gain') >= 0) t += ' The gain scales it; above −4 dBFS the soft limiter rounds the peaks.';-        t += names.indexOf('Mute') >= 0 ? ' Muted: the packets carry silence.' : ' Every millisecond 48 samples go to the PC as one USB audio packet.';-        return t;-      }-    }-    return '';-  }-  const loudWh = (td) => (td.wh || []).some((w) => w.rel > -35);   // a whistle you could see on the envelope-  const STAGE = { lim: S_lim, sq: S_sq, pump: S_pump, fmaud: S_fmaud, dsp: S_dsp, det: S_det, agc: S_agc };--  // ------------------------------------------------------------------ drawing-  function niceStep(span, n) {-    const raw = span / n, p = Math.pow(10, Math.floor(lg(raw)));-    for (const m of [1, 2, 2.5, 5]) if (m * p >= raw) return m * p;-    return 10 * p;-  }-  const fmt = (v) => { const a = Math.abs(v); const t = a >= 100 ? v.toFixed(0) : a >= 10 ? v.toFixed(1) : a >= 1 ? v.toFixed(2) : v.toFixed(3); return t.indexOf('.') < 0 ? t : t.replace(/0+$/, '').replace(/\.$/, ''); };-  function layout(opt, nPanels, extraH, msg) {-    const big = !!(opt && opt.big);-    const W = big ? Math.max(440, Math.round(opt.width || 760)) : 600;-    const L = big ? 64 : 46, R = W - (big ? 20 : 10);-    const ph = big ? Math.round(Math.max(110, Math.min(150, W * 0.18))) : 66;-    const gap = big ? 52 : 40, top = big ? (msg ? 66 : 22) : 26;-    return { W, L, R, ph, gap, top, big, H: top + nPanels * (ph + gap) + (extraH || 0) + (big ? 6 : 0) };-  }-  const last = {};-  let uid = 0;-  function render(stage, idx, opt) {-    const fn = STAGE[stage.id];-    if (!fn) return '';-    const big = !!(opt && opt.big);-    const n0 = big ? Math.max(440, Math.round(opt.width || 760)) : 600;-    const view = fn(stage, opt || {}, n0);-    let panels = view.panels;-    if (!big) panels = panels.filter((p) => p.kind !== 'usb' && !/Charge packets/.test(p.title)).slice(0, 2);-    const usb = panels.find((p) => p.kind === 'usb');-    const plots = panels.filter((p) => p.kind !== 'usb');-    const P = progress(stage, opt);-    const msg = big ? (P.step ? 'Step ' + (P.k + 1) + ': ' + P.step.title : view.note) : '';-    const lay = layout(opt, plots.length, usb ? usb.h + 40 : 0, msg);-    const { W, H, L, R, ph, gap, top } = lay;-    const T = view.T, us = view.unit === 'µs', tu = us ? 1e6 : 1e3;-    const X = (t) => L + t / T * (R - L);-    const clip = 'tc' + (++uid);-    const o = [];-    o.push('<svg class="stg scope' + (big ? ' big' : '') + '" viewBox="0 0 ' + W + ' ' + H + '"' + (big ? ' width="' + W + '" height="' + H + '"' : '') +-      ' role="img" aria-label="' + esc(stage.title + ': waveforms over time') + '" data-stage="' + esc(stage.id) + '">');-    o.push('<defs><clipPath id="' + clip + '"><rect x="' + L + '" y="0" width="' + (R - L) + '" height="' + H + '"/></clipPath></defs>');-    // the step being played, or what the window shows-    if (msg) {-      o.push('<foreignObject x="' + L + '" y="6" width="' + (R - L) + '" height="' + (top - 12) + '"><div xmlns="http://www.w3.org/1999/xhtml" class="strip' + (P.step ? ' stepnow' : '') + '">' + esc(msg) + '</div></foreignObject>');-    }-    const tStep = niceStep(T * tu, Math.max(4, Math.round((R - L) / (big ? 95 : 80))));-    const rows = [];-    plots.forEach((p, k) => {-      const y0 = top + k * (ph + gap) + (big ? 18 : 14), y1 = y0 + ph;-      const Y = (v) => y1 - (Math.max(p.y[0] - (p.y[1] - p.y[0]) * 0.08, Math.min(p.y[1] + (p.y[1] - p.y[0]) * 0.08, v)) - p.y[0]) / (p.y[1] - p.y[0]) * ph;-      rows.push({ p, Y, y0, y1 });-      o.push('<text class="pl" x="' + L + '" y="' + (y0 - (big ? 10 : 7)) + '">' + esc(fitText(p.title, R - L, big)) + '</text>');-      if (!p.noTicks) {-        const st = niceStep(p.y[1] - p.y[0], big ? 4 : 2);-        for (let j = Math.ceil(p.y[0] / st - 1e-9), v = j * st; v <= p.y[1] + st * 1e-6; j++, v = j * st) {-          o.push('<line class="grid" x1="' + L + '" x2="' + R + '" y1="' + Y(v).toFixed(1) + '" y2="' + Y(v).toFixed(1) + '"/><text class="tk" x="' + (L - 7) + '" y="' + (Y(v) + (big ? 4 : 3)).toFixed(1) + '" text-anchor="end">' + fmt(+v.toPrecision(6)) + '</text>');-        }-      }-      o.push('<line class="axis" x1="' + L + '" x2="' + R + '" y1="' + y1 + '" y2="' + y1 + '"/>');-      for (let j = 0, tv = 0; tv <= T * tu + 1e-9; j++, tv = j * tStep) {-        const x = X(tv / tu), lastT = tv + tStep > T * tu + 1e-9;-        o.push('<line class="axis" x1="' + x.toFixed(1) + '" x2="' + x.toFixed(1) + '" y1="' + y1 + '" y2="' + (y1 + 4) + '"/>');-        if (k === plots.length - 1 || big) o.push('<text class="tk" x="' + x.toFixed(1) + '" y="' + (y1 + (big ? 17 : 14)) + '" text-anchor="' + (lastT && x > R - 30 ? 'end' : 'middle') + '">' + fmt(+tv.toPrecision(6)) + (lastT ? ' ' + view.unit : '') + '</text>');-      }-      o.push('<g clip-path="url(#' + clip + ')">');-      const refs = (p.refs || []).filter(([v]) => v >= p.y[0] && v <= p.y[1]);-      for (const [v, , cls] of refs) o.push('<line class="ref' + (cls ? ' ' + cls : '') + '" x1="' + L + '" x2="' + R + '" y1="' + Y(v).toFixed(1) + '" y2="' + Y(v).toFixed(1) + '"/>');-      for (const tr of p.traces || []) o.push(drawTrace(tr, X, Y, y1, T));-      for (const [v, label] of refs) if (label) o.push('<text class="refl" x="' + (R - 4) + '" y="' + (Y(v) - 4).toFixed(1) + '" text-anchor="end">' + esc(label) + '</text>');-      if (p.sweep != null) o.push('<line class="sweep" x1="' + X(p.sweep).toFixed(1) + '" x2="' + X(p.sweep).toFixed(1) + '" y1="' + y0 + '" y2="' + y1 + '"/>');-      o.push('</g>');-      if (p.label && big) o.push('<text class="dl rd" x="' + R + '" y="' + (y0 - (big ? 10 : 7)) + '" text-anchor="end">' + esc(p.label) + '</text>');-    });-    if (usb) {-      const y0 = top + plots.length * (ph + gap) + 14, h = usb.h;-      o.push('<text class="pl" x="' + L + '" y="' + (y0 - 8) + '">' + esc(usb.title) + '</text>');-      const np = usb.packets || 1, pw = (R - L) / np;-      for (let k = 0; k < np; k++) {-        const x0 = L + k * pw;-        o.push('<rect class="pkt" x="' + (x0 + 2).toFixed(1) + '" y="' + y0 + '" width="' + (pw - 4).toFixed(1) + '" height="' + h + '" rx="5"/>');-        for (let i = 0; i < 48; i++) { const x = x0 + 6 + (i + 0.5) / 48 * (pw - 12); o.push('<line class="pktt" x1="' + x.toFixed(1) + '" x2="' + x.toFixed(1) + '" y1="' + (y0 + 8) + '" y2="' + (y0 + h - 8) + '"/>'); }-      }-    }-    const yTop = rows.length ? rows[0].y0 : top, yBot = rows.length ? rows[rows.length - 1].y1 : H;-    o.push('<line class="xhair" x1="0" x2="0" y1="' + yTop + '" y2="' + yBot + '" visibility="hidden"/>');-    o.push('<rect class="hov" x="' + L + '" y="' + (yTop - 6) + '" width="' + (R - L) + '" height="' + (yBot - yTop + 12) + '" data-i="' + idx + '"/>');-    o.push('</svg>');-    last[stage.id + (big ? ':big' : ':small')] = { view, rows, L, R, T, tu, unit: view.unit, plots };-    return o.join('');-  }-  function fitText(t, w, big) { const n = Math.floor(w / (big ? 7.9 : 6.3)); return t.length > n ? t.slice(0, n - 1) + '…' : t; }-  function drawTrace(tr, X, Y, yb, T) {-    const upto = tr.upto == null ? T : tr.upto;-    if (upto <= 0) return '';-    if (tr.kind === 'line') {-      const d = [];-      for (let i = 0; i < tr.t.length; i++) { if (tr.t[i] > upto + 1e-15) break; d.push((d.length ? 'L' : 'M') + X(tr.t[i]).toFixed(1) + ',' + Y(tr.v[i]).toFixed(1)); }-      return d.length ? '<path class="' + tr.cls + '" d="' + d.join('') + '"/>' : '';-    }-    if (tr.kind === 'band') {-      const up = [], dn = [];-      for (let i = 0; i < tr.t.length; i++) { const x = X(tr.t[i]).toFixed(1); up.push(x + ',' + Y(tr.hi[i]).toFixed(1)); dn.push(x + ',' + Y(tr.lo[i]).toFixed(1)); }-      return '<path class="' + tr.cls + '" d="M' + up.join('L') + 'L' + dn.reverse().join('L') + 'Z"/>';-    }-    if (tr.kind === 'dots') {-      const o = [];-      for (let i = 0; i < tr.t.length; i++) { if (tr.t[i] > upto) break; o.push('<circle class="' + tr.cls + '" cx="' + X(tr.t[i]).toFixed(1) + '" cy="' + Y(tr.v[i]).toFixed(1) + '" r="' + (/sm/.test(tr.cls) ? 1.3 : 2.4) + '"/>'); }-      return o.join('');-    }-    if (tr.kind === 'pulses') {-      const o = [], w = Math.max(1.5, X(tr.w) - X(0));-      for (const t of tr.t) { if (t > upto) break; const x = X(t); o.push('<rect class="' + tr.cls + '" x="' + x.toFixed(1) + '" y="' + Y(tr.h).toFixed(1) + '" width="' + w.toFixed(1) + '" height="' + (yb - Y(tr.h)).toFixed(1) + '"/>'); }-      return o.join('');-    }-    return '';-  }-  // the hover readout: time, and each panel's value there-  function pick(stage, x, opt) {-    const L0 = last[stage.id + (opt && opt.big ? ':big' : ':small')];-    if (!L0) return null;-    const { L, R, T, tu, rows } = L0;-    const xc = Math.max(L, Math.min(R, x)), t = (xc - L) / (R - L) * T;-    const vals = [];-    for (const r of rows) {-      const tr = (r.p.traces || []).find((q) => q.kind === 'line' && !/ghost|faint/.test(q.cls)) || (r.p.traces || []).find((q) => q.kind === 'band');-      if (!tr || (tr.upto != null && t > tr.upto)) continue;-      let i = 0;-      while (i < tr.t.length - 1 && tr.t[i + 1] < t) i++;-      const v = tr.kind === 'band' ? tr.hi[i] : tr.v[i];-      const name = r.p.title.split(':')[0].split(',')[0].split(' (')[0].trim();-      vals.push([name, (tr.kind === 'band' ? 'peak ' : '') + fmt(+v.toPrecision(4)) + (r.p.unit ? ' ' + r.p.unit : '')]);-    }-    return { x: xc, t: t * tu, unit: L0.unit, vals, y1: rows.length ? rows[0].y0 : 0, y2: rows.length ? rows[rows.length - 1].y1 : 0 };-  }-  return { has, render, pick, caption, IDS };-})();-if (typeof module !== 'undefined') module.exports = SCOPE;--// The math of each block as one derivation: an input equation, the operations the parts perform (each naming the-// parts and the domain it is worked in), and the output equation. Engineer's math: terms that end up near zero are-// struck out and dropped, and the numbers come from the parts (tools/design.py) and the station in the tuner.-//-// Markup: {f_LO} is an italic variable with a subscript ({ω_0}, {V_T}); [[num || den]] is a stacked fraction; ^(…) or ^−0.7 is a superscript;-// ~~ … ~~ is a term that is dropped because it is (nearly) zero. Unicode does the rest: ² ³ ⁻¹ √ ∫ Σ ∥ ≈ ω π τ.-// Equations joined by ',   ' (comma, three spaces) go on separate lines.--var MATH = (function () {-  const RS = (typeof SPECTRUM !== 'undefined' && SPECTRUM.resp) || null;-  const PI2 = 2 * Math.PI;-  const lg = Math.log10;-  const n = (x, d) => (+x.toFixed(d == null ? 3 : d)).toString();-  const SUP = { '-': '⁻', 0: '⁰', 1: '¹', 2: '²', 3: '³', 4: '⁴', 5: '⁵', 6: '⁶', 7: '⁷', 8: '⁸', 9: '⁹' };-  // a gain as a plain number: 0.75, 0.018, 3×10⁻⁶-  const num = (x) => {-    if (x === 0) return '0';-    const e = Math.floor(lg(Math.abs(x)));-    if (e >= -2 && e < 4) return String(+x.toPrecision(2));-    return +(x / Math.pow(10, e)).toFixed(1) + '×10' + String(e).split('').map((c) => SUP[c]).join('');-  };-  const g = (db) => Math.pow(10, db / 20);                    // dB to an amplitude ratio-  const dbs = (db) => (db >= 0 ? '+' : '−') + Math.abs(db).toFixed(Math.abs(db) < 10 ? 1 : 0) + ' dB';-  const mhz = (f) => n(f, 3) + ' MHz';-  const ser = (a, b) => (a * b) / (a + b);-  const cv = (v) => 56 * Math.pow(1 + v / 0.7, -0.678);        // BB910 varactor, pF-  const fres = (L, CpF) => 1 / (PI2 * Math.sqrt(L * CpF * 1e-12)) / 1e6;-  const rcg = (f, fc) => 1 / Math.sqrt(1 + Math.pow(f / fc, 2));-  const skg = (f, f0, Q) => { const x = f / f0; return 1 / Math.sqrt(Math.pow(1 - x * x, 2) + Math.pow(x / Q, 2)); };-  const resp = (name, f, fallback) => (RS && RS[name] ? RS[name](f) : fallback);--  const IN = (eq, note) => ({ k: 'in', eq, note });-  const OP = (op, by, dom, eq, note) => ({ k: 'op', op, by, dom, eq, note });-  const OUT = (eq, note) => ({ k: 'out', eq, note });-  const unreachable = (what) => ({ chain: [IN(what, ''), OUT('No LO setting reaches this station on the first board', 'Pick a station inside the board’s range in the tuner.')] });--  return {-    ant: (c) => {-      if (c.band !== 'am') {-        const fs = c.ffm, hs = resp('fmLeg', fs, -2.5), ho = resp('fmLeg', 1.01, -110);-        return {-          chain: [-            IN('{v_ant}(t) = A cos({ω_s}t) + B cos({ω_m}t)', 'Your station at ' + n(fs, 1) + ' MHz ({ω_s} = 2π · ' + n(fs, 1) + ' MHz) and a medium-wave station at 1.01 MHz. Every other signal goes through the same way.'),-            OP('Write each part in the s-domain', 'L and C', 's', '{Z_L}(s) = sL,   {Z_C}(s) = [[1 || sC]]', 'A capacitor gets easier to pass at high frequency, an inductor at low frequency.'),-            OP('Solve the FM leg’s ladder', 'C303, L304, C304 · C305, L305, C306', 's',-              '{H}(s) = [[s³ || s³ + 2{ω_h}s² + 2{ω_h}²s + {ω_h}³]] · [[{ω_l}³ || s³ + 2{ω_l}s² + 2{ω_l}²s + {ω_l}³]]',-              'A 3rd-order high-pass at 70 MHz times a 3rd-order low-pass at 130 MHz ({ω_h} = 2π · 70 MHz, {ω_l} = 2π · 130 MHz).'),-            OP('Put in s = jω for each signal', '', 'jw', '|{H}(j{ω_s})| = ' + num(g(hs)) + '   (' + dbs(hs) + '),   |{H}(j{ω_m})| = ' + num(g(ho)) + '   (' + dbs(ho) + ')  ≈ 0',-              'From the six actual L/C values with 50 Ω at each end.'),-          ],-          out: OUT('{v_FM}(t) ≈ ' + num(g(hs)) + 'A cos({ω_s}t + φ) ~~+ ' + num(g(ho)) + 'B cos({ω_m}t)~~', 'Medium wave is gone. φ is the ladder’s phase shift, which FM does not care about.'),-          how: 'Each leg is a ladder of the two component laws. In the FM leg, C303 and C304 are series capacitors and L304 shunts to ground: at FM, 1/(sC) is small and sL is large, so the signal passes; at medium wave the opposite holds and it is blocked. The 22 pF / 120 nH / 22 pF section is the mirror image, removing everything above 130 MHz. Because each leg starts with the element that blocks the other band, the two can share one antenna node.',-          flow: '{Z_C} = [[1 || sC]]',-        };-      }-      const fs = c.fam / 1000, hs = resp('amLeg', fs, -0.1), ho = resp('amLeg', c.ffm, -110);-      return {-        chain: [-          IN('{v_ant}(t) = A cos({ω_s}t) + B cos({ω_f}t)', 'Your station at ' + c.fam + ' kHz ({ω_s} = 2π · ' + c.fam + ' kHz) and an FM station at ' + n(c.ffm, 1) + ' MHz.'),-          OP('Write each part in the s-domain', 'L and C', 's', '{Z_L}(s) = sL,   {Z_C}(s) = [[1 || sC]]', 'Series inductors pass low frequencies; shunt capacitors short high frequencies to ground.'),-          OP('Solve the AM leg’s ladder', 'L301, C301, L302, C302, L303', 's', '{H}(s) = [[{ω_c}⁵ || s⁵ + 3.24{ω_c}s⁴ + 5.24{ω_c}²s³ + 5.24{ω_c}³s² + 3.24{ω_c}⁴s + {ω_c}⁵]]',-            'A 5-pole Butterworth low-pass, {ω_c} = 2π · 2 MHz.'),-          OP('Put in s = jω for each signal', '', 'jw', '|{H}(j{ω_s})| = ' + num(g(hs)) + '   (' + dbs(hs) + '),   |{H}(j{ω_f})| = ' + num(g(ho)) + '   (' + dbs(ho) + ')  ≈ 0',-            'From the five actual L/C values with 50 Ω at each end.'),-        ],-        out: OUT('{v_AM}(t) ≈ ' + num(g(hs)) + 'A cos({ω_s}t + φ) ~~+ ' + num(g(ho)) + 'B cos({ω_f}t)~~', 'FM and everything above 2 MHz is gone; the whole medium-wave band passes.'),-        how: 'The AM leg alternates series inductors (L301, L302, L303) and shunt capacitors (C301, C302): a 5-pole low-pass. Its first element is a series inductor, which is a high impedance at FM, so it does not load the FM leg on the shared antenna node.',-        flow: '{Z_L} = sL',-      };-    },--    fmrf: (c) => {-      const K = c.fmK, f = c.ffm, f0 = K.tank, Q = 10;-      const x = f / f0 - f0 / f, k = 1 / Math.sqrt(1 + Q * Q * x * x);-      const gm = 1 / (6.5 + 22), Rp = 900, Av = gm * Rp * k, G = Av * 0.2;-      const on = Math.abs(f0 - f) < 0.05;-      return {-        chain: [-          IN('{v_b}(t) = A cos({ω_s}t)', 'Your station at ' + n(f, 1) + ' MHz, out of the diplexer.'),-          OP('Turn the voltage into a current', 'Q301, R305', 't', '{i_c}(t) = −{g_m}{v_b}(t),   {g_m} = [[1 || {r_e} + {R_E}]] = [[1 || 6.5 Ω + 22 Ω]] = 35 mS',-            '{r_e} = 26 mV / 4 mA. The unbypassed 22 Ω (R305) keeps {g_m} steady and linear.'),-          OP('Push it into the tank', 'L306, C309, C310, D301', 's', '{Z}(s) = [[s / C || s² + s / ({R_p}C) + 1 / (LC)]]',-            'A parallel RLC: L306 is L, C309 plus C310 in series with the varactor is C, and {R_p} ≈ 900 Ω is the losses and the mixer’s load (estimate).'),-          OP('Evaluate at the station', 'VT_RF = ' + n(K.vtRf, 2) + ' V', 'jw', '|{Z}(j{ω_s})| = [[{R_p} || √(1 + Q²(f/{f_0} − {f_0}/f)²)]] = 900 Ω × ' + n(k, 2) + ' = ' + n(Rp * k, 0) + ' Ω',-            (on ? 'The tank is tuned onto the station ({f_0} = ' + n(f0, 2) + ' MHz), so the bracket is 0 and |Z| = {R_p}.' : 'The tank sits at {f_0} = ' + n(f0, 2) + ' MHz, ' + n(Math.abs(f0 - f), 2) + ' MHz off the station, which costs ' + dbs(20 * lg(k)) + '.') + ' Q = 10.'),-          OP('Collector voltage', 'Q301', 't', '{v_c} = −{g_m}|{Z}|{v_b} = −35 mS × ' + n(Rp * k, 0) + ' Ω × A = −' + n(Av, 1) + 'A'),-          OP('Tap off to the mixer', 'C313 (4.7 pF)', 't', '{v_mix} ≈ 0.2 · {v_c}', 'A small tap so the mixer does not load the tank; about a fifth gets through (estimate).'),-        ],-        out: OUT('{v_mix}(t) ≈ −' + n(G, 1) + 'A cos({ω_s}t)', 'About ' + dbs(20 * lg(G)) + ' (estimate). Stations far from {f_0} get less: that is the tank’s selectivity.'),-        how: 'Q301 is the transconductor: its collector current follows the base voltage. That current flows into the tank, whose impedance peaks at ω₀ = 1/√(LC), so only signals near the station see gain. VT_RF reverse-biases D301 through R307 and moves C, which moves ω₀.',-        flow: '{ω_0} = [[1 || √(LC)]]',-      };-    },--    fmlo: (c) => {-      const K = c.fmK, P = K.P;-      if (P.lo == null) return unreachable('{f_LO} = ' + n(c.ffm, 1) + ' ± 10.695 MHz');-      const below = P.side === 'below', lo = P.lo;-      const head = IN('{V_DAC} = [[' + K.dac + ' || 4095]] × 3.3 V = ' + n(K.vdac, 3) + ' V',-        c.fmK.c.tune === 'dac' ? 'The DAC code you set (AFC off).' : 'The code the firmware picks for ' + n(c.ffm, 1) + ' MHz' + (below ? ' (from below, as on the first board)' : '') + '.');-      const amp = OP('Scale up to the tuning voltage', 'U201, R201, R202', 't', '{V_T} = (1 + [[10 kΩ || 22 kΩ]]) {V_DAC} = 1.45 × ' + n(K.vdac, 3) + ' V = ' + n(K.vt, 3) + ' V', 'The two RC poles after it (3.4 Hz and 16 Hz) only remove noise.');-      const loop = OP('Loop gain of exactly 1 at 0°', 'Q302, C318, C317', 's', '{T}(j{ω_LO}) = {g_m}{Z_tank}β = 1,   β = [[{C_318} || {C_318} + {C_317}]] = [[4.7 pF || 19.7 pF]] = 0.24',-        'Above 1 the swing grows out of noise until Q302 saturates, which pins the loop gain at 1.');-      const out = OUT('{v_LO}(t) = B cos(2π · ' + mhz(lo) + ' · t)', (below ? 'f_RF − f_LO' : 'f_LO − f_RF') + ' = ' + n(Math.abs(lo - c.ffm), 3) + ' MHz: the IF.');-      if (c.mode === 'board') {-        return { chain: [head, amp, OP('Look up the first board’s calibration', 'measured table', 't', '{f_LO} = table(' + K.dac + ') = ' + mhz(lo), 'The first board’s LO runs low (91.5 to 99.2 MHz) because of extra capacitance, so the firmware uses measured code-to-frequency tables.'), loop], out,-          how: 'Q302 runs common-base with the C318/C317 divider feeding part of the collector swing back to the emitter. L307 with C319 and the varactor D302 (through C320) is the tank; VT_FM changes D302’s capacitance, which is how the DAC tunes the radio.', flow: '{ω_LO} = [[1 || √(L{C_T})]]' };-      }-      const cvv = cv(K.vt), cs = ser(22, cvv), ct = 7.84 + cs;-      return {-        chain: [head, amp,-          OP('Set the varactor', 'D302 (BB910)', 't', '{C_v} = 56 pF · (1 + {V_T} / 0.7 V)^−0.678 = ' + n(cvv, 1) + ' pF', 'More reverse voltage, less capacitance.'),-          OP('Add up the tank capacitance', 'C319, C320, C318/C317', 't', '{C_T} = 7.8 pF + [[{C_320} {C_v} || {C_320} + {C_v}]] = 7.8 + ' + n(cs, 1) + ' = ' + n(ct, 1) + ' pF',-            '7.8 pF = C319 (3.3 pF) + the C318/C317 divider (3.6 pF) + Q302 (≈ 1 pF). C320 (22 pF) in series narrows the varactor’s swing.'),-          OP('Find the resonance', 'L307 (110 nH)', 's', '{Z_tank}(s) has poles at s = ±j{ω_LO},   {f_LO} = [[1 || 2π√(L{C_T})]] ≈ ' + n(fres(110e-9, ct), 1) + ' MHz',-            'At ±j{ω_LO} the tank’s reactances cancel.'),-          loop],-        out,-        how: 'Q302 runs common-base: C316 grounds its base for RF, so the emitter is the input and the collector the output. C318 and C317 are a capacitive divider that feeds part of the output back in phase: that is β. L307 with C319 and the varactor D302 (through C320) is the tank; VT_FM changes D302’s capacitance, which is how the DAC tunes the radio.',-        flow: '{ω_LO} = [[1 || √(L{C_T})]]',-      };-    },--    fmmix: (c) => {-      const K = c.fmK, P = K.P, f = c.ffm;-      if (P.lo == null) return unreachable('{v_RF}(t) = A cos(2π · ' + n(f, 1) + ' MHz · t)');-      const lo = P.lo, below = P.side === 'below', d = Math.abs(lo - f), s = lo + f;-      const dW = below ? '({ω_s} − {ω_LO})' : '({ω_LO} − {ω_s})';-      const off = Math.abs(d - 10.695) > 0.002;-      return {-        chain: [-          IN('{v_RF}(t) = A cos({ω_s}t),   {v_LO}(t) = B cos({ω_LO}t)', 'Your station at ' + n(f, 1) + ' MHz from the RF amplifier, and the LO at ' + mhz(lo) + ' from Q302.'),-          OP('Add them on the base', 'C313, C321', 't', '{v_be}(t) = {v_RF}(t) + {v_LO}(t)', 'C313 brings the RF and C321 the LO onto Q303’s base; C322 grounds the emitter at RF.'),-          OP('The junction is exponential: expand it', 'Q303', 't', '{i_c} = {I_S} e^({v_be}/{V_T}) ≈ {I_C} [1 + [[{v_be} || {V_T}]] + [[{v_be}² || 2{V_T}²]] ~~+ [[{v_be}³ || 6{V_T}³]] + …~~]',-            'For small signals the cube and higher terms are tiny: drop them.'),-          OP('Square the sum; keep the cross term', '', 't', '{v_be}² = ~~A² cos²({ω_s}t)~~ + 2AB cos({ω_s}t) cos({ω_LO}t) ~~+ B² cos²({ω_LO}t)~~',-            'The squares land at 0 Hz and twice each frequency, nowhere near 10.7 MHz: drop them. Only the cross term multiplies RF by LO.'),-          OP('Product to sum', '', 't', '2 cos a cos b = cos(a − b) + cos(a + b),   so  2AB cos({ω_s}t) cos({ω_LO}t) = AB cos(' + dW + 't) + AB cos(({ω_LO} + {ω_s})t)'),-          OP('The same step in the s-domain', '', 's', '{V}(s)  →  ½ [ {V}(s − j{ω_LO}) + {V}(s + j{ω_LO}) ]', 'Multiplying by a cosine shifts the whole spectrum by ±{f_LO}: a copy down and a copy up, as in the chart above.'),-          OP('Put in the numbers', '', 't', '= AB cos(2π · ' + mhz(d) + ' · t) + AB cos(2π · ' + mhz(s) + ' · t)'),-          OP('Keep only what the 10.7 MHz filter passes', 'R501, FL501', 'jw', '|{H}(j2π · ' + n(s, 1) + ' MHz)| ≈ 0  →  ~~AB cos(2π · ' + n(s, 1) + ' MHz · t)~~',-            'R501 turns the collector current into a voltage; the ceramic filter that follows passes only around 10.7 MHz.'),-        ],-        out: OUT('{v_IF}(t) ≈ K · AB cos(2π · ' + mhz(d) + ' · t),   K = [[{I_C}{R_501} || 2{V_T}²]]',-          off ? 'Your station comes out ' + n(Math.abs(d - 10.695) * 1000, 0) + ' kHz from the 10.695 MHz centre (manual DAC, AFC off): the filters will cut it.' : 'Your station, now at the 10.695 MHz IF' + (below ? '.' : ', mirrored: LO − f flips the order of the stations.')),-        how: 'A transistor’s collector current is exponential in its base voltage, and the square term of that exponential contains 2·v_RF·v_LO: the product the mixer needs. Everything except the difference near 10.7 MHz is thrown away by the ceramic filter that follows.',-        flow: '{f_IF} = {f_LO} − {f_RF}',-      };-    },--    amrf: (c) => {-      const tau = 100e-9 * 1e3, w = PI2 * c.fam * 1e3, hc = (w * tau) / Math.sqrt(1 + Math.pow(w * tau, 2));-      return {-        chain: [-          IN('{v_i}(t) = A cos({ω_s}t)', 'Your station at ' + c.fam + ' kHz, out of the AM leg.'),-          OP('Coupling capacitor', 'C401', 's', '{H_c}(s) = [[sτ || 1 + sτ]],   τ ≈ 100 nF × 1 kΩ = 0.1 ms', 'A high-pass with its corner at 1.6 kHz, far below medium wave.'),-          OP('Evaluate at the station', '', 'jw', '|{H_c}(j{ω_s})| = [[{ω_s}τ || √(1 + ({ω_s}τ)²)]] = ' + n(hc, 6) + '  ≈ 1'),-          OP('Common-emitter gain', 'Q401, R407, R405', 't', '{A_v} = −[[{R_C} || {r_e} + {R_E}]] = −[[470 Ω || 6.8 Ω + 22 Ω]] = −16',-            '{r_e} = 26 mV / 3.8 mA = 6.8 Ω. R406 is bypassed by C404, so it only sets the DC current.'),-        ],-        out: OUT('{v_o}(t) ≈ −16A cos({ω_s}t)', 'About +24 dB, flat across the AM band: nothing here is tuned.'),-        how: 'R407 is the collector load R_C and the unbypassed R405 (22 Ω) is R_E. C401 blocks DC and passes everything from about 2 kHz up, so the whole AM band gets the same gain.',-        flow: '{A_v} = [[{R_C} || {r_e} + {R_E}]]',-      };-    },--    amlo: (c) => {-      const K = c.amK, P = K.P, sum = P.side === 'sum', f = c.fam / 1000;-      if (P.lo == null) return unreachable('{f_LO} = 10.695 ± ' + n(f, 3) + ' MHz');-      const lo = P.lo, Cs = 1 / Math.pow(PI2 * lo * 1e6, 2) / 8.2e-6 * 1e12;-      const Cb = 1 / (1 / Cs - 1 / 220 - 1 / 470), Cx = Cb - 15;-      const Cv = Cx > 0 && Cx < 33 ? 1 / (1 / Cx - 1 / 33) : null;-      const fit = Cv == null ? 'more than C411 can pass even with an infinite varactor' : Cv > 56 ? 'more than the BB910 gives at 0 V (56 pF): the first board gets there only through its extra stray capacitance'-        : Cv < 13.9 ? 'less than the BB910 reaches at 4.8 V (13.9 pF): with these values the top of the band is out of reach' : 'inside the BB910’s 13.9 to 56 pF range (4.8 V to 0 V)';-      return {-        chain: [-          IN('{f_LO} = ' + (sum ? '{f_IF} − {f_RF} = 10.695 − ' + n(f, 3) : '{f_RF} + {f_IF} = ' + n(f, 3) + ' + 10.695') + ' = ' + mhz(lo),-            sum ? 'The first board’s AM LO runs low, so the firmware uses the mixer’s sum product.' : 'AM is converted up: the LO runs 10.695 MHz above the station.'),-          OP('What series capacitance resonates there', 'L401 (8.2 µH)', 's', '{Z_series}(s) = sL + [[1 || s{C_s}]] = 0  at  s = j{ω_LO},   {C_s} = [[1 || (2π{f_LO})² L]] = ' + n(Cs, 1) + ' pF',-            'In a Clapp oscillator the series L-C branch is a short at the oscillation frequency.'),-          OP('Take out the feedback divider', 'C408, C409', 't', '[[1 || {C_s}]] = [[1 || {C_tune}]] + [[1 || 220 pF]] + [[1 || 470 pF]],   {C_tune} = ' + n(Cb, 1) + ' pF',-            'C408 and C409 are large, so they barely count: that is why Q402’s own capacitance hardly moves the frequency.'),-          OP('What the varactor must be', 'C410, C411, D401', 't', '{C_tune} = 15 pF + [[33 pF · {C_v} || 33 pF + {C_v}]],   {C_v} = ' + (Cv == null ? '-' : n(Cv, 1) + ' pF'),-            'That is ' + fit + '. VT_AM from the DAC sets D401.'),-          OP('Loop gain of exactly 1 at 0°', 'Q402, C408, C409', 's', '{T}(j{ω_LO}) = {g_m}{Z}β = 1', 'C408 and C409 feed part of the emitter swing back; Q402’s nonlinearity settles the amplitude.'),-        ],-        out: OUT('{v_LO}(t) = B cos(2π · ' + mhz(lo) + ' · t)', 'Taken at the emitter and coupled to the mixer through C412.'),-        how: 'This is a Clapp oscillator: L401 is in series with the small tuning capacitance (C410 in parallel with C411 and the varactor D401), and C408/C409 form the feedback divider. Because the series capacitance is far smaller than C408 and C409, it sets the frequency almost alone.',-        flow: '{ω_LO} = [[1 || √(L{C_s})]]',-      };-    },--    ammix: (c) => {-      const K = c.amK, P = K.P, f = c.fam / 1000;-      if (P.lo == null) return unreachable('{v_RF}(t) = A cos(2π · ' + c.fam + ' kHz · t)');-      const lo = P.lo, sum = P.side === 'sum', d = Math.abs(lo - f), s = lo + f;-      const keep = sum ? s : d, drop = sum ? d : s;-      return {-        chain: [-          IN('{v_RF}(t) = A cos({ω_s}t),   {v_LO}(t) = B cos({ω_LO}t)', 'Your station at ' + c.fam + ' kHz from the preamp, and the LO at ' + mhz(lo) + ' from Q402.'),-          OP('Add them on the base; the junction squares the sum', 'C405, C412, Q403', 't', '{i_c} ≈ {I_C}[1 + [[{v_be} || {V_T}]] + [[{v_be}² || 2{V_T}²]]],   {v_be}² ⊃ 2AB cos({ω_s}t) cos({ω_LO}t)',-            'The same exponential-junction multiplier as the FM mixer; the squared terms of each input land far from 10.7 MHz and are dropped.'),-          OP('Product to sum', '', 't', '2AB cos({ω_s}t) cos({ω_LO}t) = AB cos(({ω_LO} − {ω_s})t) + AB cos(({ω_LO} + {ω_s})t)'),-          OP('Put in the numbers', '', 't', '= AB cos(2π · ' + mhz(d) + ' · t) + AB cos(2π · ' + mhz(s) + ' · t)'),-          OP('Keep only what the 10.7 MHz filter passes', 'R501, FL501', 'jw', '|{H}(j2π · ' + n(drop, 3) + ' MHz)| ≈ 0  →  ~~AB cos(2π · ' + n(drop, 3) + ' MHz · t)~~',-            sum ? 'Here the difference is the one thrown away: the first board keeps the sum.' : 'The sum at ' + n(s, 3) + ' MHz is far outside the filter.'),-        ],-        out: OUT('{v_IF}(t) ≈ K · AB cos(2π · ' + mhz(keep) + ' · t)', 'Your station on the 10.695 MHz IF.'),-        how: 'C405 brings the preamplified RF and C412 the LO to Q403’s base, C413 grounds the emitter, and the collector shares R501 with the FM mixer. Only one front end is powered at a time, so the two mixers never fight over that node.',-        flow: '{f_IF} = {f_LO} − {f_RF}',-      };-    },--    cf1: (c) => {-      const fm = c.band !== 'am', dn = fm ? 0.4 : 0.1;-      const h0 = resp('cer10', 10.695, -4), hn = resp('cer10', 10.695 + dn, -35);-      return {-        chain: [-          IN('{v_i}(t) = A cos({ω_IF}t) + B cos({ω_n}t)', 'Your station at 10.695 MHz and a neighbour ' + (fm ? '400' : '100') + ' kHz away, as the mixer left them.'),-          OP('Each resonator is a band-pass', 'FL501', 's', '{H}(s) ≈ [[({ω_0}/Q) s || s² + ({ω_0}/Q) s + {ω_0}²]],   Q = [[{f_0} || BW]] = [[10.7 MHz || 180 kHz]] ≈ 59',-            'The ceramic plate only vibrates strongly near 10.7 MHz. Its real shape is the datasheet’s: 180 kHz wide at −3 dB, 4 dB loss.'),-          OP('Put in s = jω for each signal', 'R501, R503 (330 Ω)', 'jw', '|{H}(j{ω_IF})| = ' + num(g(h0)) + '   (' + dbs(h0) + '),   |{H}(j{ω_n})| = ' + num(g(hn)) + '   (' + dbs(hn) + ')',-            'The filter only has this shape with 330 Ω on both sides.'),-        ],-        out: OUT('{v_o}(t) ≈ ' + num(g(h0)) + 'A cos({ω_IF}t + φ) + ' + num(g(hn)) + 'B cos({ω_n}t)',-          fm ? 'FM’s ±75 kHz deviation fits in 180 kHz (Carson: 2 × (75 + 15) kHz). The neighbour is down but not gone: the second filter finishes it.' : 'For AM this filter is far too wide: the 455 kHz filter does the real channel selection.'),-        how: 'FL501 is a piezoelectric ceramic plate: the electrodes turn voltage into vibration and back, and the plate only rings near its mechanical resonance at 10.7 MHz. R501 (the mixer’s load) and R503 are the 330 Ω source and load it is designed for. C502 shunts the 100 MHz LO leakage before the filter.',-        flow: 'BW = 2(Δf + {f_m})',-      };-    },--    ifamp: (c) => {-      const fm = c.band !== 'am', dn = fm ? 0.4 : 0.1;-      const h0 = g(resp('cer10', 10.695, -4)), hn = g(resp('cer10', 10.695 + dn, -35));-      const Av = 165 / (6.7 + 22), a = Av * h0 * h0, b = Av * hn * hn;-      return {-        chain: [-          IN('{v_i}(t) = A cos({ω_IF}t) + B cos({ω_n}t)', 'Your station and the same neighbour, as they leave FL501 (A and B include its gain).'),-          OP('Common-emitter gain', 'Q501, R508, R506', 't', '{A_v} = −[[{R_C} ∥ {R_L} || {r_e} + {R_E}]] = −[[330 Ω ∥ 330 Ω || 6.7 Ω + 22 Ω]] = −' + n(Av, 1),-            'R508 is {R_C}; the second filter’s 330 Ω input is {R_L}; the unbypassed R506 is {R_E}.'),-          OP('The second filter, same shape', 'FL502', 'jw', '|{H}(j{ω_IF})| = ' + num(h0) + ',   |{H}(j{ω_n})| = ' + num(hn)),-          OP('Multiply it through', '', 't', '{v_o} = −' + n(Av, 1) + ' × [' + num(h0) + 'A cos({ω_IF}t) + ' + num(hn) + 'B cos({ω_n}t)]'),-        ],-        out: OUT('{v_o}(t) ≈ −' + n(Av * h0, 1) + 'A cos({ω_IF}t) ~~− ' + num(Av * hn) + 'B cos({ω_n}t)~~',-          'From the mixer to here the neighbour has been multiplied by ' + num(b) + ' against ' + n(a, 1) + ' for your station: about ' + n(20 * lg(a / b), 0) + ' dB apart, so call it zero.'),-        how: 'Q501 is a common-emitter stage whose gain only makes up for the two filters’ losses, so the 10.7 MHz strip stays well below the level where it would distort. Two filters in a row double the skirt in dB.',-        flow: '{A_v} = [[{R_C} ∥ {R_L} || {r_e} + {R_E}]]',-      };-    },--    mix2: (c) => {-      const h1 = rcg(0.455, 1.06), h2 = rcg(20.935, 1.06);-      return {-        chain: [-          IN('{v_IF1}(t) = A cos(2π · 10.695 MHz · t),   {v_XO}(t) = B cos(2π · 10.240 MHz · t)', 'Your station on the first IF, and the crystal oscillator.'),-          OP('Multiply (the same junction trick as the first mixer)', 'C508, C509, Q502', 't', '{v}(t) ∝ AB cos(2π · 10.695 MHz · t) cos(2π · 10.240 MHz · t)',-            'C508 brings the IF and C509 the crystal onto Q502’s base; C510 grounds the emitter.'),-          OP('Product to sum', '', 't', '= [[AB || 2]] [cos(2π · 0.455 MHz · t) + cos(2π · 20.935 MHz · t)]'),-          OP('The collector load is a low-pass', 'R513, C511', 's', '{H}(s) = [[{R_513} || 1 + s{R_513}{C_511}]],   {f_c} = [[1 || 2π · 1.5 kΩ · 100 pF]] = 1.06 MHz'),-          OP('Put in s = jω for both terms', '', 'jw', '|{H}(j2π · 0.455 MHz)| = ' + n(h1, 2) + '{R_513},   |{H}(j2π · 20.9 MHz)| = ' + n(h2, 3) + '{R_513}  ≈ 0'),-        ],-        out: OUT('{v_IF2}(t) ≈ K · AB cos(2π · 455 kHz · t) ~~+ ' + n(h2 / h1, 2) + 'K · AB cos(2π · 20.9 MHz · t)~~', 'The 455 kHz IF. It feeds both the FM limiter and the AM filter.'),-        how: 'Q502 multiplies exactly like the first mixers. Its collector load, R513 with C511, is a low-pass that keeps the 455 kHz difference and sinks the 10 and 20 MHz products.',-        flow: '{f_IF2} = {f_IF1} − {f_XO}',-      };-    },--    xo: () => ({-      chain: [-        IN('{Z_xtal}(s) = ({R_m} + s{L_m} + [[1 || s{C_m}]]) ∥ [[1 || s{C_0}]]', 'The quartz crystal’s electrical model (Butterworth-Van Dyke): a series RLC from its mechanics, shunted by its electrode capacitance.'),-        OP('Series resonance: the reactances cancel', 'Y501', 's', 's{L_m} + [[1 || s{C_m}]] = 0  at  {ω_s} = [[1 || √({L_m}{C_m})]]', 'The Q is enormous (tens of thousands), so the loop only has gain in a few-hertz window.'),-        OP('The load capacitance pulls it to 10.240 MHz', 'C514, C515, C516', 't', '[[1 || {C_L}]] = [[1 || 100 pF]] + [[1 || 220 pF]] + [[1 || 15 pF]],   {C_L} = 12.3 pF',-          'The crystal was cut for a 12 pF load; C516 completes it.'),-        OP('Loop gain of 1 only at the crystal’s frequency', 'Q503 (Colpitts)', 's', '{T}(j{ω_XO}) = 1,   |{T}(jω)| < 1 elsewhere', 'C514 and C515 are the Colpitts feedback divider.'),-      ],-      out: OUT('{v_XO}(t) = B cos(2π · 10.240 MHz · t)', '± 20 ppm, which is ± 205 Hz.'),-      how: 'Q503 is a Colpitts amplifier with C514 and C515 as the feedback divider; the crystal sits in the base circuit, so the loop only has gain at the crystal’s resonance. C516 completes the 12 pF load the crystal was cut for.',-      flow: '{ω_s} = [[1 || √({L_m}{C_m})]]',-    }),--    lim: () => {-      const h1 = rcg(0.455, 0.482), h2 = rcg(10, 0.482);-      return {-        chain: [-          IN('{v_in}(t) = A(t) cos θ(t),   θ(t) = 2π · 455 kHz · t + 2π · 75 kHz ∫ m(τ) dτ', 'FM keeps the audio m(t) in the phase θ. The amplitude A(t) only carries fading and noise.'),-          OP('RC low-pass first (time domain)', 'R702, C704', 't', 'RC [[d{v} || dt]] + {v}(t) = {v_in}(t)'),-          OP('Laplace transform it', '', 's', '(1 + sRC) {V}(s) = {V_in}(s),   {H}(s) = [[1 || 1 + sRC]],   {f_c} = [[1 || 2π · 2.2 kΩ · 150 pF]] = 482 kHz'),-          OP('Put in s = jω', '', 'jw', '|{H}(j2π · 455 kHz)| = ' + n(h1, 2) + ',   |{H}(j2π · 10 MHz)| = ' + n(h2, 3) + '  ≈ 0', 'The last 10 MHz products from the second mixer are dropped.'),-          OP('66 dB of gain, then the rails', 'Q701, Q702', 't', '{v_out}(t) = {V_sat} · sgn(cos θ(t))', 'Two common-emitter stages of about 33 dB each: anything above a few millivolts is clipped flat. A(t) is gone.'),-          OP('A square wave’s Fourier series', '', 'f', 'sgn(cos θ) = [[4 || π]] [cos θ − [[1 || 3]] cos 3θ + [[1 || 5]] cos 5θ − …]'),-        ],-        out: OUT('{v_out}(t) = [[4{V_sat} || π]] [cos θ(t) − [[1 || 3]] cos 3θ(t) + …]', 'Constant amplitude: only θ(t), and with it the frequency, survives. The harmonics at 1.365 and 2.275 MHz do not matter, because the next stages only use the zero crossings.'),-        how: 'R702 and C704 are the RC low-pass. Q701 and Q702 are plain common-emitter stages (2.2 kΩ loads, emitters bypassed) with so much gain that the collectors swing between cut-off and saturation. That is the sgn() function.',-        flow: '{v_out} = {V_sat} sgn({v_in})',-      };-    },--    rssi: () => ({-      chain: [-        IN('{v}(t) = A(t) cos({ω_IF}t)', 'The first limiter stage’s collector, LIM1_C.'),-        OP('Conduct only on the positive peaks', 'C711, R711, D701', 't', '{i_D}(t) > 0  only when  {v}(t) > {v_C} + {V_f}', 'C711 and R711 re-centre the swing; the diode tops up C712 near each peak.'),-        OP('Charge on the peaks, bleed in between', 'C712, R712', 't', '{C} [[d{v_C} || dt]] = {i_D}(t) − [[{v_C} || R]]'),-        OP('Between peaks it is a one-pole low-pass', '', 's', '{H}(s) = [[1 || 1 + sτ]],   τ = 100 kΩ × 100 nF = 10 ms', 'At 455 kHz the ripple is ≈ 0; the voltage follows A(t) with a 10 ms memory.'),-      ],-      out: OUT('{V_RSSI}(t) ≈ A(t) − {V_f}', 'On the first board stage 1 already clips on noise, so A is almost constant and the firmware does not use this.'),-      how: 'D701 conducts only on the positive peaks of LIM1_C (through C711, with R711 restoring the DC level), topping up C712; R712 bleeds it down between peaks.',-      flow: 'τ = RC = 10 ms',-    }),--    sq: () => ({-      chain: [-        IN('{v_in}(t) = [[4{V_sat} || π]] cos θ(t) + …', 'The limiter output, LIM2_C: already nearly square.'),-        OP('Divider with a speed-up capacitor', 'R713, R714, C713', 's', '{H}(s) = [[{R_714} || {R_713} + {R_714}]] · [[1 + s{R_713}{C_713} || 1 + s({R_713} ∥ {R_714}){C_713}]]',-          '0.32 at DC but 1 for fast edges: C713 passes the edges straight to the base so the switching is crisp.'),-        OP('Switch', 'Q703, R715', 't', '{v_out}(t) = 4.6 V  if  {v_in}(t) > {V_th} ≈ 2.2 V,  otherwise 0', '{V_th} ≈ 0.65 V × (10 + 4.7) / 4.7.'),-        OP('A 50 % square wave’s series', '', 'f', '{v_out}(t) = 2.3 V + [[4 · 2.3 V || π]] [sin θ + [[1 || 3]] sin 3θ + …]'),-        OP('Scale for the MCU', 'R716, R717', 't', 'IF_CNT = 4.6 V × [[10 kΩ || 14.7 kΩ]] = 3.1 V', 'A valid logic high for the STM32’s counter input.'),-      ],-      out: OUT('LIM_SQ(t) = a 0 to 4.6 V square wave at {f_IF}(t)', 'Its edges carry the frequency: the charge pump counts them, and so does TIM2 (for the AFC).'),-      how: 'Q703 is a transistor used as a switch: R713/R714 divide LIM2_C so it turns on when the limiter output crosses about 2.2 V. R715 pulls the collector up to make LIM_SQ, and R716/R717 scale it to IF_CNT for the MCU.',-      flow: '{V_th} ≈ 2.2 V',-    }),--    pump: () => ({-      chain: [-        IN('LIM_SQ(t): a square wave at  f(t) = 455 kHz + 75 kHz · m(t)', 'm(t) is the audio, between −1 and +1: FM moves the frequency.'),-        OP('Each cycle moves one packet of charge', 'C714, D702', 't', 'q = {C_714} ({V_pp} − 2{V_f}) = 22 pF × (4.6 − 0.6) V = 88 pC', 'Each rising edge pushes q through one diode; each falling edge refills C714 through the other.'),-        OP('Packets per second × charge = current', '', 't', 'i(t) = f(t) · q = (455 kHz + 75 kHz · m(t)) × 88 pC = 40 µA + 6.6 µA · m(t)', 'Frequency has become current.'),-        OP('Current into the integrator (time domain)', 'U701A, R718, C715', 't', '{C_f} [[d{v_o} || dt]] + [[{v_o} − {V_REF} || R]] = −i(t)', 'U701A holds its input at VREF_FM, so all of i(t) flows through R718 ∥ C715.'),-        OP('Laplace transform it', '', 's', '{V_o}(s) − [[{V_REF} || s]] = −{I}(s) · [[R || 1 + sR{C_f}]],   τ = R{C_f} = 51 kΩ × 1.5 nF = 76.5 µs',-          'R is the transimpedance; the pole at 1/(2πτ) = 2.08 kHz is the US 75 µs de-emphasis.'),-        OP('Put in the two parts of i(t)', '', 'jw', 'DC: −51 kΩ × 40 µA = −2.04 V,   audio: −51 kΩ × 6.6 µA = −0.34 V per unit of m,   455 kHz ripple: ~~|{H}| ≈ 0.004~~'),-      ],-      out: OUT('{v_o}(t) ≈ {V_REF} − 2.04 V − 0.34 V · {m_de}(t)', '{m_de} is the audio with the treble boost the station added taken back out (de-emphasis). The DC is removed later by C717.'),-      how: 'C714 is a charge bucket and D702 the two valves. Because every cycle moves the same q, the average current is f × q. U701A turns that current into a voltage through R718, and C715 across it makes the 76.5 µs pole.',-      flow: 'I = {f_IF} · q',-    }),--    fmaud: () => {-      const a1 = skg(1, 15.8, 0.74), a19 = skg(19, 15.8, 0.74), a38 = skg(38, 15.8, 0.74);-      return {-        chain: [-          IN('{v_i}(t) = a(t) + p cos(2π · 19 kHz · t) + s(t) cos(2π · 38 kHz · t) + …', 'The detector’s multiplex: a(t) = L+R audio, the 19 kHz pilot, the L−R stereo signal on 38 kHz, and RDS at 57 kHz.'),-          OP('Sallen-Key low-pass (time domain)', 'U701B, R722, R723, C718, C719', 't', '[[1 || {ω_0}²]] [[d²{v_o} || dt²]] + [[1 || Q{ω_0}]] [[d{v_o} || dt]] + {v_o}(t) = {v_i}(t)'),-          OP('Laplace transform it', '', 's', '{H}(s) = [[{ω_0}² || s² + ({ω_0}/Q) s + {ω_0}²]],   {f_0} = [[1 || 2πR√({C_1}{C_2})]] = 15.8 kHz,   Q = ½√([[{C_1} || {C_2}]]) = 0.74',-            'R = 10 kΩ, {C_1} = 1.5 nF (C718), {C_2} = 680 pF (C719).'),-          OP('Put in s = jω for each part', '', 'jw', '|{H}(j2π · 1 kHz)| = ' + n(a1, 2) + ',   |{H}(j2π · 19 kHz)| = ' + n(a19, 2) + ',   |{H}(j2π · 38 kHz)| = ' + n(a38, 2)),-          OP('Block the DC and re-centre', 'C717, R721', 's', '{H_hp}(s) = [[sRC || 1 + sRC]],   1 / (2π · 100 kΩ · 1 µF) = 1.6 Hz', 'The detector’s −2.04 V offset is removed; the audio now sits on 1.65 V for the ADC.'),-        ],-        out: OUT('{v_o}(t) ≈ 1.65 V + a(t) + ' + n(a19, 2) + 'p cos(2π · 19 kHz · t) + ' + n(a38, 2) + 's(t) cos(…)', 'The pilot is only 4.5 dB down here: the DSP’s FIR and notch remove it after the ADC.'),-        how: 'U701B is a unity-gain follower. R722 and R723 are the two resistors; C718 runs from the middle node to the output, adding positive feedback that sharpens the knee; C719 goes to ground. C717 and R721 block the detector’s DC and re-centre the audio on 1.65 V.',-        flow: '{f_0} = [[1 || 2πR√({C_1}{C_2})]]',-      };-    },--    amf: () => {-      const h0 = resp('cer455', 0.455, -6), hn = resp('cer455', 0.465, -51);-      return {-        chain: [-          IN('{v_i}(t) = A[1 + m · a(t)] cos({ω_c}t) + B cos(({ω_c} + 2π · 10 kHz) t)', 'Your AM station on 455 kHz (carrier plus ±4.5 kHz of audio sidebands) and the next channel 10 kHz away.'),-          OP('A narrow ceramic band-pass', 'FL601', 's', '{H}(s) ≈ band-pass at 455 kHz,   BW = 9 kHz,   Q ≈ [[455 kHz || 9 kHz]] ≈ 51'),-          OP('Put in s = jω', 'R601 (2.7 kΩ termination)', 'jw', '|{H}(j{ω_c})| = ' + num(g(h0)) + '   (' + dbs(h0) + '),   |{H}(j({ω_c} + 2π · 10 kHz))| = ' + num(g(hn)) + '   (' + dbs(hn) + ')  ≈ 0'),-        ],-        out: OUT('{v_o}(t) ≈ ' + num(g(h0)) + 'A[1 + m · a(t)] cos({ω_c}t) ~~+ ' + num(g(hn)) + 'B cos(({ω_c} + 2π · 10 kHz) t)~~', 'The next channel is gone; the sidebands up to ±4.5 kHz pass, which limits AM audio to 4.5 kHz.'),-        how: 'FL601 is a 455 kHz ceramic resonator ladder, like FL501 but much narrower. R601 (2.7 kΩ) in parallel with the amplifier input is its load. VBIAS (R603/R604) is made here for the next stage.',-        flow: 'BW = ±4.5 kHz',-      };-    },--    vga: () => ({-      chain: [-        IN('{v_d}(t) = A[1 + m · a(t)] cos({ω_c}t)', 'The filtered AM signal across the first differential pair.'),-        OP('A differential pair splits its tail current', 'Q601, Q603', 't', '{i_C1} − {i_C2} = {I_tail} tanh([[{v_d} || 2{V_T}]])'),-        OP('Small signal: tanh x ≈ x', '', 't', 'tanh x = x ~~− [[x³ || 3]] + …~~', 'With {v_d} well under 2{V_T} = 52 mV the cube is negligible.'),-        OP('Into one 2.2 kΩ collector load', 'R606, R611', 't', '{v_o} = [[{I_tail} {R_C} || 4{V_T}]] {v_d}'),-        OP('The AGC voltage sets the tail current', 'Q602, Q604, R608, R609, R607, R612', 't', '{I_tail} = [[{V_AGC}/2 − {V_BE} || 2 kΩ]]', 'Gain proportional to current: the stage multiplies the signal by the AGC voltage.'),-      ],-      out: OUT('{v_o}(t) = G({V_AGC}) · A[1 + m · a(t)] cos({ω_c}t),   G = [[{I_tail} · 2.2 kΩ || 104 mV]]', 'From 19 per stage at 0.9 mA down to 0.2 at 10 µA: about 40 dB of range each, 80 dB for the pair.'),-      how: 'Each BC847BS pair splits its tail current between two collectors according to the input difference, which is the tanh() law. Q602 and Q604 set the tail currents from V_AGC.',-      flow: '{A} = [[{I_tail}{R_C} || 4{V_T}]]',-    }),--    det: () => ({-      chain: [-        IN('{v_IF}(t) = {A_c}[1 + m · a(t)] cos({ω_c}t)', 'The AM signal at 455 kHz: the audio a(t) is in the envelope.'),-        OP('Post-amp', 'Q605', 't', '× 30', 'A common-emitter stage, about 2.2 kΩ / 70 Ω.'),-        OP('The diode follows the peaks', 'D601', 't', '{v_C}(t) → 30{A_c}[1 + m · a(t)] − {V_f}', 'D601, a Schottky, conducts only near each positive peak and charges C612.'),-        OP('The RC holds between peaks (time domain)', 'C612, R619', 't', 'RC [[d{v_C} || dt]] + {v_C} = peaks,   needs  [[1 || {f_c}]] ≪ RC ≪ [[1 || {f_audio}]]:  2.2 µs ≪ 22 µs ≪ 140 µs'),-        OP('As a filter on the envelope', '', 's', '{H}(s) = [[1 || 1 + s · 22 µs]],   |{H}(j2π · 455 kHz)| = 0.016 ≈ 0,   |{H}(j2π · 5 kHz)| = 0.82', 'The carrier ripple is dropped; the audio passes.'),-      ],-      out: OUT('{v_DET}(t) ≈ (30{A_c} − {V_f}) + 30{A_c} m · a(t) ~~+ ripple at 455 kHz~~', 'A DC level that tracks the station’s strength (for the AGC) plus the audio.'),-      how: 'Q605 adds the last gain. D601 conducts near each positive peak and charges C612; R619 lets the voltage fall again between peaks. With RC much longer than one IF cycle but shorter than an audio cycle, the capacitor voltage traces the envelope.',-      flow: '{v_DET} ≈ {A_c}[1 + m·a(t)]',-    }),--    agc: () => ({-      chain: [-        IN('{v_DET}(t) = {V_DC} + k · a(t)', '{V_DC} tracks the carrier strength; a(t) is the audio.'),-        OP('Integrate the error (time domain)', 'U601A, R620, C614, R623', 't', '[[d{v_AGC} || dt]] = [[{V_REF} − {v_DET} || {R_620}{C_614}]],   {V_REF} = 1.0 V'),-        OP('Laplace: a PI controller', '', 's', '{C}(s) = −[[1 + s{R_623}{C_614} || s{R_620}{C_614}]]', 'An integrator (100 kΩ × 1 µF = 0.1 s) with a zero at 34 Hz from R623.'),-        OP('Steady state: the integrator stops when its input is zero', '', 't', '[[d{v_AGC} || dt]] = 0  →  {V_DC} = {V_REF} = 1.0 V', 'A strong station raises V_DET, V_AGC falls, the VGA’s gain falls, until V_DET is back at 1.0 V.'),-        OP('Audio low-pass', 'U601B', 's', '{H}(s) = [[{ω_0}² || s² + ({ω_0}/Q) s + {ω_0}²]],   {f_0} = 4.95 kHz,   Q = 0.73'),-      ],-      out: OUT('AM_AUDIO(t) ≈ k · a(t) up to 5 kHz,   with {V_DC} held at 1.0 V', 'The same loudness for strong and weak stations.'),-      how: 'U601A compares the detector’s DC with 1.0 V and integrates the error into V_AGC. U601B is the same Sallen-Key as the FM side, tuned to 4.95 kHz.',-      flow: '[[d{V_AGC} || dt]] ∝ {V_REF} − {V_DET}',-    }),--    vt: (c) => {-      const K = c.band === 'am' ? c.amK : c.fmK;-      if (K.dac == null) return unreachable('VT for an out-of-reach station');-      const w = PI2 * 1000, h = 1.45 / Math.sqrt(1 + Math.pow(w * 0.047, 2)) / Math.sqrt(1 + Math.pow(w * 0.01, 2));-      return {-        chain: [-          IN('{V_DAC} = [[' + K.dac + ' || 4095]] × 3.3 V = ' + n(K.vdac, 3) + ' V', 'The ' + (c.band === 'am' ? 'AM' : 'FM') + ' DAC code for the station in the tuner.'),-          OP('Non-inverting amplifier', 'U201, R201, R202', 't', '{V_T} = (1 + [[{R_201} || {R_202}]]) {V_DAC} = 1.45 × ' + n(K.vdac, 3) + ' V = ' + n(K.vt, 3) + ' V', '0 to 3.3 V from the DAC becomes 0 to 4.8 V for the varactor.'),-          OP('Two RC poles (time domain)', 'R203, C201, R204, C202', 't', 'τ [[d{v} || dt]] + {v} = {v_in},   τ₁ = 47 ms,   τ₂ = 10 ms'),-          OP('Laplace transform it', '', 's', '{H}(s) = 1.45 · [[1 || 1 + s · 47 ms]] · [[1 || 1 + s · 10 ms]]', 'Poles at 3.4 Hz and 16 Hz.'),-          OP('Any noise at 1 kHz', '', 'jw', '|{H}(j2π · 1 kHz)| = ' + num(h) + '  ≈ 0', 'Noise on the tuning voltage would frequency-modulate the oscillator, so it is filtered down to a few hertz.'),-        ],-        out: OUT('{V_T}(t) ≈ ' + n(K.vt, 3) + ' V ~~+ noise~~', '1.17 mV per DAC code at the varactor.'),-        how: 'U201 is a non-inverting amplifier: R201 from the output to the inverting input and R202 to ground set the 1.45 gain. R203/C201 and R204/C202 are the two RC poles.',-        flow: '{V_T} = 1.45 · {V_DAC}',-      };-    },--    pwm: (c) => {-      const K = c.fmK, D = K.pwm / 4096, w = PI2 * 11.7e3;-      const h = 1 / (1 + Math.pow(w * 0.01, 2)) / Math.sqrt(1 + Math.pow(w * 0.001, 2));-      return {-        chain: [-          IN('{v_PWM}(t) = 3.3 V for a fraction D of each cycle, else 0,   D = [[' + K.pwm + ' || 4096]] = ' + n(D, 3), 'TIM3 on PB1 at 48 MHz / 4096 = 11.7 kHz.'),-          OP('Its Fourier series', '', 'f', '{v_PWM}(t) = D · 3.3 V + Σ [[2 · 3.3 V || kπ]] sin(kπD) cos(k{ω_PWM}t)', 'A DC average plus harmonics of 11.7 kHz.'),-          OP('Two RC poles, then ×1.45, then one more', 'R209, C206, R210, C207, U202A, R213, C208', 's', '{H}(s) = [[1 || (1 + s · 10 ms)²]] · 1.45 · [[1 || 1 + s · 1 ms]]'),-          OP('Put in s = jω', '', 'jw', '|{H}(0)| = 1.45,   |{H}(j2π · 11.7 kHz)| = ' + num(h * 1.45) + '  ≈ 0', 'The ripple is gone; only the average is left.'),-        ],-        out: OUT('{V_RF} = 1.45 · D · 3.3 V = ' + n(K.vtRf, 2) + ' V ~~+ ripple~~', 'That puts the RF tank at ' + n(K.tank, 2) + ' MHz.'),-        how: 'The STM32’s two DACs are busy with the oscillators, so TIM3 makes a PWM on PB1. R209/C206 and R210/C207 average it, U202A multiplies by 1.45, and R213/C208 clean up the op-amp output.',-        flow: '{V_RF} = 1.45 · D · 3.3 V',-      };-    },--    band: (c) => ({-      chain: [-        IN((c.band === 'am' ? 'AM_EN_N' : 'FM_EN_N') + ' = 0 V', 'The firmware pulls the enable pin low to turn a band on.'),-        OP('Base current', c.band === 'am' ? 'R220' : 'R218', 't', '{I_B} = [[5 V − {V_EB} || 1 kΩ]] = [[5 V − 0.7 V || 1 kΩ]] = 4.3 mA'),-        OP('Saturate the switch', c.band === 'am' ? 'Q202' : 'Q201', 't', 'β{I_B} ≈ 100 × 4.3 mA ≫ 15 mA', 'Far more base drive than the front end’s current needs, so the PNP is fully on.'),-      ],-      out: OUT('+5V_' + (c.band === 'am' ? 'AM' : 'FM') + ' ≈ 5 V − {V_CE(sat)} ≈ 4.9 V', 'At reset the pins float and R217/R219 hold the bases at 5 V: both bands start off.'),-      how: 'Q201 and Q202 are PNP transistors with their emitters on +5VA. Pulling FM_EN_N or AM_EN_N low draws base current through R218/R220 and the transistor switches on, powering that band’s RF amp, oscillator and mixer.',-      flow: 'EN low → band on',-    }),--    ui: () => ({-      chain: [-        IN('GPIO = 3.3 V', 'The firmware drives the LED pin high.'),-        OP('The resistor takes what the LED does not', 'series resistor', 't', '{I_LED} = [[3.3 V − {V_f} || R]]'),-      ],-      out: OUT('Green and blue: [[3.3 − 2.8 V || 220 Ω]] = 2.3 mA,   yellow: [[3.3 − 2.0 V || 1 kΩ]] = 1.3 mA', ''),-      how: 'Each LED hangs from a GPIO through a resistor that sets its current from the difference between 3.3 V and its forward voltage.',-      flow: 'I = (3.3 V − {V_f}) / R',-    }),--    mcu: (c) => {-      const C = c.fmK.c, fm = c.band !== 'am';-      const chain = [-        IN('x(t) = a(t)' + (fm ? ' + p cos(2π · 19 kHz · t) + …' : ''), 'The audio from the analog chain' + (fm ? ', with what is left of the pilot and subcarriers' : '') + ', on 1.65 V.'),-        OP('Sample it', 'ADC, TIM15', 'z', 'x[n] = x(n{T_s}),   {T_s} = [[1 || 192 kHz]]', 'Far faster than needed, so the analog filters only have to stop things above 96 kHz.'),-        OP('32-tap FIR low-pass', 'firmware', 'z', 'y[n] = Σ_(k = 0…31) h[k] x[n − k],   {H}(z) = Σ h[k] z⁻ᵏ', 'Flat to 15 kHz, at least 58 dB down (×0.0013) from 30 kHz.'),-        OP('Keep every fourth sample', 'firmware', 'z', 'w[m] = y[4m]', '192 kHz / 4 = 48 kHz. Nothing above 24 kHz is left to fold back.'),-      ];-      if (fm && C.notch) chain.push(OP('19 kHz notch', 'firmware', 'z', '{H}(z) = [[1 − 2 cos({ω_0}) z⁻¹ + z⁻² || 1 − 2r cos({ω_0}) z⁻¹ + r² z⁻²]],   |{H}(e^(j{ω_0}))| = 0.0025 ≈ 0', 'Zeros on the unit circle at 19 kHz, poles just inside (r < 1) so the notch is narrow.'));-      if (C.gain) chain.push(OP('Gain', 'firmware', 'z', 'w[m] × ' + n(Math.pow(10, C.gain / 20), 2) + '   (' + dbs(C.gain) + ')'));-      return {-        chain,-        out: OUT(C.mute ? 'Muted: nothing goes to the PC' : 'z[m] ≈ a(m · 20.8 µs)' + (fm && C.notch ? ' ~~+ 0.0025p cos(…)~~' : fm ? ' + p cos(2π · 19 kHz · m · 20.8 µs)' : ''), 'Sent to the PC at 48 kHz as a USB microphone.'),-        how: 'The STM32G0B1 samples the audio at 192 kHz, then does the sharp filtering digitally: the FIR removes everything above 15 kHz, keeping every fourth sample brings it down to 48 kHz, and the notch removes the 19 kHz pilot.',-        flow: 'y[n] = Σ h[k] x[n − k]',-      };-    },--    usb: () => ({-      chain: [-        IN('VBUS = 5 V', 'From the USB-C host, once it sees the 5.1 kΩ pull-downs on CC1/CC2 (R101, R102).'),-        OP('Through the OR-ing diode', 'D105', 't', '{V_5V} = 5 V − {V_f} ≈ 4.7 V', 'D105 and D106 let USB or the machine-pin VIN supply the board without fighting.'),-        OP('Power lost in the diode', 'D105', 't', '{P_D105} = {V_f} · I = 0.3 V × 85 mA ≈ 26 mW', 'It runs about 4 °C warm.'),-      ],-      out: OUT('+5V ≈ 4.7 V,   up to 500 mA (F101)', ''),-      how: 'J101 brings in VBUS, D+ and D−. D105 and D106 OR the USB and VIN supplies, F101 limits the current, and U101 clamps ESD on the data lines.',-      flow: '{R_CC} = 5.1 kΩ',-    }),--    reg: () => ({-      chain: [-        IN('{V_in} ≈ 4.7 V', 'The +5V rail after the OR-ing diode.'),-        OP('Linear regulator', 'U102 (AP2112K)', 't', '{V_out} = 3.3 V,   {P_LDO} = ({V_in} − {V_out}) · I = 1.4 V · I'),-        OP('Ferrite and capacitor filters', 'FB101, FB102', 's', '{H}(s) = [[1 || 1 + s · L/R + s²LC]]', '600 Ω at 100 MHz with 22 µF / 1 µF: the MCU’s switching noise stays off +5VA and +3.3VA.'),-      ],-      out: OUT('+3.3V for the MCU;   +5VA and +3.3VA kept quiet for the RF and the ADC', ''),-      how: 'U102 drops the 5 V rail to 3.3 V for the MCU. The ferrite beads FB101 and FB102 with their capacitors are LC low-pass filters that keep the MCU’s switching noise out of the analog rails.',-      flow: '{V_out} = 3.3 V',-    }),-  };-})();--// Render the markup: {f_IF} variables, [[num || den]] fractions, ~~dropped terms~~. html() for the page, svg() for the diagram.-var MATHFMT = (function () {-  const esc = (s) => String(s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');-  const VAR = /\{([^{}_^\[\]]+?)(?:_([^{}^\[\]]+))?(?:\^([^{}\[\]]+))?\}/g;-  function inline(s) {-    return esc(s).replace(VAR, (m, b, sub, sup) => '<i>' + b + '</i>' + (sub ? '<sub>' + sub + '</sub>' : '') + (sup ? '<sup>' + sup + '</sup>' : ''))-      .replace(/\^\(([^()]*)\)/g, '<sup>$1</sup>').replace(/\^([−-]?[0-9.]+)/g, '<sup>$1</sup>');-  }-  function fracs(s) {-    let out = '', i = 0;-    while (i < s.length) {-      const a = s.indexOf('[[', i);-      if (a < 0) { out += inline(s.slice(i)); break; }-      const b = s.indexOf(']]', a);-      out += inline(s.slice(i, a));-      const [num, den] = s.slice(a + 2, b).split('||');-      out += '<span class="frac"><span class="fn">' + inline(num.trim()) + '</span><span class="fd">' + inline((den || '').trim()) + '</span></span>';-      i = b + 2;-    }-    return out;-  }-  function html(s) {-    return String(s).split('~~').map((part, k) => (k % 2 ? '<span class="drop" title="≈ 0: dropped">' + fracs(part) + '</span>' : fracs(part))).join('');-  }-  // SVG: dropped terms vanish, fractions become a/b inline, subscripts become shifted tspans-  function svg(s) {-    s = String(s).replace(/~~[^~]*~~/g, '');-    s = s.replace(/\[\[\s*(.*?)\s*\|\|\s*(.*?)\s*\]\]/g, (m, a, b) => (/[ +−]/.test(a) ? '(' + a + ')' : a) + '/' + (/[ +−·]/.test(b) ? '(' + b + ')' : b));-    let out = '', last = 0, m, pending = 0;-    VAR.lastIndex = 0;-    const plain = (t) => { if (!t) return; out += '<tspan' + (pending ? ' dy="' + pending + '"' : '') + '>' + esc(t) + '</tspan>'; pending = 0; };-    while ((m = VAR.exec(s))) {-      plain(s.slice(last, m.index));-      out += '<tspan class="mv"' + (pending ? ' dy="' + pending + '"' : '') + '>' + esc(m[1]) + '</tspan>';-      pending = 0;-      if (m[2]) { out += '<tspan class="ms" dy="3">' + esc(m[2]) + '</tspan>'; pending = -3; }-      last = VAR.lastIndex;-    }-    plain(s.slice(last));-    if (pending) out += '<tspan dy="' + pending + '"> </tspan>';-    return out;-  }-  return { html, svg };-})();--/* rfflow.js: the receiver drawn as an RF block diagram (standard symbols), with an equation under each step.- * RFFLOW.draw(eqOf) returns the SVG markup; eqOf(block) gives that block's compact equation (math.js markup).- * Every symbol group has data-id = its design.py block, so a click opens that block's schematic. */-var RFFLOW = (function () {-  'use strict';-  const esc = (s) => String(s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');--  // ---------------------------------------------------------------- symbols (centre x, y)-  const tri = (x, y) => 'M' + (x - 20) + ',' + (y - 19) + 'L' + (x - 20) + ',' + (y + 19) + 'L' + (x + 21) + ',' + y + 'Z';-  const arrowHead = (x, y, ang) => { const a = ang * Math.PI / 180, l = 6; return 'M' + x + ',' + y + 'L' + (x - l * Math.cos(a - 0.45)).toFixed(1) + ',' + (y - l * Math.sin(a - 0.45)).toFixed(1) + 'M' + x + ',' + y + 'L' + (x - l * Math.cos(a + 0.45)).toFixed(1) + ',' + (y - l * Math.sin(a + 0.45)).toFixed(1); };-  const SYM = {-    antenna: (x, y) => '<path class="s" d="M' + x + ',' + y + 'V' + (y - 30) + 'M' + (x - 13) + ',' + (y - 44) + 'L' + x + ',' + (y - 30) + 'L' + (x + 13) + ',' + (y - 44) + 'Z"/>',-    filter: (x, y, o) => {-      const k = o.kind, X0 = x - 16, X1 = x + 16, Yt = y - 8, Yb = y + 8;-      const g = k === 'lp' ? 'M' + X0 + ',' + Yt + 'H' + (x + 2) + 'Q' + (x + 9) + ',' + Yt + ' ' + (x + 12) + ',' + Yb-        : k === 'hp' ? 'M' + (x - 12) + ',' + Yb + 'Q' + (x - 9) + ',' + Yt + ' ' + (x - 2) + ',' + Yt + 'H' + X1-          : 'M' + X0 + ',' + Yb + 'Q' + (x - 9) + ',' + Yb + ' ' + (x - 6) + ',' + Yt + 'H' + (x + 6) + 'Q' + (x + 9) + ',' + Yb + ' ' + X1 + ',' + Yb;-      return '<rect class="s" x="' + (x - 24) + '" y="' + (y - 17) + '" width="48" height="34" rx="3"/><path class="g" d="' + g + '"/>' +-        '<path class="gx" d="M' + X0 + ',' + (Yb + 4) + 'H' + X1 + '"/>';-    },-    amp: (x, y, o) => {-      let s = '<path class="s" d="' + tri(x, y) + '"/>';-      if (o.vga) s += '<path class="g" d="M' + (x - 14) + ',' + (y + 17) + 'L' + (x + 6) + ',' + (y - 17) + arrowHead(x + 6, y - 17, -60) + '"/>';-      if (o.tuned) {   // a varactor-tuned tank on the output: plates with an arrow, hung from the top edge-        const t = y - 10;-        s += '<path class="s" d="M' + x + ',' + t + 'V' + (t - 13) + 'M' + (x - 8) + ',' + (t - 13) + 'H' + (x + 8) + 'M' + (x - 8) + ',' + (t - 18) + 'H' + (x + 8) + 'M' + x + ',' + (t - 18) + 'V' + (t - 24) + '"/>' +-          '<path class="g" d="M' + (x - 11) + ',' + (t - 8) + 'L' + (x + 11) + ',' + (t - 23) + arrowHead(x + 11, t - 23, -34) + '"/>';-      }-      if (o.text) s += '<text class="st" x="' + (x - 6) + '" y="' + (y + 4) + '" text-anchor="middle">' + esc(o.text) + '</text>';-      return s;-    },-    mixer: (x, y) => '<circle class="s" cx="' + x + '" cy="' + y + '" r="17"/><path class="s" d="M' + (x - 12) + ',' + (y - 12) + 'L' + (x + 12) + ',' + (y + 12) + 'M' + (x + 12) + ',' + (y - 12) + 'L' + (x - 12) + ',' + (y + 12) + '"/>',-    osc: (x, y, o) => {-      let s = '<circle class="s" cx="' + x + '" cy="' + y + '" r="17"/><path class="g" d="M' + (x - 11) + ',' + y + 'C' + (x - 7) + ',' + (y - 13) + ' ' + (x - 3) + ',' + (y - 13) + ' ' + x + ',' + y + 'S' + (x + 7) + ',' + (y + 13) + ' ' + (x + 11) + ',' + y + '"/>';-      if (o.vco) s += '<path class="g" d="M' + (x - 19) + ',' + (y + 19) + 'L' + (x + 19) + ',' + (y - 19) + arrowHead(x + 19, y - 19, -45) + '"/>';-      if (o.xtal) s += '<path class="s" d="M' + (x - 34) + ',' + (y - 8) + 'V' + (y + 8) + 'M' + (x - 24) + ',' + (y - 8) + 'V' + (y + 8) + 'M' + (x - 24) + ',' + y + 'H' + (x - 17) + '"/><rect class="s" x="' + (x - 31.5) + '" y="' + (y - 10) + '" width="5" height="20"/>';-      return s;-    },-    limiter: (x, y) => '<path class="s" d="' + tri(x, y) + '"/><path class="g" d="M' + (x - 15) + ',' + (y + 1) + 'L' + (x - 12) + ',' + (y - 6) + 'H' + (x - 6) + 'L' + (x - 3) + ',' + (y + 1) + 'L' + x + ',' + (y + 7) + 'H' + (x + 6) + 'L' + (x + 8) + ',' + (y + 2) + '"/>',-    comparator: (x, y) => '<path class="s" d="' + tri(x, y) + '"/><path class="g" d="M' + (x - 15) + ',' + (y + 6) + 'H' + (x - 10) + 'V' + (y - 6) + 'H' + (x - 3) + 'V' + (y + 6) + 'H' + (x + 4) + 'V' + (y - 6) + 'H' + (x + 8) + '"/>',-    disc: (x, y) => '<rect class="s" x="' + (x - 27) + '" y="' + (y - 17) + '" width="54" height="34" rx="3"/><text class="st" x="' + x + '" y="' + (y + 4) + '" text-anchor="middle">f → V</text>',-    integ: (x, y, o) => {-      const f = o.flip ? -1 : 1;-      const d = 'M' + (x - 20 * f) + ',' + (y - 19) + 'L' + (x - 20 * f) + ',' + (y + 19) + 'L' + (x + 21 * f) + ',' + y + 'Z';-      return '<path class="s" d="' + d + '"/><text class="st big" x="' + (x - 7 * f) + '" y="' + (y + 6) + '" text-anchor="middle">∫</text>';-    },-    diode: (x, y) => '<path class="s" d="M' + (x - 14) + ',' + y + 'H' + (x - 6) + 'M' + (x + 6) + ',' + (y - 8) + 'V' + (y + 8) + 'M' + (x + 6) + ',' + y + 'H' + (x + 14) + '"/><path class="sf" d="M' + (x - 6) + ',' + (y - 8) + 'L' + (x - 6) + ',' + (y + 8) + 'L' + (x + 6) + ',' + y + 'Z"/>' +-      '<path class="s" d="M' + (x + 10) + ',' + y + 'V' + (y + 14) + 'M' + (x + 4) + ',' + (y + 14) + 'H' + (x + 16) + 'M' + (x + 4) + ',' + (y + 18) + 'H' + (x + 16) + 'M' + (x + 10) + ',' + (y + 18) + 'V' + (y + 24) + 'M' + (x + 5) + ',' + (y + 24) + 'H' + (x + 15) + '"/>',-    vdiode: (x, y) => '<path class="s" d="M' + x + ',' + (y - 14) + 'V' + (y - 6) + 'M' + (x - 8) + ',' + (y + 6) + 'H' + (x + 8) + 'M' + x + ',' + (y + 6) + 'V' + (y + 14) + '"/><path class="sf" d="M' + (x - 8) + ',' + (y - 6) + 'L' + (x + 8) + ',' + (y - 6) + 'L' + x + ',' + (y + 6) + 'Z"/>',-    sw: (x, y) => '<circle class="sf" cx="' + (x - 14) + '" cy="' + y + '" r="2.6"/><circle class="sf" cx="' + (x + 14) + '" cy="' + (y - 9) + '" r="2.6"/><circle class="sf" cx="' + (x + 14) + '" cy="' + (y + 9) + '" r="2.6"/><path class="s" d="M' + (x - 14) + ',' + y + 'L' + (x + 12) + ',' + (y - 8) + '"/>',-    adc: (x, y) => '<path class="s" d="M' + (x - 24) + ',' + (y - 15) + 'H' + (x + 10) + 'L' + (x + 24) + ',' + y + 'L' + (x + 10) + ',' + (y + 15) + 'H' + (x - 24) + 'Z"/><text class="st" x="' + (x - 5) + '" y="' + (y + 4) + '" text-anchor="middle">ADC</text>',-    box: (x, y, o) => '<rect class="s" x="' + (x - o.w / 2) + '" y="' + (y - o.h / 2) + '" width="' + o.w + '" height="' + o.h + '" rx="4"/>' +-      (o.lines || []).map((t, i, a) => '<text class="st' + (i ? ' sm' : '') + '" x="' + x + '" y="' + (y + 4 + (i - (a.length - 1) / 2) * 13) + '" text-anchor="middle">' + esc(t) + '</text>').join(''),-    led: (x, y) => '<path class="s" d="M' + (x - 14) + ',' + y + 'H' + (x - 6) + 'M' + (x + 6) + ',' + (y - 8) + 'V' + (y + 8) + 'M' + (x + 6) + ',' + y + 'H' + (x + 14) + '"/><path class="sf" d="M' + (x - 6) + ',' + (y - 8) + 'L' + (x - 6) + ',' + (y + 8) + 'L' + (x + 6) + ',' + y + 'Z"/><path class="g" d="M' + (x - 1) + ',' + (y - 11) + 'L' + (x + 5) + ',' + (y - 18) + arrowHead(x + 5, y - 18, -50) + 'M' + (x + 5) + ',' + (y - 10) + 'L' + (x + 11) + ',' + (y - 17) + arrowHead(x + 11, y - 17, -50) + '"/>',-    pc: (x, y) => '<rect class="s" x="' + (x - 22) + '" y="' + (y - 17) + '" width="44" height="28" rx="2"/><path class="s" d="M' + (x - 8) + ',' + (y + 17) + 'H' + (x + 8) + 'M' + x + ',' + (y + 11) + 'V' + (y + 17) + '"/>',-  };--  // ---------------------------------------------------------------- layout: [block, symbol, x, y, options, label]-  // label: [position, title, live key?]; the equation under the title comes from the block's math (flow form)-  const N = [-    ['ant', 'antenna', 48, 290, {}, ['above', 'Antenna', null, true]],-    ['ant', 'filter', 150, 120, { kind: 'bp' }, ['below', 'Diplexer, FM leg']],-    ['ant', 'filter', 150, 460, { kind: 'lp' }, ['below', 'Diplexer, AM leg', null, true]],-    ['band', 'sw', 150, 290, {}, ['below', 'Band switch']],-    ['pwm', 'amp', 275, 36, { text: '×1.45' }, ['right', 'RF tracking (VT_RF)']],-    ['fmrf', 'amp', 275, 120, { tuned: true }, ['below', 'RF amp, tuned tank']],-    ['vt', 'amp', 300, 205, { text: '×1.45' }, null],-    ['vt', 'amp', 300, 375, { text: '×1.45' }, ['mid', 'Varactor drivers', null, false, [300, 284]]],-    ['fmlo', 'osc', 400, 205, { vco: true }, ['right', 'FM VCO', 'fmLO']],-    ['fmmix', 'mixer', 400, 120, {}, ['above', 'FM mixer', 'fmIF']],-    ['amrf', 'amp', 275, 460, {}, ['below', 'AM preamp']],-    ['amlo', 'osc', 400, 375, { vco: true }, ['right', 'AM VCO', 'amLO']],-    ['ammix', 'mixer', 400, 460, {}, ['below', 'AM mixer', 'amIF']],-    ['cf1', 'filter', 595, 290, { kind: 'bp' }, ['below', 'Filter 1, 10.7 MHz']],-    ['ifamp', 'amp', 720, 290, {}, ['below', 'IF amp']],-    ['ifamp', 'filter', 845, 290, { kind: 'bp' }, ['below', 'Filter 2, 10.7 MHz', null, true]],-    ['mix2', 'mixer', 955, 290, {}, ['above', 'Second mixer', 'if2']],-    ['xo', 'osc', 955, 395, { xtal: true }, ['below', 'Crystal LO']],-    ['lim', 'limiter', 130, 660, {}, ['below', 'Limiter ×2']],-    ['rssi', 'vdiode', 195, 730, {}, ['right', 'RSSI']],-    ['sq', 'comparator', 260, 660, {}, ['below', 'Squarer']],-    ['pump', 'disc', 400, 660, {}, ['below', 'Pulse-count detector', 'pumpI']],-    ['pump', 'integ', 530, 660, {}, ['below', 'De-emphasis', null, true]],-    ['fmaud', 'filter', 660, 660, { kind: 'lp' }, ['below', 'FM audio filter']],-    ['amf', 'filter', 130, 870, { kind: 'bp' }, ['above', '455 kHz filter']],-    ['vga', 'amp', 240, 870, { vga: true }, null],-    ['vga', 'amp', 330, 870, { vga: true }, ['mid', 'AGC amplifiers', null, false, [285, 816]]],-    ['det', 'amp', 430, 870, {}, null],-    ['det', 'diode', 530, 870, {}, ['mid', 'Post-amp & detector', null, false, [480, 816]]],-    ['agc', 'filter', 660, 870, { kind: 'lp' }, ['above', 'AM audio filter', null, true]],-    ['agc', 'integ', 520, 945, { flip: true }, ['below', 'AGC loop']],-    ['mcu', 'adc', 884, 660, {}, null],-    ['mcu', 'adc', 884, 870, {}, null],-    ['mcu', 'box', 990, 765, { w: 80, h: 64, lines: ['DSP', 'FIR ÷4, notch', 'AFC, seek'] }, ['mid', 'STM32G0B1', null, false, [1000, 642]]],-    ['usb', 'box', 1160, 765, { w: 62, h: 30, lines: ['USB-C'] }, ['below', 'USB']],-    ['pc', 'pc', 1160, 665, {}, ['above', 'PC: mic + serial port']],-    ['reg', 'box', 1160, 860, { w: 50, h: 28, lines: ['LDO'] }, ['below', 'Power']],-    ['ui', 'led', 1160, 945, {}, ['below', 'LEDs']],-  ];-  // wires: [kind, [points], fromBlock, toBlock, arrow, label [text|@key, x, y, anchor]]-  const W = [-    ['if', [[48, 290], [95, 290]], 'ant', 'ant', false],-    ['fm', [[95, 290], [95, 120], [124, 120]], 'ant', 'ant', true],-    ['am', [[95, 290], [95, 460], [124, 460]], 'ant', 'ant', true],-    ['fm', [[176, 120], [253, 120]], 'ant', 'fmrf', true, ['@fmRF', 214, 112]],-    ['ctrl', [[275, 56], [275, 87]], 'pwm', 'fmrf', true],-    ['fm', [[297, 120], [381, 120]], 'fmrf', 'fmmix', true],-    ['ctrl', [[322, 205], [381, 205]], 'vt', 'fmlo', true],-    ['fm', [[400, 186], [400, 139]], 'fmlo', 'fmmix', true],-    ['am', [[176, 460], [253, 460]], 'ant', 'amrf', true, ['@amRF', 214, 452]],-    ['am', [[297, 460], [381, 460]], 'amrf', 'ammix', true],-    ['ctrl', [[322, 375], [381, 375]], 'vt', 'amlo', true],-    ['am', [[400, 394], [400, 441]], 'amlo', 'ammix', true],-    ['fm', [[419, 120], [540, 120], [540, 290]], 'fmmix', 'cf1', false],-    ['am', [[419, 460], [540, 460], [540, 290]], 'ammix', 'cf1', false],-    ['if', [[540, 290], [569, 290]], 'fmmix', 'cf1', true],-    ['if', [[621, 290], [698, 290]], 'cf1', 'ifamp', true],-    ['if', [[743, 290], [819, 290]], 'ifamp', 'ifamp', true],-    ['if', [[871, 290], [936, 290]], 'ifamp', 'mix2', true],-    ['if', [[955, 376], [955, 309]], 'xo', 'mix2', true, ['10.240 MHz', 949, 348, 'end']],-    ['if', [[974, 290], [1015, 290], [1015, 548], [60, 548], [60, 660], [108, 660]], 'mix2', 'lim', true, ['455 kHz IF to both detectors', 530, 541]],-    ['if', [[60, 660], [60, 870], [104, 870]], 'mix2', 'amf', true],-    ['fm', [[152, 660], [238, 660]], 'lim', 'sq', true],-    ['fm', [[195, 660], [195, 714]], 'lim', 'rssi', true],-    ['fm', [[195, 744], [195, 782], [838, 782]], 'rssi', 'mcu', true, ['RSSI_FM', 760, 776]],-    ['dig', [[325, 660], [325, 798], [838, 798]], 'sq', 'mcu', true, ['IF_CNT → counter', 760, 810]],-    ['fm', [[282, 660], [371, 660]], 'sq', 'pump', true],-    ['fm', [[428, 660], [508, 660]], 'pump', 'pump', true],-    ['fm', [[552, 660], [634, 660]], 'pump', 'fmaud', true],-    ['fm', [[686, 660], [858, 660]], 'fmaud', 'mcu', true, ['FM audio', 770, 652]],-    ['am', [[156, 870], [218, 870]], 'amf', 'vga', true],-    ['am', [[262, 870], [308, 870]], 'vga', 'vga', true],-    ['am', [[352, 870], [408, 870]], 'vga', 'det', true],-    ['am', [[452, 870], [514, 870]], 'det', 'det', false],-    ['am', [[546, 870], [634, 870]], 'det', 'agc', true],-    ['am', [[686, 870], [858, 870]], 'agc', 'mcu', true, ['AM audio', 770, 862]],-    ['am loop', [[590, 870], [590, 945], [543, 945]], 'det', 'agc', true],-    ['am loop', [[498, 945], [240, 945], [240, 891]], 'agc', 'vga', true, ['V_AGC sets the gain', 370, 961]],-    ['am loop', [[330, 945], [330, 891]], 'agc', 'vga', true],-    ['dig', [[908, 660], [990, 660], [990, 731]], 'mcu', 'mcu', true],-    ['dig', [[908, 870], [990, 870], [990, 799]], 'mcu', 'mcu', true],-    ['dig', [[1032, 765], [1127, 765]], 'mcu', 'usb', true],-    ['dig', [[1160, 748], [1160, 685]], 'usb', 'pc', true],-    ['dig', [[1133, 860], [1082, 860]], 'reg', 'mcu', true],-    ['ctrl', [[1082, 945], [1144, 945]], 'mcu', 'ui', true],-    // control bus from the MCU: DACs, PWM, band enables, calibration marker-    ['ctrl', [[880, 620], [880, 562], [225, 562], [225, 36], [253, 36]], 'mcu', 'pwm', true, ['DAC_FM, DAC_AM, PWM_RF, band enables, CAL_MARK', 560, 576]],-    ['ctrl', [[225, 205], [278, 205]], 'mcu', 'vt', true],-    ['ctrl', [[225, 375], [278, 375]], 'mcu', 'vt', true],-    ['ctrl', [[225, 290], [168, 290]], 'mcu', 'band', true],-    ['ctrl', [[225, 562], [30, 562], [30, 300], [44, 300]], 'mcu', 'ant', true, ['CAL_MARK', 34, 576, 'start']],-  ];-  const JUNCTIONS = [[95, 290], [540, 290], [60, 660], [195, 660], [325, 660], [225, 205], [225, 375], [225, 290], [225, 562], [590, 870], [330, 945]];--  function label(o, x, y, sym, lab, eq, group) {-    const [pos, title, live, , at] = lab;-    let tx = x, ty, an = 'middle';-    const off = { antenna: [52, 0], filter: [17, 17], amp: [19, 19], mixer: [17, 17], osc: [17, 17], limiter: [19, 19], comparator: [19, 19], disc: [17, 17], integ: [19, 19], diode: [10, 24], vdiode: [14, 14], sw: [9, 9], adc: [15, 15], box: [16, 16], led: [18, 8], pc: [17, 17] }[sym] || [18, 18];-    const lines = [['lt', title]];-    if (eq) lines.push(['le', eq]);-    if (live) lines.push(['lv', '@' + live]);-    let y0;-    if (pos === 'mid' && at) { tx = at[0]; y0 = at[1]; }-    else if (pos === 'above') y0 = y - off[0] - 8 - (lines.length - 1) * 14;-    else if (pos === 'below') y0 = y + off[1] + 16;-    else if (pos === 'right') { tx = x + 24; an = 'start'; y0 = y - 6; }-    lines.forEach(([cls, t], i) => {-      const yy = y0 + i * 14;-      if (cls === 'lv') o.push('<text class="lv" x="' + tx + '" y="' + yy + '" text-anchor="' + an + '" data-live="' + t.slice(1) + '"></text>');-      else if (cls === 'le') o.push('<text class="le" x="' + tx + '" y="' + yy + '" text-anchor="' + an + '">' + MATHFMT.svg(t) + '</text>');-      else o.push('<text class="lt" x="' + tx + '" y="' + yy + '" text-anchor="' + an + '">' + esc(t) + '</text>');-    });-  }--  function draw(eqOf, groupOf) {-    const o = [];-    o.push('<defs>');-    for (const k of ['fm', 'am', 'if', 'dig', 'ctrl']) o.push('<marker id="rfa-' + k + '" viewBox="0 0 8 8" refX="7.2" refY="4" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,0.6L8,4L0,7.4z" style="fill:var(--' + k + ')"/></marker>');-    o.push('</defs>');-    o.push('<text class="sec" x="20" y="22">Antenna to 455 kHz</text><text class="sec" x="20" y="610">455 kHz to the PC</text>');-    // the MCU outline sits behind its contents-    o.push('<g class="rf node dig" data-id="mcu"><rect class="mcubox" x="840" y="620" width="242" height="345" rx="8"/><text class="st sm" x="852" y="955">DACs, PWM, band enables, TIM1 marker ↑</text></g>');-    for (const [kind, pts, a, b, arrow, lab] of W) {-      const k = kind.split(' ')[0];-      o.push('<g class="rfw ' + kind + '" data-b="' + a + ' ' + b + '"><path class="w ' + k + '" d="M' + pts.map((p) => p.join(',')).join('L') + '"' + (arrow ? ' marker-end="url(#rfa-' + k + ')"' : '') + '/>' +-        (lab ? '<text class="wl' + (lab[0][0] === '@' ? ' dyn' : '') + '"' + (lab[0][0] === '@' ? ' data-live="' + lab[0].slice(1) + '"' : '') + ' x="' + lab[1] + '" y="' + lab[2] + '" text-anchor="' + (lab[3] || 'middle') + '">' + (lab[0][0] === '@' ? '' : esc(lab[0])) + '</text>' : '') + '</g>');-    }-    for (const [x, y] of JUNCTIONS) o.push('<circle class="jn" cx="' + x + '" cy="' + y + '" r="2.8"/>');-    const seen = new Set();-    for (const [id, sym, x, y, opt, lab] of N) {-      const group = groupOf(id);-      const first = !seen.has(id);-      seen.add(id);-      o.push('<g class="rf node ' + group + (id === 'pc' ? ' term' : '') + '" data-id="' + id + '"' + (id === 'pc' ? '' : ' tabindex="' + (first ? 0 : -1) + '" role="button"') + '>');-      o.push('<rect class="hit" x="' + (x - 30) + '" y="' + (y - 30) + '" width="60" height="60"/>');-      o.push(SYM[sym](x, y, opt || {}));-      if (lab) label(o, x, y, sym, lab, lab[3] === true ? null : eqOf(id), group);-      if (first && id !== 'pc') o.push('<path class="warn" data-warn="1" d="M' + (x + 16) + ',' + (y - 30) + 'l6,-10l6,10z" hidden="hidden"><title>Differs on the first board</title></path>');-      o.push('</g>');-    }-    return o.join('');-  }-  return { draw, W: 1240, H: 1005, wires: W };-})();--// Explanations, flowchart layout and signal order for the AM/FM circuit explorer.-// Numbers come from tools/design.py (values, design notes) and firmware/README.md (first-board findings).--var GROUPS = {-  fm: { name: 'FM path', short: 'FM' },-  am: { name: 'AM path', short: 'AM' },-  if: { name: 'Shared IF', short: 'IF' },-  ctrl: { name: 'Tuning & control', short: 'Control' },-  dig: { name: 'MCU, USB & power', short: 'Digital' },-};--// Signal order: what "Next" walks through. FM first, as in the walkthrough.-var ORDER = ['ant', 'fmrf', 'fmlo', 'fmmix', 'cf1', 'ifamp', 'mix2', 'xo', 'lim', 'rssi', 'sq', 'pump', 'fmaud',-  'amrf', 'amlo', 'ammix', 'amf', 'vga', 'det', 'agc', 'vt', 'pwm', 'band', 'mcu', 'usb', 'reg', 'ui'];--var INFO = {-  ant: {-    title: 'Antenna & diplexer', group: 'fm', bands: ['fm', 'am'],-    role: 'Splits one antenna into a medium-wave path and an FM path, and injects the calibration markers.',-    text: [-      'The SMA jack feeds one node, <code>ANT</code>, with two filters hanging off it. Each filter starts with the part that blocks the other band, so neither steals the other’s signal. The AM leg starts with a 2.2 µH series inductor, about 1.4 kΩ at 100 MHz. The FM leg starts with a 47 pF series capacitor, about 3.4 kΩ at 1 MHz.',-      'The AM leg is a 5-pole, 2 MHz low-pass. The FM leg is a 70 MHz high-pass followed by a 130 MHz low-pass. That window removes AM, shortwave and strong VHF/UHF energy, but it is far too wide to pick out one station. Selecting the station is the RF amplifier’s job.',-      'R317 and C323 let the MCU’s PA8 square wave onto the antenna node. Its harmonics are weak markers (about −60 dBm) at exactly known frequencies, which the firmware tunes to when it calibrates the oscillators.',-    ],-    facts: [-      'FM high-pass: 47 pF → 56 nH → 47 pF, corner 70 MHz',-      'FM low-pass: 22 pF → 120 nH → 22 pF, corner 130 MHz (Butterworth for 50 Ω: 24.5 pF, 122 nH)',-      'AM low-pass: 2.2 µH → 2.7 nF → 8.2 µH → 2.7 nF → 2.2 µH, corner 2 MHz',-      'R301 (100 k) bleeds static off the antenna',-    ],-    board: 'Since firmware v0.3 the markers come from a 48 MHz clock: harmonics at k × 48/N MHz.',-  },-  fmrf: {-    title: 'FM RF amplifier', group: 'fm', bands: ['fm'],-    role: 'Amplifies the FM band and acts as a band-pass filter that follows the station.',-    text: [-      'Q301 is a common-emitter amplifier on an MMBTH10 VHF transistor (f<sub>T</sub> 650 MHz), biased at about 4 mA by R303 and R304. The unbypassed 22 Ω emitter resistor R305 trades a little gain for linearity, so a strong local station does not overload the stage. R306 sets the DC current, and C308 shorts it out at RF.',-      'The collector load is a parallel LC tank: L306 with C309, plus the BB910 varactor through C310. A tank is a high impedance, and so gives high gain, only near its resonant frequency. With 150 nH it needs about 21.8 pF to resonate at 88 MHz and 14.5 pF at 108 MHz. <code>VT_RF</code> sets the varactor’s share.',-      'It has to track the station because of the image. With the LO 10.695 MHz above the station, a second frequency 21.39 MHz above the station also lands on the IF. That image is often in the aircraft band (118 to 137 MHz), which the antenna’s 130 MHz low-pass lets through. Only the tuned tank rejects it.',-      'C310 (22 pF in series) blocks DC, keeps most of the RF voltage off the varactor so the signal does not modulate its capacitance, and narrows the tuning range to the band. C313 (4.7 pF) taps lightly into the mixer so the mixer does not load the tank’s Q.',-    ],-    facts: [-      'I<sub>C</sub> ≈ 4 mA; emitter: R305 22 Ω unbypassed + R306 82 Ω bypassed',-      'Tank: 150 nH ∥ (3.3 pF + BB910 via 22 pF)',-      'Image = station + 21.39 MHz',-      'Supply: +5V_FM through R308 (47 Ω) = V_RF1',-    ],-    board: 'The preselector is parked at PWM 2400 rather than swept per station; that gave the best quieting on the upper band, and the app’s “Peak it” re-peaks it by lowest hiss. Moving <code>VT_RF</code> pulls the LO by up to about 200 kHz through the mixer base.',-  },-  fmlo: {-    title: 'FM local oscillator', group: 'fm', bands: ['fm'],-    role: 'The voltage-controlled oscillator that does the tuning: 98.7 to 118.7 MHz by design.',-    text: [-      'A common-base Colpitts on Q302. C316 grounds the base for RF. The feedback divider, C318 (4.7 pF, collector to emitter) and C317 (15 pF, emitter to ground), returns part of the collector swing to the emitter in phase, so the stage oscillates at the tank’s resonance.',-      'The tank is L307 (110 nH) with C319 (3.3 pF) and the BB910 varactor through C320 (22 pF). <code>VT_FM</code>, 0 to 4.8 V from the DAC and op-amp, reverse-biases the varactor: more voltage, less capacitance, higher frequency.',-      'C321 (2.2 pF) injects a small sample of the LO into the mixer’s base. The firmware sets LO = station + 10.695 MHz.',-    ],-    facts: [-      'I<sub>E</sub> ≈ 2 mA (R312 330 Ω)',-      'With 110 nH the tank needs 23.6 pF at 98.7 MHz and 16.3 pF at 118.7 MHz',-      'Probe FLO (TP303) sits on the emitter, a low-impedance node, so it does not detune the tank',-    ],-    board: 'Measured LO: 91.5 to 99.2 MHz, about 12 % low with half the range. That implies 23.4 to 27.5 pF in the tank instead of 16.3 to 23.6 pF. The board hears 87.5 to 88.5 MHz normally and 102.2 to 108 MHz with the LO below the station (the image side); 88.5 to 102 MHz is out of reach. The fix is less fixed capacitance or inductance (C319, L307), more varactor coupling (C320), then a re-calibration.',-  },-  fmmix: {-    title: 'FM mixer', group: 'fm', bands: ['fm'],-    role: 'Multiplies the station by the LO; the difference lands at 10.7 MHz.',-    text: [-      'Q303 is a single-transistor mixer. The RF (through C313) and the LO (through C321) both drive its base. The transistor’s exponential curve makes the collector current contain sum and difference products, and the 10.7 MHz ceramic filter downstream keeps only the difference.',-      'The collector drives <code>IF_MIX</code>, the shared IF node. Its load is R501 (330 Ω) in the IF block, which is also the ceramic filter’s source impedance. The AM mixer’s collector joins the same node; only one front end is powered at a time.',-      'Because the LO reaches this base, a little of it also leaks backwards through C313, the RF tank and Q301 to the antenna.',-    ],-    facts: [-      'I<sub>E</sub> ≈ 2 mA (design note); emitter R316 150 Ω bypassed by C322',-      'IF = LO − RF = 10.695 MHz',-      'Probe MIX (TP304) on IF_MIX',-    ],-    board: 'The RF review estimated about −56 to −52 dBm of LO at the SMA through that leak path. The FCC 15.111 limit is 2 nW (−57 dBm), so measure it first.',-  },-  amrf: {-    title: 'AM RF preamplifier', group: 'am', bands: ['am'],-    role: 'A fixed broadband preamp for 530 to 1700 kHz.',-    text: [-      'Q401 (MMBT3904) is a common-emitter stage at about 3.8 mA with a 470 Ω collector load, about 24 dB of gain. R401 (51 Ω) terminates the 2 MHz low-pass so the filter sees its design impedance.',-      'There is no tuning here. The AM LO sits up at 11 to 12 MHz, so the image lands at 22 to 23 MHz, far above the 2 MHz low-pass. A fixed broadband preamp is enough.',-    ],-    facts: ['Emitter: R405 22 Ω unbypassed + R406 56 Ω bypassed', 'Supply: +5V_AM through R402 (47 Ω) = V_AM1', 'Probes AMIN (TP403) and ARF (TP404)'],-  },-  amlo: {-    title: 'AM local oscillator', group: 'am', bands: ['am'],-    role: 'Voltage-controlled oscillator at 11.23 to 12.4 MHz by design.',-    text: [-      'A Clapp oscillator on Q402. The frequency is set by L401 (8.2 µH) in series with C410 (15 pF) and the BB910 varactor through C411 (33 pF). C408 (220 pF, base to emitter) and C409 (470 pF, emitter to ground) form the feedback divider. The tank’s series capacitance is much smaller than the divider’s, so the transistor’s own capacitances barely move the frequency.',-      '<code>VT_AM</code> tunes it. The output is taken at the emitter and coupled to the AM mixer through C412 (47 pF).',-      'Converting AM up to 10.7 MHz, instead of down to 455 kHz, means the VCO only needs a 1.1 : 1 range, and the image is easy to filter.',-    ],-    facts: ['LO = station + 10.695 MHz: 11.225 MHz at 530 kHz, 12.395 MHz at 1700 kHz', 'Probe ALO (TP405) on the emitter'],-    board: 'Measured LO: 9.55 to 10.16 MHz. The firmware receives with the mixer’s sum product instead (LO + station = 10.695 MHz), which covers about 533 to 1150 kHz. A scan found 820 kHz (WBAP).',-  },-  ammix: {-    title: 'AM mixer', group: 'am', bands: ['am'],-    role: 'Same topology as the FM mixer; its collector joins the shared IF node.',-    text: [-      'Q403 mixes the preamp output (through C405) with the LO (through C412) at its base. Its collector shares <code>IF_MIX</code> and the 330 Ω load with the FM mixer. The band switch powers only one front end at a time, so the idle mixer sits unbiased and does not load the node.',-    ],-    facts: ['Emitter: R415 150 Ω bypassed by C413', 'IF = LO − RF = 10.695 MHz (by design)'],-  },-  cf1: {-    title: 'Mixer load & first 10.7 MHz filter', group: 'if', bands: ['fm', 'am'],-    role: 'Loads the mixers and starts the channel selection at 10.7 MHz.',-    text: [-      'R501 (330 Ω) from V_IF1 is the mixers’ collector load and the ceramic filter’s source impedance; R503 (330 Ω) terminates its output. A ceramic filter only shows its specified shape between the right impedances.',-      'C502 (22 pF) shunts the VHF LO feed-through on <code>IF_MIX</code> before it reaches the filter.',-      'FL501 passes about 180 kHz around 10.7 MHz, wide enough for FM’s ±75 kHz deviation. On AM it removes far-off signals; the narrow 455 kHz filter does the AM channel selection later.',-    ],-    facts: ['HCCF3-10.700, 7 × 3 mm SMD, 330 Ω in and out', 'V_IF1 = +5VA through R502 (22 Ω)', 'Probe CF1 (TP503) on the filter output'],-  },-  ifamp: {-    title: '10.7 MHz IF amplifier & second filter', group: 'if', bands: ['fm', 'am'],-    role: 'Makes up the filter losses, then filters again for steeper skirts.',-    text: [-      'Q501 is a common-emitter stage at about 3.9 mA with a 330 Ω collector load, which is again the next filter’s source impedance. It gives about 15 dB.',-      'FL502 is the same 10.7 MHz part. Two filters in cascade have much steeper skirts than one.',-    ],-    facts: ['Gain ≈ 15 dB, I<sub>C</sub> ≈ 3.9 mA', 'Probe IF1 (TP504) on the collector; 10M7 (MC20) on the filter output'],-  },-  mix2: {-    title: 'Second mixer', group: 'if', bands: ['fm', 'am'],-    role: 'Converts the 10.695 MHz IF down to 455 kHz.',-    text: [-      'Q502 mixes the IF (through C508) with the 10.240 MHz crystal oscillator (through C509) at its base. The difference, 10.695 − 10.240 = 0.455 MHz, appears across the 1.5 kΩ collector load. C511 (100 pF) rolls off the 10 MHz products.',-      '<code>IF2_OUT</code> feeds both 455 kHz chains at once: the AM filter and the FM limiter.',-    ],-    facts: ['I<sub>E</sub> ≈ 1.8 mA from the bias values (the design note says 1.4 mA)', 'Probe 455K (MC21) on IF2_OUT'],-  },-  xo: {-    title: '10.24 MHz crystal oscillator', group: 'if', bands: ['fm', 'am'],-    role: 'A fixed, crystal-accurate second LO.',-    text: [-      'Q503 is a Colpitts with the crystal Y501 in its base circuit. C514 and C515 (100 and 220 pF) form the feedback divider, and C516 trims the crystal’s load.',-      'The design uses a 10.240 MHz crystal because JLC stocks it (10.245 MHz parts are scarce). So the first IF is 10.695 MHz rather than 10.700: the firmware sets LO1 = station + 10.695 MHz, and the 5 kHz offset sits far inside the 180 kHz filters.',-    ],-    facts: ['I<sub>E</sub> ≈ 1.1 mA', 'Probe XO (TP505) on the emitter'],-    board: 'From the RF review: Y501’s 9th and 10th harmonics (92.16 and 102.4 MHz) fall in the FM band.',-  },-  lim: {-    title: 'Limiter', group: 'fm', bands: ['fm', 'am'],-    role: 'Clips the 455 kHz IF to a constant amplitude, so only its frequency matters.',-    text: [-      'An RC low-pass (R702 2.2 kΩ, C704 150 pF, about 480 kHz) takes off what is left of the 10 MHz products. Two identical common-emitter stages (Q701, Q702, about 33 dB each) then amplify until the signal is hard-clipped.',-      'FM carries its audio in the frequency, so the amplitude, along with most noise and fading, can be thrown away.',-    ],-    facts: ['I<sub>C</sub> ≈ 0.95 mA per stage, 2.2 kΩ loads', 'Probes LIM1 (TP702) and LIM2 (TP703)', 'Also used on AM: the IF counter needs the squared-up IF on both bands'],-  },-  rssi: {-    title: 'FM signal-strength detector', group: 'fm', bands: ['fm'],-    role: 'Was meant to rank stations during seek.',-    text: [-      'D701 rectifies the first limiter stage’s output into C712 and R712, and the DC goes to PA6 as <code>RSSI_FM</code>. The idea was that stage 1 would still follow the signal level before it limits.',-    ],-    facts: ['Probe RSF (TP704)'],-    board: '<code>RSSI_FM</code> sits at 85 to 100 mV with or without a station, because stage 1 already limits on noise. The firmware ignores it. It detects carriers with a hiss meter on the audio, plus a check that the IF follows the LO when the DAC is nudged.',-  },-  sq: {-    title: 'Squarer & IF counter output', group: 'fm', bands: ['fm', 'am'],-    role: 'Makes a clean square wave for the detector and for the MCU’s frequency counter.',-    text: [-      'Q703 is a saturating switch DC-coupled from the second limiter, switching at about 2.2 V on <code>LIM2_C</code>; C713 speeds up the edges. Its collector, <code>LIM_SQ</code>, swings 0 to about 4.6 V and drives the diode pump.',-      'R716 and R717 divide it to about 3 V, a valid logic high, as <code>IF_CNT</code>, which TIM2 counts on PA15. The MCU measures the IF to the hertz, and that one number drives AFC, seek and calibration on both bands.',-    ],-    facts: ['Probe SQ (MC24) on LIM_SQ, CNT (TP705) on IF_CNT'],-  },-  pump: {-    title: 'Pulse-count FM detector', group: 'fm', bands: ['fm'],-    role: 'Turns frequency into a voltage: this is the FM demodulator.',-    text: [-      'On every IF cycle, C714 (22 pF) charges through one diode of D702 and discharges through the other into U701A’s summing junction. Each cycle moves the same packet of charge, C · (V<sub>pp</sub> − 2V<sub>f</sub>), so the average current is proportional to the number of cycles per second: about 40 µA at 455 kHz, ±6.6 µA for ±75 kHz of deviation.',-      'U701A is an integrator. R718 (51 kΩ) turns the current into a voltage, and C715 (1.5 nF) across it gives the 75 µs de-emphasis that undoes the broadcaster’s treble boost. <code>FM_DEMOD</code> sits around 1.6 to 1.8 V with no modulation.',-    ],-    facts: ['VREF_FM is 78 % of V_IF4 (R725 1.2 k / R726 4.3 k): about 3.6 V with the real ~4.6 V supply after the OR-ing diode, 3.9 V at a full 5 V', 'FM_DEMOD sits about 2 V below VREF_FM (40 µA × 51 kΩ)', '51 kΩ ∥ 1.5 nF = 76.5 µs; 1 nF would give 50 µs for Europe', 'Probe DEM (MC23) on FM_DEMOD'],-  },-  fmaud: {-    title: 'AFC output & FM audio filter', group: 'fm', bands: ['fm'],-    role: 'Splits the detector output into a slow tuning-error voltage and filtered audio.',-    text: [-      '<code>FM_DC</code> is FM_DEMOD × 2/3 through a 67 ms filter ((R719 ∥ R720) × C716): the average tuning error.',-      'The audio goes through C717, is re-centred on 1.65 V (the middle of the 3.3 V ADC range), and passes U701B, a unity-gain Sallen-Key low-pass at 15.8 kHz meant to keep the 19 kHz pilot out. R724 limits the current into the ADC pin if the 5 V op-amp swings high.',-    ],-    facts: ['Sallen-Key: 10 k / 10 k, 1.5 nF / 680 pF → 15.8 kHz', 'Probes FMDC (TP707), FMA (TP708); edge contact FM (MC16)'],-    board: 'Two poles could not stop the stereo subcarrier (23 to 53 kHz) from aliasing at 48 kHz. Since firmware v0.4 the ADC samples at 192 kHz and a 32-tap FIR decimates to 48 kHz; the pilot is now −73 dB.',-  },-  amf: {-    title: '455 kHz AM filter & bias', group: 'am', bands: ['am'],-    role: 'Sets the AM channel width: ±4.5 kHz.',-    text: [-      'FL601 is the AM selectivity. It passes ±4.5 kHz around 455 kHz and rejects the neighbouring channels 10 kHz away. It is specified with 2 kΩ at both ends. The output side gets about that: R601 (2.7 kΩ) in parallel with the amplifier input. The input side sees less, because the second mixer’s 1.5 kΩ load is shared with the FM limiter’s input on the same node.',-      'R603 and R604 make <code>VBIAS</code> (about 2.9 V), which biases both differential pairs.',-    ],-    facts: ['Probes AMF (TP603), VB (TP602), VIF3 (TP601)'],-    board: 'AM fault: nothing gets from here to the detector. <code>RSSI_AM</code> stays at 2.39 V even with a −40 dBm marker centred on 455 kHz. FL601’s signal pads measured open, so it is not fitted backwards. The next step is the DC survey in the firmware README.',-  },-  vga: {-    title: 'AGC amplifiers', group: 'am', bands: ['am'],-    role: 'Two differential pairs whose gain the AGC loop sets.',-    text: [-      'Each BC847BS pair (Q601, Q603) amplifies the difference between its input and VBIAS. A differential pair’s gain is proportional to its tail current, I<sub>tail</sub> · R<sub>C</sub> / (4 V<sub>T</sub>): about ×19 at 0.9 mA and ×0.2 at 10 µA, so each stage spans about 40 dB.',-      'Q602 and Q604 set the tail currents from <code>AGC_B</code>, which is V_AGC divided by two.',-    ],-    facts: ['R<sub>C</sub> = 2.2 kΩ; tail emitter resistors 2 kΩ', 'Probes VGA1 (TP604), VGA2 (TP605)'],-  },-  det: {-    title: 'IF post-amp & envelope detector', group: 'am', bands: ['am'],-    role: 'Final 455 kHz gain, then a diode recovers the audio envelope.',-    text: [-      'Q605 adds about ×30 at 1.1 mA. D601, a Schottky, charges C612 (2.2 nF) to the peaks of the IF, and R619 (10 kΩ) lets it follow the audio: a 22 µs time constant.',-      'The result, <code>AM_DET</code>, is the audio riding on a DC level proportional to the carrier.',-    ],-    facts: ['Probe AIF (TP606) on the post-amp; DET (MC22) on AM_DET'],-  },-  agc: {-    title: 'AGC loop, RSSI & AM audio', group: 'am', bands: ['am'],-    role: 'Holds the detector at a constant level and filters the audio.',-    text: [-      'U601A integrates the difference between AM_DET and a 1.0 V reference and drives <code>V_AGC</code>, which sets the amplifier tail currents. A stronger station gives more DC at the detector, which lowers V_AGC and the gain. <code>RSSI_AM</code> (V_AGC / 2) tells the MCU the gain setting: lower means stronger.',-      'U601B is a 5 kHz Sallen-Key low-pass, and the audio is re-centred on 1.65 V for the ADC as <code>AM_AUDIO</code> on PA0.',-    ],-    facts: ['Reference: R621 39 k / R622 10 k from V_IF3 ≈ 1.0 V', 'Sallen-Key: 10 k / 10 k, 4.7 nF / 2.2 nF → 4.95 kHz', 'Probes AGC (TP607), RSA (TP608), AMA (TP609); edge contact AM (MC15)'],-    board: '<code>RSSI_AM</code> sits at its 2.39 V rail (maximum gain), because the detector never reaches the setpoint. See the AM filter block.',-  },-  vt: {-    title: 'Varactor drivers', group: 'ctrl', bands: ['fm', 'am'],-    role: 'Scales the MCU’s DACs (0 to 3.3 V) up to the 0 to 4.8 V tuning voltages.',-    text: [-      'U201 runs both channels as non-inverting amplifiers with a gain of 1 + 10k/22k = 1.45. Two RC poles follow each output (10 kΩ with 4.7 µF, then 10 kΩ with 1 µF). Noise on a tuning voltage frequency-modulates the oscillator, so it is filtered hard.',-      '<code>VT_FM</code> tunes the FM oscillator and <code>VT_AM</code> the AM oscillator.',-    ],-    facts: ['12-bit DAC: 0.81 mV per code, 1.17 mV per code at the varactor', 'Poles at about 3.4 Hz and 16 Hz', 'Probes DACF/DACA (TP201/202), VTF1/VTA1 (TP204/205); VTF, VTA (MC25, MC26)'],-    board: 'The tuning voltage floors near 0 V: the FM LO flattens below about DAC code 200, probably at the op-amp’s output limit.',-  },-  pwm: {-    title: 'RF tracking voltage & 1.65 V reference', group: 'ctrl', bands: ['fm'],-    role: 'A PWM “third DAC” for the FM preselector, plus the audio bias reference.',-    text: [-      'The STM32 has two DAC channels and both are used for the oscillators. So <code>VT_RF</code> comes from a PWM on PB1, smoothed by two RC poles (about 16 Hz) and scaled ×1.45 by U202A.',-      'U202B buffers half of +3.3VA to make <code>VREF_1V65</code>, the bias for both audio filters, so the audio sits in the middle of the ADC range.',-    ],-    facts: ['A third pole after the amplifier: R213 1 k\u03a9 with C208 1 \u00b5F, about 160 Hz', 'Probes PWM (TP203), VTR1 (TP206), VREF (TP207); VTR (MC27)'],-  },-  band: {-    title: 'Band switches', group: 'ctrl', bands: ['fm', 'am'],-    role: 'Powers one front end at a time.',-    text: [-      'Q201 and Q202 are PNP high-side switches from +5VA. The MCU pulls <code>FM_EN_N</code> or <code>AM_EN_N</code> low (open-drain, 5 V tolerant) to turn a band on. At reset the pins float, and the 10 kΩ pull-ups keep both bands off.',-      'Only the selected front end’s RF amp, oscillator and mixer are powered, which is how the two mixers can share one IF node.',-    ],-    facts: ['Probes 5VFM (TP208), 5VAM (TP209); 5VA (MC28)'],-  },-  ui: {-    title: 'Status LEDs', group: 'ctrl', bands: ['fm', 'am'],-    role: 'Band and USB status.',-    text: [-      'Green is FM, yellow is AM and blue is USB/status, all driven from 3.3 V GPIOs (PB13-PB15). The green and blue LEDs drop about 2.8 V, so they use 220 Ω; the yellow uses 1 kΩ. Everything else is controlled from the PC.',-    ],-    facts: [],-  },-  mcu: {-    title: 'STM32G0B1 microcontroller', group: 'dig', bands: ['fm', 'am'],-    role: 'Tunes, calibrates, digitises the audio and talks USB.',-    text: [-      'A Cortex-M0+ with a 12-bit ADC, two 12-bit DACs and full-speed USB. DAC1 (PA4, PA5) drives the varactor amplifiers. TIM3 on PB1 makes the VT_RF PWM, TIM1 on PA8 makes the calibration markers, and TIM2 counts the IF on PA15. PB8 and PB9 switch the bands.',-      'The ADC samples the active band’s audio at 192 kHz. Every millisecond the DSP decimates to 48 kHz with a 32-tap FIR, notches the 19 kHz pilot, cancels the board’s own 1 kHz hum, applies the noise filter and a soft limiter, and hands 48 samples to USB.',-      'On the PC it is a USB microphone (48 kHz, 16-bit mono) plus a serial port for commands. A blank chip boots ST’s ROM USB DFU, so the first flash and every update go over the same cable.',-    ],-    facts: ['40 MHz crystal Y101: harmonics at 80 and 120 MHz, clear of the FM band and the LO range', 'Everything runs at 48 MHz; USB is clocked from the crystal since v0.3', 'SWD, UART and BOOT are optional contacts down the left edge'],-    board: 'USB on the internal 48 MHz RC oscillator failed once the board was warm, so v0.3 moved USB onto the crystal. The DSP’s 1 ms burst leaks through VREF+ as a 1 kHz tone, which the firmware cancels (−39 → −60 dBFS).',-  },-  usb: {-    title: 'USB-C, power input & ESD', group: 'dig', bands: ['fm', 'am'],-    role: 'One cable for power, audio, control and firmware.',-    text: [-      'J101 is a USB 2.0 Type-C receptacle. R101 and R102 (5.1 kΩ) on CC1 and CC2 tell the host this is a device that wants 5 V. U101 (USBLC6) clamps ESD on D+ and D−.',-      '5 V can also come in on the VIN machine contact (MC1). Two B5819W Schottky diodes OR the two sources, and a 500 mA polyfuse feeds the +5V rail. The red LED shows power.',-    ],-    facts: ['Draw ≈ 85 mA with FM on; D105 is the warmest part, +4.3 °C (Adom Fields)', 'Probes VBUS, VIN, VOR, 5V (TP101-TP104)'],-  },-  reg: {-    title: '3.3 V regulator & analog rails', group: 'dig', bands: ['fm', 'am'],-    role: 'Makes 3.3 V and the filtered analog supplies.',-    text: [-      'U102 (AP2112K) makes +3V3 for the MCU. Ferrite beads split off <code>+5VA</code>, which feeds every RF and IF stage and the op-amps (each stage adds its own RC decoupling), and <code>+3.3VA</code>, the MCU’s VREF+ for the ADC and DACs.',-    ],-    facts: ['Probes 3V3, 3V3A, 5VA (TP105-TP107)'],-    board: 'VREF+ has one ferrite plus 1 µF / 10 nF. That lets the DSP’s 1 kHz current pulse into the audio; the next revision should filter it harder.',-  },-};--// Flowchart geometry (SVG user units). Nodes: [x, y, w, h]. Edges: [from, to, kind, points, label?, labelPos?]-var FLOW = {-  w: 1120, h: 770,-  sections: [[20, 30, 'Antenna to 455 kHz'], [20, 428, 'Detectors & USB']],-  nodes: {-    ant: [10, 160, 132, 70, 'Antenna + diplexer', 'SMA \u2192 AM / FM'],-    fmrf: [170, 50, 120, 56, 'FM RF amp', 'Q301 \u00b7 tuned tank'],-    pwm: [170, 128, 120, 44, 'RF tracking', 'PWM → VT_RF'],-    vt: [170, 186, 120, 50, 'Varactor drivers', 'DAC → VT_FM, VT_AM'],-    amrf: [170, 282, 120, 56, 'AM preamp', 'Q401 · 24 dB'],-    fmmix: [335, 50, 120, 56, 'FM mixer', 'Q303 → 10.7 MHz'],-    fmlo: [335, 128, 120, 50, 'FM oscillator', '98.7 to 118.7 MHz'],-    amlo: [335, 210, 120, 50, 'AM oscillator', '11.2 to 12.4 MHz'],-    ammix: [335, 282, 120, 56, 'AM mixer', 'Q403 → 10.7 MHz'],-    cf1: [500, 167, 110, 56, '10.7 MHz filter', 'FL501 · 330 Ω'],-    ifamp: [655, 167, 110, 56, 'IF amp + filter', 'Q501 · FL502'],-    mix2: [810, 167, 120, 56, 'Second mixer', 'Q502 → 455 kHz'],-    xo: [810, 262, 120, 50, 'Crystal LO', '10.240 MHz \u00b7 Q503'],-    lim: [170, 440, 120, 56, 'Limiter', 'Q701, Q702'],-    rssi: [170, 520, 120, 44, 'FM RSSI', 'D701 \u2192 RSSI_FM'],-    sq: [330, 440, 110, 56, 'Squarer', 'Q703 → IF_CNT'],-    pump: [480, 440, 130, 56, 'FM detector', 'diode pump · U701A'],-    fmaud: [650, 440, 120, 56, 'FM audio filter', 'U701B · 15.8 kHz'],-    amf: [170, 630, 120, 56, '455 kHz AM filter', 'FL601 · ±4.5 kHz'],-    vga: [330, 630, 110, 56, 'AGC amplifiers', 'Q601, Q603 pairs'],-    det: [480, 630, 130, 56, 'Envelope detector', 'Q605 · D601'],-    agc: [650, 630, 120, 56, 'AGC + AM audio', 'U601 · 5 kHz'],-    mcu: [830, 430, 150, 300, 'STM32G0B1', 'ADC · DSP · USB'],-    pc: [1000, 432, 110, 40, 'PC', 'mic + serial port'],-    usb: [1000, 490, 110, 56, 'USB-C', 'power · ESD'],-    reg: [1000, 566, 110, 50, '3.3 V LDO', 'rails + filters'],-    ui: [1000, 636, 110, 40, 'Status LEDs', 'PB13-PB15'],-    band: [1000, 696, 110, 50, 'Band switches', 'Q201, Q202'],-  },-  mcuPins: [['PA0 / PA1', 'audio ADC'], ['PA2 / PA6', 'RSSI ADC'], ['PA3', 'FM_DC ADC'], ['PA4 / PA5', 'tuning DACs'], ['PB1', 'VT_RF PWM'],-    ['PA15', 'IF counter'], ['PA8', 'cal markers'], ['PB8 / PB9', 'band enables'], ['PA11 / 12', 'USB']],-  edges: [-    ['ant', 'fmrf', 'fm', [[75, 160], [75, 78], [170, 78]], '@rf', [122, 71]],-    ['ant', 'amrf', 'am', [[75, 230], [75, 310], [170, 310]], '@rf', [122, 303]],-    ['fmrf', 'fmmix', 'fm', [[290, 78], [335, 78]]],-    ['fmlo', 'fmmix', 'fm', [[395, 128], [395, 106]], '@lo', [401, 122, 'start']],-    ['amrf', 'ammix', 'am', [[290, 310], [335, 310]]],-    ['amlo', 'ammix', 'am', [[395, 260], [395, 282]], '@lo', [401, 276, 'start']],-    ['fmmix', 'cf1', 'fm', [[455, 78], [478, 78], [478, 195], [500, 195]]],-    ['ammix', 'cf1', 'am', [[455, 310], [478, 310], [478, 195]]],-    ['cf1', 'ifamp', 'if', [[610, 195], [655, 195]]],-    ['ifamp', 'mix2', 'if', [[765, 195], [810, 195]]],-    ['xo', 'mix2', 'if', [[870, 262], [870, 223]], '10.240 MHz', [876, 247, 'start']],-    ['mix2', 'lim', 'if', [[930, 195], [970, 195], [970, 400], [140, 400], [140, 468], [170, 468]], '455 kHz IF (IF2_OUT) to both detectors', [560, 393]],-    ['mix2', 'amf', 'if', [[140, 400], [140, 658], [170, 658]]],-    ['lim', 'sq', 'fm', [[290, 468], [330, 468]]],-    ['lim', 'rssi', 'fm', [[230, 496], [230, 520]]],-    ['sq', 'pump', 'fm', [[440, 468], [480, 468]]],-    ['pump', 'fmaud', 'fm', [[610, 468], [650, 468]]],-    ['fmaud', 'mcu', 'fm', [[770, 458], [830, 458]], 'FM audio', [800, 451]],-    ['fmaud', 'mcu', 'fm', [[770, 480], [830, 480]], 'FM_DC', [800, 493]],-    ['rssi', 'mcu', 'fm', [[290, 542], [830, 542]], 'RSSI_FM', [700, 536]],-    ['sq', 'mcu', 'dig', [[385, 496], [385, 590], [830, 590]], 'IF_CNT: the IF counter (TIM2)', [610, 584]],-    ['amf', 'vga', 'am', [[290, 658], [330, 658]]],-    ['vga', 'det', 'am', [[440, 658], [480, 658]]],-    ['det', 'agc', 'am', [[610, 658], [650, 658]]],-    ['agc', 'mcu', 'am', [[770, 648], [830, 648]], 'AM audio', [800, 641]],-    ['agc', 'mcu', 'am', [[770, 670], [830, 670]], 'RSSI_AM', [800, 683]],-    ['agc', 'vga', 'am', [[710, 686], [710, 714], [385, 714], [385, 686]], 'V_AGC sets the gain', [548, 728]],-    ['mcu', 'usb', 'dig', [[980, 518], [1000, 518]]],-    ['usb', 'pc', 'dig', [[1055, 490], [1055, 472]]],-    ['reg', 'mcu', 'dig', [[1000, 591], [980, 591]]],-    ['mcu', 'ui', 'ctrl', [[980, 656], [1000, 656]]],-    ['mcu', 'band', 'ctrl', [[980, 716], [1000, 716]]],-    ['mcu', 'vt', 'ctrl', [[880, 430], [880, 372], [150, 372], [150, 211], [170, 211]], 'DAC_FM, DAC_AM, PWM_RF, CAL_MARK from the MCU', [515, 366]],-    ['mcu', 'pwm', 'ctrl', [[150, 211], [150, 150], [170, 150]]],-    ['pwm', 'fmrf', 'ctrl', [[230, 128], [230, 106]], 'VT_RF', [236, 121, 'start']],-    ['vt', 'fmlo', 'ctrl', [[290, 203], [315, 203], [315, 153], [335, 153]]],-    ['vt', 'amlo', 'ctrl', [[290, 223], [322, 223], [322, 235], [335, 235]]],-    ['mcu', 'ant', 'ctrl', [[150, 372], [40, 372], [40, 230]]],-  ],-  // relations that are not drawn as lines but light up together-  links: [['band', 'fmrf'], ['band', 'fmlo'], ['band', 'fmmix'], ['band', 'amrf'], ['band', 'amlo'], ['band', 'ammix'], ['reg', 'usb']],-};--// Which flowchart node holds which drawn blocks (all 1:1 except the terminal "pc")-var NODE_BLOCK = { pc: null };--/* AM/FM circuit explorer: flowchart, station tuner, schematic viewer. Data: DESIGN, BLOCK_SRC (build.py),-   SCH_BLOCKS (blocks/*.js), INFO / FLOW / ORDER / GROUPS (content.js), SCH (sch.js). */-(function () {-  'use strict';-  // Standalone, the explorer is the whole document. As the wiki widget (widget.js) it lives in a shadow root-  // (EXPLORER_ROOT) under its custom element (EXPLORER_HOST), and the page's URL hash belongs to the wiki.-  const ROOT = typeof EXPLORER_ROOT !== 'undefined' ? EXPLORER_ROOT : document;-  const HOST = typeof EXPLORER_HOST !== 'undefined' ? EXPLORER_HOST : null;-  const $ = (s, el) => (el || ROOT).querySelector(s);-  const $$ = (s, el) => Array.from((el || ROOT).querySelectorAll(s));-  // monochrome icons (currentColor), 24 x 24-  const ICON = {-    play: '<svg class="ico" viewBox="0 0 24 24" aria-hidden="true"><path d="M8 5.5v13l10.5-6.5z" fill="currentColor"/></svg>',-    pause: '<svg class="ico" viewBox="0 0 24 24" aria-hidden="true"><path d="M7.5 5.5h3v13h-3zM13.5 5.5h3v13h-3z" fill="currentColor"/></svg>',-    check: '<svg class="ico" viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7.5" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"/></svg>',-    close: '<svg class="ico" viewBox="0 0 24 24" aria-hidden="true"><path d="M6.5 6.5l11 11M17.5 6.5l-11 11" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>',-  };-  const esc = (s) => String(s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');-  const SVGNS = 'http://www.w3.org/2000/svg';--  // ------------------------------------------------------------ render every block once, index nets and parts-  const BL = {}, R = {};-  const netBlocks = {}, netPinBlocks = {}, partBlocks = {};-  let nErr = 0, nWires = 0;-  const drawnRefs = new Set();-  for (const b of SCH_BLOCKS) {-    BL[b.id] = b;-    const r = SCH.render(b, DESIGN);-    R[b.id] = r;-    const A = r.analysis;-    nErr += A.errors.length;-    nWires += A.wires.length;-    if (A.errors.length && window.console) console.warn(A.errors);-    const add = (map, k) => { if (!k) return; (map[k] = map[k] || []); if (!map[k].includes(b.id)) map[k].push(b.id); };-    for (const w of A.wires) add(netBlocks, A.netAt(w.pts[0]));-    for (const a of A.anchors) add(netBlocks, a.name);-    for (const p of A.parts) {-      add(partBlocks, p.ref);-      drawnRefs.add(p.ref);-      for (const pin of Object.values(p.pins)) { add(netBlocks, pin.net); add(netPinBlocks, pin.net); }-    }-  }-  const orderIdx = (id) => { const i = ORDER.indexOf(id); return i < 0 ? 99 : i; };-  for (const m of [netBlocks, netPinBlocks, partBlocks]) for (const k in m) m[k].sort((a, b) => orderIdx(a) - orderIdx(b));-  const homeBlock = (ref) => {-    const p = DESIGN.parts[ref];-    const list = partBlocks[ref] || [];-    return p && list.includes(p.block) ? p.block : list[0];-  };-  const totalParts = Object.keys(DESIGN.parts).length;-  const groundOnly = Object.keys(DESIGN.parts).filter((r) => !drawnRefs.has(r) && Object.values(DESIGN.parts[r].pins).every((n) => n === 'GND')).length;-  $('#check').innerHTML = '<b>' + (nErr ? nErr + ' wiring errors' : 'Every wire matches tools/design.py') + '</b><br>' +-    drawnRefs.size + ' of ' + totalParts + ' parts drawn' + (groundOnly ? ' (the other ' + groundOnly + ' are ground-only machine pins)' : '') + ', ' + nWires + ' wires';--  // ------------------------------------------------------------ state-  const S = { band: 'fm', mode: 'design', f: { fm: 101.1, am: 1010 }, sel: null, part: null, net: null, ctl: Object.assign({}, SPECTRUM.CTL0) };-  const FM = { lo: [98.7, 118.7], boardLo: [91.5, 99.2], min: 87.5, max: 108, step: 0.1 };-  const AM = { lo: [11.23, 12.4], boardLo: [9.547, 10.162], min: 530, max: 1700, step: 10 };-  const IF1 = 10.695, LO2 = 10.240, IF2 = 0.455;-  const AM_ONLY = ['amrf', 'amlo', 'ammix', 'amf', 'vga', 'det', 'agc'];-  const FM_ONLY = ['fmrf', 'fmlo', 'fmmix', 'rssi', 'pump', 'fmaud', 'pwm'];--  function plan(band, mode, f) {-    // returns {rf, lo, side, image, ok, note} with frequencies in MHz-    if (band === 'fm') {-      const rf = f;-      if (mode === 'design') {-        const lo = rf + IF1;-        return { rf, lo, side: 'above', image: rf + 2 * IF1, ok: lo >= FM.lo[0] - 1e-9 && lo <= FM.lo[1] + 1e-9 };-      }-      const hi = rf + IF1, low = rf - IF1;-      if (hi <= FM.boardLo[1]) return { rf, lo: hi, side: 'above', image: rf + 2 * IF1, ok: hi >= FM.boardLo[0] };-      if (low >= FM.boardLo[0] && low <= FM.boardLo[1]) return { rf, lo: low, side: 'below', image: rf - 2 * IF1, ok: true };-      return { rf, lo: hi, alt: low, side: 'none', image: rf + 2 * IF1, ok: false };-    }-    const rf = f / 1000;-    if (mode === 'design') {-      const lo = rf + IF1;-      return { rf, lo, side: 'above', image: rf + 2 * IF1, ok: lo >= AM.lo[0] - 1e-9 && lo <= AM.lo[1] + 1e-9 };-    }-    const lo = IF1 - rf;   // the first board's AM VCO runs low: LO + RF = IF ("sum" mode)-    return { rf, lo, side: 'sum', image: lo + IF1, ok: lo >= AM.boardLo[0] && lo <= AM.boardLo[1] };-  }-  const mhz = (v, d) => { const t = v.toFixed(d == null ? 3 : d); return t.indexOf('.') < 0 ? t : t.replace(/0+$/, '').replace(/\.$/, ''); };-  const fmtF = (v) => (v < 2 ? mhz(v * 1000, 1) + ' kHz' : mhz(v) + ' MHz');--  // ------------------------------------------------------------ block diagram (RF symbols, rfflow.js)-  const flowSvg = $('#flow');-  const mctx = () => {-    const fmK = SPECTRUM.control(Object.assign({}, S, { band: 'fm' })), amK = SPECTRUM.control(Object.assign({}, S, { band: 'am' }));-    return { band: S.band, ffm: S.f.fm, fam: S.f.am, mode: S.mode, fmP: fmK.P, amP: amK.P, fmK, amK };-  };-  function buildFlow() {-    const c = mctx();-    flowSvg.setAttribute('viewBox', '0 0 ' + RFFLOW.W + ' ' + RFFLOW.H);-    flowSvg.innerHTML = RFFLOW.draw((id) => (MATH[id] ? MATH[id](c).flow : null), (id) => (INFO[id] ? INFO[id].group : 'dig'));-    $$('.node[data-id]', flowSvg).forEach((g) => {-      const id = g.dataset.id;-      if (!INFO[id]) return;-      g.addEventListener('click', () => select(id, { scroll: true }));-      g.addEventListener('keydown', (ev) => { if (ev.key === 'Enter' || ev.key === ' ') { ev.preventDefault(); select(id, { scroll: true }); } });-      g.addEventListener('mouseenter', (ev) => { relate(id, true); tipFlow(id, ev); });-      g.addEventListener('mousemove', moveTip);-      g.addEventListener('mouseleave', () => { relate(id, false); hideTip(); });-      g.addEventListener('focus', () => relate(id, true));-      g.addEventListener('blur', () => relate(id, false));-    });-  }-  function tipFlow(id, ev) {-    const m = MATH[id] && MATH[id](mctx());-    const first = m && m.chain[0], last = m && (m.out || m.chain[m.chain.length - 1]);-    const one = (e) => MATHFMT.html(e.split(/,\s{3}/)[0]);-    tip.innerHTML = '<b>' + esc(INFO[id].title) + '</b>' + (m ? '<div class="td">In</div><div class="teq">' + one(first.eq) + '</div><div class="td">Out</div><div class="teq">' + one(last.eq) + '</div>' : '') +-      '<div class="td hintline">Click for the schematic, the spectrum and the full math</div>';-    tip.hidden = false; moveTip(ev);-  }-  function relate(id, on) {-    const rel = new Set();-    $$('.rfw', flowSvg).forEach((w) => {-      const [a, b] = w.dataset.b.split(' ');-      const hit = a === id || b === id;-      if (hit) { rel.add(a); rel.add(b); }-      w.classList.toggle('hot', on && hit);-    });-    rel.delete(id);-    $$('.node[data-id]', flowSvg).forEach((n) => n.classList.toggle('rel', on && rel.has(n.dataset.id)));-  }-  function renderMath() {-    const box = $('#mathbox');-    if (!box) return;-    if (!S.sel || !MATH[S.sel]) { box.innerHTML = ''; return; }-    const m = MATH[S.sel](mctx());-    const items = m.chain.concat(m.out ? [m.out] : []);-    // one equation per line: the math strings join related equations with ',   '-    const eqs = (e) => e.split(/,\s{3}/).map((x) => '<div class="eq">' + MATHFMT.html(x) + '</div>').join('');-    const note = (t) => (t ? '<p class="cnote">' + MATHFMT.html(t) + '</p>' : '');-    // in the prose, single-letter variables with subscripts (R_E, g_m) are typeset; net names (VT_RF) are not-    const prose = (t) => esc(t).replace(/(^|[^A-Za-z0-9+])([A-Za-zωβτ])_([A-Za-z0-9]+)\b/g, '$1<i>$2</i><sub>$3</sub>');-    const DOM = { t: 'time domain', s: 's-domain', jw: 's = jω', z: 'z-domain', f: 'spectrum' };-    let k = 0, dom = 't';-    const li = items.map((it) => {-      if (it.k !== 'op') return '<li class="c' + it.k + '"><span class="ctag">' + (it.k === 'in' ? 'In' : 'Out') + '</span><div class="ceq">' + eqs(it.eq) + '</div>' + note(it.note) + '</li>';-      k++;-      return '<li class="cop"><span class="cn">' + k + '</span><div class="chead"><span class="cname">' + esc(it.op) + '</span>' + (it.by ? '<span class="cby">' + esc(it.by) + '</span>' : '') +-        (it.dom && (it.dom !== dom || k === 1) ? '<span class="cdom">' + (dom = it.dom, DOM[it.dom]) + '</span>' : '') + '</div><div class="ceq">' + eqs(it.eq) + '</div>' + note(it.note) + '</li>';-    }).join('');-    const drops = items.some((it) => /~~/.test(it.eq));-    box.innerHTML = '<h3>The math</h3><p class="msub">What goes in, what each part does to it, and what comes out' + (drops ? '. <span class="drop">Struck-out</span> terms are near zero and dropped' : '') + '.</p>' +-      '<ol class="chain">' + li + '</ol>' +-      (m.how ? '<details class="mhow"><summary>How the circuit does it</summary><p>' + prose(m.how) + '</p></details>' : '');-  }-  function liveText(key) {-    const c = mctx(), fp = c.fmP, ap = c.amP;-    const r3 = (v) => (+v.toFixed(3)).toString();-    switch (key) {-      case 'fmRF': return S.f.fm.toFixed(1) + ' MHz';-      case 'amRF': return S.f.am + ' kHz';-      case 'fmLO': return fp.lo == null ? 'out of reach (first board)' : '= ' + r3(fp.lo) + ' MHz' + (fp.side === 'below' ? ' (below)' : '');-      case 'fmIF': return fp.lo == null ? 'out of reach (first board)' : fp.side === 'below' ? 'here f_RF − f_LO = 10.695 MHz' : '= ' + r3(fp.lo) + ' − ' + S.f.fm.toFixed(1) + ' = 10.695 MHz';-      case 'amLO': return '= ' + r3(ap.lo) + ' MHz' + (ap.ok ? '' : ' (out of reach)');-      case 'amIF': return ap.side === 'sum' ? 'here f_LO + f_RF = 10.695 MHz' : '= ' + r3(ap.lo) + ' − ' + r3(S.f.am / 1000) + ' = 10.695 MHz';-      case 'if2': return '= 10.695 − 10.240 = 0.455 MHz';-      case 'pumpI': return '= 455 kHz × 88 pC = 40 µA';-      default: return '';-    }-  }-  function paintFlow() {-    const off = new Set(S.band === 'fm' ? AM_ONLY : FM_ONLY);-    $$('.node[data-id]', flowSvg).forEach((n) => {-      const id = n.dataset.id;-      n.classList.toggle('off', off.has(id));-      n.classList.toggle('sel', id === S.sel);-      const w = $('[data-warn]', n);-      if (w) w.toggleAttribute('hidden', !(S.mode === 'board' && INFO[id] && INFO[id].board));-    });-    $$('.rfw', flowSvg).forEach((w) => {-      const [a, b] = w.dataset.b.split(' ');-      w.classList.toggle('off', off.has(a) || off.has(b));-    });-    $$('[data-live]', flowSvg).forEach((t) => { t.textContent = liveText(t.dataset.live); });-    renderMath();-  }--  // ------------------------------------------------------------ tuner-  const tuner = $('#tuner');-  function setBand(b) {-    S.band = b;-    $$('#band button').forEach((x) => x.setAttribute('aria-pressed', String(x.dataset.band === b)));-    tuner.classList.toggle('band-am', b === 'am');-    const c = b === 'fm' ? FM : AM;-    const r = $('#f-range');-    r.min = c.min; r.max = c.max; r.step = c.step;-    $('#f-unit').textContent = b === 'fm' ? 'MHz' : 'kHz';-    $('#presets').innerHTML = (b === 'fm' ? [88.1, 98.1, 103.3, 106.7] : [600, 820, 1010, 1500])-      .map((v) => '<button type="button" data-v="' + v + '">' + v + '</button>').join('');-    setF(S.f[b]);-  }-  function setF(v) {-    const c = S.band === 'fm' ? FM : AM;-    v = Math.min(c.max, Math.max(c.min, Math.round(v / c.step) * c.step));-    S.f[S.band] = +v.toFixed(1);-    $('#f-range').value = S.f[S.band];-    const inp = $('#f-in');-    if (ROOT.activeElement !== inp) inp.value = S.band === 'fm' ? S.f.fm.toFixed(1) : String(S.f.am);-    paintTuner();-    paintFlow();-  }-  function paintTuner() {-    const p0 = plan(S.band, S.mode, S.f[S.band]);-    const K = SPECTRUM.control(S);-    const p = Object.assign({}, p0, { lo: K.P.lo == null ? p0.lo : K.P.lo, tank: K.tank });-    const fm = S.band === 'fm';-    const rows = [-      ['rf', 'Station', fmtF(p.rf)],-      ['lo', 'Oscillator (LO1)', K.P.lo == null ? '-' : mhz(K.P.lo) + ' MHz'],-      ['', 'First IF', K.if1 == null ? '-' : mhz(K.if1) + ' MHz'],-      ['', 'Crystal (LO2)', '10.240 MHz'],-      ['', 'Second IF', K.if2 == null ? '-' : mhz(K.if2 * 1000, 1) + ' kHz'],-    ];-    $('#freqs').innerHTML = rows.map(([c, k, v]) => '<div class="freq ' + c + '"><div class="k">' + k + '</div><div class="v">' + v + '</div></div>').join('');-    const v = $('#verdict');-    let html;-    const range = (a) => mhz(a[0], 2) + '-' + mhz(a[1], 2) + ' MHz';-    if (S.mode === 'design') {-      if (fm) {-        html = 'The LO runs <b>10.695 MHz above</b> the station: ' + mhz(p.rf, 1) + ' + 10.695 = <b>' + mhz(p.lo) + ' MHz</b>. ' +-          (p.ok ? 'That is inside the designed ' + range(FM.lo) + ' range. ' : '<b>That is outside the designed ' + range(FM.lo) + ' range.</b> ') + 'The RF amplifier\u2019s tank tracks the station.';-      } else {-        html = 'AM is converted <b>up</b>: LO = ' + mhz(p.rf * 1000, 0) + ' kHz + 10.695 MHz = <b>' + mhz(p.lo) + ' MHz</b>' +-          (p.ok ? '' : ' (<b>outside the designed ' + range(AM.lo) + '</b>)') + '. The 2 MHz low-pass in front needs no tuning.';-      }-    } else if (fm) {-      if (p.side === 'above') html = 'The first board’s LO reaches this one on the normal side: <b>' + mhz(p.lo) + ' MHz</b>, inside its measured ' + range(FM.boardLo) + '.';-      else if (p.side === 'below') html = 'The first board’s LO only covers ' + range(FM.boardLo) + ', so it tunes this station from <b>below</b>: ' + mhz(p.rf, 1) + ' − 10.695 = <b>' + mhz(p.lo) + ' MHz</b>.';-      else html = '<b>Out of reach on the first board.</b> The LO would need ' + mhz(p.lo) + ' or ' + mhz(p.alt) + ' MHz; it covers ' + range(FM.boardLo) + '. The board hears 87.5 to 88.5 and 102.2 to 108 MHz until the tank is retuned.';-      if (p.side !== 'none') html += ' The RF tank is parked at PWM 2400 rather than tracking the station.';-    } else {-      html = p.ok-        ? 'The first board’s AM LO runs low (' + range(AM.boardLo) + '), so the firmware uses the mixer’s <b>sum</b>: LO = 10.695 − ' + mhz(p.rf, 3) + ' = <b>' + mhz(p.lo) + ' MHz</b>. Tuning works, but the AM IF strip passes no audio yet.'-        : '<b>Out of reach on the first board.</b> Sum mode needs an LO of ' + mhz(p.lo) + ' MHz; the board covers ' + range(AM.boardLo) + ', which is about 533 to 1150 kHz.';-    }-    if (S.ctl.tune === 'dac' && K.P.lo != null) {-      const off = Math.abs(K.if1 - 10.695) * 1000;-      html = '<b>Manual DAC</b> (AFC off): code ' + K.dac + ' \u2192 VT ' + K.vt.toFixed(3) + ' V \u2192 LO <b>' + mhz(K.P.lo) + ' MHz</b>. Your station comes out at ' + mhz(K.if1) + ' MHz, <b>' + off.toFixed(off < 10 ? 1 : 0) + ' kHz</b> from the 10.695 MHz centre' +-        (off < 1 ? ': centred.' : off < 90 ? ': on the slope of the 10.7 MHz filters.' : ': outside the filters, so it is cut.');-      p.ok = off < 90;-    }-    v.innerHTML = html;-    v.classList.toggle('bad', !p.ok);-    drawSpectrum(p);-    scheduleStages();-  }-  function drawSpectrum(p) {-    const fm = S.band === 'fm';-    const W = 640, X0 = 34, X1 = 620, YT = 22, YB = 108;-    const lo = fm ? 60 : 0, hi = fm ? 140 : 25;-    const sx = (f) => X0 + (f - lo) / (hi - lo) * (X1 - X0);-    const sy = (a) => YB - a * (YB - YT - 14);-    const o = [];-    const band = fm ? [87.5, 108] : [0.53, 1.7];-    o.push('<rect class="bandfill" x="' + sx(band[0]) + '" y="' + YT + '" width="' + (sx(band[1]) - sx(band[0])) + '" height="' + (YB - YT) + '"/>');-    o.push('<text x="' + (sx(band[0]) + 3) + '" y="' + (YT + 10) + '">' + (fm ? 'FM band' : 'AM') + '</text>');-    // filter response: tracking tank (FM, design) or the fixed 2 MHz low-pass (AM)-    const curve = [];-    if (fm) {-      const Q = 12, f0 = p.tank || p.rf;-      for (let f = lo; f <= hi; f += 0.25) { const x = f / f0 - f0 / f; curve.push([sx(f), sy(1 / Math.sqrt(1 + Q * Q * x * x))]); }-    } else if (!fm) {-      for (let f = 0.01; f <= hi; f += 0.05) curve.push([sx(f), sy(1 / Math.sqrt(1 + Math.pow(f / 2, 10)))]);-    }-    if (curve.length) {-      o.push('<path class="resp" d="M' + curve[0][0] + ',' + YB + 'L' + curve.map((c) => c.join(',')).join('L') + 'L' + curve[curve.length - 1][0] + ',' + YB + 'Z"/>');-      const lab = fm ? 'RF tank (tracks the station)' : '2 MHz low-pass';-      o.push('<text x="' + (fm ? sx(p.rf) - 8 : sx(2.2)) + '" y="' + (fm ? YT + 30 : YT + 30) + '" text-anchor="' + (fm ? 'end' : 'start') + '">' + lab + '</text>');-    }-    // axis-    o.push('<line class="axis" x1="' + X0 + '" x2="' + X1 + '" y1="' + YB + '" y2="' + YB + '"/>');-    const ticks = fm ? [60, 70, 80, 90, 100, 110, 120, 130, 140] : [0, 5, 10, 15, 20, 25];-    ticks.forEach((t, k) => {-      const last = k === ticks.length - 1;-      o.push('<line class="tick" x1="' + sx(t) + '" x2="' + sx(t) + '" y1="' + YB + '" y2="' + (YB + 4) + '"/><text x="' + (sx(t) + (last ? 4 : 0)) + '" y="' + (YB + 14) + '" text-anchor="' + (last ? 'end' : 'middle') + '">' + t + (last ? ' MHz' : '') + '</text>');-    });-    // LO range bar-    const lr = fm ? (S.mode === 'design' ? FM.lo : FM.boardLo) : (S.mode === 'design' ? AM.lo : AM.boardLo);-    o.push('<rect class="lorange" x="' + sx(lr[0]) + '" y="' + (YB + 20) + '" width="' + Math.max(2, sx(lr[1]) - sx(lr[0])) + '" height="7" rx="2"/>');-    o.push('<text x="' + (sx(lr[1]) + 5) + '" y="' + (YB + 27) + '">LO range' + (S.mode === 'board' ? ', first board' : '') + '</text>');-    // markers-    const mk = (f, cls, lab, row) => {-      if (f < lo || f > hi) return;-      o.push('<line class="' + cls + '" x1="' + sx(f) + '" x2="' + sx(f) + '" y1="' + (YT + 4) + '" y2="' + YB + '"/>');-      o.push('<text class="lbl-' + cls.slice(2) + '" x="' + sx(f) + '" y="' + (YT - 4 - row * 0) + '" text-anchor="middle">' + lab + '</text>');-    };-    mk(p.rf, 'm-rf', fm ? 'station' : 'stn', 0);-    mk(p.lo, 'm-lo', 'LO', 0);-    $('#spec').innerHTML = o.join('');-    $('#spec').setAttribute('viewBox', '0 0 ' + W + ' 140');-  }--  // ------------------------------------------------------------ detail view-  const view = $('#sch-view');-  let vb = null, vbFit = null;-  function select(id, opt) {-    opt = opt || {};-    if (!INFO[id] || !BL[id]) return;-    S.sel = id; S.part = null; S.net = null;-    const info = INFO[id], b = BL[id];-    $('#d-title').textContent = info.title;-    const src = BLOCK_SRC[id];-    const chips = ['<span class="chip ' + info.group + '">' + GROUPS[info.group].name + '</span>'];-    for (const bd of info.bands) if (bd !== info.group) chips.push('<span class="chip ' + bd + '">' + bd.toUpperCase() + '</span>');-    if (info.bands.length === 2 && info.group !== 'if' && info.group !== 'dig' && info.group !== 'ctrl') chips.push('<span class="chip if">both bands</span>');-    if (src) chips.push('<span class="chip src">tools/design.py ' + src[0] + '-' + src[1] + '</span>');-    $('#d-chips').innerHTML = chips.join('');-    const i = ORDER.indexOf(id);-    $('#prev').disabled = i <= 0; $('#next').disabled = i >= ORDER.length - 1;-    $('#prev').dataset.go = ORDER[i - 1] || ''; $('#next').dataset.go = ORDER[i + 1] || '';-    $('#prev').title = i > 0 ? INFO[ORDER[i - 1]].title : ''; $('#next').title = i < ORDER.length - 1 ? INFO[ORDER[i + 1]].title : '';-    // schematic-    view.innerHTML = R[id].svg;-    const svg = $('svg', view);-    svg.removeAttribute('width'); svg.removeAttribute('height');-    vbFit = [-16, -16, b.w + 32, b.h + 32];-    vb = vbFit.slice();-    applyVB();-    wireSchematic(svg);-    // info column-    const facts = info.facts && info.facts.length ? '<div><h3>Key numbers</h3><ul class="facts">' + info.facts.map((f) => '<li>' + f + '</li>').join('') + '</ul></div>' : '';-    const board = info.board ? '<div class="board"><h3>' + (info.boardTitle || (id === 'fmmix' || id === 'xo' ? 'From the RF review' : 'On the first board')) + '</h3><p>' + info.board + '</p></div>' : '';-    const parts = R[id].analysis.parts.map((p) => p.ref).filter((r, k, a) => a.indexOf(r) === k);-    parts.sort((a, b2) => sortRef(a) - sortRef(b2) || a.localeCompare(b2));-    const rows = parts.map((r) => {-      const d = DESIGN.parts[r];-      const isTp = /^(TP|MC|MP)/.test(r);-      return '<tr data-ref="' + r + '"><td>' + r + '</td><td>' + esc(isTp ? d.value : d.value) + '</td><td>' + esc(isTp ? (r.startsWith('TP') ? 'test pad on ' : 'machine contact on ') + (Object.values(d.pins)[0] || '') : d.desc) + '</td></tr>';-    }).join('');-    $('#info').innerHTML = '<p class="role">' + info.role + '</p><div class="text">' + info.text.map((t) => '<p>' + t + '</p>').join('') + '</div>' +-      board + facts + '<div id="card-slot"></div>' +-      '<div><h3>Parts in this drawing (' + parts.length + ')</h3><div class="parts-wrap"><table class="parts"><tbody>' + rows + '</tbody></table></div></div>';-    $$('.parts tr', $('#info')).forEach((tr) => {-      tr.addEventListener('mouseenter', () => hotPart(tr.dataset.ref, true));-      tr.addEventListener('mouseleave', () => hotPart(tr.dataset.ref, false));-      tr.addEventListener('click', () => showPart(tr.dataset.ref));-    });-    paintFlow();-    if (opt.stage) SD.stage = opt.stage;-    SD.anim = null;-    renderCtxCtl(id);-    renderDetailChart();-    if (!HOST) try { history.replaceState(null, '', '#' + id); } catch (e) { /* sandboxed */ }-    if (opt.scroll) {-      const r = $('#detail').getBoundingClientRect();-      if (r.top > window.innerHeight * 0.6 || r.bottom < 80) $('#detail').scrollIntoView({ behavior: matchMedia('(prefers-reduced-motion: reduce)').matches ? 'auto' : 'smooth', block: 'start' });-    }-  }-  function sortRef(r) {-    const m = r.match(/^([A-Z]+)(\d+)/);-    const pri = { Q: 0, U: 1, J: 2, Y: 3, FL: 4, D: 5, L: 6, C: 7, R: 8, F: 9, FB: 9, TP: 10, MC: 11, MP: 12 };-    return m ? (pri[m[1]] != null ? pri[m[1]] : 9) * 10000 + +m[2] : 999999;-  }-  function applyVB() {-    const svg = $('svg', view);-    if (svg) svg.setAttribute('viewBox', vb.map((v) => Math.round(v * 10) / 10).join(' '));-  }-  function zoom(f, cx, cy) {-    const [x, y, w, h] = vb;-    const nw = Math.min(vbFit[2] * 1.2, Math.max(vbFit[2] / 6, w / f));-    const k = nw / w;-    cx = cx == null ? x + w / 2 : cx; cy = cy == null ? y + h / 2 : cy;-    vb = [cx - (cx - x) * k, cy - (cy - y) * k, w * k, h * k];-    applyVB();-  }-  $('#z-in').addEventListener('click', () => zoom(1.4));-  $('#z-out').addEventListener('click', () => zoom(1 / 1.4));-  $('#z-fit').addEventListener('click', () => { vb = vbFit.slice(); applyVB(); });-  view.addEventListener('wheel', (ev) => {-    if (!ev.ctrlKey && !ev.metaKey) return;-    ev.preventDefault();-    const svg = $('svg', view), r = svg.getBoundingClientRect();-    const cx = vb[0] + (ev.clientX - r.left) / r.width * vb[2], cy = vb[1] + (ev.clientY - r.top) / r.height * vb[3];-    zoom(ev.deltaY < 0 ? 1.15 : 1 / 1.15, cx, cy);-  }, { passive: false });-  let drag = null;-  view.addEventListener('pointerdown', (ev) => {-    if (ev.target.closest('.part, .flag')) return;-    drag = { x: ev.clientX, y: ev.clientY, vb: vb.slice(), moved: false };-    view.setPointerCapture(ev.pointerId);-  });-  view.addEventListener('pointermove', (ev) => {-    if (!drag) return;-    const svg = $('svg', view), r = svg.getBoundingClientRect();-    const dx = (ev.clientX - drag.x) / r.width * vb[2], dy = (ev.clientY - drag.y) / r.height * vb[3];-    if (Math.abs(ev.clientX - drag.x) + Math.abs(ev.clientY - drag.y) > 3) { drag.moved = true; view.classList.add('dragging'); hideTip(); }-    if (drag.moved) { vb = [drag.vb[0] - dx, drag.vb[1] - dy, vb[2], vb[3]]; applyVB(); }-  });-  const endDrag = () => { if (drag) { view.classList.remove('dragging'); setTimeout(() => { drag = null; }, 0); } };-  view.addEventListener('pointerup', endDrag);-  view.addEventListener('pointercancel', endDrag);--  function wireSchematic(svg) {-    $$('.part', svg).forEach((g) => {-      g.addEventListener('mouseenter', (ev) => { hotPart(g.dataset.ref, true); tipPart(g.dataset.ref, ev); });-      g.addEventListener('mousemove', moveTip);-      g.addEventListener('mouseleave', () => { hotPart(g.dataset.ref, false); hideTip(); });-      g.addEventListener('click', () => { if (!drag || !drag.moved) showPart(g.dataset.ref); });-    });-    $$('[data-net]', svg).forEach((el) => {-      const net = el.dataset.net;-      if (!net) return;-      el.addEventListener('mouseenter', (ev) => { hlNet(net, true); tipNet(net, ev, el.classList.contains('flag')); });-      el.addEventListener('mousemove', moveTip);-      el.addEventListener('mouseleave', () => { hlNet(net, false); hideTip(); });-      if (el.classList.contains('flag')) {-        el.addEventListener('click', (ev) => { if (!drag || !drag.moved) followNet(net, ev); });-        el.addEventListener('keydown', (ev) => { if (ev.key === 'Enter' || ev.key === ' ') { ev.preventDefault(); followNet(net, ev); } });-      } else {-        el.addEventListener('click', () => { if (!drag || !drag.moved) { S.net = S.net === net ? null : net; hlNet(net, true); } });-      }-    });-  }-  function hotPart(ref, on) {-    $$('.part[data-ref="' + ref + '"]', view).forEach((g) => g.classList.toggle('hot', on || S.part === ref));-    $$('.parts tr[data-ref="' + ref + '"]').forEach((tr) => tr.classList.toggle('hot', on || S.part === ref));-  }-  function hlNet(net, on) {-    $$('[data-net]', view).forEach((el) => {-      const match = el.dataset.net === net && on;-      el.classList.toggle('hl', match || (S.net != null && el.dataset.net === S.net));-    });-  }--  // ------------------------------------------------------------ tooltip, menus, part card-  const tip = $('#tip');-  function moveTip(ev) {-    const pad = 14, w = tip.offsetWidth, h = tip.offsetHeight;-    let x = ev.clientX + pad, y = ev.clientY + pad;-    if (x + w > window.innerWidth - 8) x = ev.clientX - w - pad;-    if (y + h > window.innerHeight - 8) y = ev.clientY - h - pad;-    tip.style.left = Math.max(4, x) + 'px'; tip.style.top = Math.max(4, y) + 'px';-  }-  function hideTip() { tip.hidden = true; }-  function tipPart(ref, ev) {-    const d = DESIGN.parts[ref];-    if (!d) return;-    const kind = ref.startsWith('TP') ? 'Test pad, silk label ' + d.value : ref.startsWith('MC') ? 'Machine contact, silk label ' + d.value : d.desc;-    tip.innerHTML = '<b>' + esc(ref) + '</b> <span class="tv">' + esc(ref.match(/^(TP|MC)/) ? Object.values(d.pins)[0] : d.value) + '</span><div class="td">' + esc(kind) + '</div>' +-      (d.mpn || d.lcsc ? '<div class="tv">' + esc([d.mpn, d.lcsc].filter(Boolean).join(' · ')) + '</div>' : '');-    tip.hidden = false; moveTip(ev);-  }-  const blockName = (id) => (INFO[id] ? INFO[id].title : id);-  function tipNet(net, ev, isFlag) {-    const others = (netPinBlocks[net] || netBlocks[net] || []).filter((x) => x !== S.sel);-    const pads = Object.entries(DESIGN.parts).filter(([r, p]) => /^(TP|MC)/.test(r) && Object.values(p.pins)[0] === net).map(([r, p]) => p.value + ' (' + r + ')');-    tip.innerHTML = '<b>' + esc(net) + '</b>' + (others.length ? '<div class="td">' + (isFlag ? 'Click to go to ' : 'Also in ') + others.map(blockName).map(esc).join(', ') + '</div>' : '') +-      (pads.length ? '<div class="tv">Probe: ' + esc(pads.join(', ')) + '</div>' : '');-    tip.hidden = false; moveTip(ev);-  }-  const menu = $('#menu');-  function closeMenu() { menu.hidden = true; }-  document.addEventListener('click', (ev) => { if (!menu.hidden && !ev.composedPath().some((n) => n === menu || (n.classList && n.classList.contains('flag')))) closeMenu(); });-  document.addEventListener('keydown', (ev) => { if (ev.key === 'Escape') { closeMenu(); hideTip(); } });-  function followNet(net, ev) {-    hideTip();-    let others = (netPinBlocks[net] || []).filter((x) => x !== S.sel && INFO[x]);-    if (!others.length) others = (netBlocks[net] || []).filter((x) => x !== S.sel && INFO[x]);-    if (!others.length) return;-    const go = (id) => { closeMenu(); select(id); setTimeout(() => { S.net = net; hlNet(net, true); }, 0); };-    if (others.length === 1) return go(others[0]);-    menu.innerHTML = '<div class="mh">' + esc(net) + ' continues in</div>' + others.map((id) => '<button type="button" data-go="' + id + '">' + esc(blockName(id)) + '</button>').join('');-    $$('button', menu).forEach((b) => b.addEventListener('click', () => go(b.dataset.go)));-    menu.hidden = false;-    const x = Math.min(window.innerWidth - menu.offsetWidth - 8, (ev.clientX || 100) + 6);-    const y = Math.min(window.innerHeight - menu.offsetHeight - 8, (ev.clientY || 100) + 6);-    menu.style.left = x + 'px'; menu.style.top = y + 'px';-    $('button', menu).focus();-  }-  function showPart(ref) {-    const prev = S.part;-    S.part = ref;-    if (prev) hotPart(prev, false);-    hotPart(ref, true);-    const d = DESIGN.parts[ref];-    const slot = $('#card-slot');-    if (!d || !slot) return;-    const links = [];-    if (d.wiki) links.push('<a href="' + esc(d.wiki) + '" target="_blank" rel="noopener">Wiki page</a>');-    if (d.lcsc) links.push('<a href="https://www.lcsc.com/product-detail/' + esc(d.lcsc) + '.html" target="_blank" rel="noopener">LCSC ' + esc(d.lcsc) + '</a>');-    const pins = Object.entries(d.pins).filter(([, n]) => n).map(([pin, n]) => '<button type="button" data-net="' + esc(n) + '" title="Show ' + esc(n) + '">' + esc(pin) + ': ' + esc(n) + '</button>').join('');-    slot.innerHTML = '<div class="card"><div class="ct"><b>' + esc(ref) + '</b><button type="button" aria-label="Close" id="card-x">' + ICON.close + '</button></div>' +-      '<div class="cv">' + esc(d.value) + (d.mpn && d.mpn !== d.value ? ' · ' + esc(d.mpn) : '') + '</div>' +-      '<div class="cd">' + esc(d.desc) + '</div>' + (links.length ? '<div class="cl">' + links.join('') + '</div>' : '') +-      '<div class="pins">' + pins + '</div></div>';-    $('#card-x').addEventListener('click', () => { S.part = null; hotPart(ref, false); slot.innerHTML = ''; });-    $$('.pins button', slot).forEach((b) => b.addEventListener('click', (ev) => {-      const net = b.dataset.net;-      if ((netBlocks[net] || []).includes(S.sel)) { S.net = net; hlNet(net, true); }-      else followNet(net, ev);-    }));-  }--  // ------------------------------------------------------------ find-  $('#find').addEventListener('submit', (ev) => {-    ev.preventDefault();-    const q = $('#find-in').value.trim();-    const msg = $('#find-msg');-    msg.textContent = '';-    if (!q) return;-    const ref = q.toUpperCase();-    if (DESIGN.parts[ref] && homeBlock(ref)) { select(homeBlock(ref)); showPart(ref); return; }-    const net = Object.keys(netBlocks).find((n) => n.toUpperCase() === ref);-    if (net) {-      // open the block where the net has the most connections-      const cands = netPinBlocks[net] || netBlocks[net];-      const score = (id) => R[id].analysis.parts.reduce((n, p) => n + Object.values(p.pins).filter((x) => x.net === net).length, 0);-      const id = cands.slice().sort((a, b2) => score(b2) - score(a) || orderIdx(a) - orderIdx(b2))[0];-      select(id); S.net = net; hlNet(net, true); return;-    }-    msg.textContent = 'No part or net called ' + q;-  });-  const dl = $('#find-list');-  dl.innerHTML = Object.keys(DESIGN.parts).filter((r) => partBlocks[r]).concat(Object.keys(netBlocks)).map((s) => '<option value="' + esc(s) + '">').join('');--  // ------------------------------------------------------------ controls-  $$('#band button').forEach((b) => b.addEventListener('click', () => setBand(b.dataset.band)));-  $$('#mode button').forEach((b) => b.addEventListener('click', () => {-    S.mode = b.dataset.mode;-    $$('#mode button').forEach((x) => x.setAttribute('aria-pressed', String(x === b)));-    paintTuner(); paintFlow();-  }));-  $('#f-range').addEventListener('input', (ev) => setF(+ev.target.value));-  $('#f-in').addEventListener('change', (ev) => { const v = parseFloat(ev.target.value); if (isFinite(v)) setF(S.band === 'am' && v < 2 ? v * 1000 : v); });-  $('#f-in').addEventListener('keydown', (ev) => { if (ev.key === 'Enter') ev.target.blur(); });-  $('#f-in').addEventListener('blur', () => setF(S.f[S.band]));-  $('#presets').addEventListener('click', (ev) => { const b = ev.target.closest('button'); if (b) setF(+b.dataset.v); });-  $('#prev').addEventListener('click', (ev) => { if (ev.currentTarget.dataset.go) select(ev.currentTarget.dataset.go); });-  $('#next').addEventListener('click', (ev) => { if (ev.currentTarget.dataset.go) select(ev.currentTarget.dataset.go); });-  $('#to-flow').addEventListener('click', () => $('#flow-panel').scrollIntoView({ behavior: 'smooth', block: 'start' }));---  // ------------------------------------------------------------ spectrum at each stage-  let SPEC = null, stagesQueued = false;-  function scheduleStages() {-    if (stagesQueued) return;-    stagesQueued = true;-    requestAnimationFrame(() => { stagesQueued = false; renderStages(); });-  }-  function legendHtml(mixer) {-    const items = [['sig-st', 'your station'], ['sig-sub', 'stereo pilot and subcarriers'], ['sig-other', 'other stations'], ['sig-img', 'calibration marker (when on)'],-      ['', 'spectrum: signals + noise', 'trace'], ['', 'into this stage', 'ghost'], ['', 'AM / FM broadcast band', 'band'], mixer ? ['text-2', 'box: the part magnified below', 'zoombox'] : ['text-2', 'stage gain (top panel)']];-    return items.map(([v, t, k]) => '<span><i class="' + (k || '') + '" style="--sc:var(--' + (v || 'text-3') + ')"></i>' + esc(t) + '</span>').join('');-  }-  const sigLevel = (st, x) => x.db.toFixed(1) + ' ' + st.yUnit;-  const sigFreq = (st, x) => SPECTRUM.fmtF(x.band ? (x.band[0] + x.band[1]) / 2 : x.f, st.ax.unit);-  function stageTable(st) {-    const rows = (st.out.sig || []).filter((x) => x.f >= st.ax.min && x.f <= st.ax.max).sort((a, b) => b.db - a.db).slice(0, 12);-    if (!rows.length) return '';-    return '<details><summary>Levels table</summary><table><thead><tr><th>Signal</th><th>Frequency</th><th>Level</th></tr></thead><tbody>' +-      rows.map((x) => '<tr><td>' + esc(x.label) + '</td><td class="n">' + esc(sigFreq(st, x)) + '</td><td class="n">' + sigLevel(st, x) + '</td></tr>').join('') +-      '</tbody></table></details>';-  }-  const capOf = (st) => (st.inp && st.strip ? st.strip + ' ' : '') + (st.cap || '');-  function stageCard(st, i) {-    return '<article class="stage" data-i="' + i + '"><header><span class="step">' + (i + 1) + '</span><div class="sh"><h3>' + esc(st.title) + '</h3><span class="parts">' + esc(st.parts) + '</span></div>' +-      (st.est ? '<span class="est">gain estimated</span>' : '') + '<button type="button" class="open" data-block="' + esc(st.block) + '" data-st="' + esc(st.id) + '">Open with schematic</button></header>' +-      (useScope(st) ? SCOPE.render(st, i) : SPECTRUM.render(st, i)) + (st.fault ? '<p class="sfault">' + esc(st.fault) + '</p>' : '') + (useScope(st) ? '<p class="cap">' + esc(SCOPE.caption(st)) + '</p>' : st.cap || st.inp ? '<p class="cap">' + esc(capOf(st)) + '</p>' : '') + stageTable(st) + '</article>';-  }-  function renderStages() {-    SPEC = SPECTRUM.build(S);-    const grid = $('#spec-grid');-    grid.className = 'spec-grid band-' + S.band;-    $('#view-spec').className = 'band-' + S.band;-    grid.__stages = SPEC.stages;-    const last = SPEC.stages[SPEC.stages.length - 1];-    grid.innerHTML = SPEC.stages.map((st, i) => stageCard(st, i)).join('') +-      (last && last.fault && SPEC.stages.length < 6 ? '<p class="spec-end">Nothing reaches the IF, so there is nothing to follow past this point.</p>' : '');-    renderDetailChart();-    applyPin();-  }--  // ------------------------------------------------------------ the big chart under the schematic-  // Blocks that are not a stage of their own show the stage they serve.-  const STAGE_FOR = {-    fmlo: ['fmmix', 'The oscillator itself is one line at the LO frequency. Its job shows in the mixer, which moves every signal by the LO.'],-    amlo: ['ammix', 'The oscillator itself is one line at the LO frequency. Its job shows in the mixer, which moves every signal by the LO.'],-    xo: ['mix2', 'This crystal is the second mixer’s LO; this is what it does to the signal.'],-    rssi: ['lim', 'RSSI_FM taps the first limiter stage; this is the limiter.'],-    pwm: ['fmrf', 'VT_RF tunes the RF amplifier’s tank; this is that stage.'],-    vt: ['@mix', 'VT_FM and VT_AM set the oscillators, and the oscillator decides where the mixer puts every signal.'],-    band: ['@rf', 'The band switch powers this front end; this is its RF stage.'],-  };-  const SD = { stage: null, win: {}, pin: null, drag: null, width: 0, list: null, band: 'fm', dom: 'time' };-  try { SD.dom = localStorage.getItem('amfm-explorer-dom') || 'time'; } catch (e) { /* no storage */ }-  // From the limiter on, the signal is shown in time, as a scope on that node would show it (Spectrum switches back).-  function useScope(st) { return SD.dom !== 'freq' && typeof SCOPE !== 'undefined' && SCOPE.has(st); }-  function scopeLegend(st) {-    const items = [['sig-st', 'the signal on that node', 'line']].concat(st && st.td && st.td.fault ? [['', 'what the design expects', 'ghost']] : []).concat([['text-2', 'switch point, rails and rest levels', 'ref']]);-    return items.map(([v, t, k]) => '<span><i class="' + k + '" style="--sc:var(--' + (v || 'text-3') + ')"></i>' + esc(t) + '</span>').join('') +-      '<span>Hover to read the time and each panel’s value. Spectrum shows the same stage as amplitude against frequency.</span>';-  }-  function chartFor(id) {-    let target = id, note = '';-    if (STAGE_FOR[id]) {-      [target, note] = STAGE_FOR[id];-      if (target === '@mix') target = S.band === 'fm' ? 'fmmix' : 'ammix';-      if (target === '@rf') target = S.band === 'fm' ? 'fmrf' : 'amrf';-    }-    const find = (list) => list.map((st, i) => (st.block === target || st.id === target ? i : -1)).filter((i) => i >= 0);-    let list = SPEC.stages, band = S.band, idx = find(list);-    if (!idx.length) {-      const ob = S.band === 'fm' ? 'am' : 'fm';-      const other = SPECTRUM.build(Object.assign({}, S, { band: ob }));-      const j = find(other.stages);-      if (j.length) { list = other.stages; band = ob; idx = j; }-    }-    return { list, band, idx, note };-  }-  function renderDetailChart() {-    const sec = $('#sd'), view = $('#sd-view');-    if (!S.sel || !SPEC) return;-    const C = chartFor(S.sel);-    if (!C.idx.length) { sec.hidden = true; return; }-    sec.hidden = false;-    if (!C.idx.some((i) => C.list[i].id === SD.stage)) {-      const anim = C.idx.find((i) => C.list[i].steps && C.list[i].steps.length);-      SD.stage = C.list[anim != null ? anim : C.idx[0]].id;-    }-    SD.sibs = C.idx.map((i) => C.list[i]);-    const i = C.list.findIndex((st) => st.id === SD.stage);-    const st = C.list[i];-    SD.list = C.list; SD.band = C.band;-    $('#sd-title').textContent = 'Stage ' + (i + 1) + ' of ' + C.list.length + ': ' + st.title + ', what it does to the signal';-    $('#sd-tabs').innerHTML = C.idx.length > 1 ? C.idx.map((k) => '<button type="button" data-st="' + esc(C.list[k].id) + '" aria-pressed="' + (C.list[k].id === SD.stage) + '">' + esc(C.list[k].title) + '</button>').join('') : '';-    const note = (C.note ? C.note + ' ' : '') + (C.band !== S.band ? 'Shown for the ' + C.band.toUpperCase() + ' band, because this block is not used on ' + S.band.toUpperCase() + '.' : '');-    $('#sd-note').hidden = !note; $('#sd-note').textContent = note;-    const width = Math.max(440, Math.floor(view.clientWidth || 720));-    SD.width = width;-    if (SD.anim && SD.anim.stage !== st.id) SD.anim = null;-    view.__i = i;-    drawChart(st, i, width);-    view.className = 'sd-view band-' + C.band;-    renderSteps(st);-    const sc = useScope(st);-    $('#sd-dom').hidden = typeof SCOPE === 'undefined' || !SCOPE.has(st);-    $$('#sd-dom button').forEach((b) => b.setAttribute('aria-pressed', String(b.dataset.dom === (sc ? 'time' : 'freq'))));-    $('.sd-bar .zoom').hidden = sc;-    $('#sd .sch-key').hidden = sc;-    $('#sd-legend').className = 'sd-legend spec-legend band-' + C.band;-    $('#sd-legend').innerHTML = sc ? scopeLegend(st) : legendHtml(!!st.inp);-    view.__stages = C.list; view.__st = st;-    $('#sd-cap').innerHTML = (st.fault ? '<p class="sfault">' + esc(st.fault) + '</p>' : '') + (sc ? '<p>' + esc(SCOPE.caption(st)) + '</p>' : st.cap || st.inp ? '<p>' + esc(capOf(st)) + '</p>' : '') +-      (st.est ? '<p class="hint">The gain of this stage is an estimate from the component values; the design notes do not give it.</p>' : '');-    $('#sz-fit').disabled = !SD.win[st.id];-    applyPin();-    renderFollow();-  }-  // draw just the chart (also each animation frame)-  function drawChart(st, i, width) {-    const view = $('#sd-view');-    st = st || view.__st; i = i == null ? view.__i : i; width = width || SD.width;-    if (!st) return;-    const A = SD.anim && SD.anim.stage === st.id ? SD.anim : null;-    const opt = { big: true, width, win: SD.win[st.id] || null, anim: A ? { k: A.k, t: A.t } : null };-    view.__scope = useScope(st);-    view.innerHTML = view.__scope ? SCOPE.render(st, i, opt) : SPECTRUM.render(st, i, opt);-    view.__opt = opt;-    if (SD.pin) applyPin();-  }-  // zoom: factor > 1 zooms in, about frequency fc (or the window centre)-  function sdZoom(factor, fc) {-    const st = $('#sd-view').__st;-    if (!st) return;-    const lg = st.ax.log, T = (v) => (lg ? Math.log10(v) : v), Ti = (v) => (lg ? Math.pow(10, v) : v);-    const [a, b] = SD.win[st.id] || [st.ax.min, st.ax.max];-    const BA = T(st.ax.min), BB = T(st.ax.max), A = T(a), B = T(b);-    const c = fc == null ? (A + B) / 2 : T(fc);-    const span = Math.max((BB - BA) / 400, Math.min(BB - BA, (B - A) / factor));-    let lo = c - (c - A) * span / (B - A), hi = lo + span;-    if (lo < BA) { lo = BA; hi = lo + span; }-    if (hi > BB) { hi = BB; lo = hi - span; }-    SD.win[st.id] = span >= (BB - BA) * 0.999 ? null : [Ti(lo), Ti(hi)];-    renderDetailChart();-  }-  function sdZoomTo(s) {-    const st = $('#sd-view').__st;-    if (!st || !s) return;-    const lo0 = s.band ? s.band[0] : s.f - Math.max(s.bw || 0, (st.ax.max - st.ax.min) / 60) * 2.5;-    const hi0 = s.band ? s.band[1] : s.f + Math.max(s.bw || 0, (st.ax.max - st.ax.min) / 60) * 2.5;-    let lo = Math.max(st.ax.min, lo0), hi = Math.min(st.ax.max, hi0);-    if (st.ax.log && !s.band) { const k = 1 + Math.max(0.03, 3 * (s.bw || 0) / s.f); lo = Math.max(st.ax.min, s.f / k); hi = Math.min(st.ax.max, s.f * k); }-    SD.win[st.id] = [lo, hi];-    renderDetailChart();-  }-  $('#sz-in').addEventListener('click', () => sdZoom(1.6));-  $('#sz-out').addEventListener('click', () => sdZoom(1 / 1.6));-  $('#sz-fit').addEventListener('click', () => { const st = $('#sd-view').__st; if (st) { SD.win[st.id] = null; renderDetailChart(); } });-  $('#sz-st').addEventListener('click', () => {-    const st = $('#sd-view').__st;-    if (!st) return;-    const s = (st.out.sig || []).filter((x) => x.kind === 'station' && !x.harm && !x.dc).sort((a, b) => b.db - a.db)[0];-    if (s) sdZoomTo(s);-  });-  $('#sd-dom').addEventListener('click', (ev) => {-    const b = ev.target.closest('button[data-dom]');-    if (!b) return;-    SD.dom = b.dataset.dom;-    try { localStorage.setItem('amfm-explorer-dom', SD.dom); } catch (e) { /* no storage */ }-    SD.anim = null;-    renderDetailChart();-    scheduleStages();-  });-  $('#sd-tabs').addEventListener('click', (ev) => { const b = ev.target.closest('button'); if (b) { SD.stage = b.dataset.st; renderDetailChart(); } });-  const sdView = $('#sd-view');-  const vbX = (svg, clientX) => { const r = svg.getBoundingClientRect(); return (clientX - r.left) / r.width * svg.viewBox.baseVal.width; };-  const vbY = (svg, clientY) => { const r = svg.getBoundingClientRect(); return (clientY - r.top) / r.height * svg.viewBox.baseVal.height; };-  sdView.addEventListener('wheel', (ev) => {-    if (!ev.ctrlKey && !ev.metaKey) return;-    const svg = $('svg', sdView);-    if (!svg || sdView.__scope) return;-    ev.preventDefault();-    sdZoom(ev.deltaY < 0 ? 1.25 : 1 / 1.25, SPECTRUM.fAt(sdView.__st, sdView.__opt, vbX(svg, ev.clientX)));-  }, { passive: false });-  sdView.addEventListener('pointerdown', (ev) => {-    const svg = $('svg', sdView);-    if (!svg || ev.button !== 0 || sdView.__scope) return;-    SD.drag = { x: ev.clientX, win: SD.win[sdView.__st.id] || null, moved: false, id: ev.pointerId };-  });-  sdView.addEventListener('pointermove', (ev) => {-    const d = SD.drag;-    if (!d) return;-    const st = sdView.__st, svg = $('svg', sdView);-    if (!d.moved && Math.abs(ev.clientX - d.x) < 4) return;-    if (!d.moved) { d.moved = true; sdView.setPointerCapture(d.id); sdView.classList.add('dragging'); hideTip(); }-    const lay = SPECTRUM.layout(st, sdView.__opt), r = svg.getBoundingClientRect();-    const dxv = (ev.clientX - d.x) / r.width * svg.viewBox.baseVal.width / (lay.R - lay.L);-    const lgx = st.ax.log, T = (v) => (lgx ? Math.log10(v) : v), Ti = (v) => (lgx ? Math.pow(10, v) : v);-    const [a, b] = d.win || [st.ax.min, st.ax.max];-    const span = T(b) - T(a), BA = T(st.ax.min), BB = T(st.ax.max);-    if (span >= BB - BA - 1e-12) return;-    let lo = T(a) - dxv * span;-    lo = Math.max(BA, Math.min(BB - span, lo));-    SD.win[st.id] = [Ti(lo), Ti(lo + span)];-    renderDetailChart();-  });-  const endSdDrag = () => { if (SD.drag) { const moved = SD.drag.moved; sdView.classList.remove('dragging'); setTimeout(() => { SD.drag = null; }, 0); return moved; } return false; };-  sdView.addEventListener('pointerup', endSdDrag);-  sdView.addEventListener('pointercancel', endSdDrag);-  sdView.addEventListener('dblclick', (ev) => {-    const svg = $('svg', sdView);-    if (!svg || sdView.__scope) return;-    const res = SPECTRUM.pick(sdView.__st, vbX(svg, ev.clientX), sdView.__opt, vbY(svg, ev.clientY));-    if (res.panel === 'in') {-      const out = res.sig && (sdView.__st.out.sig || []).find((x) => x.id === res.sig.id && !x.sum);-      if (out) sdZoomTo(out);-      return;-    }-    if (res.sig) sdZoomTo(res.sig); else sdZoom(2, res.f);-  });-  if (window.ResizeObserver) {-    let rq = 0;-    new ResizeObserver(() => {-      const w = Math.floor(sdView.clientWidth);-      if (!sdView.__st || Math.abs(w - SD.width) < 12) return;-      cancelAnimationFrame(rq); rq = requestAnimationFrame(renderDetailChart);-    }).observe(sdView);-  }--  // ------------------------------------------------------------ STM32 controls: what the firmware can set-  const CTX = { ant: ['marker'], fmrf: ['pwm'], pwm: ['pwm'], fmlo: ['tune'], amlo: ['tune'], vt: ['tune'], fmmix: ['tune'], ammix: ['tune'], cf1: ['tune'], ifamp: ['tune'],-    mix2: ['tune'], xo: ['tune'], lim: ['tune'], rssi: ['tune'], sq: ['tune'], pump: ['tune'], amf: ['tune'], vga: ['tune'], det: ['tune'], band: ['band'], ui: ['band'], mcu: ['dsp'], fmaud: ['dsp'], agc: ['dsp'], amrf: ['tune'] };-  const seg = (key, opts) => '<div class="seg sm" data-seg="' + key + '">' + opts.map(([v, t]) => '<button type="button" data-ctl="' + key + '" data-v="' + v + '">' + t + '</button>').join('') + '</div>';-  function ctlCard(key, sfx) {-    const id = (k) => 'c-' + k + '-' + sfx;-    const card = (title, pin, body) => '<div class="ccard" data-card="' + key + '"><div class="ch"><b>' + title + '</b><span class="pin">' + pin + '</span></div>' + body + '<p class="ro" data-ro="' + key + '"></p></div>';-    if (key === 'tune') return card('Tuning DAC', '<span data-ro="tunePin"></span>',-      seg('tune', [['station', 'Station + AFC'], ['dac', 'Manual DAC']]) +-      '<label class="sl" for="' + id('dac') + '"><span>DAC code</span><input type="range" min="0" max="4095" step="1" id="' + id('dac') + '" data-ctl="dac"><output data-ro="dacv"></output></label>');-    if (key === 'pwm') return card('RF tracking PWM', 'PB1 TIM3 → 2-pole RC → U202A ×1.45 → VT_RF',-      seg('pwmMode', [['track', 'Track'], ['manual', 'Manual']]) +-      '<label class="sl" for="' + id('pwm') + '"><span>PWM</span><input type="range" min="0" max="4096" step="1" id="' + id('pwm') + '" data-ctl="pwm"><output data-ro="pwmv"></output></label>');-    if (key === 'marker') return card('Calibration marker', 'PA8 TIM1 → R317, C323 → antenna',-      '<label class="ck" for="' + id('mk') + '"><input type="checkbox" id="' + id('mk') + '" data-ctl="marker"> Marker on</label>' +-      '<label class="sl" for="' + id('mn') + '"><span>N</span><input type="range" min="4" max="100" step="1" id="' + id('mn') + '" data-ctl="markerN"><output data-ro="markerv"></output></label>');-    if (key === 'band') return card('Band enables', 'PB8 FM_EN_N, PB9 AM_EN_N → Q201, Q202', seg('band', [['fm', 'FM'], ['am', 'AM']]));-    return card('DSP', 'firmware, between the ADC and USB',-      '<div class="ckrow"><label class="ck" for="' + id('no') + '"><input type="checkbox" id="' + id('no') + '" data-ctl="notch"> 19 kHz notch</label>' +-      '<label class="ck" for="' + id('hu') + '"><input type="checkbox" id="' + id('hu') + '" data-ctl="hum"> Hum canceller</label>' +-      '<label class="ck" for="' + id('mu') + '"><input type="checkbox" id="' + id('mu') + '" data-ctl="mute"> Mute</label></div>' +-      '<div class="ckrow"><span class="lbl">Noise filter</span>' + seg('nf', [['off', 'Off'], ['auto', 'Auto'], ['strong', 'Strong']]) + '</div>' +-      '<label class="sl" for="' + id('ga') + '"><span>Gain</span><input type="range" min="-20" max="12" step="1" id="' + id('ga') + '" data-ctl="gain"><output data-ro="gainv"></output></label>');-  }-  function renderCtlPanel() { $('#ctl-grid').innerHTML = ['tune', 'pwm', 'marker', 'band', 'dsp'].map((k) => ctlCard(k, 'g')).join(''); syncCtl(); }-  function renderCtxCtl(id) {-    const keys = CTX[id] || [];-    $('#sd-ctl').innerHTML = keys.length ? '<div class="sdc-h">STM32 controls for this stage</div><div class="sdc-grid">' + keys.map((k) => ctlCard(k, 's')).join('') + '</div>' : '';-    syncCtl();-  }-  function syncCtl() {-    const K = SPECTRUM.control(S), c = S.ctl, fm = S.band === 'fm';-    $$('[data-ctl]').forEach((el) => {-      const key = el.dataset.ctl;-      if (el.dataset.v != null) {-        const cur = key === 'tune' ? c.tune : key === 'pwmMode' ? c.pwmMode : key === 'nf' ? c.nf : key === 'band' ? S.band : null;-        el.setAttribute('aria-pressed', String(cur === el.dataset.v));-        if (key === 'pwmMode') el.disabled = !fm;-        return;-      }-      if (el.type === 'checkbox') { el.checked = !!c[key]; if (key === 'notch') el.disabled = !fm; return; }-      if (ROOT.activeElement === el) return;-      if (key === 'dac') el.value = K.dac == null ? c.dac : K.dac;-      else if (key === 'pwm') { el.value = K.pwm; el.disabled = !fm; }-      else el.value = c[key];-    });-    const r3 = (v) => (+v.toFixed(3)).toString();-    const ro = {-      tunePin: fm ? 'PA4 DAC1 → U201A ×1.45 → VT_FM' : 'PA5 DAC2 → U201B ×1.45 → VT_AM',-      dacv: K.dac == null ? '-' : String(K.dac),-      tune: K.dac == null ? 'No DAC code reaches this station on the first board.'-        : 'Code ' + K.dac + ' → ' + K.vdac.toFixed(3) + ' V → ×1.45 → ' + (fm ? 'VT_FM ' : 'VT_AM ') + K.vt.toFixed(3) + ' V → LO ' + r3(K.P.lo) + ' MHz' + (S.mode === 'board' ? ' (the board’s calibration table)' : ' (varactor model)') +-          '. IF counter (TIM2): ' + (K.if2 * 1000).toFixed(1) + ' kHz' + (c.tune === 'station' ? ', held on 455 kHz by the AFC.' : Math.abs(K.if2 - 0.455) < 0.0005 ? ', centred.' : ', ' + (Math.abs(K.if2 - 0.455) * 1000).toFixed(1) + ' kHz off centre: the AFC would pull it back.'),-      pwmv: String(K.pwm),-      pwm: fm ? 'PWM ' + K.pwm + ' / 4096 = ' + (K.pwm / 40.96).toFixed(1) + ' % duty → ' + (K.vtRf / 1.45).toFixed(2) + ' V → ×1.45 → VT_RF ' + K.vtRf.toFixed(2) + ' V → tank at ' + K.tank.toFixed(1) + ' MHz (model; its range is ' + K.tankRange[0].toFixed(0) + '-' + K.tankRange[1].toFixed(0) + ' MHz)' +-        (c.pwmMode === 'track' ? (S.mode === 'board' ? ', where the first board’s firmware parks it.' : ', following your station.') : '.') : 'FM only: the AM front end has no tracking tank.',-      markerv: String(c.markerN),-      marker: (() => {-        const f = 48 / c.markerN, f0 = fm ? S.f.fm : S.f.am / 1000, k = Math.max(1, Math.round(f0 / f));-        return (c.marker ? '' : 'Off (PA8 idles low). When on: ') + '48 MHz / ' + c.markerN + ' = ' + r3(f) + ' MHz square wave; harmonic ' + k + ' at ' + r3(k * f) + ' MHz is ' + (Math.abs(k * f - f0) * 1000).toFixed(0) + ' kHz from your station.';-      })(),-      band: 'PB8 FM_EN_N ' + (fm ? 'low → FM front end powered' : 'high-Z → FM off') + '; PB9 AM_EN_N ' + (fm ? 'high-Z → AM off' : 'low → AM front end powered') + '. LED ' + (fm ? 'green (PB13)' : 'yellow (PB14)') + ' on.',-      gainv: (c.gain > 0 ? '+' : '') + c.gain + ' dB',-      dsp: 'FIR ÷4 always on; pilot notch ' + (fm ? (c.notch ? 'on' : 'off') : 'n/a on AM') + '; noise filter ' + c.nf + '; hum canceller ' + (c.hum ? 'on' : 'off') + '; gain ' + (c.gain > 0 ? '+' : '') + c.gain + ' dB' + (c.mute ? '; muted' : '') + '.',-    };-    $$('[data-ro]').forEach((el) => { if (ro[el.dataset.ro] != null) el.textContent = ro[el.dataset.ro]; });-  }-  function setCtl(key, val) {-    if (key === 'band') { setBand(val); syncCtl(); return; }-    const c = S.ctl;-    if (key === 'tune') c.tune = val;-    else if (key === 'pwmMode') c.pwmMode = val;-    else if (key === 'nf') c.nf = val;-    else if (key === 'dac') { c.dac = +val; c.tune = 'dac'; }-    else if (key === 'pwm') { c.pwm = +val; c.pwmMode = 'manual'; }-    else if (key === 'markerN') { c.markerN = +val; c.marker = true; }-    else if (key === 'gain') c.gain = +val;-    else c[key] = val;-    if (key === 'tune' && val === 'dac') { const K = SPECTRUM.control(Object.assign({}, S, { ctl: Object.assign({}, c, { tune: 'station' }) })); if (K.dac != null) c.dac = K.dac; }-    syncCtl();-    paintTuner();-    paintFlow();-  }-  ROOT.addEventListener('input', (ev) => { const el = ev.target; if (el.dataset && el.dataset.ctl && el.type === 'range') setCtl(el.dataset.ctl, el.value); });-  ROOT.addEventListener('change', (ev) => { const el = ev.target; if (el.dataset && el.dataset.ctl && el.type === 'checkbox') setCtl(el.dataset.ctl, el.checked); });-  ROOT.addEventListener('click', (ev) => { const b = ev.target.closest && ev.target.closest('button[data-ctl][data-v]'); if (b && !b.disabled) setCtl(b.dataset.ctl, b.dataset.v); });--  // ------------------------------------------------------------ step player: each part of a stage, one at a time-  const DUR = { in: 1500, filter: 2300, gain: 2000, convert: 1800, mix: 4200, out: 1800 };-  const RM = window.matchMedia && matchMedia('(prefers-reduced-motion: reduce)').matches;-  function renderSteps(st) {-    const play = $('#sd-play');-    play.hidden = false;-    if (!st.steps || !st.steps.length) {-      const other = (SD.sibs || []).find((x) => x !== st && x.steps && x.steps.length);-      $('#sp-play').hidden = !other;-      $('#sp-play').innerHTML = other ? ICON.play + 'Animate: ' + esc(other.title) : '';-      $('#sp-play').dataset.go = other ? other.id : '';-      $('#sd-steps').innerHTML = '<span class="nosteps">' + (other ? 'This is the band as it arrives, with nothing applied yet. The \u201c' + esc(other.title) + '\u201d tab steps through each part.' : S.mode === 'board' ? 'Nothing to step through: on the first board no signal reaches this stage.' : 'Nothing to step through at this stage.') + '</span>';-      return;-    }-    $('#sp-play').hidden = false;-    $('#sp-play').dataset.go = '';-    const A = SD.anim && SD.anim.stage === st.id ? SD.anim : null;-    $('#sd-steps').innerHTML = st.steps.map((x, k) => '<button type="button" data-k="' + k + '" aria-pressed="' + !!(A && A.k === k) + '"><span class="n">' + (k + 1) + '</span>' + esc(x.name) + '</button>').join('') +-      '<button type="button" data-k="final" aria-pressed="' + !A + '"><span class="n">' + ICON.check + '</span>Result</button>';-    $('#sp-play').innerHTML = A && A.playing ? ICON.pause + 'Pause' : ICON.play + 'Play the steps';-  }-  function frame(now) {-    const A = SD.anim;-    if (!A || !A.playing) return;-    const st = $('#sd-view').__st;-    if (!st || st.id !== A.stage || !st.steps) { SD.anim = null; return; }-    const step = st.steps[A.k], dur = DUR[step.kind] || 2000;-    let t = (now - A.t0) / dur;-    if (t >= 1) {-      A.k++; A.t0 = now; t = 0;-      if (A.k >= st.steps.length) { SD.anim = null; renderDetailChart(); return; }-      renderSteps(st);-    }-    A.t = RM ? 1 : t;-    drawChart();-    requestAnimationFrame(frame);-  }-  $('#sp-play').addEventListener('click', () => {-    const go = $('#sp-play').dataset.go;-    if (go) { SD.stage = go; SD.anim = { stage: go, k: 0, t: 0, t0: performance.now(), playing: true }; renderDetailChart(); requestAnimationFrame(frame); return; }-    const st = $('#sd-view').__st;-    if (!st || !st.steps) return;-    if (SD.anim && SD.anim.stage === st.id && SD.anim.playing) { SD.anim.playing = false; renderSteps(st); return; }-    const k = SD.anim && SD.anim.stage === st.id && SD.anim.k < st.steps.length - 1 && SD.anim.t < 1 ? SD.anim.k : 0;-    SD.anim = { stage: st.id, k, t: 0, t0: performance.now(), playing: true };-    renderSteps(st);-    requestAnimationFrame(frame);-  });-  $('#sd-steps').addEventListener('click', (ev) => {-    const b = ev.target.closest('button');-    const st = $('#sd-view').__st;-    if (!b || !st) return;-    SD.anim = b.dataset.k === 'final' ? null : { stage: st.id, k: +b.dataset.k, t: 1, playing: false };-    renderSteps(st);-    drawChart();-  });--  // ------------------------------------------------------------ pin a signal and follow it through every stage-  function applyPin() {-    ROOT.querySelectorAll('svg.stg .sg.pin').forEach((e) => e.classList.remove('pin'));-    ROOT.querySelectorAll('.spec-grid, .sd-view').forEach((g) => g.classList.toggle('pinned', !!SD.pin));-    if (SD.pin) ROOT.querySelectorAll('svg.stg .sg[data-sid="' + SD.pin + '"]').forEach((e) => e.classList.add('pin'));-  }-  function renderFollow() {-    const box = $('#sd-follow');-    if (!SD.pin || !SD.list) { box.innerHTML = ''; return; }-    const rows = [];-    let label = '';-    const first = SD.list[0] && (SD.list[0].out.sig || []).find((x) => x.id === SD.pin);-    const pinKind = first ? first.kind : null;-    SD.list.forEach((st, i) => {-      // the product that carries the signal: same kind as where it started (a sum product on the first board's AM)-      const s = (st.out.sig || []).filter((x) => x.id.split(':')[0] === SD.pin && !x.harm).sort((a, b) => (a.kind === pinKind ? 0 : 1) - (b.kind === pinKind ? 0 : 1) || (a.id === SD.pin ? 0 : 1) - (b.id === SD.pin ? 0 : 1) || (a.sum ? 1 : 0) - (b.sum ? 1 : 0) || b.db - a.db)[0];-      if (s && !label) label = s.label;-      rows.push('<tr data-st="' + esc(st.id) + '" data-block="' + esc(st.block) + '"' + (st.id === SD.stage ? ' class="cur"' : '') + ' tabindex="0"><td class="n">' + (i + 1) + '</td><td>' + esc(st.title) + '</td>' +-        (s ? '<td class="n">' + esc(sigFreq(st, s)) + '</td><td class="n">' + sigLevel(st, s) + '</td>' : '<td class="n gone" colspan="2">' + (i ? 'gone (filtered out)' : '-') + '</td>') + '</tr>');-    });-    box.innerHTML = '<div class="follow"><div class="fh"><span><b>Following: ' + esc(label || SD.pin) + '</b> through every stage. Click a row to open that stage.</span><button type="button" id="unpin">Stop following</button></div>' +-      '<div class="fwrap"><table><thead><tr><th class="n">#</th><th>Stage</th><th class="n">Frequency</th><th class="n">Level</th></tr></thead><tbody>' + rows.join('') + '</tbody></table></div></div>';-    $('#unpin').addEventListener('click', () => { SD.pin = null; applyPin(); renderFollow(); });-    $$('tr[data-st]', box).forEach((tr) => {-      const go = () => { SD.stage = tr.dataset.st; if (tr.dataset.block !== S.sel) select(tr.dataset.block, { stage: tr.dataset.st }); else renderDetailChart(); };-      tr.addEventListener('click', go);-      tr.addEventListener('keydown', (ev) => { if (ev.key === 'Enter') go(); });-    });-  }-  function pinAt(host, ev) {-    const hov = ev.target.closest('.hov');-    if (!hov) return;-    const svg = hov.ownerSVGElement;-    if (svg.classList.contains('scope')) return;-    const st = host.__st || host.__stages[+hov.dataset.i];-    const res = SPECTRUM.pick(st, vbX(svg, ev.clientX), host.__opt, vbY(svg, ev.clientY));-    // clicking the same spot again steps through signals that share it, then stops following-    const ids = [res.sig].concat(res.also || []).filter(Boolean).map((x) => x.id.split(':')[0]).filter((v, k, a) => a.indexOf(v) === k);-    const at = ids.indexOf(SD.pin);-    SD.pin = !ids.length ? null : at < 0 ? ids[0] : ids[at + 1] || null;-    applyPin();-    renderFollow();-  }-  sdView.addEventListener('click', (ev) => { if (SD.drag && SD.drag.moved) return; pinAt(sdView, ev); });-  $('#spec-grid').addEventListener('click', (ev) => {-    const b = ev.target.closest('.open');-    if (b) { SD.stage = b.dataset.st; select(b.dataset.block, { scroll: true, stage: b.dataset.st }); return; }-    if (ev.target.closest('.hov')) pinAt($('#spec-grid'), ev);-  });--  // ------------------------------------------------------------ hover readout, shared by both chart sizes-  function hoverStage(ev) {-    const hov = ev.target.closest('.hov');-    const host = ev.target.closest('.spec-grid, .sd-view');-    if (!hov || !host || (SD.drag && SD.drag.moved)) return;-    const st = host.__st || host.__stages[+hov.dataset.i];-    const svg = hov.ownerSVGElement;-    if (svg.classList.contains('scope')) {-      const r = SCOPE.pick(st, vbX(svg, ev.clientX), host.classList.contains('sd-view') ? host.__opt : null);-      if (!r) return;-      const xh = $('.xhair', svg);-      xh.setAttribute('x1', r.x); xh.setAttribute('x2', r.x); xh.setAttribute('y1', r.y1); xh.setAttribute('y2', r.y2); xh.setAttribute('visibility', 'visible');-      tip.textContent = '';-      const add = (cls, text) => { const d = document.createElement('div'); d.className = cls; d.textContent = text; tip.appendChild(d); };-      add('tval', 't = ' + (r.t < 10 ? r.t.toFixed(2) : r.t.toFixed(1)) + ' ' + r.unit);-      for (const [name, val] of r.vals) add('td', name + ': ' + val);-      tip.hidden = false; moveTip(ev);-      return;-    }-    const res = SPECTRUM.pick(st, vbX(svg, ev.clientX), host.__opt, vbY(svg, ev.clientY));-    const xh = $('.xhair', svg);-    xh.setAttribute('x1', res.x); xh.setAttribute('x2', res.x); xh.setAttribute('y1', res.y1); xh.setAttribute('y2', res.y2); xh.setAttribute('visibility', 'visible');-    const sid = res.sig ? res.sig.id.split(':')[0] : null;-    ROOT.querySelectorAll('.spec-grid, .sd-view').forEach((g) => g.classList.toggle('focus', !!sid));-    ROOT.querySelectorAll('svg.stg .sg.on').forEach((e) => e.classList.remove('on'));-    if (sid) ROOT.querySelectorAll('svg.stg .sg[data-sid="' + sid + '"]').forEach((e) => e.classList.add('on'));-    tip.textContent = '';-    const row = (cls, text, key) => { const d = document.createElement('div'); d.className = cls; if (key) { const k = document.createElement('span'); k.className = 'tkey'; k.style.setProperty('--sc', 'var(--' + key + ')'); d.appendChild(k); } d.appendChild(document.createTextNode(text)); tip.appendChild(d); };-    if (res.sig) {-      const kindVar = { station: 'sig-' + (host.classList.contains('band-am') ? 'am' : 'fm'), image: 'sig-img', sub: 'sig-sub', other: 'sig-other' }[res.sig.kind];-      row('tval', res.val.toFixed(1) + ' ' + st.yUnit);-      row('trow', res.sig.label, kindVar);-      if (res.panel === 'in') row('td', SPECTRUM.fmtF(res.f, res.unit) + (res.sig.from != null ? ': the ' + (res.sig.sum ? 'sum' : 'difference') + ' copy of ' + SPECTRUM.fmtF(res.sig.from, 'MHz') + (res.sig.sum ? ' (f + LO)' : ' (|f − LO|)') : ''));-      else row('td', SPECTRUM.fmtF(res.f, st.ax.unit) + (res.sig.from != null ? ', from ' + SPECTRUM.fmtF(res.sig.from, res.sig.from < 2 ? 'kHz' : 'MHz') + ' at the stage input' : ''));-    } else {-      row('td', SPECTRUM.fmtF(res.f, res.unit || st.ax.unit));-    }-    if (res.gain != null) row('td', 'Stage gain here: ' + (res.gain >= 0 ? '+' : '−') + Math.abs(res.gain).toFixed(1) + ' dB');-    if (res.floor != null && isFinite(res.floor)) row('td', 'Noise floor: ' + res.floor.toFixed(0) + ' ' + st.yUnit);-    for (const a of res.also || []) row('td', 'Also here: ' + a.label + ', ' + a.db.toFixed(1) + ' ' + st.yUnit);-    if (res.sig) row('td hintline', SD.pin === sid ? ((res.also || []).length ? 'Click to follow the next signal here' : 'Click to stop following') : 'Click to follow it through every stage');-    tip.hidden = false; moveTip(ev);-  }-  function leaveStage(ev) {-    const svg = ev.target.ownerSVGElement;-    if (svg) { const xh = $('.xhair', svg); if (xh) xh.setAttribute('visibility', 'hidden'); }-    ROOT.querySelectorAll('.spec-grid, .sd-view').forEach((g) => g.classList.remove('focus'));-    ROOT.querySelectorAll('svg.stg .sg.on').forEach((e) => e.classList.remove('on'));-    hideTip();-  }-  ROOT.addEventListener('pointermove', (ev) => { if (ev.target.classList && ev.target.classList.contains('hov')) hoverStage(ev); });-  ROOT.addEventListener('pointerout', (ev) => { if (ev.target.classList && ev.target.classList.contains('hov')) leaveStage(ev); });-  $('#spec-legend').innerHTML = legendHtml(false) + '<span>On mixer stages the top panel is everything the mixer makes on one wide axis (the input dashed, the LO, and the two copies at LO − f and LO + f); the bottom panel magnifies the boxed part around the IF.</span><span>From the limiter on, the cards show the signal over time, as a scope on that node would; the Waveform / Spectrum switch above the big chart under each schematic changes all of them.</span>';-  $('#sd-legend').innerHTML = legendHtml();--  // tabs-  function showTab(which, persist) {-    const spec = which === 'spec';-    $('#tab-flow').setAttribute('aria-selected', String(!spec)); $('#tab-spec').setAttribute('aria-selected', String(spec));-    $('#view-flow').hidden = spec; $('#view-spec').hidden = !spec;-    if (persist) { try { localStorage.setItem('amfm-explorer-tab', which); } catch (e) { /* no storage */ } }-  }-  $('#tab-flow').addEventListener('click', () => showTab('flow', true));-  $('#tab-spec').addEventListener('click', () => showTab('spec', true));-  $$('.tabs [role=tab]').forEach((t) => t.addEventListener('keydown', (ev) => {-    if (ev.key === 'ArrowRight' || ev.key === 'ArrowLeft') { const o = t.id === 'tab-flow' ? $('#tab-spec') : $('#tab-flow'); o.focus(); o.click(); }-  }));--  buildFlow();-  const attr = (k) => (HOST && HOST.getAttribute(k)) || '';-  if (attr('mode') === 'board') { const b = $('#mode button[data-mode="board"]'); if (b) b.click(); }-  setBand(attr('band') === 'am' ? 'am' : 'fm');-  let start = HOST ? attr('block') : (location.hash || '').slice(1);-  let tab = 'flow';-  try { tab = localStorage.getItem('amfm-explorer-tab') || 'flow'; } catch (e) { /* no storage */ }-  if (start === 'spectrum' || attr('view') === 'stages') { tab = 'spec'; if (start === 'spectrum') start = 'ant'; }-  showTab(tab, false);-  if (!INFO[start] || !BL[start]) start = 'ant';-  renderCtlPanel();-  renderStages();-  select(start);-  if (!HOST) window.addEventListener('hashchange', () => { const h = location.hash.slice(1); if (h !== S.sel && INFO[h] && BL[h]) select(h, { scroll: true }); });-  // for the wiki's widget automation (window.__adomInlineWidgets): wait for it, read and set what it shows-  if (HOST) HOST.adomDrive = {-    ready: () => Promise.resolve(),-    state: () => ({ state: S.sel, band: S.band, mode: S.mode, station: S.band === 'fm' ? S.f.fm : S.f.am, view: $('#view-spec').hidden ? 'diagram' : 'stages' }),-    set: (v) => { v = String(v); if (v === 'fm' || v === 'am') setBand(v); else if (INFO[v] && BL[v]) select(v, { scroll: true }); return Promise.resolve(); },-  };-})();--  }-  class AmfmExplorer extends HTMLElement {-    connectedCallback() {-      if (this._booted) return;-      this._booted = true;-      var root = this.shadowRoot || this.attachShadow({ mode: 'open' });-      root.innerHTML = '<style>' + CSS + '</style>' + HTML;-      try { boot(root, this); } catch (e) {-        console.error('[adom-amfm-explorer]', e);-        var p = document.createElement('p');-        p.textContent = 'The circuit explorer could not start: ' + e.message;-        p.style.cssText = 'color:#e6edf3;font:14px Satoshi,sans-serif;border:1px solid #30363d;border-radius:10px;padding:12px 14px';-        root.innerHTML = ''; root.appendChild(p);-      }-    }-  }-  customElements.define('adom-amfm-explorer', AmfmExplorer);-})();