Skip to content

feat(pan): configurable decay / afterglow for the spectrum trace (FR-PAN-14) - #199

Merged
dc0sk merged 2 commits into
mainfrom
feat/spectrum-afterglow
Sep 21, 2026
Merged

dc0sk merged 2 commits into
mainfrom
feat/spectrum-afterglow

Conversation

@dc0sk

@dc0sk dc0sk commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Stacked on #198 (GPU load) on #197 (TLS) on #196 (POTA).

What

A Spectrum afterglow setting (Settings, milliseconds, 0 = off — the default, otherwise 50–5000). A peak lingers on the trace and fades, so a brief signal (a CW dit, an FT8 tone) can still be seen after it has passed. A ghost trace is drawn under the live one — a faint fill and a dimmer outline.

Design (mine — please overrule)

  • Decay is a constant dB per second: an exponential decay of power with time constant τ, so 4.34 dB per τ. Attack is instant; the ghost is never below the live trace.
  • Off by default, so nothing changes until you choose.
  • Advanced once per row, when the row arrives — deliberately not per drawn frame. perf(pan): redraw at the rate rows arrive, not the display's (FR-PAN-13) #198 makes the window redraw at the row rate, and the look must not depend on how often it redraws; a peak in a row no frame showed isn't lost.
  • The ghost restarts when the pan's centre, span or width changes (else it would be drawn at the wrong frequencies), when the setting changes, and when the history is cleared.
  • The waterfall is not affected.

Verified

fmt, clippy --all-features, full workspace tests (445, bounded), cargo xtask OK. The maths is tested against closed-form values (4.3429 dB per τ, power ratio 1/e, −50 dB peak after 990 ms is −54.30 ± 0.02), not against the code's own output. 35 mutations; survivors that were real (an "off" state enforced three times over so each masked the others; an untested clamp) are fixed, and one equivalent mutation (a draw-time width check guarding a race no test can reach without a renderer) is commented as such. Two structural guards cover the drawing order and the four hand-offs of the setting (one of which ends in ..Default::default() and would silently reset a forgotten field).

Also fixes the Networks summary saying "of 3 on" after POTA made four.

Not seen on screen — please read

The display was asleep, so how it looks is untested. The fill's opacity (0.10) and the outline's (0.40) are my guesses; that is yours to judge.

Validation parked with DC0SK (not done here)

  • Settings → Spectrum afterglow: try 300 and 2000 ms on a live band. Do brief signals linger and fade? Is the fill too faint or too heavy? Does the live trace stay clearly on top?
  • Change the pan span / retune: the trail should restart, not smear at the old frequencies.
  • Set it back to 0: the trace should look exactly as before.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ma4bQKqGNFTYyVSEKPcXRk

dc0sk and others added 2 commits September 21, 2026 10:02
…PAN-14)

A peak lingers on the trace and fades, so a brief signal (a CW dit, an FT8
tone) can still be seen after it has passed. A ghost trace is kept beside the
live one and drawn under it: it meets a rising level at once and falls at a
constant dB per second, an exponential decay of power with the operator's time
constant (4.34 dB per tau), never below the live trace.

- app/src/afterglow.rs: the pure decay, restarting when the pan's centre, span
  or width changes; non-finite input cannot poison it.
- Advanced once per row on arrival in PanShared, not once per drawn frame, so
  how often the window redraws (FR-PAN-13) cannot change the look.
- spectrum_afterglow_ms in the settings: 0 = off (the default), otherwise
  50-5000 ms, a Settings field that applies as it is typed.
- Both traces map bins to points through one function.
- Also: the Networks summary said "of 3 on" after POTA made four.

Not seen on screen: the display was asleep when this was built.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ma4bQKqGNFTYyVSEKPcXRk
# Conflicts:
#	docs/requirements/system-requirements.md
@dc0sk
dc0sk changed the base branch from perf/gpu-load to main September 21, 2026 18:05
@dc0sk dc0sk closed this Sep 21, 2026
@dc0sk dc0sk reopened this Sep 21, 2026
@dc0sk
dc0sk merged commit 435e69a into main Sep 21, 2026
5 checks passed
@dc0sk
dc0sk deleted the feat/spectrum-afterglow branch September 22, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant