SAF
Loading...
Searching...
No Matches
beamformer.h
Go to the documentation of this file.
1/*
2 * Copyright 2019 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
38#ifndef __BEAMFORMER_H_INCLUDED__
39#define __BEAMFORMER_H_INCLUDED__
40
41#include "_common.h"
42
43#ifdef __cplusplus
44extern "C" {
45#endif /* __cplusplus */
46
47/* ========================================================================== */
48/* Main Functions */
49/* ========================================================================== */
50
56void beamformer_create(void** const phBeam);
57
63void beamformer_destroy(void** const phBeam);
64
71void beamformer_init(void* const hBeam,
72 int samplerate);
73
84void beamformer_process(void* const hBeam,
85 const float *const * inputs,
86 float* const* outputs,
87 int nInputs,
88 int nOutputs,
89 int nSamples);
90
91
92/* ========================================================================== */
93/* Set Functions */
94/* ========================================================================== */
95
100void beamformer_refreshSettings(void* const hBeam);
101
110void beamformer_setBeamOrder(void* const hBeam, int newValue);
111
113void beamformer_setBeamAzi_deg(void* const hBeam, int index, float newAzi_deg);
114
116void beamformer_setBeamElev_deg(void* const hBeam, int index, float newElev_deg);
117
119void beamformer_setNumBeams(void* const hBeam, int new_nBeams);
120
125void beamformer_setChOrder(void* const hBeam, int newOrder);
126
131void beamformer_setNormType(void* const hBeam, int newType);
132
134void beamformer_setBeamType(void* const hBeam, int newID);
135
136
137/* ========================================================================== */
138/* Get Functions */
139/* ========================================================================== */
140
146
148int beamformer_getBeamOrder(void* const hBeam);
149
151float beamformer_getBeamAzi_deg(void* const hBeam, int index);
152
154float beamformer_getBeamElev_deg(void* const hBeam, int index);
155
157int beamformer_getNumBeams(void* const hBeam);
158
161
166int beamformer_getNSHrequired(void* const hBeam);
167
173int beamformer_getChOrder(void* const hBeam);
174
180int beamformer_getNormType(void* const hBeam);
181
183int beamformer_getBeamType(void* const hBeam);
184
190
191
192#ifdef __cplusplus
193} /* extern "C" { */
194#endif /* __cplusplus */
195
196#endif /* __BEAMFORMER_H_INCLUDED__ */
A bunch of things that are common to many of the saf examples.
float beamformer_getBeamAzi_deg(void *const hBeam, int index)
Returns the beamformer azimuth direction of a given index h, in DEGREES.
Definition beamformer.c:288
float beamformer_getBeamElev_deg(void *const hBeam, int index)
Returns the beamformer elevation direction of a given index, in DEGREES.
Definition beamformer.c:294
void beamformer_setBeamType(void *const hBeam, int newID)
Sets the beamforming approach to employ (see STATIC_BEAM_TYPES enum)
Definition beamformer.c:266
int beamformer_getChOrder(void *const hBeam)
Returns the Ambisonic channel ordering convention currently being used to decode with,...
Definition beamformer.c:317
int beamformer_getProcessingDelay(void)
Returns the processing delay in samples (may be used for delay compensation features)
Definition beamformer.c:335
int beamformer_getNumBeams(void *const hBeam)
Returns the number of beamformers being generated.
Definition beamformer.c:300
void beamformer_create(void **const phBeam)
Creates an instance of beamformer.
Definition beamformer.c:30
void beamformer_setBeamOrder(void *const hBeam, int newValue)
Sets the beamforming order (see SH_ORDERS enum)
Definition beamformer.c:207
void beamformer_setChOrder(void *const hBeam, int newOrder)
Sets the Ambisonic channel ordering convention to decode with, in order to match the convention emplo...
Definition beamformer.c:252
int beamformer_getBeamType(void *const hBeam)
Returns the beamforming approach employed (see STATIC_BEAM_TYPES enum)
Definition beamformer.c:329
void beamformer_setNumBeams(void *const hBeam, int new_nBeams)
Sets the number of beamformers to generate.
Definition beamformer.c:241
void beamformer_init(void *const hBeam, int samplerate)
Initialises an instance of beamformer with default settings.
Definition beamformer.c:72
int beamformer_getNSHrequired(void *const hBeam)
Returns the number of spherical harmonic signals required by the currently selected beamforming order...
Definition beamformer.c:311
int beamformer_getFrameSize(void)
Returns the processing framesize (i.e., number of samples processed with every _process() call )
Definition beamformer.c:277
void beamformer_destroy(void **const phBeam)
Destroys an instance of beamformer.
Definition beamformer.c:57
int beamformer_getMaxNumBeams(void)
Returns the maximum number of beamformers permitted.
Definition beamformer.c:306
void beamformer_process(void *const hBeam, const float *const *inputs, float *const *outputs, int nInputs, int nOutputs, int nSamples)
Generates beamformers/virtual microphones in the specified directions.
Definition beamformer.c:96
int beamformer_getBeamOrder(void *const hBeam)
Returns the beamforming order (see SH_ORDERS enum)
Definition beamformer.c:282
void beamformer_setBeamElev_deg(void *const hBeam, int index, float newElev_deg)
Sets a beamformer elevation direction for a given index, in DEGREES.
Definition beamformer.c:232
void beamformer_setBeamAzi_deg(void *const hBeam, int index, float newAzi_deg)
Sets a beamformer azimuth direction of a given index, in DEGREES.
Definition beamformer.c:221
void beamformer_refreshSettings(void *const hBeam)
Sets all intialisation flags to 1; re-initialising all settings/variables as beamformer is currently ...
Definition beamformer.c:199
void beamformer_setNormType(void *const hBeam, int newType)
Sets the Ambisonic normalisation convention to decode with, in order to match with the convention emp...
Definition beamformer.c:259
int beamformer_getNormType(void *const hBeam)
Returns the Ambisonic normalisation convention currently being usedto decode with,...
Definition beamformer.c:323