Moving Receivers (Beta)
Creating a Moving Receiver
A moving receiver, similar to a moving source, is defined by assigning a Trajectory that describes its spatial path throughout the simulation. It can be created using one of the following factory methods:
-
make_moving_mono()— creates a mono-channel moving receiver that follows the specified trajectory. -
make_moving_spatial()— creates a spatial receiver configuration that moves along the trajectory.
Both constructors require a trajectory definition, which determines the receiver’s position as a function of time.
The created moving receiver is then used a source in simulation definition.
moving_receiver = treble.Receiver.make_moving_spatial(
trajectory=traj_polyline,
label='moving_spatial',
ambisonics_order=16,
)
sim_def = treble.SimulationDefinition(
name="Simulation",
simulation_type=treble.SimulationType.ga,
model=model,
energy_decay_threshold=40,
receiver_list=receiver,
source_list=moving_source_speech,
material_assignment=material_assignments
)
In contrast to moving sources, the receiver orientation is not required during receiver creation. Instead, it is typically specified later during the rendering stage.
The orientation can be defined on the associated Trajectory and retrieved before rendering if needed. However, it is recommended to configure the orientation explicitly prior to rendering, following the same workflow used for other receiver types.
This separation allows the same simulated receiver trajectory to be rendered multiple times with different orientation configurations, without requiring the simulation to be recomputed.
sim = project.get_simulation_by_name('Simulation')
res = sim.get_results_object()
moving_irs = res.get_moving_ir(source=sim.sources[0], receiver=sim.receivers[0])
rec_traj = moving_irs.get_trajectory() # Get trajectory from simulation
orientation_lookahaed = rec_traj.look_ahead() # Creates a new orientation looking forward