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
44
extern
"C"
{
45
#endif
/* __cplusplus */
46
47
/* ========================================================================== */
48
/* Main Functions */
49
/* ========================================================================== */
50
56
void
beamformer_create
(
void
**
const
phBeam);
57
63
void
beamformer_destroy
(
void
**
const
phBeam);
64
71
void
beamformer_init
(
void
*
const
hBeam,
72
int
samplerate);
73
84
void
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
100
void
beamformer_refreshSettings
(
void
*
const
hBeam);
101
110
void
beamformer_setBeamOrder
(
void
*
const
hBeam,
int
newValue);
111
113
void
beamformer_setBeamAzi_deg
(
void
*
const
hBeam,
int
index,
float
newAzi_deg);
114
116
void
beamformer_setBeamElev_deg
(
void
*
const
hBeam,
int
index,
float
newElev_deg);
117
119
void
beamformer_setNumBeams
(
void
*
const
hBeam,
int
new_nBeams);
120
125
void
beamformer_setChOrder
(
void
*
const
hBeam,
int
newOrder);
126
131
void
beamformer_setNormType
(
void
*
const
hBeam,
int
newType);
132
134
void
beamformer_setBeamType
(
void
*
const
hBeam,
int
newID);
135
136
137
/* ========================================================================== */
138
/* Get Functions */
139
/* ========================================================================== */
140
145
int
beamformer_getFrameSize
(
void
);
146
148
int
beamformer_getBeamOrder
(
void
*
const
hBeam);
149
151
float
beamformer_getBeamAzi_deg
(
void
*
const
hBeam,
int
index);
152
154
float
beamformer_getBeamElev_deg
(
void
*
const
hBeam,
int
index);
155
157
int
beamformer_getNumBeams
(
void
*
const
hBeam);
158
160
int
beamformer_getMaxNumBeams
(
void
);
161
166
int
beamformer_getNSHrequired
(
void
*
const
hBeam);
167
173
int
beamformer_getChOrder
(
void
*
const
hBeam);
174
180
int
beamformer_getNormType
(
void
*
const
hBeam);
181
183
int
beamformer_getBeamType
(
void
*
const
hBeam);
184
189
int
beamformer_getProcessingDelay
(
void
);
190
191
192
#ifdef __cplusplus
193
}
/* extern "C" { */
194
#endif
/* __cplusplus */
195
196
#endif
/* __BEAMFORMER_H_INCLUDED__ */
_common.h
A bunch of things that are common to many of the saf examples.
beamformer_getBeamAzi_deg
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
beamformer_getBeamElev_deg
float beamformer_getBeamElev_deg(void *const hBeam, int index)
Returns the beamformer elevation direction of a given index, in DEGREES.
Definition
beamformer.c:294
beamformer_setBeamType
void beamformer_setBeamType(void *const hBeam, int newID)
Sets the beamforming approach to employ (see STATIC_BEAM_TYPES enum)
Definition
beamformer.c:266
beamformer_getChOrder
int beamformer_getChOrder(void *const hBeam)
Returns the Ambisonic channel ordering convention currently being used to decode with,...
Definition
beamformer.c:317
beamformer_getProcessingDelay
int beamformer_getProcessingDelay(void)
Returns the processing delay in samples (may be used for delay compensation features)
Definition
beamformer.c:335
beamformer_getNumBeams
int beamformer_getNumBeams(void *const hBeam)
Returns the number of beamformers being generated.
Definition
beamformer.c:300
beamformer_create
void beamformer_create(void **const phBeam)
Creates an instance of beamformer.
Definition
beamformer.c:30
beamformer_setBeamOrder
void beamformer_setBeamOrder(void *const hBeam, int newValue)
Sets the beamforming order (see SH_ORDERS enum)
Definition
beamformer.c:207
beamformer_setChOrder
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
beamformer_getBeamType
int beamformer_getBeamType(void *const hBeam)
Returns the beamforming approach employed (see STATIC_BEAM_TYPES enum)
Definition
beamformer.c:329
beamformer_setNumBeams
void beamformer_setNumBeams(void *const hBeam, int new_nBeams)
Sets the number of beamformers to generate.
Definition
beamformer.c:241
beamformer_init
void beamformer_init(void *const hBeam, int samplerate)
Initialises an instance of beamformer with default settings.
Definition
beamformer.c:72
beamformer_getNSHrequired
int beamformer_getNSHrequired(void *const hBeam)
Returns the number of spherical harmonic signals required by the currently selected beamforming order...
Definition
beamformer.c:311
beamformer_getFrameSize
int beamformer_getFrameSize(void)
Returns the processing framesize (i.e., number of samples processed with every _process() call )
Definition
beamformer.c:277
beamformer_destroy
void beamformer_destroy(void **const phBeam)
Destroys an instance of beamformer.
Definition
beamformer.c:57
beamformer_getMaxNumBeams
int beamformer_getMaxNumBeams(void)
Returns the maximum number of beamformers permitted.
Definition
beamformer.c:306
beamformer_process
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
beamformer_getBeamOrder
int beamformer_getBeamOrder(void *const hBeam)
Returns the beamforming order (see SH_ORDERS enum)
Definition
beamformer.c:282
beamformer_setBeamElev_deg
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
beamformer_setBeamAzi_deg
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
beamformer_refreshSettings
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
beamformer_setNormType
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
beamformer_getNormType
int beamformer_getNormType(void *const hBeam)
Returns the Ambisonic normalisation convention currently being usedto decode with,...
Definition
beamformer.c:323
examples
include
beamformer.h
Generated on Fri Feb 2 2024 09:00:59 for SAF by
1.10.0