visualdynamics.plot.sine_distortion¶
sine_distortion
¶
A sine tone's distortion against frequency, with the limit drawn.
The question this view answers is the one the distortion check asks
along a sweep: where, if anywhere, was there enough on the channel
besides the tone to change the test. So the view puts the distortion
(core.sine_distortion, the RMS of everything that is not the tone over
the RMS of the tone, in percent) against frequency, on the log frequency
axis every sine level is read on, and draws the limit across it.
Everything is said by line style, marker shape and words as well as by
color, never by hue alone:
- the limit, a dashed line, named in the legend with its percentage, its dB and the tolerance on the ratio it comes from ('limit 32.0 % (-9.9 dB): unfiltered 5 % over the tone');
- each channel, a solid line with a hollow marker of its own shape every few lines, named with its worst reading and its verdict in words;
- a line over the limit, the same marker filled, so being over reads as a change of fill on a shape the reader has already matched to the legend, as the SRS tolerance view marks a point outside its band.
A line the check could not judge (the tone under its noise floor, or a tone the levels do not hold live beside it) is left out, a gap in the curve, and the notes say how many. The distortion axis is linear and starts at zero, because the limit is read as a height and a clean channel reads near zero, where a log axis has no floor.
Functions:
| Name | Description |
|---|---|
channel_words |
One channel in the legend's words: its name, its worst reading and |
limit_words |
The limit in the legend's words: 'limit 32.0 % (-9.9 dB): |
readout |
The check's numbers as the window's readout words them, on |
draw_distortion |
Draw a |
build_distortion |
Draw a distortion check into a graphics layout, its legend below |
Functions:¶
channel_words
¶
One channel in the legend's words: its name, its worst reading and its verdict, such as '101Z+: worst 12.3 % at 412 Hz, within the limit' or '101Z+: worst 41.0 % at 400 Hz, 12 lines over the limit'.
Source code in src/visualdynamics/plot/sine_distortion.py
limit_words
¶
The limit in the legend's words: 'limit 32.0 % (-9.9 dB): unfiltered 5 % over the tone'.
Source code in src/visualdynamics/plot/sine_distortion.py
readout
¶
The check's numbers as the window's readout words them, on
channel dof (every channel when None): 'limit', 'worst', 'over' and
'verdict'. A number the check does not give reads as a dash; the
notes say why.
Source code in src/visualdynamics/plot/sine_distortion.py
draw_distortion
¶
draw_distortion(plot: Any, check: Any, *, dof: str | None = None, colors: Any = None, legend: bool = True) -> list[Any]
Draw a DistortionCheck onto a pyqtgraph plot item and return the
items drawn.
The limit dashed in the plot's foreground, then each channel (or
only dof) as a solid curve in its color, in percent, with a hollow
marker of its own shape every few lines and the same marker filled on
every line over the limit. With legend, the limit and each channel
are named for the plot's legend in words (limit_words,
channel_words); the panel's small preview passes False and words
them in its readout instead. The plot is expected on a log frequency
axis; the curves are given in Hz and pyqtgraph takes the log.
Source code in src/visualdynamics/plot/sine_distortion.py
build_distortion
¶
Draw a distortion check into a graphics layout, its legend below it, and return the plot item.
The title names the tone and the verdict in words; the notes the check carries, if any, go under it, since a verdict that left lines unjudged should not be read without them.