treble_tsdk.results.moving_ir
Classes
- class treble_tsdk.results.moving_ir.MovingIR
- __init__(data_loader: IRDataLoader, source: Source, receiver: Receiver, simulation_type: SimulationType, filter_definitions: list[FilterDefinition] = None)
- convolve_with_audio_signal(audio: AudioSignal, device: DeviceObj | None = None, speed: float | DynamicPosition | None = None, receiver_orientation: TrajectoryOrientation | Rotation | DynamicOrientation | None = None) ConvolvedAudioSignal
Convolve the moving IR with an audio signal using the specified auralization method.
This method uses MovingAuralizer internally to handle the crossfading between IRs at different positions along the trajectory.
- Parameters:
audio – The audio signal to convolve with the moving IR.
device – The device to render the spatial IRs for. If None, the spatial IRs will be used.
speed – The speed of movement in m/s. If None (default), the speed is chosen automatically so the moving source/receiver traverses the full trajectory in exactly the duration of the dry audio signal. DynamicPosition describes a variable position-over-time schedule, expressed as meters along the trajectory arc-length. Its duration_s must match the audio duration.
receiver_orientation – The orientation of the receiver. If None, it look along the x axis. A TrajectoryOrientation (or single Rotation) describes a position-dependent orientation along the trajectory. A DynamicOrientation describes a time-dependent orientation schedule; orientation is sampled at each segment’s audio time during rendering (matching scene behaviour), and its duration_s must match the audio duration.
- Returns:
A ConvolvedAudioSignal containing the auralized output.
- get_ir_type() ReceiverType
Gets the type of the IR of each point in the moving source/receiver.
- get_speed_to_match_audio(audio: AudioSignal) float
Compute the constant speed (m/s) at which traversing the full trajectory takes exactly audio.duration seconds.
Useful for inspecting the value that convolve_with_audio_signal will pick when speed=None.
- Parameters:
audio – The dry audio signal whose duration should be matched.
- Returns:
Speed in m/s such that trajectory_length / speed == audio.duration.
- Raises:
ValueError – If the audio has zero duration or the trajectory has zero length.
- get_srd_device_ir(point_index: int, simulation: Simulation) DeviceIR
- get_trajectory() Trajectory
- plot(model=None)
Plot the moving impulse response with interactive visualization.
Creates an interactive Dash app with tabs for different plot types (Impulse Response, Frequency Response, Phase Response, EDC) and a slider to select which point along the trajectory to display.
- Parameters:
model – Optional ModelObj. When provided, the right panel shows the 3D model view (like the trajectory plot) with the moving source/receiver position synced to the slider.
- property point_count: int