SAF
Loading...
Searching...
No Matches
saf_hades_synthesis.c File Reference

Source file for the HADES synthesis (SAF_HADES_MODULE) More...

Go to the source code of this file.

Functions

void hades_radial_editor_create (hades_radial_editor_handle *const phREd, hades_analysis_handle const hAna)
 Creates and returns a handle to an instance of a hades radial editor object, which allows for direction-dependent (360degree) manipulation of gains.
 
void hades_radial_editor_destroy (hades_radial_editor_handle *const phREd)
 Destroys an instance of a hades radial editor object.
 
void hades_radial_editor_apply (hades_radial_editor_handle const hREd, hades_param_container_handle const hPCon, float dirGain_dB[360])
 Applies the radial (360 degree) parameter editing.
 
void hades_synthesis_create (hades_synthesis_handle *const phSyn, hades_analysis_handle const hAna, HADES_BEAMFORMER_TYPE beamOption, int enableCM, int refIndices[2], hades_binaural_config *binConfig, HADES_HRTF_INTERP_OPTIONS interpOption)
 Creates and returns a handle to an instance of a hades synthesis object.
 
void hades_synthesis_destroy (hades_synthesis_handle *const phSyn)
 Destroys an instance of hades synthesis.
 
void hades_synthesis_reset (hades_synthesis_handle const hSyn)
 Flushes run-time buffers with zeros.
 
void hades_synthesis_apply (hades_synthesis_handle const hSyn, hades_param_container_handle const hPCon, hades_signal_container_handle const hSCon, int nChannels, int blocksize, float **output)
 Performs hades synthesis.
 
float * hades_synthesis_getEqPtr (hades_synthesis_handle const hSyn, int *nBands)
 Returns a pointer to the eq vector, which can be changed at run-time.
 
float * hades_synthesis_getStreamBalancePtr (hades_synthesis_handle const hSyn, int *nBands)
 Returns a pointer to the stream balance vector [0..2], which can be changed at run-time.
 
float * hades_synthesis_getSynthesisAveragingCoeffPtr (hades_synthesis_handle const hSyn)
 Returns a pointer to the synthesis averaging coefficient scalar [0..1], which can be changed at run-time.
 
int hades_synthesis_getProcDelay (hades_synthesis_handle const hSyn)
 Returns the synthesiser processing delay, in samples.
 

Detailed Description

Source file for the HADES synthesis (SAF_HADES_MODULE)

The framework for binaural rendering of Hearing-Assistive/Augmented-reality Devices (HADES) is described further in [1].

See also
[1] Fernandez, J., McCormack, L., Hyvärinen, P., Politis, A., and Pulkki, V. 2022. “Enhancing binaural rendering of head-worn microphone arrays through the use of adaptive spatial covariance matching”, The Journal of the Acoustical Society of America 151, 2624-2635
Author
Leo McCormack and Janani Fernandez
Date
01.02.2021
License
GNU GPLv2

Definition in file saf_hades_synthesis.c.

Function Documentation

◆ hades_radial_editor_apply()

void hades_radial_editor_apply ( hades_radial_editor_handle const hREd,
hades_param_container_handle const hPCon,
float dirGain_dB[360] )

Applies the radial (360 degree) parameter editing.

Parameters
[in]hREdhades radial editor handle
[in]hPConhades parameter container handle
[in]dirGain_dBExtra directional gains for the direct stream, in dB

Definition at line 77 of file saf_hades_synthesis.c.

◆ hades_radial_editor_create()

void hades_radial_editor_create ( hades_radial_editor_handle *const phREd,
hades_analysis_handle const hAna )

Creates and returns a handle to an instance of a hades radial editor object, which allows for direction-dependent (360degree) manipulation of gains.

Parameters
[in]phREd(&) address of hades radial editor handle
[in]hAnahades analysis handle

Definition at line 47 of file saf_hades_synthesis.c.

◆ hades_radial_editor_destroy()

void hades_radial_editor_destroy ( hades_radial_editor_handle *const phREd)

Destroys an instance of a hades radial editor object.

Parameters
[in]phREd(&) address of hades radial editor handle

Definition at line 63 of file saf_hades_synthesis.c.

