Main Content

Ambisonic插件生成

This examples shows how to create ambisonic plugins using MATLAB® higher order ambisonic (HOA) demo functions. Ambisonics is a spatial audio technique which represents a three-dimensional sound field using spherical harmonics. This example contains an encoder plugin, a function to generate custom encoder plugins, a decoder plugin, and a function to generate custom decoder plugins. The customization of plugin generation enables a user to specify various ambisonic orders and various device lists for a given ambisonic configuration.

背景

Ambisonic编码是将声场分解成球形谐波的过程。编码矩阵是特定设备位置处存在的球面谐波的量。在模式匹配解码中,解码矩阵是编码矩阵的伪逆。Ambisonic Deadoding是将球面谐波重建为声场的过程。

This example involves higher order ambisonics, which include traditional first-order ambisonics. In ambisonics, there is a relationship between the number of ambisonic channels and the ambisonic order:

Ambisonic_Channels =(Ambisonic_Order + 1)^ 2

For example: First-order ambisonics requires four audio channels while fourth-order ambisonics requires 25 audio channels.

支持以下约定金宝app

  • ACN通道测序

  • SN3D normalization

  • 方位角从0到360度

  • 从-90到90度的海拔

Ambisonic Design的示例支持伪逆解码的第七次野金宝app蛮人。

Ambisonic设备:元素和扬声器

Ambisonic设备分为两组:元素和扬声器。每个设备都有一个音频信号和描述其位置和操作的元数据。元素对应于多元素麦克风阵列,并且扬声器对应于用于ambisonic播放的扬声器阵列。

The ambisonic encoder applies the ambisonic encoding matrix to raw audio from microphone elements. The position (azimuth, elevation) and deviceType of the microphone elements along with desired ambisonic order are needed to create the ambisonic encoding matrix.

The ambisonic decoder applies the ambisonic decoding matrix to ambisonic audio for playback on speakers. The position (azimuth, elevation) and deviceType of the speakers along with desired ambisonic order are needed to create the ambisonic decoding matrix.

Sound Field Representation

为了捕获,表示或再现与amisiSICS的声场,设备数量(元素或扬声器)必须大于或等于ambisonic信道的数量。

对于编码示例,用32音频捕获-channel spherical array microphone may be encoded up to fourth-order ambisonics (25 channels). For the decoding example, a loudspeaker array containing 64 speakers is configured for ambisonic playback up to seventh-order. If the playback content is fourth order ambisonics, then even though the array is set up for seventh- order, only fourth-order ambisonics is realized through the system.

number_devices >= number_ambisonic_channels

For an encoder, if the number of devices (elements) is less than the number of ambisonic channels, then audio from the device (elements) positions may be represented in ambisonics, but a sound field is not represented. One or more audio channels may be encoded into ambisonics in an effort to position sources in an ambisonic field. Each encoder represents the intensity of the sound field to be encoded at a specified device (element) location.

For a decoder, if the number of devices (speakers) is less than the number of ambisonic channels, the devices (speakers) do not fully reproduce a sound field at the specified ambisonic order. A sound field may be reproduced at a lower ambisonic order. For example, third-order ambisonics played on a speaker array with 10 speakers can be realized as a second-order (9 channel) system with an additional speaker for playback. Each decoder represents an intensity of the ambisonic field at the specified device (speaker) position.

pseudo-inverse decoding method

有许多解码选项,该示例使用伪逆解码,也称为模式匹配。该解码方法有利于常规形状的设备布局。其他解码方法可以利用不规则形状的装置布局。

DeviceType

The deviceType for encoders turns the device (element) encoding on or off for a particular element. The deviceType for decoders turns the device (speaker) decoding on or off for a particular speaker. If the deviceType vector is omitted, then the deviceTypes are set to 1 (on). The intention behind deviceType is to provide flexibility of padding encoder inputs or decoder outputs with off channels to fit an ambisonic encoder or decoder plugin into an environment with fixed channel counts such as an 8-, 16- or 32-channel audio bus.

例如:具有14个元素的二阶AMBISONIC编码器具有14个输入和9个输出。如果将具有DeviceType 0(OFF)的更多设备(元素)添加到编码器,则编码器具有16个输入和9个输出。具有29个设备(扬声器)的四阶AMBISONIC解码器具有25个输入和29个输出。如果将具有DeviceType 0(OFF)的其他设备(扬声器)添加到解码器,则通道计数成为25个输入和32个输出。

当DeviceType设置为0(关闭)时,忽略该频道的方位角和高度;但是,仍然需要一个值。当设备类型设置为0(OFF)时建议将方位角设置为0度。

Ambisonic Encoder Plugin

audioptuinexample.ambiencoderplugin建在周围audioExample.ambisonics.ambiencode.ambiencode.ambiencode.mtrxandaudioExample.ambisonics.ambiencode.ambiencode.ambiencode.职能。The number of devices (elements to be encoded) is the number of input channels of the encoder plugin. The ambisonic order determines the number of output channels of the encoder plugin.

audioExample.ambisonics.ambiencode.ambiencode.ambiencode.mtrxgenerates the ambisonic encoder matrix from a given ambisonic order and a given device list.audioExample.ambisonics.ambiencode.ambiencode.ambiencode.applies the ambisonic encoder matrix to raw audio resulting in ambisonic encoded audio. The formatting of the ambisonic audio may be specified with theaudioExample.ambisonics.ambiencode.ambiencode.ambiencode.功能。原始音频通道的数量必须等于Ambisonic编码器矩阵中的设备数。

