HoaMatrixXformer:
Filter:
atk-sc3/Classes (extension) | Libraries > Ambisonic Toolkit > Matrix & Kernel > HOA

HoaMatrixXformer
ExtensionExtension

Higher Order Ambisonic (HOA) matrix transformers

Description

Generate matrix transformers required by the Ambisonic Toolkit's Higher Order Ambisonic (HOA) transformer, HoaXformMatrix.

Class Methods

.newBeam

Beamform into a Higher Order Ambisonic signal (HOA).

Arguments:

theta

Azimuth, in radians.

phi

Elevation, in radians.

beamShape

Keyword argument for beam shape. See discussion here.

order

Ambisonic order.

.newNull

Nullform into a Higher Order Ambisonic signal (HOA).

Arguments:

theta

Azimuth, in radians.

phi

Elevation, in radians.

beamShape

Keyword argument for beam shape. See discussion here.

order

Ambisonic order.

.newReflect

Mirror a Higher Order Ambisonic signal (HOA).

Arguments:

mirror

Keyword argument for reflection. See discussion below.

order

Ambisonic order.

Discussion:

A variety of reflection transforms are offered:

keywordmirror
\reflectMirror across the origin. Equivalent to: \flip * \flop * \flap.1
\flipMirror in the y-axis.2
\flopMirror in the x-axis.3
\flapMirror in the z-axis.4
\CondonShortleyPhaseCondon-Shortley Phase. Equivalent to: \flip * \flop.
\originSynonym for \reflect.
\xSynonym for \flop.
\ySynonym for \flip.
\zSynonym for \flap.

.newRotateAxis

Rotate a Higher Order Ambisonic signal (HOA) around an axis.

Arguments:

axis

Keyword argument for axis of rotation. See discussion below.

angle

Rotation angle, in radians.

order

Ambisonic order.

Discussion:

Rotation about one of the three cartesian axes are offered via these keywords:

keywordaxis of rotation
\xx-axis
\yy-axis
\zz-axis
\rotateSynonym for \z.
\tiltSynonym for \x.
\tumbleSynonym for \y.
\yawSynonym for \z.
\pitchSynonym for \y.
\rollSynonym for \x.

.newRTT

Compound rotation around the z, x and y axes, applied in sequential order: rotate, tilt, tumble.

NOTE: Extrinsic, "laboratory-fixed" axes.

Arguments:

rotate

Rotation angle around z-axis, in radians.

tilt

Rotation angle around x-axis, in radians.

tumble

Rotation angle around y-axis, in radians.

order

Ambisonic order.

.newYPR

Compound rotation around the z, y' and x" axes: yaw, pitch, roll.

