|
SAF
|
A simple shoebox room Ambisonic encoder. More...
#include "_common.h"Go to the source code of this file.
Macros | |
| #define | ROOM_SIM_MAX_NUM_RECEIVERS ( 16 ) |
| Maximum supported number of receivers for the room sim example. | |
| #define | ROOM_SIM_MAX_NUM_SOURCES ( 16 ) |
| Maximum supported number of sources for the room sim example. | |
Functions | |
| void | ambi_roomsim_create (void **const phAmbi) |
| Creates an instance of ambi_roomsim. | |
| void | ambi_roomsim_destroy (void **const phAmbi) |
| Destroys an instance of ambi_roomsim. | |
| void | ambi_roomsim_init (void *const hAmbi, int samplerate) |
| Initialises an instance of ambi_roomsim with default settings. | |
| void | ambi_roomsim_process (void *const hAmbi, const float *const *inputs, float *const *outputs, int nInputs, int nOutputs, int nSamples) |
| Processes audio. | |
| void | ambi_roomsim_refreshParams (void *const hAmbi) |
| Sets all intialisation flags to 1; re-initialising all settings/variables as ambi_roomsim is currently configured, at next available opportunity. | |
| void | ambi_roomsim_setEnableIMSflag (void *const hAmbi, int newValue) |
| Sets whether to include image sources (1) or not (0) | |
| void | ambi_roomsim_setMaxReflectionOrder (void *const hAmbi, int newValue) |
| Sets the maximum reflection order. | |
| void | ambi_roomsim_setOutputOrder (void *const hAmbi, int newValue) |
| Sets the encoding order (see SH_ORDERS enum) | |
| void | ambi_roomsim_setNumSources (void *const hAmbi, int new_nSources) |
| Sets the number of input signals/sources to encode. | |
| void | ambi_roomsim_setSourceX (void *const hAmbi, int index, float newValue) |
| Sets the 'x' coordinate for a specific source index. | |
| void | ambi_roomsim_setSourceY (void *const hAmbi, int index, float newValue) |
| Sets the 'y' coordinate for a specific source index. | |
| void | ambi_roomsim_setSourceZ (void *const hAmbi, int index, float newValue) |
| Sets the 'z' coordinate for a specific source index. | |
| void | ambi_roomsim_setNumReceivers (void *const hAmbi, int new_nReceievers) |
| Sets the number of input SH receivers. | |
| void | ambi_roomsim_setReceiverX (void *const hAmbi, int index, float newValue) |
| Sets the 'x' coordinate for a specific receiver index. | |
| void | ambi_roomsim_setReceiverY (void *const hAmbi, int index, float newValue) |
| Sets the 'y' coordinate for a specific receiver index. | |
| void | ambi_roomsim_setReceiverZ (void *const hAmbi, int index, float newValue) |
| Sets the 'z' coordinate for a specific receiver index. | |
| void | ambi_roomsim_setRoomDimX (void *const hAmbi, float newValue) |
| Sets the room length along the x dimension. | |
| void | ambi_roomsim_setRoomDimY (void *const hAmbi, float newValue) |
| Sets the room length along the y dimension. | |
| void | ambi_roomsim_setRoomDimZ (void *const hAmbi, float newValue) |
| Sets the room length along the z dimension. | |
| void | ambi_roomsim_setWallAbsCoeff (void *const hAmbi, int xyz_idx, int posNeg_idx, float new_value) |
| Sets wall absorption coefficients. | |
| void | ambi_roomsim_setChOrder (void *const hAmbi, int newOrder) |
| Sets the Ambisonic channel ordering convention to encode with (see CH_ORDER enum) | |
| void | ambi_roomsim_setNormType (void *const hAmbi, int newType) |
| Sets the Ambisonic normalisation convention to encode with (see NORM_TYPES enum) | |
| int | ambi_roomsim_getFrameSize (void) |
| Returns the processing framesize (i.e., number of samples processed with every _process() call ) | |
| int | ambi_roomsim_getEnableIMSflag (void *const hAmbi) |
| Returns whether to include image sources (1) or not (0) | |
| int | ambi_roomsim_getMaxReflectionOrder (void *const hAmbi) |
| Returns the maximum reflection order. | |
| int | ambi_roomsim_getOutputOrder (void *const hAmbi) |
| Returns the decoding order (see SH_ORDERS enum) | |
| int | ambi_roomsim_getNumSources (void *const hAmbi) |
| Returns the number of input signals/sources to encode. | |
| int | ambi_roomsim_getMaxNumSources (void) |
| Returns the maximum number of input signals/sources that can be encoded. | |
| int | ambi_roomsim_getNSHrequired (void *const hAmbi) |
| Returns the number of spherical harmonic signals required by the current decoding order: (current_order+1)^2. | |
| float | ambi_roomsim_getSourceX (void *const hAmbi, int index) |
| Returns the 'x' coordinate for a specific source index. | |
| float | ambi_roomsim_getSourceY (void *const hAmbi, int index) |
| Returns the 'y' coordinate for a specific source index. | |
| float | ambi_roomsim_getSourceZ (void *const hAmbi, int index) |
| Returns the 'z' coordinate for a specific source index. | |
| int | ambi_roomsim_getNumReceivers (void *const hAmbi) |
| Returns the number of SH receivers. | |
| int | ambi_roomsim_getMaxNumReceivers (void) |
| Returns the maximum number of receivers. | |
| float | ambi_roomsim_getReceiverX (void *const hAmbi, int index) |
| Returns the 'x' coordinate for a specific receiver index. | |
| float | ambi_roomsim_getReceiverY (void *const hAmbi, int index) |
| Returns the 'y' coordinate for a specific receiver index. | |
| float | ambi_roomsim_getReceiverZ (void *const hAmbi, int index) |
| Returns the 'z' coordinate for a specific receiver index. | |
| float | ambi_roomsim_getRoomDimX (void *const hAmbi) |
| Returns the room length along the x dimension. | |
| float | ambi_roomsim_getRoomDimY (void *const hAmbi) |
| Returns the room length along the y dimension. | |
| float | ambi_roomsim_getRoomDimZ (void *const hAmbi) |
| Returns the room length along the z dimension. | |
| float | ambi_roomsim_getWallAbsCoeff (void *const hAmbi, int xyz_idx, int posNeg_idx) |
| Returns wall absorption coefficients. | |
| int | ambi_roomsim_getChOrder (void *const hAmbi) |
| Returns the Ambisonic channel ordering convention currently being used to encode with (see CH_ORDER enum) | |
| int | ambi_roomsim_getNormType (void *const hAmbi) |
| Returns the Ambisonic normalisation convention currently being used to encode with (see NORM_TYPES enum) | |
| int | ambi_roomsim_getProcessingDelay (void) |
| Returns the processing delay in samples (may be used for delay compensation features) | |
Variables | |
| const float | ambi_roomsim_default_abs_wall [6] |
| Default wall absorption coefficients. | |
| const float | ambi_roomsim_default_room_dims [3] |
| Default room dimensions. | |
| const int | ambi_roomsim_defaultNumSources |
| Default number of sources in the simulation. | |
| const float | ambi_roomsim_defaultSourcePositions [ROOM_SIM_MAX_NUM_SOURCES][3] |
| Default source positions. | |
| const int | ambi_roomsim_defaultNumReceivers |
| Default number of receivers in the simulation. | |
| const float | ambi_roomsim_defaultReceiverPositions [ROOM_SIM_MAX_NUM_RECEIVERS][3] |
| Default receiver positions. | |
A simple shoebox room Ambisonic encoder.
Definition in file ambi_roomsim.h.
| #define ROOM_SIM_MAX_NUM_RECEIVERS ( 16 ) |
Maximum supported number of receivers for the room sim example.
Definition at line 50 of file ambi_roomsim.h.
| #define ROOM_SIM_MAX_NUM_SOURCES ( 16 ) |
Maximum supported number of sources for the room sim example.
Definition at line 52 of file ambi_roomsim.h.
| void ambi_roomsim_create | ( | void **const | phAmbi | ) |
Creates an instance of ambi_roomsim.
| [in] | phAmbi | (&) address of ambi_roomsim handle |
Definition at line 29 of file ambi_roomsim.c.
| void ambi_roomsim_destroy | ( | void **const | phAmbi | ) |
Destroys an instance of ambi_roomsim.
| [in] | phAmbi | (&) address of ambi_roomsim handle |
Definition at line 63 of file ambi_roomsim.c.
| int ambi_roomsim_getChOrder | ( | void *const | hAmbi | ) |
Returns the Ambisonic channel ordering convention currently being used to encode with (see CH_ORDER enum)
Definition at line 460 of file ambi_roomsim.c.
| int ambi_roomsim_getEnableIMSflag | ( | void *const | hAmbi | ) |
Returns whether to include image sources (1) or not (0)
Definition at line 348 of file ambi_roomsim.c.
| int ambi_roomsim_getFrameSize | ( | void | ) |
Returns the processing framesize (i.e., number of samples processed with every _process() call )
Definition at line 343 of file ambi_roomsim.c.
| int ambi_roomsim_getMaxNumReceivers | ( | void | ) |
Returns the maximum number of receivers.
Definition at line 410 of file ambi_roomsim.c.
| int ambi_roomsim_getMaxNumSources | ( | void | ) |
Returns the maximum number of input signals/sources that can be encoded.
Definition at line 372 of file ambi_roomsim.c.
| int ambi_roomsim_getMaxReflectionOrder | ( | void *const | hAmbi | ) |
Returns the maximum reflection order.
Definition at line 354 of file ambi_roomsim.c.
| int ambi_roomsim_getNormType | ( | void *const | hAmbi | ) |
Returns the Ambisonic normalisation convention currently being used to encode with (see NORM_TYPES enum)
Definition at line 466 of file ambi_roomsim.c.
| int ambi_roomsim_getNSHrequired | ( | void *const | hAmbi | ) |
Returns the number of spherical harmonic signals required by the current decoding order: (current_order+1)^2.
Definition at line 377 of file ambi_roomsim.c.
| int ambi_roomsim_getNumReceivers | ( | void *const | hAmbi | ) |
Returns the number of SH receivers.
Definition at line 404 of file ambi_roomsim.c.
| int ambi_roomsim_getNumSources | ( | void *const | hAmbi | ) |
Returns the number of input signals/sources to encode.
Definition at line 366 of file ambi_roomsim.c.
| int ambi_roomsim_getOutputOrder | ( | void *const | hAmbi | ) |
Returns the decoding order (see SH_ORDERS enum)
If decoding order is higher than the input signal order, the extra required channels are filled with zeros. If the decoding order is lower than the input signal order, the number input signals is truncated accordingly.
Definition at line 360 of file ambi_roomsim.c.
| int ambi_roomsim_getProcessingDelay | ( | void | ) |
Returns the processing delay in samples (may be used for delay compensation features)
Definition at line 472 of file ambi_roomsim.c.
| float ambi_roomsim_getReceiverX | ( | void *const | hAmbi, |
| int | index ) |
Returns the 'x' coordinate for a specific receiver index.
Definition at line 415 of file ambi_roomsim.c.
| float ambi_roomsim_getReceiverY | ( | void *const | hAmbi, |
| int | index ) |
Returns the 'y' coordinate for a specific receiver index.
Definition at line 422 of file ambi_roomsim.c.
| float ambi_roomsim_getReceiverZ | ( | void *const | hAmbi, |
| int | index ) |
Returns the 'z' coordinate for a specific receiver index.
Definition at line 429 of file ambi_roomsim.c.
| float ambi_roomsim_getRoomDimX | ( | void *const | hAmbi | ) |
Returns the room length along the x dimension.
Definition at line 436 of file ambi_roomsim.c.
| float ambi_roomsim_getRoomDimY | ( | void *const | hAmbi | ) |
Returns the room length along the y dimension.
Definition at line 442 of file ambi_roomsim.c.
| float ambi_roomsim_getRoomDimZ | ( | void *const | hAmbi | ) |
Returns the room length along the z dimension.
Definition at line 448 of file ambi_roomsim.c.
| float ambi_roomsim_getSourceX | ( | void *const | hAmbi, |
| int | index ) |
Returns the 'x' coordinate for a specific source index.
Definition at line 383 of file ambi_roomsim.c.
| float ambi_roomsim_getSourceY | ( | void *const | hAmbi, |
| int | index ) |
Returns the 'y' coordinate for a specific source index.
Definition at line 390 of file ambi_roomsim.c.
| float ambi_roomsim_getSourceZ | ( | void *const | hAmbi, |
| int | index ) |
Returns the 'z' coordinate for a specific source index.
Definition at line 397 of file ambi_roomsim.c.
| float ambi_roomsim_getWallAbsCoeff | ( | void *const | hAmbi, |
| int | xyz_idx, | ||
| int | posNeg_idx ) |
Returns wall absorption coefficients.
Definition at line 454 of file ambi_roomsim.c.
| void ambi_roomsim_init | ( | void *const | hAmbi, |
| int | samplerate ) |
Initialises an instance of ambi_roomsim with default settings.
| [in] | hAmbi | ambi_roomsim handle |
| [in] | samplerate | Host samplerate. |
Definition at line 80 of file ambi_roomsim.c.
| void ambi_roomsim_process | ( | void *const | hAmbi, |
| const float *const * | inputs, | ||
| float *const * | outputs, | ||
| int | nInputs, | ||
| int | nOutputs, | ||
| int | nSamples ) |
Processes audio.
| [in] | hAmbi | ambi_roomsim handle |
| [in] | inputs | Input channel buffers; 2-D array: nInputs x nSamples |
| [in] | outputs | Output channel buffers; 2-D array: nOutputs x nSamples |
| [in] | nInputs | Number of input channels |
| [in] | nOutputs | Number of output channels |
| [in] | nSamples | Number of samples in 'inputs'/'output' matrices |
Definition at line 90 of file ambi_roomsim.c.
| void ambi_roomsim_refreshParams | ( | void *const | hAmbi | ) |
Sets all intialisation flags to 1; re-initialising all settings/variables as ambi_roomsim is currently configured, at next available opportunity.
Definition at line 205 of file ambi_roomsim.c.
| void ambi_roomsim_setChOrder | ( | void *const | hAmbi, |
| int | newOrder ) |
Sets the Ambisonic channel ordering convention to encode with (see CH_ORDER enum)
Definition at line 326 of file ambi_roomsim.c.
| void ambi_roomsim_setEnableIMSflag | ( | void *const | hAmbi, |
| int | newValue ) |
Sets whether to include image sources (1) or not (0)
Definition at line 211 of file ambi_roomsim.c.
| void ambi_roomsim_setMaxReflectionOrder | ( | void *const | hAmbi, |
| int | newValue ) |
Sets the maximum reflection order.
Definition at line 217 of file ambi_roomsim.c.
| void ambi_roomsim_setNormType | ( | void *const | hAmbi, |
| int | newType ) |
Sets the Ambisonic normalisation convention to encode with (see NORM_TYPES enum)
Definition at line 333 of file ambi_roomsim.c.
| void ambi_roomsim_setNumReceivers | ( | void *const | hAmbi, |
| int | new_nReceievers ) |
Sets the number of input SH receivers.
Definition at line 265 of file ambi_roomsim.c.
| void ambi_roomsim_setNumSources | ( | void *const | hAmbi, |
| int | new_nSources ) |
Sets the number of input signals/sources to encode.
Definition at line 238 of file ambi_roomsim.c.
| void ambi_roomsim_setOutputOrder | ( | void *const | hAmbi, |
| int | newValue ) |
Sets the encoding order (see SH_ORDERS enum)
Definition at line 223 of file ambi_roomsim.c.
| void ambi_roomsim_setReceiverX | ( | void *const | hAmbi, |
| int | index, | ||
| float | newValue ) |
Sets the 'x' coordinate for a specific receiver index.
| [in] | hAmbi | ambi_roomsim handle |
| [in] | index | Receiver index |
| [in] | newValue | New 'x' coordinate, in metres |
Definition at line 271 of file ambi_roomsim.c.
| void ambi_roomsim_setReceiverY | ( | void *const | hAmbi, |
| int | index, | ||
| float | newValue ) |
Sets the 'y' coordinate for a specific receiver index.
| [in] | hAmbi | ambi_roomsim handle |
| [in] | index | Receiver index |
| [in] | newValue | New 'y' coordinate, in metres |
Definition at line 278 of file ambi_roomsim.c.
| void ambi_roomsim_setReceiverZ | ( | void *const | hAmbi, |
| int | index, | ||
| float | newValue ) |
Sets the 'z' coordinate for a specific receiver index.
| [in] | hAmbi | ambi_roomsim handle |
| [in] | index | Receiver index |
| [in] | newValue | New 'z' coordinate, in metres |
Definition at line 285 of file ambi_roomsim.c.
| void ambi_roomsim_setRoomDimX | ( | void *const | hAmbi, |
| float | newValue ) |
Sets the room length along the x dimension.
Definition at line 292 of file ambi_roomsim.c.
| void ambi_roomsim_setRoomDimY | ( | void *const | hAmbi, |
| float | newValue ) |
Sets the room length along the y dimension.
Definition at line 300 of file ambi_roomsim.c.
| void ambi_roomsim_setRoomDimZ | ( | void *const | hAmbi, |
| float | newValue ) |
Sets the room length along the z dimension.
Definition at line 308 of file ambi_roomsim.c.
| void ambi_roomsim_setSourceX | ( | void *const | hAmbi, |
| int | index, | ||
| float | newValue ) |
Sets the 'x' coordinate for a specific source index.
| [in] | hAmbi | ambi_roomsim handle |
| [in] | index | Source index |
| [in] | newValue | New 'x' coordinate, in metres |
Definition at line 244 of file ambi_roomsim.c.
| void ambi_roomsim_setSourceY | ( | void *const | hAmbi, |
| int | index, | ||
| float | newValue ) |
Sets the 'y' coordinate for a specific source index.
| [in] | hAmbi | ambi_roomsim handle |
| [in] | index | Source index |
| [in] | newValue | New 'y' coordinate, in metres |
Definition at line 251 of file ambi_roomsim.c.
| void ambi_roomsim_setSourceZ | ( | void *const | hAmbi, |
| int | index, | ||
| float | newValue ) |
Sets the 'z' coordinate for a specific source index.
| [in] | hAmbi | ambi_roomsim handle |
| [in] | index | Source index |
| [in] | newValue | New 'z' coordinate, in metres |
Definition at line 258 of file ambi_roomsim.c.
| void ambi_roomsim_setWallAbsCoeff | ( | void *const | hAmbi, |
| int | xyz_idx, | ||
| int | posNeg_idx, | ||
| float | new_value ) |
Sets wall absorption coefficients.
Definition at line 316 of file ambi_roomsim.c.
|
extern |
Default wall absorption coefficients.
Definition at line 29 of file ambi_roomsim_internal.c.
|
extern |
Default room dimensions.
Definition at line 31 of file ambi_roomsim_internal.c.
|
extern |
Default number of receivers in the simulation.
Definition at line 42 of file ambi_roomsim_internal.c.
|
extern |
Default number of sources in the simulation.
Definition at line 33 of file ambi_roomsim_internal.c.
|
extern |
Default receiver positions.
Definition at line 44 of file ambi_roomsim_internal.c.
|
extern |
Default source positions.
Definition at line 35 of file ambi_roomsim_internal.c.