48#ifndef __AMBI_BIN_INTERNAL_H_INCLUDED__
49#define __AMBI_BIN_INTERNAL_H_INCLUDED__
63#if !defined(AMBI_BIN_FRAME_SIZE)
64# if defined(FRAME_SIZE)
65# define AMBI_BIN_FRAME_SIZE ( FRAME_SIZE )
67# define AMBI_BIN_FRAME_SIZE ( 128 )
70#define HOP_SIZE ( 128 )
71#define HYBRID_BANDS ( HOP_SIZE + 5 )
72#define TIME_SLOTS ( AMBI_BIN_FRAME_SIZE / HOP_SIZE )
73#define POST_GAIN ( -9.0f )
76#if (AMBI_BIN_FRAME_SIZE % HOP_SIZE != 0)
77# error "AMBI_BIN_FRAME_SIZE must be an integer multiple of HOP_SIZE"
86typedef struct _ambi_bin_codecPars
113typedef struct _ambi_bin
PROC_STATUS
Current status of the processing loop.
NORM_TYPES
Available Ambisonic normalisation conventions.
CH_ORDER
Available Ambisonic channel ordering conventions.
#define MAX_NUM_SH_SIGNALS
Maximum number of spherical harmonic components/signals supported.
CODEC_STATUS
Current status of the codec.
A binaural Ambisonic decoder for reproducing Ambisonic sound scenes over headphones.
AMBI_BIN_DECODING_METHODS
Available decoding methods for the ambi_bin example.
AMBI_BIN_PREPROC
Available HRIR pre-preprocessing options.
#define HYBRID_BANDS
Number of frequency bands.
void ambi_bin_setCodecStatus(void *const hAmbi, CODEC_STATUS newStatus)
Sets codec status.
#define NUM_EARS
2 (true for most humans)
Main include header for the Spatial_Audio_Framework (SAF)
Include header for SAF externals.
Contains variables for sofa file loading, HRIRs, and the binaural decoder.
int N_hrir_dirs
number of HRIR directions in the current sofa file
float * hrir_dirs_deg
directions of the HRIRs in degrees [azi elev]; FLAT: N_hrir_dirs x 2
float * weights
grid integration weights of hrirs; N_hrirs x 1
int hrir_len
length of the HRIRs, this can be truncated, see "saf_sofa_reader.h"
float_complex * hrtf_fb
HRTF filterbank coeffs; FLAT: nBands x nCH x N_hrirs.
char * sofa_filepath
absolute/relevative file path for a sofa file
int hrir_fs
sampling rate of the HRIRs, should ideally match the host sampling rate, although not required
float * hrirs
time domain HRIRs; FLAT: N_hrir_dirs x 2 x hrir_len
float * itds_s
interaural-time differences for each HRIR (in seconds); N_hrirs x 1
Main structure for ambi_bin.
CODEC_STATUS codecStatus
see CODEC_STATUS
float_complex *** binframeTF
Output binaural signals in the time-frequency domain; HYBRID_BANDS x NUM_EARS x TIME_SLOTS.
float pitch
pitch (Euler) rotation angle, in degrees
CH_ORDER chOrdering
Ambisonic channel order convention (see CH_ORDER)
int bFlipRoll
flag to flip the sign of the roll rotation angle
int enableDiffuseMatching
0: disabled, 1: enabled
int afSTFTdelay
for host delay compensation
int bFlipPitch
flag to flip the sign of the pitch rotation angle
int enableTruncationEQ
0: disabled, 1: enabled
AMBI_BIN_DECODING_METHODS method
current decoding method (see AMBI_BIN_DECODING_METHODS)
int useRollPitchYawFlag
rotation order flag, 1: r-p-y, 0: y-p-r
int enableMaxRE
0: disabled, 1: enabled
PROC_STATUS procStatus
see PROC_STATUS
char * progressBarText
Current (re)initialisation step, string.
int useDefaultHRIRsFLAG
1: use default HRIRs in database, 0: use those from SOFA file
int bFlipYaw
flag to flip the sign of the yaw rotation angle
int new_order
new decoding order (current value will be replaced by this after next re-init)
void * hSTFT
afSTFT handle
NORM_TYPES norm
Ambisonic normalisation convention (see NORM_TYPES)
AMBI_BIN_PREPROC preProc
HRIR pre-processing strategy.
float_complex *** SHframeTF
Input spherical harmonic (SH) signals in the time-frequency domain; HYBRID_BANDS x MAX_NUM_SH_SIGNALS...
float progressBar0_1
Current (re)initialisation progress, between [0..1].
float roll
roll (Euler) rotation angle, in degrees
int recalc_M_rotFLAG
0: no init required, 1: init required
int nSH
number of spherical harmonic signals
ambi_bin_codecPars * pars
Decoding specific data.
float yaw
yaw (Euler) rotation angle, in degrees
int order
current decoding order
int reinit_hrtfsFLAG
0: no init required, 1: init required
float ** SHFrameTD
Input spherical harmonic (SH) signals in the time-domain; MAX_NUM_SH_SIGNALS x AMBI_BIN_FRAME_SIZE.
float ** binFrameTD
Output binaural signals in the time-domain; NUM_EARS x AMBI_BIN_FRAME_SIZE.
int enableRotation
Whether rotation should be enabled (1) or disabled (0)