visualdynamics.plot.breakpoints¶
breakpoints
¶
A random specification's breakpoint table read: each segment's slope and area written on the specification, and under it the rms accumulated from the low end. Two rows.
The question this view answers is where a specification's rms comes from. On log-log axes a slope at the top of the band looks like a short line at the end of the profile, and it is often the largest area of all, because a hertz at 1,500 Hz counts as much as a hertz at 100 Hz. So each segment carries its slope in decibels per octave and its area, written on it, and the second row draws the running rms, the root of the area from the lowest breakpoint up to each frequency: it climbs steeply where the area is, and ends at the specification's rms.
The two rows are told apart by line style and words, never by hue alone: the specification is solid, as it is drawn everywhere else here, and the running rms is dashed, with its title saying what it is and where it ends. The breakpoints wear hollow circles on both rows, so a reader matches a bend in the specification to the step in the rms under it. The rows share their frequency axis, panned and zoomed together.
The same two pieces are added to the specification sheet's plot in the
app (add_segment_labels, add_running_rms), where the specification
row is the sheet's own preview with its bands; the standalone plot
(plot.plot_breakpoints) draws the specification itself, log-log.
Functions:
| Name | Description |
|---|---|
slope_text |
A slope in words: 'flat', or '+3.0 dB/oct' with a typeset sign. |
running_curve |
(frequencies, rms): the running rms of a `core.breakpoints. |
readout |
The numbers of a reading, short enough for the app's panel, in |
add_segment_labels |
Write each segment's slope and area on |
add_running_rms |
The running rms of |
build_breakpoints |
Draw a |
Functions:¶
slope_text
¶
A slope in words: 'flat', or '+3.0 dB/oct' with a typeset sign.
running_curve
¶
(frequencies, rms): the running rms of a core.breakpoints.
BreakpointReading at RUNNING_POINTS across every segment, spaced
in log frequency, the breakpoints among them, in SI.
Source code in src/visualdynamics/plot/breakpoints.py
readout
¶
The numbers of a reading, short enough for the app's panel, in display units: one row per segment with its band ('segment'), its slope, its area, its share of the whole area, and the running rms at its end, then a total row with the whole area and the rms.
dim is the quantity the density is of ('acceleration'), so areas
are in its square and rms in it. Each value is text.
Source code in src/visualdynamics/plot/breakpoints.py
add_segment_labels
¶
add_segment_labels(plot: Any, reading: Any, dim: str, unit_system: Any = None, theme: Any = None) -> list
Write each segment's slope and area on plot, which draws the
specification, above the middle of the segment in log frequency;
return the labels. Nothing is written past MOST_LABELS segments.
The labels are placed in the plot's own coordinates, so a plot on log axes gets logarithms (pyqtgraph moves its curves into log space itself and leaves every other item where it is put).
Source code in src/visualdynamics/plot/breakpoints.py
add_running_rms
¶
add_running_rms(layout: Any, row: int, reading: Any, dim: str, *, link: Any = None, unit_system: Any = None, theme: Any = None) -> Any
The running rms of reading as its own row of layout at
row, dashed, the breakpoints circled and its end written in the
title; return the plot.
With link, the specification's plot, the row shares its frequency
axis and its log or linear scale. The running rms is accumulated
from the lowest breakpoint upward, in the quantity's display unit
('g' for an acceleration density in g^2/Hz).
Source code in src/visualdynamics/plot/breakpoints.py
build_breakpoints
¶
build_breakpoints(layout: Any, reading: Any, dim: str, *, name: str | None = None, unit_system: Any = None, theme: Any = None) -> tuple[Any, Any]
Draw a core.breakpoints.BreakpointReading into layout: the
specification on log-log axes, solid, its breakpoints circled and
each segment's slope and area written on it, above; the running rms
beneath, dashed, sharing the frequency axis. dim is the quantity
the density is of; name labels the channel in the title. Returns
the two plots.