SAF
Loading...
Searching...
No Matches
binauraliser_nf.h

Convolves input audio (up to 64 channels) with interpolated HRTFs in the time-frequency domain, and applies optional near-field binaural filtering, as described in [1].

Convolves input audio (up to 64 channels) with interpolated HRTFs in the time-frequency domain, and applies optional near-field binaural filtering, as described in [1].

See also
[1] S. Spagnol, E. Tavazzi, and F. Avanzini, “Distance rendering and perception of nearby virtual sound sources with a near-field filter model,” Applied Acoustics, vol. 115, pp. 61–73, Jan. 2017, doi: 10.1016/j.apacoust.2016.08.015.

Files

binauraliser.h (include), binauraliser_internal.h, binauraliser_nf.h (include), binauraliser_nf_internal.h, binauraliser.c, binauraliser_internal.c, binauraliser_nf_internal.c, binauraliser_nf.c

Include Header

/*
* Copyright 2022 Michael McCrea, Leo McCormack
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef __BINAURALISER_NF_H_INCLUDED__
#define __BINAURALISER_NF_H_INCLUDED__
#include <binauraliser.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* ========================================================================== */
/* Main Functions */
/* ========================================================================== */
void binauraliserNF_create(void** const phBin);
void binauraliserNF_destroy(void** const phBin);
void binauraliserNF_init(void* const hBin,
int samplerate);
/* See the source definition for a note on redundancy with binauraliser_initCodec. */
void binauraliserNF_initCodec(void* const hBin);
void binauraliserNF_process(void* const hBin,
const float *const * inputs,
float* const* outputs,
int nInputs,
int nOutputs,
int nSamples);
void binauraliserNF_processFD(void* const hBin,
const float *const * inputs,
float* const* outputs,
int nInputs,
int nOutputs,
int nSamples);
/* ========================================================================== */
/* Set Functions */
/* ========================================================================== */
void binauraliserNF_setSourceDist_m(void* const hBin,
int index,
float newDist_m);
int newPresetID);
/* ========================================================================== */
/* Get Functions */
/* ========================================================================== */
float binauraliserNF_getSourceDist_m(void* const hBin, int index);
float binauraliserNF_getFarfieldThresh_m(void* const hBin);
float binauraliserNF_getFarfieldHeadroom(void* const hBin);
float binauraliserNF_getNearfieldLimit_m(void* const hBin);
#ifdef __cplusplus
} /* extern "C" { */
#endif /* __cplusplus */
#endif /* __BINAURALISER_NF_H_INCLUDED__ */
Convolves input audio (up to 64 channels) with interpolated HRTFs in the time-frequency domain.
float binauraliserNF_getNearfieldLimit_m(void *const hBin)
Returns the minimum distance possible for near field filter, in METERS.
void binauraliserNF_processFD(void *const hBin, const float *const *inputs, float *const *outputs, int nInputs, int nOutputs, int nSamples)
Alternate version of binauraliserNF_process() that performs frequency-domain DVF filtering.
void binauraliserNF_init(void *const hBin, int samplerate)
Initialises an instance of binauraliser with default settings.
float binauraliserNF_getSourceDist_m(void *const hBin, int index)
Returns the source elevation for a given index, in METERS.
void binauraliserNF_create(void **const phBin)
Creates an instance of the binauraliser.
void binauraliserNF_destroy(void **const phBin)
Destroys an instance of the binauraliser.
void binauraliserNF_setInputConfigPreset(void *const hBin, int newPresetID)
Loads an input preset (see SOURCE_CONFIG_PRESETS enum)
float binauraliserNF_getFarfieldThresh_m(void *const hBin)
Returns the distance considered to be the far field (beyond which no near field filtering is applied)...
void binauraliserNF_setSourceDist_m(void *const hBin, int index, float newDist_m)
Sets the panning distance for a specific channel index, in METERS.
float binauraliserNF_getFarfieldHeadroom(void *const hBin)
Returns the scaling factor to give the far field threshold headroom (useful for UI range limits)
void binauraliserNF_initCodec(void *const hBin)
Intialises the codec variables, based on current global/user parameters.
void binauraliserNF_process(void *const hBin, const float *const *inputs, float *const *outputs, int nInputs, int nOutputs, int nSamples)
Binauralises the input signals at the user specified directions.