visualdynamics.plot.tracking_filter¶
tracking_filter
¶
The tracking filter, drawn on the record it reads.
A level read through a tracking filter is a number with a cause, and the cause is a band that moves. This view draws the band where it is applied, the way the averaging's frames are drawn on the record they are cut from and a filter's preview over the trace it filters: one tone of one channel, the record above, its time-frequency picture below, the band's shape beside the picture at one instant.
The record and the band's output, FilterOverlay's way round. The
record stands back in gray and what the band passes takes the ink,
because the passed waveform is the subject (Brandon, 2026-08-25, for
the filter's preview: the reader judged the thing being decided from
the drabber line when it was the other way). The ink is the theme's
filter_preview rather than the channel's own color, and that is the
one place this departs from the preview: here the same color draws the
band's corridor, its shape and its weight on the record as well, so
magenta means the filter on all three panels and nothing else does.
The picture is the scalogram, in decibels. core.wavelet's
transform, drawn by plot.scalogram.scalogram_image — time across,
log frequency up, the cone of influence veiled — because it is already
the repository's time-frequency reading and its rows are evenly spaced
in log frequency, which is the axis a proportional band is a constant
width on. Two settings differ from the scalogram view, both for this
question. The color is the magnitude in dB below the picture's
largest, over COLOR_RANGE: on the scalogram's linear scale a noise
floor a fifth of the tone's amplitude, spread over the whole band, is
a few percent of the color bar and draws black, and a picture meant to
show the band holding the noise out has to show the noise. And the
wavelet is narrower in frequency (OMEGA0, twelve cycles against the
scalogram's six), so the tone's ridge is narrower than the common
bands: at six cycles it is 14 % either side of the tone at −3 dB, more
than half of a 50 % band's 25 %; at twelve, 7 %. A band narrower than
that — 10 % proportional, a few hertz fixed — is narrower than a
picture of a moving tone resolves, and its corridor drawn inside the
ridge says exactly that. The price is time: a longer wavelet smears a sweep along it, and at an
octave a second the drive moves about 7 % within the wavelet's width
at 20 Hz — as much as the wavelet resolves — and a fifth of that at
100 Hz, so the ridge stays a ridge from the bottom of a sweep up.
The band is a corridor that follows the sweep. Its edges are the drive plus and minus half the bandwidth, the −3 dB points, drawn over the picture as dashed lines on a halo: dashes because a reader who cannot tell magenta from the colormap can still tell a dashed line from a field, the halo because a thin line over viridis vanishes into whichever stop it happens to match. A proportional band is a constant width on the log axis, a pair of lines parallel to the ridge; a fixed band is a constant width in hertz, wide at the bottom of the axis and pinched at the top. That difference is the point of the picture.
The shape stands on the picture's own frequency axis. The band's
magnitude at the cursor (SineTracking.response) is drawn beside the
picture with frequency up, linked to it, so the −3 dB edges of the
shape continue the corridor's edges across the gap and the drive and
its harmonics are marked at the same heights on both: the drive inside
the band, where the shape is 0 dB; a harmonic outside it, where the
shape reads its rejection. The marks are told apart by shape — a
circle for the drive, a triangle for a harmonic — and drawn two-tone,
the background inside the foreground, so they read on any stop of the
colormap.
The band's weight on the record, drawn behind the cursor. The
band's output at an instant is the record before it weighted by the
low-pass's impulse response (SineTracking.weighting), so that weight
is shaded on the record, reaching back from the cursor, fading as the
weight does — the averaging's band, whose shading is the weight each
moment of the record carries, applied to a filter instead of a frame.
Its length is the settling the readout states: a wide band's weight is
a sliver, a narrow one's reaches back across a change in level, and
the passed waveform's envelope follows that change over the same
stretch. The shading is clipped at zero where the fourth order's
response dips negative, as the averaging's flat-top shoulders are;
the dip is about a sixth of the peak, and it is why the band
overshoots a step.
One setting per view. Several corridors over one picture, each with its own shape beside it, crowd the field the corridors are meant to be read against; two settings are two calls, laid side by side. The level strip that could sit under the record is left out for the same reason: the passed waveform's envelope is the 'filtered' reading, already drawn at every sample.
The cursor is a handle in the window. Shown in the application's pane it can be dragged along either time axis, and the shape, the marks, the weight and the readout follow the hand — each a closed form, so the redraw is immediate. Headless, it is an argument.
Classes:
| Name | Description |
|---|---|
TrackingFilterView |
The items |
Functions:
| Name | Description |
|---|---|
default_range |
The picture's frequency range, Hz: an octave under the lowest |
build_tracking_filter |
Draw one tone's tracking band on its record, and return the view. |
Classes¶
TrackingFilterView
¶
TrackingFilterView(record_plot: Any, picture: Any, shape: Any, readout: Any, waveform: Any, frequencies: ndarray, harmonics: Sequence[int], colors: Mapping[str, str], heights: tuple[float, float], interactive: bool)
The items build_tracking_filter draws, and the cursor that
moves them. Owns every item it adds; set_cursor restates the
shape, the marks, the weight and the readout for a new instant.
Methods:
| Name | Description |
|---|---|
set_cursor |
Put the cursor at |
Source code in src/visualdynamics/plot/tracking_filter.py
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | |
Methods:¶
set_cursor
¶
Put the cursor at seconds on the record's clock (held to the
tone's span) and restate everything read there; returns where
it landed.
Source code in src/visualdynamics/plot/tracking_filter.py
Functions:¶
default_range
¶
The picture's frequency range, Hz: an octave under the lowest drive up to half again past the highest harmonic marked (the band's top edge, if that is higher), held under Nyquist.
Source code in src/visualdynamics/plot/tracking_filter.py
build_tracking_filter
¶
build_tracking_filter(layout: Any, history: Any, waveform: Any, *, cursor: float | None = None, span: tuple[float, float] | None = None, harmonics: Sequence[int] = HARMONICS, low: float | None = None, high: float | None = None, omega0: float = OMEGA0, unit_system: Any = None, theme: Any = None, interactive: bool = True) -> TrackingFilterView
Draw one tone's tracking band on its record, and return the view.
waveform is core.sine_tracking.track_waveform's, of history's
channel waveform.dof. The record and the passed waveform are
drawn in row 0, the picture with the corridor in row 2 and the
shape beside it in column 1, the readout above the shape, the
legend under the picture. cursor is seconds on the record's
clock, the middle of the tone's span by default; span the stretch
of record the time axes show, the whole record by default.
harmonics are the multiples of the drive marked; low, high
and omega0 set the picture (default_range, OMEGA0).
Source code in src/visualdynamics/plot/tracking_filter.py
377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 | |