33#ifndef __BINAURALISER_INTERNAL_H_INCLUDED__
34#define __BINAURALISER_INTERNAL_H_INCLUDED__
48#if !defined(BINAURALISER_FRAME_SIZE)
49# if defined(FRAME_SIZE)
50# define BINAURALISER_FRAME_SIZE ( FRAME_SIZE )
52# define BINAURALISER_FRAME_SIZE ( 128 )
55#define HOP_SIZE ( 128 )
56#define HYBRID_BANDS ( HOP_SIZE + 5 )
57#define TIME_SLOTS ( BINAURALISER_FRAME_SIZE / HOP_SIZE )
60#if (BINAURALISER_FRAME_SIZE % HOP_SIZE != 0)
61# error "BINAURALISER_FRAME_SIZE must be an integer multiple of HOP_SIZE"
73typedef struct _binauraliser
96 int hrtf_vbapTableRes[2];
#define MAX_NUM_INPUTS
Maximum number of input channels supported.
SOURCE_CONFIG_PRESETS
Available source configurations presets to use for encoding/panning.
PROC_STATUS
Current status of the processing loop.
CODEC_STATUS
Current status of the codec.
#define HYBRID_BANDS
Number of frequency bands.
Convolves input audio (up to 64 channels) with interpolated HRTFs in the time-frequency domain.
INTERP_MODES
Available interpolation modes.
void binauraliser_initHRTFsAndGainTables(void *const hBin)
Initialise the HRTFs: either loading the default set or loading from a SOFA file; and then generate a...
void binauraliser_setCodecStatus(void *const hBin, CODEC_STATUS newStatus)
Sets codec status (see CODEC_STATUS enum)
void binauraliser_loadPreset(SOURCE_CONFIG_PRESETS preset, float dirs_deg[MAX_NUM_INPUTS][2], int *newNCH, int *nDims)
Returns the source directions for a specified source config preset.
void binauraliser_initTFT(void *const hBin)
Initialise the filterbank used by binauraliser.
#define HYBRID_BANDS
Number of frequency bands.
void binauraliser_interpHRTFs(void *const hBin, INTERP_MODES mode, float azimuth_deg, float elevation_deg, float_complex h_intrp[HYBRID_BANDS][NUM_EARS])
Interpolates between (up to) 3 HRTFs via amplitude-normalised VBAP gains.
#define NUM_EARS
2 (true for most humans)
Main include header for the Spatial_Audio_Framework (SAF)
Include header for SAF externals.
Main structure for binauraliser.
float ** inputFrameTD
time-domain input frame; MAX_NUM_INPUTS x BINAURALISER_FRAME_SIZE
int hrir_runtime_len
length of the HRIRs being used for processing (after any resampling), in samples
int enableRotation
1: enable rotation, 0: disable
int fs
Host sampling rate, in Hz.
float roll
roll (Euler) rotation angle, in degrees
PROC_STATUS procStatus
see PROC_STATUS
int bFlipYaw
flag to flip the sign of the yaw rotation angle
int recalc_M_rotFLAG
1: re-calculate the rotation matrix, 0: do not
float_complex *** outputframeTF
time-frequency domain input frame; HYBRID_BANDS x NUM_EARS x TIME_SLOTS
int nSources
Current number of input/source signals.
float * hrtf_vbap_gtableComp
N_hrtf_vbap_gtable x 3.
int N_hrir_dirs
number of HRIR directions in the current sofa file
float * hrirs
time domain HRIRs; FLAT: N_hrir_dirs x NUM_EARS x hrir_len
float_complex * hrtf_fb
hrtf filterbank coefficients; nBands x nCH x N_hrirs
int N_hrtf_vbap_gtable
Number of interpolation weights/directions.
float progressBar0_1
Current (re)initialisation progress, between [0..1].
int hrir_runtime_fs
sampling rate of the HRIRs being used for processing (after any resampling)
float * hrir_dirs_deg
directions of the HRIRs in degrees [azi elev]; FLAT: N_hrir_dirs x 2
int reInitHRTFsAndGainTables
1: reinitialise the HRTFs and interpolation tables, 0: do not
float pitch
pitch (Euler) rotation angle, in degrees
float * weights
Integration weights for the HRIR measurement grid.
int useRollPitchYawFlag
rotation order flag, 1: r-p-y, 0: y-p-r
float_complex *** inputframeTF
time-frequency domain input frame; HYBRID_BANDS x MAX_NUM_INPUTS x TIME_SLOTS
float * itds_s
interaural-time differences for each HRIR (in seconds); nBands x 1
int * hrtf_vbap_gtableIdx
N_hrtf_vbap_gtable x 3.
int hrir_loaded_len
length of the loaded HRIRs, in samples
CODEC_STATUS codecStatus
see CODEC_STATUS
char * progressBarText
Current (re)initialisation step, string.
void * hSTFT
afSTFT handle
float * hrtf_fb_mag
magnitudes of the hrtf filterbank coefficients; nBands x nCH x N_hrirs
int new_nSources
New number of input/source signals (current value will be replaced by this after next re-init)
int enableHRIRsDiffuseEQ
flag to diffuse-field equalisation to the currently loaded HRTFs
float yaw
yaw (Euler) rotation angle, in degrees
int hrir_loaded_fs
sampling rate of the loaded HRIRs
int useDefaultHRIRsFLAG
1: use default HRIRs in database, 0: use those from SOFA file
int bFlipRoll
flag to flip the sign of the roll rotation angle
char * sofa_filepath
absolute/relevative file path for a sofa file
int nTriangles
Number of triangles in the convex hull of the spherical arrangement of HRIR directions/points.
int bFlipPitch
flag to flip the sign of the pitch rotation angle
INTERP_MODES interpMode
see INTERP_MODES
float ** outframeTD
time-domain output frame; NUM_EARS x BINAURALISER_FRAME_SIZE