treble_tsdk.results.plot¶
Results plotting and visualization utilities.
Provides functions for creating interactive plots of acoustic parameters, directivity patterns, and other simulation results.
Functions
|
Create a 2D polar plot of directivity pattern at a specific frequency. |
|
Create a 3D mesh plot of directivity pattern at a specific frequency. |
|
Create layout components for directivity visualization widget. |
|
Get the button ID with the most recent timestamp. |
|
A widget which can plot acoustic parameters for multiple sources and receivers at a time |
|
A widget to plot device information. |
|
Plot directivity pattern of a directive source. |
|
Plot a mono impulse response with interactive visualization. |
|
Plot multi-channel impulse response data with interactive visualization. |
Plots the resolution of ambisonics orders |
|
|
Plot a spatial (ambisonics) impulse response with interactive visualization. |
|
A widget where results of a simulation can be plotted in an interactive widget with loading feedback for data streaming |
|
Create an interactive widget for plotting acoustic parameters. |
|
Creates a spherical mesh from a set of points |
Classes
Data container for directivity pattern visualization. |
- treble_tsdk.results.plot.multiresults_parameter_plot_widget(results: Results)¶
A widget which can plot acoustic parameters for multiple sources and receivers at a time
- Parameters:
results (Results) – Results object with the relevant information
- treble_tsdk.results.plot.results_parameters_plot_widget(parameter_data: AcousticParameters)¶
Create an interactive widget for plotting acoustic parameters.
- Parameters:
parameter_data (AcousticParameters) – Acoustic parameters data to visualize.
- treble_tsdk.results.plot.plot_multichannel_data(device: DeviceIR | AudioSignal, comparison: dict[str, 'DeviceIR | AudioSignal'] = None, title: str = 'Device Impulse Response', channel_label: str = 'Device mic ', label: str = None)¶
Plot multi-channel impulse response data with interactive visualization.
- Parameters:
device (DeviceIR | AudioSignal) – Device impulse response or audio signal to plot.
comparison (dict[str, DeviceIR | AudioSignal]) – Optional comparison data with labels.
title (str) – Plot title, defaults to “Device Impulse Response”.
channel_label (str) – Label prefix for channels, defaults to “Device mic “.
label (str) – Optional label for the device data.
- treble_tsdk.results.plot.plot_spatial_ir(impulse_response: SpatialIR, channel_range: tuple[int, int] = (0, 8))¶
Plot a spatial (ambisonics) impulse response with interactive visualization.
- treble_tsdk.results.plot.plot_mono_ir(impulse_response: MonoIR, comparison: dict[str, 'MonoIR'] = None, label=None)¶
Plot a mono impulse response with interactive visualization.
- treble_tsdk.results.plot.create_2d_directivity_figure(index: int, angles: ndarray, sel_indices: ndarray, directivity_data: DirectivityPatternForPlotting) Figure¶
Create a 2D polar plot of directivity pattern at a specific frequency.
- Parameters:
index (int) – Frequency index to plot.
angles (np.ndarray) – Angular positions for the plot.
sel_indices (np.ndarray) – Selected indices for the directivity data.
directivity_data (DirectivityPatternForPlotting) – Directivity pattern data.
- Returns go.Figure:
Plotly figure with 2D polar directivity plot.
- treble_tsdk.results.plot.create_3d_directivity_figure(index: int, pattern_name: str, directivity_data: DirectivityPatternForPlotting) Figure¶
Create a 3D mesh plot of directivity pattern at a specific frequency.
- Parameters:
index (int) – Frequency index to plot.
pattern_name (str) – Pattern type (‘exact-pattern’ or ‘wavebased-pattern’).
directivity_data (DirectivityPatternForPlotting) – Directivity pattern data.
- Returns go.Figure:
Plotly figure with 3D mesh directivity plot.
- treble_tsdk.results.plot.get_directivity_layout(frequency, name)¶
Create layout components for directivity visualization widget.
- Parameters:
frequency – Array of frequencies for the slider.
name – Name of the source for display.
- Returns:
List of Dash layout components.
- treble_tsdk.results.plot.plot_resolution_of_ambisonics_orders()¶
Plots the resolution of ambisonics orders
- treble_tsdk.results.plot.plot_directive_source(directivity_data: DirectivityPatternForPlotting, name: str)¶
Plot directivity pattern of a directive source.
- Parameters:
directivity_data (DirectivityPatternForPlotting) – Directivity pattern data to plot.
name (str) – Name of the source.
- treble_tsdk.results.plot.plot_device(device: DeviceObj)¶
A widget to plot device information.
Here we will be able to plot 1. Transfer functions for any angle 2. Spherical harmonics graph 3. Polar directivity pattern for microphones 4. Directivity balloons of microphones
- Parameters:
device (DeviceObj) – The device in question
- treble_tsdk.results.plot.get_latest_button(timestamps: dict[str, int])¶
Get the button ID with the most recent timestamp.
- treble_tsdk.results.plot.spherical_mesh(input_points: ndarray) pyvista.PolyData¶
Creates a spherical mesh from a set of points
- Parameters:
input_points (np.ndarray) – The points to create the mesh from
- Return pv.PolyData:
The mesh
- class treble_tsdk.results.plot.DirectivityPatternForPlotting¶
Data container for directivity pattern visualization.
Holds frequency-dependent directivity data and surface mesh information for plotting.