visualdynamics.gui.filter_panel¶
filter_panel
¶
The filter settings, as a table beside the time history.
The pass band is set here (its kind, its edges and the order), and the response of the filter they make is drawn under the table, magnitude against frequency, so the shape is seen where it is set. Beside the settings are the values that follow from them, all read off that same curve: Nyquist, the level an octave beyond a single corner, and where the filter is at -3 dB.
One kind is shown at a time: a low-pass shows one corner, a high-pass
one, and a band-pass its two edges, so only what applies is on screen
(principle 3). The kind cannot disagree with the numbers, because
core.filters.Filtering derives it from which edges are set.
The panel shows the settings and reports when they change. Its Apply Filter button asks for a filtered copy of the history with the current settings, which the window makes with the same project verb a script calls. The averaging panel works the same way, because both hold settings that are stored with the record.
Classes:
| Name | Description |
|---|---|
FilterResponsePlot |
The filter's response: a small plot of magnitude in dB against log |
FilterPanel |
The filter settings table. |
Classes¶
FilterResponsePlot
¶
Bases: PreviewPlot
The filter's response: a small plot of magnitude in dB against log frequency, whose dashed corner lines can be dragged to set the corners.
It draws core.filters.response, the squared magnitude, because the
filter is run forward and backward and that is the response the data
gets. The curve is computed there and only drawn here, so the report
can draw the same curve from the same numbers.
The plot has no legend and no axis titles, only decade grid lines
and a dashed line at each corner (one for a low- or high-pass, two
for a band-pass). It is in a 210-pixel column and shows only the
filter's shape, so that it does not compete with the record beside
it. edge_moved reports each move of a drag and edge_settled the
release, each with the edge ('low' or 'high') and its position in
Hz.
Methods:
| Name | Description |
|---|---|
apply_theme |
Redraw the axes, the curve and the corner lines in a new |
show_response |
Draw one response. |
Source code in src/visualdynamics/gui/filter_panel.py
Methods:¶
apply_theme
¶
Redraw the axes, the curve and the corner lines in a new theme's colors.
Source code in src/visualdynamics/gui/filter_panel.py
show_response
¶
Draw one response.
frequencies is in Hz and magnitude in dB. Frequencies at or
below zero are left out, and the curve is clipped at FLOOR
(-80 dB). low and high are the pass-band edges in Hz, each
drawn as a dashed line when it is set and hidden when it is None.
A dragged line stays on the axis, stops short of Nyquist, and
keeps a band-pass's edges at least EDGE_GAP (0.1 Hz) apart.
The curve is given in Hz and everything else in log10. In log
mode pyqtgraph transforms its data items itself, but an
InfiniteLine and setXRange are placed in view coordinates,
which on that axis are already the logarithms.
Source code in src/visualdynamics/gui/filter_panel.py
FilterPanel
¶
Bases: QWidget
The filter settings table.
Each edit is reported on changed as a whole Filtering, and the
Apply Filter button on apply_asked. A drag of a corner line
reports once, when the mouse is released.
Methods:
| Name | Description |
|---|---|
show_history |
Show a time history and the filtering set on it. |
set_filtering |
Show a filtering in the editors, without emitting |
filtering |
The filtering the editors show now. |
Source code in src/visualdynamics/gui/filter_panel.py
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 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 | |
Methods:¶
show_history
¶
show_history(history: TimeHistory, filtering: Filtering) -> None
Show a time history and the filtering set on it.
The limit on the edges, just under Nyquist, comes from the history's sample rate and not from the values already in the boxes.
Source code in src/visualdynamics/gui/filter_panel.py
set_filtering
¶
set_filtering(filtering: Filtering) -> None
Show a filtering in the editors, without emitting changed.
Source code in src/visualdynamics/gui/filter_panel.py
filtering
¶
filtering() -> Filtering
The filtering the editors show now.