Skip to main content

Create a Device from Simulation Results

Upon conclusion of a device creation simulation, it is easy to create the device related transfer function (DRTF) from the results. The first step, is to get the results object.

results = simulation.get_results_object("directory_for_results")

Then, from the results object, there is a method to create a DRTF where we recommend supplying a list of labels for the microphones on the device to make it easy to recognize which is which when looking at the device later on. The order of the labels is the same as the order of the microphones specified when defining the device creating simulation. Now, when creating the DRTF, you will only be able to select an ambisonics order lower or equal to the one defined on the simulation level.

device_def = results.create_drtf(
device_name="some_device",
ambisonics_order=16,
microphone_labels=["TopRight", "TopLeft"]
)

This method uses the tools from the Generic Device Import to create a DeviceDefinition object. By then adding the device definition to the device library, the device gets fully created and stored in the device library, resulting in a DeviceObj.

device = tsdk.device_library.add_device(device_def)

The end result can then be analyzed visually.

The created device can be imported in to simulation where there is a spatial receiver. This covered more in depth in our results section