◆ hades_synthesis_apply()

void hades_synthesis_apply ( hades_synthesis_handle const hSyn,
hades_param_container_handle const hPCon,
hades_signal_container_handle const hSCon,
int nChannels,
int blocksize,
float ** output )

Performs hades synthesis.

Note
If nChannels is higher than the number required by the configuration, then these extra channels are zero'd. If there are too few, then the channels are truncated.
Parameters
[in]hSynhades synthesis handle
[in]hPConhades parameter container handle
[in]hSConhades signal container handle
[in]nChannelsNumber of channels in output buffer
[in]blocksizeNumber of samples in output buffer
[out]outputOutput buffer; nChannels x blocksize

Definition at line 308 of file saf_hades_synthesis.c.

◆ hades_synthesis_create()

void hades_synthesis_create ( hades_synthesis_handle *const phSyn,
hades_analysis_handle const hAna,
HADES_BEAMFORMER_TYPE beamOption,
int enableCM,
int refIndices[2],
hades_binaural_config * binConfig,
HADES_HRTF_INTERP_OPTIONS interpOption )

Creates and returns a handle to an instance of a hades synthesis object.

Parameters
[in]phSyn(&) address of hades synthesis handle
[in]hAnahades analysis handle
[in]beamOptionsee HADES_BEAMFORMER_TYPE
[in]enableCM0: disabled, 1: enable covariance matching
[in]binConfigBinaural configuration
[in]interpOptionsee HADES_HRTF_INTERP_OPTIONS

Definition at line 106 of file saf_hades_synthesis.c.

◆ hades_synthesis_destroy()

void hades_synthesis_destroy ( hades_synthesis_handle *const phSyn)

Destroys an instance of hades synthesis.

Parameters
[in]phSyn(&) address of hades synthesis handle

Definition at line 234 of file saf_hades_synthesis.c.

◆ hades_synthesis_getEqPtr()

float * hades_synthesis_getEqPtr ( hades_synthesis_handle const hSyn,
int * nBands )

Returns a pointer to the eq vector, which can be changed at run-time.

Parameters
[in]hSynhades synthesis handle
[out]nBands(&) Number of bands (set to NULL if not needed)
Returns
pointer to the eq vector (or NULL if hSyn is not initialised); nBands x 1

Definition at line 499 of file saf_hades_synthesis.c.

◆ hades_synthesis_getProcDelay()

int hades_synthesis_getProcDelay ( hades_synthesis_handle const hSyn)

Returns the synthesiser processing delay, in samples.

Note
This is not inclusive of the time-frequency transform delay, as you may get this using hades_analysis_getProcDelay(). The total delay is: hades_analysis_getProcDelay() + hades_synthesis_getProcDelay().

Definition at line 546 of file saf_hades_synthesis.c.

◆ hades_synthesis_getStreamBalancePtr()

float * hades_synthesis_getStreamBalancePtr ( hades_synthesis_handle const hSyn,
int * nBands )

Returns a pointer to the stream balance vector [0..2], which can be changed at run-time.

Parameters
[in]hSynhades synthesis handle
[out]nBands(&) Number of bands (set to NULL if not needed)
Returns
pointer to the stream balance vector (or NULL if hSyn is not initialised); nBands x 1

Definition at line 517 of file saf_hades_synthesis.c.

◆ hades_synthesis_getSynthesisAveragingCoeffPtr()

float * hades_synthesis_getSynthesisAveragingCoeffPtr ( hades_synthesis_handle const hSyn)

Returns a pointer to the synthesis averaging coefficient scalar [0..1], which can be changed at run-time.

Parameters
[in]hSynhades synthesis handle
Returns
pointer to the mixing matrix averaging coeff scalar (or NULL if hSyn is not initialised); 1 x 1

Definition at line 535 of file saf_hades_synthesis.c.

◆ hades_synthesis_reset()

void hades_synthesis_reset ( hades_synthesis_handle const hSyn)

Flushes run-time buffers with zeros.

Call this ONCE before calling hades_synthesis_apply()

Parameters
[in]hSynhades synthesis handle

Definition at line 290 of file saf_hades_synthesis.c.