SAF
Loading...
Searching...
No Matches
sldoa.h

A spatially-localised active-intensity (SLAI) based direction-of- arrival estimator (SLDoA)

A spatially-localised active-intensity (SLAI) based direction-of- arrival estimator (SLDoA)

Files

sldoa.h (include), sldoa_internal.h, sldoa_database.h, sldoa.c, sldoa_internal.c, sldoa_database.c

Include Header

/*
* Copyright 2017-2018 Leo McCormack
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef __SLDOA_H_INCLUDED__
#define __SLDOA_H_INCLUDED__
#include "_common.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* ========================================================================== */
/* Main Functions */
/* ========================================================================== */
void sldoa_create(void** const phSld);
void sldoa_destroy(void** const phSld);
void sldoa_init(void* const hSld,
float samplerate);
void sldoa_initCodec(void* const hSld);
void sldoa_analysis(void* const hSld,
const float *const * inputs,
int nInputs,
int nSamples,
int isPlaying);
/* ========================================================================== */
/* Set Functions */
/* ========================================================================== */
void sldoa_setMasterOrder(void* const hSld, int newValue);
void sldoa_refreshSettings(void* const hSld);
void sldoa_setMaxFreq(void* const hSld, float newFreq);
void sldoa_setMinFreq(void* const hSld, float newFreq);
void sldoa_setAvg(void* const hSld, float newAvg);
void sldoa_setAnaOrder(void* const hSld, int newValue, int bandIdx);
void sldoa_setAnaOrderAllBands(void* const hSld, int newValue);
void sldoa_setChOrder(void* const hSld, int newOrder);
void sldoa_setNormType(void* const hSld, int newType);
void sldoa_setSourcePreset(void* const hSld, int newPresetID);
/* ========================================================================== */
/* Get Functions */
/* ========================================================================== */
float sldoa_getProgressBar0_1(void* const hSld);
void sldoa_getProgressBarText(void* const hSld, char* text);
int sldoa_getMasterOrder(void* const hSld);
int sldoa_getSamplingRate(void* const hSld);
float sldoa_getMaxFreq(void* const hSld);
float sldoa_getMinFreq(void* const hSld);
float sldoa_getAvg(void* const hSld);
int sldoa_getNSHrequired(void* const hSld);
void sldoa_getDisplayData(void * const hSld,
float** pAzi_deg,
float** pElev_deg,
float** pColourScale,
float** pAlphaScale,
int** pNsectorsPerBand,
int* pMaxNumSectors,
int* pStartBand,
int* pEndBand);
int sldoa_getAnaOrder(void* const hSld, int bandIdx);
int sldoa_getAnaOrderAllBands(void* const hSld);
void sldoa_getAnaOrderHandle(void* const hSld,
float** pX_vector,
int** pY_values,
int* pNpoints);
int sldoa_getChOrder(void* const hSld);
int sldoa_getNormType(void* const hSld);
#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */
#endif /* __SLDOA_H_INCLUDED__ */
A bunch of things that are common to many of the saf examples.
CODEC_STATUS
Current status of the codec.
Definition _common.h:201
int sldoa_getNumberOfBands(void)
Returns the number frequency bands employed by sldoa.
Definition sldoa.c:621
int sldoa_getProcessingDelay(void)
Returns the processing delay in samples (may be used for delay compensation features)
Definition sldoa.c:644
void sldoa_destroy(void **const phSld)
Destroys an instance of the sldoa.
Definition sldoa.c:110
int sldoa_getMasterOrder(void *const hSld)
Returns the current maximum analysis/input order (see SH_ORDERS enum)
Definition sldoa.c:528
int sldoa_getAnaOrder(void *const hSld, int bandIdx)
Returns the input/analysis order for one specific frequency band.
Definition sldoa.c:595
int sldoa_getChOrder(void *const hSld)
Returns the Ambisonic channel ordering convention currently being used to decode with,...
Definition sldoa.c:632
void sldoa_refreshSettings(void *const hSld)
Sets all intialisation flags to 1; re-initialising all settings/variables as sldoa is currently confi...
Definition sldoa.c:372
void sldoa_initCodec(void *const hSld)
Intialises the codec variables, based on current global/user parameters.
Definition sldoa.c:177
int sldoa_getAnaOrderAllBands(void *const hSld)
Returns the input/analysis order for the first frequency band.
Definition sldoa.c:601
void sldoa_setChOrder(void *const hSld, int newOrder)
Sets the Ambisonic channel ordering convention to decode with, in order to match the convention emplo...
Definition sldoa.c:488
void sldoa_setSourcePreset(void *const hSld, int newPresetID)
Sets an input preset, the microphone/hyrophone array used to capture the input signals (see MIC_PRESE...
Definition sldoa.c:401
void sldoa_setMaxFreq(void *const hSld, float newFreq)
Sets the maximum analysis frequency, in Hz.
Definition sldoa.c:377
int sldoa_getFrameSize(void)
Returns the processing framesize (i.e., number of samples processed with every _process() call )
Definition sldoa.c:505
void sldoa_setAnaOrder(void *const hSld, int newValue, int bandIdx)
Sets the input/analysis order for one specific frequency band.
Definition sldoa.c:470
float sldoa_getMaxFreq(void *const hSld)
Returns the maximum analysis frequency, in Hz.
Definition sldoa.c:540
void sldoa_init(void *const hSld, float samplerate)
Initialises an instance of sldoa with default settings.
Definition sldoa.c:151
void sldoa_setNormType(void *const hSld, int newType)
Sets the Ambisonic normalisation convention to decode with, in order to match with the convention emp...
Definition sldoa.c:495
void sldoa_setAnaOrderAllBands(void *const hSld, int newValue)
Sets the input/analysis order for all frequency bands.
Definition sldoa.c:477
int sldoa_getNormType(void *const hSld)
Returns the Ambisonic normalisation convention currently being usedto decode with,...
Definition sldoa.c:638
void sldoa_getAnaOrderHandle(void *const hSld, float **pX_vector, int **pY_values, int *pNpoints)
Returns the input/analysis order for all frequency bands.
Definition sldoa.c:608
void sldoa_analysis(void *const hSld, const float *const *inputs, int nInputs, int nSamples, int isPlaying)
Applies the spatially-localised active-intensity based direction-of-arrival estimator (SLDoA) onto th...
Definition sldoa.c:206
float sldoa_getProgressBar0_1(void *const hSld)
(Optional) Returns current intialisation/processing progress, between 0..1
Definition sldoa.c:516
float sldoa_getAvg(void *const hSld)
Returns the current DoA averaging coefficient value, 0..1.
Definition sldoa.c:552
float sldoa_getMinFreq(void *const hSld)
Returns the minimum analysis frequency, in Hz.
Definition sldoa.c:546
CODEC_STATUS sldoa_getCodecStatus(void *const hSld)
Returns current codec status (see CODEC_STATUS enum)
Definition sldoa.c:510
void sldoa_setAvg(void *const hSld, float newAvg)
Sets the DoA averaging coefficient, 0..1.
Definition sldoa.c:395
int sldoa_getNSHrequired(void *const hSld)
Returns the number of spherical harmonic signals required by the current analysis order: (current_ord...
Definition sldoa.c:626
void sldoa_setMasterOrder(void *const hSld, int newValue)
Sets the maximum input/analysis order (see SH_ORDERS enum)
Definition sldoa.c:358
void sldoa_getProgressBarText(void *const hSld, char *text)
(Optional) Returns current intialisation/processing progress text
Definition sldoa.c:522
void sldoa_create(void **const phSld)
Creates an instance of the sldoa.
Definition sldoa.c:50
int sldoa_getSamplingRate(void *const hSld)
Returns the current sampling rate, in Hz.
Definition sldoa.c:534
void sldoa_getDisplayData(void *const hSld, float **pAzi_deg, float **pElev_deg, float **pColourScale, float **pAlphaScale, int **pNsectorsPerBand, int *pMaxNumSectors, int *pStartBand, int *pEndBand)
Returns the analysis output data.
Definition sldoa.c:560
void sldoa_setMinFreq(void *const hSld, float newFreq)
Sets the minimum analysis frequency, in Hz.
Definition sldoa.c:386