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 | None = None, receiver_orientation: TrajectoryOrientation | Rotation | 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 based on the specified speed.
- 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 (equivalent to calling
get_speed_to_match_audio()). Must be > 0 when explicitly provided.receiver_orientation – The orientation of the receiver. If None, it look along the x axis.
- 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.durationseconds.Useful for inspecting the value that
convolve_with_audio_signal()will pick whenspeed=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