SAF
Loading...
Searching...
No Matches
saf_hades_analysis.h
Go to the documentation of this file.
1/*
2 * This file is part of the saf_hades module.
3 * Copyright (c) 2021 - Leo McCormack & Janani Fernandez
4 *
5 * The saf_hades module is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 *
10 * The saf_hades module is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * See <http://www.gnu.org/licenses/> for a copy of the GNU General Public
16 * License.
17 */
18
38#ifndef __SAF_HADES_ANALYSIS_H_INCLUDED__
39#define __SAF_HADES_ANALYSIS_H_INCLUDED__
40
41#ifdef __cplusplus
42extern "C" {
43#endif /* __cplusplus */
44
45#ifdef SAF_ENABLE_HADES_MODULE
46
48#define HADES_MAX_NMICS ( 64 )
49
51typedef struct _hades_analysis_data* hades_analysis_handle;
52
54typedef struct _hades_param_container_data* hades_param_container_handle;
55
57typedef struct _hades_signal_container_data* hades_signal_container_handle;
58
59/* ========================================================================== */
60/* HADES Analysis Configurations Options */
61/* ========================================================================== */
62
73
78
84
85
86/* ========================================================================== */
87/* HADES Analysis */
88/* ========================================================================== */
89
108void hades_analysis_create(/* Input Arguments */
109 hades_analysis_handle* const phAna,
110 float fs,
111 HADES_FILTERBANKS fbOption,
112 int hopsize,
113 int blocksize,
114 int hybridmode,
115 float* h_array,
116 float* grid_dirs_deg,
117 int nGrid,
118 int nMics,
119 int h_len,
121 HADES_DOA_ESTIMATORS doaOption);
122
128void hades_analysis_destroy(/* Input Arguments */
129 hades_analysis_handle* const phAna);
130
139
160void hades_analysis_apply(/* Input Arguments */
161 hades_analysis_handle const hAna,
162 float** input,
163 int nChannels,
164 int blocksize,
165 /* Output Arguments */
166 void* const hPCon,
167 void* const hSCon);
168
177const float* hades_analysis_getFrequencyVectorPtr(/* Input Arguments */
178 hades_analysis_handle const hAna,
179 /* Output Arguments */
180 int* nBands);
181
184
194
203
204
205/* ========================================================================== */
206/* Parameter and Signal Containers */
207/* ========================================================================== */
208
221void hades_param_container_create(/* Input Arguments */
222 hades_param_container_handle* const phPCon,
223 hades_analysis_handle const hAna);
224
230void hades_param_container_destroy(/* Input Arguments */
231 hades_param_container_handle* const phPCon);
232
246 hades_analysis_handle const hAna);
247
253void hades_signal_container_destroy(/* Input Arguments */
254 hades_signal_container_handle* const phSCon);
255
256#endif /* SAF_ENABLE_HADES_MODULE */
257
258
259#ifdef __cplusplus
260} /* extern "C" */
261#endif /* __cplusplus */
262
263#endif /* __SAF_HADES_ANALYSIS_H_INCLUDED__ */
void hades_analysis_reset(hades_analysis_handle const hAna)
Flushes run-time buffers with zeros.
const float * hades_analysis_getFrequencyVectorPtr(hades_analysis_handle const hAna, int *nBands)
Returns a pointer to the frequency vector (read-only)
int hades_analysis_getProcDelay(hades_analysis_handle const hAna)
Returns the analyser processing delay, in samples.
void hades_param_container_destroy(hades_param_container_handle *const phPCon)
Destroys an instance of a hades parameter container.
void hades_analysis_destroy(hades_analysis_handle *const phAna)
Destroys an instance of a hades analysis object.
void hades_signal_container_create(hades_signal_container_handle *const phSCon, hades_analysis_handle const hAna)
Creates an instance of a container used for storing the TF-domain audio returned by an analyser for o...
void hades_analysis_create(hades_analysis_handle *const phAna, float fs, HADES_FILTERBANKS fbOption, int hopsize, int blocksize, int hybridmode, float *h_array, float *grid_dirs_deg, int nGrid, int nMics, int h_len, HADES_DIFFUSENESS_ESTIMATORS diffOption, HADES_DOA_ESTIMATORS doaOption)
Creates and returns a handle to an instance of a hades analysis object.
struct _hades_analysis_data * hades_analysis_handle
Handle for the hades analysis data.
void hades_param_container_create(hades_param_container_handle *const phPCon, hades_analysis_handle const hAna)
Creates an instance of a container used for storing the parameters estimated by an analyser for one '...
int hades_analysis_getNbands(hades_analysis_handle const hAna)
Returns number of frequency bands (0 if hAna is not initialised)
struct _hades_param_container_data * hades_param_container_handle
Handle for the hades parameter container data.
struct _hades_signal_container_data * hades_signal_container_handle
Handle for the hades signal container data.
HADES_FILTERBANKS
Filterbank options.
@ HADES_USE_AFSTFT
Alias-free STFT filterbank.
@ HADES_USE_AFSTFT_LD
Alias-free STFT filterbank (low delay)
HADES_DOA_ESTIMATORS
Options for DoA estimation for hades_analysis.
@ HADES_USE_MUSIC
Use MUSIC.
float * hades_analysis_getCovarianceAvagingCoeffPtr(hades_analysis_handle const hAna)
Returns a pointer to the covariance matrix averaging scalar [0..1], which can be changed at run-time.
void hades_analysis_apply(hades_analysis_handle const hAna, float **input, int nChannels, int blocksize, void *const hPCon, void *const hSCon)
Performs hades encoding: forward time-frequency transform, diffuseness and DoA estimation per band.
void hades_signal_container_destroy(hades_signal_container_handle *const phSCon)
Destroys an instance of a hades signal container.
HADES_DIFFUSENESS_ESTIMATORS
Options for diffuseness estimation for hades_analysis.
@ HADES_USE_COMEDIE
As in [1], after spatially whitening the array SCM.