SAF
Loading...
Searching...
No Matches
sldoa.h
Go to the documentation of this file.
1/*
2 * Copyright 2017-2018 Leo McCormack
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 * PERFORMANCE OF THIS SOFTWARE.
15 */
16
57#ifndef __SLDOA_H_INCLUDED__
58#define __SLDOA_H_INCLUDED__
59
60#include "_common.h"
61
62#ifdef __cplusplus
63extern "C" {
64#endif /* __cplusplus */
65
66/* ========================================================================== */
67/* Main Functions */
68/* ========================================================================== */
69
75void sldoa_create(void** const phSld);
76
82void sldoa_destroy(void** const phSld);
83
92void sldoa_init(void* const hSld,
93 float samplerate);
94
110void sldoa_initCodec(void* const hSld);
111
134void sldoa_analysis(void* const hSld,
135 const float *const * inputs,
136 int nInputs,
137 int nSamples,
138 int isPlaying);
139
140
141/* ========================================================================== */
142/* Set Functions */
143/* ========================================================================== */
144
146void sldoa_setMasterOrder(void* const hSld, int newValue);
147
152void sldoa_refreshSettings(void* const hSld);
153
155void sldoa_setMaxFreq(void* const hSld, float newFreq);
156
158void sldoa_setMinFreq(void* const hSld, float newFreq);
159
161void sldoa_setAvg(void* const hSld, float newAvg);
162
164void sldoa_setAnaOrder(void* const hSld, int newValue, int bandIdx);
165
167void sldoa_setAnaOrderAllBands(void* const hSld, int newValue);
168
173void sldoa_setChOrder(void* const hSld, int newOrder);
174
179void sldoa_setNormType(void* const hSld, int newType);
180
185void sldoa_setSourcePreset(void* const hSld, int newPresetID);
186
187
188/* ========================================================================== */
189/* Get Functions */
190/* ========================================================================== */
191
196int sldoa_getFrameSize(void);
197
199CODEC_STATUS sldoa_getCodecStatus(void* const hSld);
200
206float sldoa_getProgressBar0_1(void* const hSld);
207
214void sldoa_getProgressBarText(void* const hSld, char* text);
215
217int sldoa_getMasterOrder(void* const hSld);
218
220int sldoa_getSamplingRate(void* const hSld);
221
223float sldoa_getMaxFreq(void* const hSld);
224
226float sldoa_getMinFreq(void* const hSld);
227
229float sldoa_getAvg(void* const hSld);
230
232int sldoa_getNumberOfBands(void);
233
238int sldoa_getNSHrequired(void* const hSld);
239
264void sldoa_getDisplayData(void * const hSld,
265 float** pAzi_deg,
266 float** pElev_deg,
267 float** pColourScale,
268 float** pAlphaScale,
269 int** pNsectorsPerBand,
270 int* pMaxNumSectors,
271 int* pStartBand,
272 int* pEndBand);
273
275int sldoa_getAnaOrder(void* const hSld, int bandIdx);
276
278int sldoa_getAnaOrderAllBands(void* const hSld);
279
288void sldoa_getAnaOrderHandle(void* const hSld,
289 float** pX_vector,
290 int** pY_values,
291 int* pNpoints);
292
298int sldoa_getChOrder(void* const hSld);
299
305int sldoa_getNormType(void* const hSld);
306
312
313
314#ifdef __cplusplus
315} /* extern "C" */
316#endif /* __cplusplus */
317
318#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