Common Structures

Position Classes

class ear.common.Position

A 3D position represented in polar or Cartesian coordinates.

class ear.common.PolarPosition(azimuth, elevation, distance=1.0)

Bases: ear.common.Position, ear.common.PolarPositionMixin

A 3D position represented in ADM-format polar coordinates.

azimuth

anti-clockwise azimuth in degrees, measured from the front

Type

float

elevation

elevation in degrees, measured upwards from the equator

Type

float

distance

distance relative to the audioPackFormat absoluteDistance parameter

Type

float

class ear.common.CartesianPosition(X, Y, Z)

Bases: ear.common.Position, ear.common.CartesianPositionMixin

A 3D position represented in ADM-format Cartesian coordinates.

X

left-to-right position, from -1 to 1

Type

float

Y

back-to-front position, from -1 to 1

Type

float

Z

bottom-to-top position, from -1 to 1

Type

float

Position Mixins

These two classes provide common methods for the various real position classes:

class ear.common.PolarPositionMixin

Methods to be defined on all polar position objects which have azimuth, elevation and distance attributes.

as_cartesian_array()

Get the position as a Cartesian array.

Returns

equivalent X, Y and Z coordinates

Return type

np.array of shape (3,)

as_cartesian_position()

Get the equivalent cartesian position.

Return type

ear.common.CartesianPosition

class ear.common.CartesianPositionMixin

Methods to be defined on all Cartesian position objects which have X, Y and Z attributes.

as_cartesian_array()

Get the position as a Cartesian array.

Returns

equivalent X, Y and Z coordinates

Return type

np.array of shape (3,)

as_polar_position()

Get the equivalent cartesian position.

Return type

ear.common.PolarPosition

Screen Classes

class ear.common.CartesianScreen(aspectRatio, centrePosition, widthX)

ADM screen representation using Cartesian coordinates.

This is used to represent the audioProgrammeReferenceScreen, as well as the screen position in the reproduction room.

aspectRatio

aspect ratio

Type

float

centrePosition

screenCentrePosition element

Type

CartesianPosition

widthX

screenWidth X attribute

Type

float

class ear.common.PolarScreen(aspectRatio, centrePosition, widthAzimuth)

ADM screen representation using Cartesian coordinates.

This is used to represent the audioProgrammeReferenceScreen, as well as the screen position in the reproduction room.

aspectRatio

aspect ratio

Type

float

centrePosition

screenCentrePosition element

Type

PolarPosition

widthX

screenWidth azimuth attribute

Type

float

ear.common.default_screen = PolarScreen(aspectRatio=1.78, centrePosition=PolarPosition(azimuth=0.0, elevation=0.0, distance=1.0), widthAzimuth=58.0)

The default screen position, size and shape.