Skip to main content

Basic Sources

Creating a omnidirectional source

To define an omnidirectional source, an object Source is created with the source type treble.SourceType.omni. The position of the source is determined by the cartesian coordinates x,y,z. Moreover, the source can be labeled by using the parameter label.

from treble_tsdk import treble

source_omni = treble.Source.make_omni(location=treble.Point3d(1,1,1.5), label="Omni_source")

Creating dipole and cardioid sources

Other basic sources that can be defined are the dipole and cardioid source. As before, an object Source is created with the source type treble.SourceType.dipole and treble.SourceType.cardioid. The orientation of the source can be determined by the SourceProperties, where the azimuth and elevation of the source are specified.

source_dipole = treble.Source.make_dipole(
location=treble.Point3d(2,1,1.5),
label="Dipole_source",
orientation=treble.Rotation(azimuth=90)
)

source_cardioid = treble.Source.make_cardioid(
location=treble.Point3d(4,1,1.5),
label="Cardioid_source",
orientation=treble.Rotation(azimuth=180)
)

Combining sources in a simulation

Several sources can be used in a signle simulation as follows

sources = []
sources.append(source_omni)
sources.append(source_dipole)
sources.append(source_cardioid)