Spatially encodes spherical microphone array signals into spherical harmonic signals (aka: Ambisonic signals) utilising theoretical encoding filters.
Spatially encodes spherical microphone array signals into spherical harmonic signals (aka: Ambisonic signals) utilising theoretical encoding filters.
#ifndef __ARRAY2SH_H_INCLUDED__
#define __ARRAY2SH_H_INCLUDED__
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
MICROPHONE_ARRAY_PRESET_DEFAULT = 1,
MICROPHONE_ARRAY_PRESET_AALTO_HYDROPHONE,
MICROPHONE_ARRAY_PRESET_SENNHEISER_AMBEO,
MICROPHONE_ARRAY_PRESET_CORE_SOUND_TETRAMIC,
MICROPHONE_ARRAY_PRESET_ZOOM_H3VR_PRESET,
MICROPHONE_ARRAY_PRESET_SOUND_FIELD_SPS200,
MICROPHONE_ARRAY_PRESET_ZYLIA_1D,
MICROPHONE_ARRAY_PRESET_EIGENMIKE32,
MICROPHONE_ARRAY_PRESET_EIGENMIKE64,
MICROPHONE_ARRAY_PRESET_DTU_MIC
typedef enum {
#define ARRAY2SH_NUM_FILTER_TYPES ( 4 )
typedef enum {
#define ARRAY2SH_NUM_ARRAY_TYPES ( 2 )
typedef enum {
#define ARRAY2SH_NUM_WEIGHT_TYPES ( 6 )
typedef enum {
#define ARRAY2SH_MAX_NUM_SENSORS ( MAX_NUM_CHANNELS )
#define ARRAY2SH_MAX_GAIN_MIN_VALUE ( 0.0f )
#define ARRAY2SH_MAX_GAIN_MAX_VALUE ( 80.0f )
#define ARRAY2SH_POST_GAIN_MIN_VALUE ( -60.0f )
#define ARRAY2SH_POST_GAIN_MAX_VALUE ( 12.0f )
#define ARRAY2SH_SPEED_OF_SOUND_MIN_VALUE ( 200.0f )
#define ARRAY2SH_SPEED_OF_SOUND_MAX_VALUE ( 2000.0f )
#define ARRAY2SH_ARRAY_RADIUS_MIN_VALUE ( 1.0f )
#define ARRAY2SH_ARRAY_RADIUS_MAX_VALUE ( 400.0f )
#define ARRAY2SH_BAFFLE_RADIUS_MIN_VALUE ( 1.0f )
#define ARRAY2SH_BAFFLE_RADIUS_MAX_VALUE ( 400.0f )
int samplerate);
const float *const * inputs,
float* const* outputs,
int nInputs,
int nOutputs,
int nSamples);
int* nCurves,
int* nFreqPoints);
#ifdef __cplusplus
}
#endif
#endif
A bunch of things that are common to many of the saf examples.
float array2sh_getR(void *const hA2sh)
Returns the radius of the scatterer, in meters.
float * array2sh_getSpatialCorrelation_Handle(void *const hA2sh, int *nCurves, int *nFreqPoints)
Returns a pointer to the spatial correlation [1] data.
float array2sh_getSensorElev_deg(void *const hA2sh, int index)
Returns a particular sensor's elevation w.r.t to the origin of the array, in DEGREES.
float array2sh_getr(void *const hA2sh)
Returns the radius of the array, in meters.
ARRAY2SH_MICROPHONE_ARRAY_PRESETS
Available microphone array presets.
void array2sh_setNumSensors(void *const hA2sh, int newQ)
Sets the number of sensors in the array.
float ** array2sh_getbN_inv(void *const hA2sh, int *nCurves, int *nFreqPoints)
Returns the regularised inversion of the modal coefficients per frequency (may be used for optional p...
void array2sh_setSensorElev_rad(void *const hA2sh, int index, float newElev_rad)
Sets a particular sensor's elevation (radians) w.r.t to the origin of the array.
void array2sh_setR(void *const hA2sh, float newR)
Sets the radius (in meters) of the scatterer (only for Rigid arrays).
void array2sh_setEvalStatus(void *const hA2sh, ARRAY2SH_EVAL_STATUS evalStatus)
Sets current eval status (see ARRAY2SH_EVAL_STATUS enum)
float array2sh_getSensorAzi_deg(void *const hA2sh, int index)
Returns a particular sensor's azimuth w.r.t to the origin of the array, in DEGREES.
float * array2sh_getFreqVector(void *const hA2sh, int *nFreqPoints)
Returns a pointer to the frequency vector.
ARRAY2SH_FILTER_TYPES
Available encoding filter approaches.
@ FILTER_Z_STYLE
Encoding filters based on a linear-phase filter- bank approach [3].
@ FILTER_SOFT_LIM
Encoding filters based on a 'soft-limiting' regularised inversion of the modal responses [1].
@ FILTER_Z_STYLE_MAXRE
Same as FILTER_Z_STYLE, only it also has max_rE weights baked in.
@ FILTER_TIKHONOV
Encoding filters based on a 'Tikhonov' regularised inversion of the modal responses [2].
void array2sh_setRegPar(void *const hA2sh, float newVal)
Sets the value of the regularisation parameter (the maximum permitted gain of the filters),...
int array2sh_getRequestEncoderEvalFLAG(void *const hA2sh)
Returns a flag, which is '1' if there has been a recent request to evaluate the current encoding perf...
int array2sh_getMaxNumSensors(void)
Returns the maximum supported number of sensors which can be in the array.
void array2sh_setArrayType(void *const hA2sh, int newType)
Sets the type of array (see ARRAY2SH_ARRAY_TYPES enum)
int array2sh_getEncodingOrder(void *const hA2sh)
Returns the current encoding order (see SH_ORDERS enum)
float array2sh_getProgressBar0_1(void *const hA2sh)
(Optional) Returns current intialisation/processing progress, between 0..1
void array2sh_refreshSettings(void *const hA2sh)
Sets all intialisation flags to 1; re-initialising all settings/variables as array2sh is currently co...
void array2sh_setEncodingOrder(void *const hA2sh, int newOrder)
Sets the encoding order (see SH_ORDERS enum)
void array2sh_setFilterType(void *const hA2sh, int newType)
Sets the type filter design to employ for computing the encoding matrices (see ARRAY2SH_FILTER_TYPES ...
int array2sh_getSamplingRate(void *const hA2sh)
Returns the DAW/Host sample rate.
void array2sh_setSensorElev_deg(void *const hA2sh, int index, float newElev_deg)
Sets a particular sensor's elevation (degrees) w.r.t to the origin of the array.
float array2sh_getRegPar(void *const hA2sh)
Returns the value of the regurlisation parameter; the maximum permitted gain provided by the filters,...
float * array2sh_getLevelDifference_Handle(void *const hA2sh, int *nCurves, int *nFreqPoints)
Returns a pointer to the level-difference [1] data.
int array2sh_getArrayType(void *const hA2sh)
Returns the type of array.
int array2sh_getNormType(void *const hA2sh)
Returns the Ambisonic normalisation convention currently being usedto decode with,...
int array2sh_getDiffEQpastAliasing(void *const hA2sh)
Flag to enabled/disable diffuse equalisation above the spatial aliasing limit of the array (0: disabl...
float ** array2sh_getbN_modal(void *const hA2sh, int *nCurves, int *nFreqPoints)
Returns the direct inversion of the modal coefficients per frequency (may be used for optional plotti...
ARRAY2SH_WEIGHT_TYPES
List of supported sensor directivities and array construction types.
@ WEIGHT_RIGID_OMNI
Rigid baffle construction with omni sensors.
@ WEIGHT_OPEN_OMNI
Open array construction with omni sensors.
@ WEIGHT_OPEN_DIPOLE
Open array construction with dipole sensors.
@ WEIGHT_RIGID_CARD
Rigid baffle construction with cardioid sensors.
@ WEIGHT_RIGID_DIPOLE
Rigid baffle construction with dipole sensors.
@ WEIGHT_OPEN_CARD
Open array construction with cardioid sensors.
int array2sh_getMinNumSensors(void *const hA2sh)
Returns the minimum number of sensors which can be in the array [(current_order+1)^2].
float array2sh_getc(void *const hA2sh)
Returns the speed of sound of the medium (~343m/s air, ~1480m/s water), in m/s.
void array2sh_getProgressBarText(void *const hA2sh, char *text)
(Optional) Returns current intialisation/processing progress text
void array2sh_setc(void *const hA2sh, float newc)
Sets the speed of sound of the medium (~343m/s air, ~1480m/s water), in m/s.
void array2sh_evalEncoder(void *const hA2sh)
Evaluates the encoder, based on current global/user parameters.
void array2sh_setr(void *const hA2sh, float newr)
Sets the radius of the array.
void array2sh_setSensorAzi_rad(void *const hA2sh, int index, float newAzi_rad)
Sets a particular sensor's azimuth (radians) w.r.t to the origin of the array.
void array2sh_setSensorAzi_deg(void *const hA2sh, int index, float newAzi_deg)
Sets a particular sensor's azimuth (degrees) w.r.t to the origin of the array.
int array2sh_getNSHrequired(void *const hA2sh)
Returns the number of spherical harmonic signals required by the current encoding order: (current_ord...
void array2sh_setWeightType(void *const hA2sh, int newType)
Sets the type of weights to use (see ARRAY2SH_WEIGHT_TYPES enum)
void array2sh_setDiffEQpastAliasing(void *const hA2sh, int newState)
Analyses what the theoretical spatial aliasing frequency is, and conducts diffuse-field equalisation ...
float array2sh_getGain(void *const hA2sh)
Returns the amount of post gain to apply after the encoding, in DECIBELS.
void array2sh_setChOrder(void *const hA2sh, int newOrder)
Sets the Ambisonic channel ordering convention to encode with, in order to match the convention emplo...
float array2sh_getSensorAzi_rad(void *const hA2sh, int index)
Returns a particular sensor's azimuth w.r.t to the origin of the array, in RADIANS.
float array2sh_getSensorElev_rad(void *const hA2sh, int index)
Returns a particular sensor's elevation w.r.t to the origin of the array, in RADIANS.
ARRAY2SH_ARRAY_TYPES
List of supported array types.
@ ARRAY_CYLINDRICAL
Cylindrial arrangement of sensors (open/rigid)
@ ARRAY_SPHERICAL
Spherical arrangement of sensors (open/rigid)
int array2sh_getChOrder(void *const hA2sh)
Returns the Ambisonic channel ordering convention currently being used to decode with,...
int array2sh_getFilterType(void *const hA2sh)
Returns the type filter design to employ for computing the encoding matrices (see ARRAY2SH_FILTER_TYP...
int array2sh_getWeightType(void *const hA2sh)
Returns the type of weights to use see ARRAY2SH_WEIGHT_TYPES enum.
int array2sh_getReinitSHTmatrixFLAG(void *const hA2sh)
Returns 0 if SHT is not be reinitialised, 1: if it is.
int array2sh_getProcessingDelay(void)
Returns the processing delay in samples (may be used for delay compensation features)
int array2sh_getNumSensors(void *const hA2sh)
Returns the number of sensors in the array.
void array2sh_setRequestEncoderEvalFLAG(void *const hA2sh, int newState)
Evaluates the performance of the current encoding filters when applied to a theoretical model of the ...
ARRAY2SH_EVAL_STATUS array2sh_getEvalStatus(void *const hA2sh)
Returns current eval status (see ARRAY2SH_EVAL_STATUS enum)
ARRAY2SH_EVAL_STATUS
Current status of the encoder evaluation output data.
@ EVAL_STATUS_RECENTLY_EVALUATED
Encoder has recently been evaluated.
@ EVAL_STATUS_EVALUATING
Encoder is being evaluated.
@ EVAL_STATUS_EVALUATED
Encoder has been evaluated.
@ EVAL_STATUS_NOT_EVALUATED
Encoder has not been evaluated.