38#ifndef __SAF_HADES_INTERNAL_H_INCLUDED__
39#define __SAF_HADES_INTERNAL_H_INCLUDED__
50#ifdef SAF_ENABLE_HADES_MODULE
53#define HADES_MAX_BLOCKSIZE ( 4096 )
65typedef struct _hades_analysis_data
111typedef struct _hades_synthesis_data
169typedef struct _hades_param_container_data {
184typedef struct _hades_radial_editor_data {
193typedef struct _hades_signal_container_data {
227 float* target_dirs_deg,
230 float_complex* hrtf_interp);
242 float* grid_dirs_deg,
271 float_complex* A_grid,
Main include header for the Spatial_Audio_Framework (SAF)
Include header for SAF externals.
Header for the HADES analysis (SAF_HADES_MODULE)
#define HADES_MAX_NMICS
Maximum number of microphones.
struct _hades_analysis_data * hades_analysis_handle
Handle for the hades analysis data.
HADES_FILTERBANKS
Filterbank options.
HADES_DOA_ESTIMATORS
Options for DoA estimation for hades_analysis.
HADES_DIFFUSENESS_ESTIMATORS
Options for diffuseness estimation for hades_analysis.
void hades_sdMUSIC_destroy(void **const phMUSIC)
Destroys an instance of the spherical harmonic domain MUSIC implementation, which may be used for com...
void hades_sdMUSIC_create(void **const phMUSIC, int nMics, float *grid_dirs_deg, int nDirs)
Creates an instance of the space-domain MUSIC implementation.
void hades_getInterpolatedHRTFs(hades_analysis_handle const hAna, HADES_HRTF_INTERP_OPTIONS interpOption, hades_binaural_config *binConfig, float *target_dirs_deg, int nTargetDirs, float_complex *hrtf_interp)
Binaural filter interpolator.
void hades_sdMUSIC_compute(void *const hMUSIC, float_complex *A_grid, float_complex *Vn, int nSrcs, float *P_music, int *peak_inds)
Computes a pseudo-spectrum based on the MUSIC algorithm optionally returning the grid indices corresp...
float hades_comedie(float *lambda, int N)
Returns an estimate of the diffuseness, based on [1].
Header for the HADES synthesis (SAF_HADES_MODULE)
HADES_BEAMFORMER_TYPE
Beamforming options for hades_synthesis.
HADES_HRTF_INTERP_OPTIONS
HRTF interpolation options for hades_synthesis.
Helper struct for averaging covariance matrices (block-wise)
Main structure for hades analysis.
int nMics
Number of microphones.
float covAvgCoeff
Temporal averaging coefficient [0 1].
float_complex ** T
for covariance whitening; nBands x (nMics x nMics)
int blocksize
Number of samples to process at a time (note that 1 doa and diffuseness estimate is made per block)
int hybridmode
Optionally, the lowest TF bands may be subdivided to improve low-freq resolution.
void * hEig
handle for the eigen solver
float_complex * DCM_array
Diffuse covariance matrix (computed over all grid directions and weighted); FLAT: nBands x nMics x nM...
float * grid_dirs_xyz
Scanning grid coordinates (unit vectors and only used by grid-based estimators); FLAT: nGrid x 3.
float * h_array
Array impulse responses; FLAT: nGrid x nMics x h_len.
float * freqVector
Centre frequencies; nBands x 1.
HADES_DOA_ESTIMATORS doaOpt
see HADES_DOA_ESTIMATORS
float * grid_dirs_deg
Array grid dirs in degrees; FLAT: nGrid x 2.
float ** inputBlock
Input frame; nMics x blocksize.
int hopsize
Filterbank hop size (blocksize must be divisable by this.
float_complex * V
Eigen vectors; FLAT: nMics x nMics.
HADES_FILTERBANKS fbOpt
see HADES_FILTERBANKS
float_complex * H_array_w
Array IRs in the frequency domain spatially weightend; FLAT: nBands x nMics x nDirs.
void * hFB_enc
Time-frequency transform handle.
float_complex * W
Diffuse integration weighting matrix; FLAT: nGrid x nGrid.
int h_len
Length of impulse responses, in samples.
float * lambda
Eigenvalues; nMics x 1.
CxMic * Cx
Current (time-averaged) covariance matrix per band; nBands x 1.
float_complex * H_array
Array IRs in the frequency domain; FLAT: nBands x nMics x nDirs.
float fs
Host samplerate, Hz.
int filterbankDelay
Filterbank delay, in time-domain samples.
int nBands
Number of frequency bands.
void * hDoA
DoA estimator handle.
int timeSlots
Number of time slots.
float_complex * Vn
Noise subspace; FLAT: nMics x (nMics-1)
HADES_DIFFUSENESS_ESTIMATORS diffOpt
see HADES_DIFFUSENESS_ESTIMATORS
int nGrid
Number of grid/scanning directions.
Binaural configuration struct.
Parameter container to store the data from an analyser for one blocksize of audio.
int * gains_idx
Reproduction direction index per band; nBands x 1.
int * doa_idx
Beamforming direction index per band; nBands x 1.
float * diffuseness
Diffuseness value per band; nBands x 1.
float * gains_diff
Extra diffuse reproduction gain per band (default=1.0f); nBands x 1
int nBands
Number of bands.
float * gains_dir
Extra direct reproduction gain per band (default=1.0f); nBands x 1
Main structure for hades radial (360degree) gain and direct-to-diffuse ratio editor.
float * pGrid_dirs_deg
Pointer to grid dirs in degrees; FLAT: nGrid x 2.
float * pGrid_dirs_xyz
Pointer to grid dirs as Cartesian coordinates of unit length; FLAT: nGrid x 3.
int nGrid
Number of grid/scanning directions.
int nBands
Number of bands.
Signal container to store one block of TF-domain audio data.
int nBands
Number of bands in the time-frequency transform.
int nMics
Number of spherical harmonic components.
int timeSlots
Number of time frames in time-frequency transform.
CxMic * Cx
NON-time-averaged covariance matrix per band; nBands x .Cx(nMics x nMics)
float_complex *** inTF
Input frame in TF-domain; nBands x nMics x timeSlots.
Main structure for hades synthesis.
float ** outTD
output time-domain buffer; NUM_EARS x blocksize
void * hLinSolve
Handle for solving linear equations (Ax=b)
int blocksize
blocksize in samples
void * hCDF
Handle for solving the covariance matching problem.
float_complex ** M
Mixing matrix per band; nBands x FLAT: (NUM_EARS x nMics)
float synAvgCoeff
Mixing matrix averaging coefficent [0..1].
HADES_FILTERBANKS fbOpt
Filterbank option, see HADES_FILTERBANKS.
float_complex * new_M
New mixing matrix (not yet temporally averaged); FLAT: NUM_EARS x nMics.
int nBands
Number of bands in the time-frequency transform domain.
float_complex * H_array
Array IRs in the frequency domain; FLAT: nBands x nMics x nGrid.
float_complex * As
Array steering vector for DoA; FLAT: nMics x 1.
float * eq
Gain factor per band; nBands x 1.
int timeSlots
Number of time frames in the time-frequency transform domain.
float_complex * H_bin
To spatialise the source beamformers; FLAT: nBands x NUM_EARS x nGrid.
HADES_BEAMFORMER_TYPE beamOption
see HADES_BEAMFORMER_TYPE
int enableCM
Flag: whether the spatial covariance matching is enabled (1) or disabled (0)
hades_binaural_config * binConfig
Internal copy of user configuration.
float * freqVector
Frequency vector (band centre frequencies); nBands x 1.
float * grid_dirs_deg
Array grid dirs in degrees; FLAT: nGrid x 2.
int nGrid
Number of grid/scanning directions.
float_complex * Q
Mixing matrix for the direct and diffuse streams combined (based on the diffuseness value); FLAT: NUM...
float_complex * As_r
Array steering vector relative to right reference sensor; FLAT: nMics x 1.
float * diffEQ
EQ curve to bring the overall diffuse-field magnitude response of the array to that of the HRTFs inst...
void * hPinv
Handle for computing the Moore-Penrose pseudo inverse.
float_complex * DCM_array
Diffuse coherence matrix for the array; FLAT: nBands x nMics x nMics.
int hopsize
hopsize in samples
float_complex * Cy
Target binaural spatial covariance matrix; FLAT: NUM_EARS x NUM_EARS.
float_complex *** outTF
nBands x NUM_EARS x timeSlots
float ** grid_dirs_xyz
Grid dirs as Cartesian coordinates of unit length; nGrid x 3.
float_complex * Q_dir
Mixing matrix for the direct stream; FLAT: NUM_EARS x nMics.
float_complex * DCM_bin_norm
Diffuse coherence matrix for the HRTF set, normalised with 1/trace(DCM_bin); FLAT: nBands x nMics x n...
float_complex * W
Diffuse integration weighting matrix; FLAT: nGrid x nGrid.
float_complex * Q_diff
Mixing matrix for the diffuse stream; FLAT: NUM_EARS x nMics.
HADES_HRTF_INTERP_OPTIONS interpOption
HRIR interpolation option, see HADES_HRTF_INTERP_OPTIONS.
float_complex * As_l
Array steering vector relative to left reference sensor; FLAT: nMics x 1.
void * hFB_dec
Filterbank handle.
int nMics
Number of microphones.
float * streamBalance
Stream balance per band (0:fully diffuse, 1:balanced, 2:fully direct); nBands x 1.