The encoder plugin inherits directly from the audioPlugin base class. The plugin constructor callsaudioExample.ambisonics.ambiencode.ambiencode.ambiencode.mtrx构建初始编码器矩阵。过程函数调用audioExample.ambisonics.ambiencode.ambiencode.ambiencode.to apply the encoder matrix to the audio input. The output of the plugin is ambisonic encoded audio. The encoder matrix is recalculated only when a plugin property is modified which minimizes computations inside the process loop.

The plugin interface populates azimuth and elevation but not device type. The idea behind device type is to add off-channels to an encoder matrix to fit the matrix into a 8x-channel frame. For example: second-order has 9 channels, create a 16 channel encoder matrix, with the first 9 channels having device type of 1 (on) and the remaining 7 channels having device type of 0 (off).

Audioiotestbench(audioptuinexample.ambiencoderplugin)

audioTestBench('-close'

Inspect Code|Run Plugin|Generate Plugin

Generate Custom Ambisonic Encoder Plugin

Generating ambisonic plugins can be an involved process. Theambigenerateencoderplugin.function streamlines the process of generating ambisonic encoder plugins. This function supports up to seventh-order ambisonics. Supported formats are 'acn-sn3d', 'acn-n3d', 'acn-fuma', 'acn-maxn', 'fuma-sn3d', 'fuma-n3d', 'fuma-fuma', 'fuma-maxn'. The function requires the following inputs:

  1. name of the audioPlugin class

  2. 编码器位置的设备列表

  3. ambisonic order

  4. ambisonic format

% Provide a name for the audioPlugin class名称='myEncoderPlugin';% Include a device list of element positions装置= [45 135 225 315 45 135 225 315;-45 -45 -45 -45 45 45 45 45];%指定the ambisonic orderorder = 3;%指定the ambisonic format格式='acn-sn3d';

Run the function.

AudioExample.ambisonics.ambigenerate encoderplugin(名称,设备,订单,格式)

Once designed, the audio plugin can be validated, generated, and deployed to a third-party digital audio workstation (DAW).

Ambisonic Decoder Plugin

audioptuminexample.ambidecoderplugin建在周围audioexample.ambisonics.ambidecodemtrxandaudioexample.ambisonics.ambidecode职能。AMBISONIC订单确定解码器插件的输入通道数。设备数量(扬声器位置)是解码器插件的输出通道数。

audioexample.ambisonics.ambidecodemtrxgenerates the ambisonic decoder matrix from a given ambisonic order and a given device list.audioexample.ambisonics.ambidecode将Ambisonic解码器矩阵应用于Ambisonic Audio,导致解码的音频。可以使用ambisonic音频的格式指定audioexample.ambisonics.ambidecode功能。audioexample.ambisonics.ambidecodedetermines the ambisonic order from the minimum of the ambisonic order of the input audio and the ambisonic order of the decoder matrix.

解码器插件直接从AudioPlugin基类继承。插件构造函数调用audioexample.ambisonics.ambidecodemtrxto build the initial decoder matrix. The process function callsaudioexample.ambisonics.ambidecodeto apply the decoder matrix to the audio input. The output of the plugin is decoded audio. The decoder matrix is recalculated only when a plugin property is modified which minimizes computations inside the process loop.

The plugin interface populates azimuth and elevation but not device type. The idea behind device type is to add off-channels to an encoder matrix to fit the matrix into a 8x-channel frame. For example: second-order has 9 channels, create a 16 channel encoder matrix, with the first 9 channels having device type of 1 (on) and the remaining 7 channels having device type of 0 (off).

Audioiotestbench(audioptuinexample.ambidecoderplugin)

audioTestBench('-close'

Inspect Code|Run Plugin|Generate Plugin

生成自定义Ambisonic解码器插件

Generating ambisonic plugins can be an involved process. TheambiGenerateDecoderPluginfunction streamlines the process of generating ambisonic decoder plugins. This function supports up to seventh-order ambisonics. Supported formats are 'acn-sn3d', 'acn-n3d', 'acn-fuma', 'acn-maxn', 'fuma-sn3d', 'fuma-n3d', 'fuma-fuma', 'fuma-maxn'. The function requires the following inputs:

  1. name of theaudioplugin班级

  2. 设备列表解码器位置

  3. ambisonic order

  4. ambisonic format

% Provide a name for the audioPlugin class名称='mydecoderplugin';%包括扬声器位置的设备列表装置= [45 135 225 315 45 135 225 315;-45 -45 -45 -45 45 45 45 45];%指定the ambisonic orderorder = 3;%指定the ambisonic format格式='acn-sn3d';

Run the function.

audioexample.ambisonics.ambiGenerateDecoderPlugin(name,device,order,format)

Once designed, the audio plugin can be validated, generated, and deployed to a third-party digital audio workstation (DAW).

也可以看看

Ambisonic Binaural Decoding

Related Topics

References

[1] Kronlachner, M. (2014). Spatial Transformations for the Alteration of Ambisonic Recordings (Master's thesis).

[2] https://en.wikipedia.org/wiki/ambisonics

[3] https://en.wikipedia.org/wiki/ambisonic_data_exchange_Formats