NOTE: Mixed extrinsic (z-axis), intrinsic (y' & x"-axes) rotations. This rotation differs from *newRTT, which is extrinsic.

Arguments:

yaw

Rotation angle around z-axis, in radians.

pitch

Rotation angle around y'-axis, in radians.

roll

Rotation angle around x"-axis, in radians.

order

Ambisonic order.

.newRotate

Compound rotation around the cartesian axes, applied in sequential order.

NOTE: Extrinsic, "laboratory-fixed" axes.

Arguments:

r1

Rotation angle around axis-1, in radians.

r2

Rotation angle around axis-2, in radians.

r3

Rotation angle around axis-2, in radians.

axes

Individual axes are specified via the axial keywords for *newRotateAxis.

Specify order of rotations via concatenation. E.g., rotate, tilt, tumble: \zxy

order

Ambisonic order.

.newSwapAxes

Swap two axes of a Higher Order Ambisonic signal (HOA).

Arguments:

axes

Individual axes are specified via the axial keywords for *newRotateAxis.

Specify swap via concatenation. E.g., swap y-axis with z-azis: \yz

order

Ambisonic order.

.newDominate

Apply dominance along an arbitrary axis.

Arguments:

gain

Dominance gain, in dB.

theta

Azimuth, in radians.

phi

Elevation, in radians.

order

Ambisonic order.

Discussion:

Applies dominance along the axis defined by theta and phi.

Positive values of gain increase the gain at [theta, phi] to +gain dB, while decreasing the gain at [theta.neg, phi.neg] to -gain. This simultaneously results in a distortion of the image towards [theta, phi]. Negative values of gain invert this distortion, distorting towards [theta.neg, phi.neg] . The default, 0, results in no change.

Imaging is illustrated here.

.newZoom

Apply zoom along an arbitrary axis.

Arguments:

angle

Distortion angle, in radians. -pi/2 to pi/2

theta

Azimuth, in radians.

phi

Elevation, in radians.

order

Ambisonic order.

Discussion:

Applies zoom along the axis defined by theta and phi.

Zoom is a normailised dominance variant, specified in terms of a distortion angle. Positive values of angle increase gain at [theta, phi], while reducing at [theta.neg, phi.neg]. Negative values do the inverse. The default, 0, results in no change.

Imaging is illustrated here.

.newFocus

Apply focus along an arbitrary axis.

Arguments:

angle

Distortion angle, in radians. -pi/2 to pi/2

theta

Azimuth, in radians.

phi

Elevation, in radians.

order

Ambisonic order.

Discussion:

Applies focus along the axis defined by theta and phi.

Focus is a normalised dominance variant, specified in terms of a distortion angle. Positive values of angle maintain gain at [theta, phi], while reducing at [theta.neg, phi.neg]. Negative values do the inverse. The default, 0, results in no change.

In contrast with zoom, gain is maintained at 0dB in the direction of distortion.

Imaging is illustrated here.

.newAsymmetry

Apply soundfield asymmetry

Arguments:

angle

Distortion angle, in radians. -pi/2 to pi/2

order

Ambisonic order.

Discussion:

Positive values of angle rotate [-pi/2, 0] towards [0, 0], and at pi/2 collapse the soundfield to a travelling wave. Negative values rotate [pi/2, 0] towards [0, 0]. The default, 0, results in no change.

Imaging is illustrated here.

.newBalance

Apply soundfield balance.

Arguments:

angle

Distortion angle, in radians. -pi/2 to pi/2

order

Ambisonic order.

Discussion:

A synonym for apply zoom along the y-axis.

Balance is a normailised dominance variant, specified in terms of a distortion angle. Positive values of angle increase gain at [pi/2, 0], while reducing at [-pi/2, 0]. Negative values do the inverse. The default, 0, results in no change.

Imaging is illustrated here.

Matrix & File

.newFromMatrix

Transform a Higher Order Ambisonic signal (HOA) via a directly designed spatial filter.

Arguments:

matrix

A Matrix instance.

order

Ambisonic order.

Instance Methods

Information

Matrix

File handling

Analysis

.analyzeAverage

Return an average analysis of transformer amplitude and energies.

Returns:

Analysis is returned in an IdentityDictionary, with the following keys:

keywordanalysis
\amppressure (virtual loudspeaker sum)
\rmsspherical harmonic energy
\energyvirtual loudspeaker (angular) energy
\meanEtransformer reduced energy
\matchWeighttransformer matching weights (a Dictionary)

The required weights for gain matching are returned in the \matchWeight Dictionary:

keywordanalysis
\ampmatch weight for pressure (virtual loudspeaker sum)
\rmsmatch weight for spherical harmonic energy
\energymatch weight for virtual loudspeaker (angular) energy

Discussion:

Offers a convenient way to review modifications to the soundfield.

Rotation:

Beamforming:

.analyzeDirections

Return a directional analysis of modifications to the soundfield.

Arguments:

directions

A single azimuth value, or an array of test directions. Specify in radians.

Rank 1 arrays return pantophonic, while rank 2 arrays return periphonic. E.g.,

Returns:

Analysis is returned in an IdentityDictionary, with the following keys:

keywordanalysis
\amppressure (virtual loudspeaker sum)
\rmsspherical harmonic energy
\energyvirtual loudspeaker energy
\spreadEenergy spread (a Dictionary)
\rVvelocity localisation vector, rV (a Dictionary)
\rEenergy localisation vector, rE (a Dictionary)

Two measures of energy spread are offered in the \spreadE Dictionary:

keywordanalysis
\cosroll-off to ~-3dB, in radians
\hvcroll-off to ~-6dB, in radians

Information regarding rV, the velocity localisation vector, is returned in the \rV Dictionary:

keywordanalysis
\magnitudesvector magnitudes
\directionsvector directions, in radians
\warpangle distortion from test directions, in radians
\rEwarpangle distortion from rE, in radians
\xyzrV, in cartesian coordinates

Similarly, information regarding rE, the energy localisation vector, is returned in the \rE Dictionary:

keywordanalysis
\magnitudesvector magnitudes
\directionsvector directions, in radians
\warpangle distortion from test directions, in radians
\rVwarpangle distortion from rV, in radians
\xyzrE, in cartesian coordinates

Offers detailed analysis of transformer performance.

Rotation:

Beamforming:

Nullforming:

Examples

TBD

[1] - HOA transform equivalent to FoaXformerMatrix: *newMirrorO.
[2] - HOA transform equivalent to FoaXformerMatrix: *newMirrorY.
[3] - HOA transform equivalent to FoaXformerMatrix: *newMirrorX.
[4] - HOA transform equivalent to FoaXformerMatrix: *newMirrorZ.