40 { -120.415474946769f, 69.7642225220975f},
41 { 169.426697678052f, -17.3466306179260f},
42 { 107.629281568279f, -10.0793856720614f},
43 { -59.5674172539630f, -69.7763953095265f},
44 { -107.629493132161f, 10.0801907586439f},
45 { 59.5651193014662f, 69.7750019669784f},
46 { -72.3715136529922f, -10.0909592824967f},
47 { 120.418832045969f, -69.7630732527928f},
48 { 72.3705387467529f, 10.0908849630425f},
49 { 10.5699823270029f, 17.3489915451677f},
50 { -169.426851150349f, 17.3476277272366f},
51 { -30.7728814706980f, 68.2546206344998f},
52 { 101.529181734204f, 18.5653877408229f},
53 { 149.250234431564f, 68.2619792676765f},
54 { 18.9183978612362f, -10.9197242075287f},
55 { 78.4729799557400f, -18.5558892226653f},
56 { -18.9161109968480f, 10.9195275229078f},
57 { -78.4723066816396f, 18.5565169424192f},
58 { -161.085243560336f, -10.9220975953767f},
59 { -101.530063994217f, -18.5648176173994f},
60 { 161.085855454581f, 10.9237834974412f},
61 { 30.7790837424989f, -68.2562996173874f},
62 { -149.255648697558f, -68.2594892022576f},
63 { 56.4638592172755f, 41.2645742763346f},
64 { 46.4626904606488f, 24.5386896277818f},
65 { -123.528839291756f, 41.2565889648213f},
66 { 32.1932295461248f, 38.8027347956192f},
67 { 133.534545076742f, -24.5310453346374f},
68 { -32.1935458377634f, -38.8041545028931f},
69 { -133.533477606995f, 24.5319420428588f},
70 { -147.797881221742f, 38.7980990097138f},
71 { -46.4626630742447f, -24.5400749997299f},
72 { 147.799544204027f, -38.7965984357137f},
73 { -56.4649576930965f, -41.2658215291547f},
74 { 123.530547454259f, -41.2555316199835f},
75 { 84.7385596473317f, 27.3132538556364f},
76 { 27.4072860474693f, 4.67593317316088f},
77 { -95.2612516264878f, 27.3036967398252f},
78 { 10.0607591758466f, 62.2287426217158f},
79 { 152.592710471291f, -4.67007594116539f},
80 { -10.0604693351594f, -62.2317767049329f},
81 { -152.592615409799f, 4.67188744845125f},
82 { -169.918387889403f, 62.2272712110016f},
83 { -27.4047652820400f, -4.67684895484045f},
84 { 169.918493477140f, -62.2246416140826f},
85 { -84.7390238025025f, -27.3120311727342f},
86 { 95.2622793653641f, -27.3027426350066f},
87 { 136.272846725200f, -0.726139068263599f},
88 { -1.05456977390436f, -46.2698051615206f},
89 { -43.7263256019408f, -0.737666959763443f},
90 { -91.0084089447853f, 43.7170295842697f},
91 { -178.936314291048f, 46.2682278552731f},
92 { 91.0100541861312f, -43.7163112498585f},
93 { 178.938490558618f, -46.2666218304286f},
94 { 88.9860902890987f, 43.7285680951606f},
95 { 1.05095788619312f, 46.2682407577363f},
96 { -88.9851906686018f, -43.7278600822776f},
97 { -136.273314433943f, 0.726484363994244f},
98 { 43.7273191822901f, 0.733967099281741f},
99 { 55.2321077221357f, 10.8187456245361f},
100 { 13.0867814081219f, 34.0654299770448f},
101 { -124.767898552651f, 10.8099467408727f},
102 { 71.4751302534919f, 53.7984109774923f},
103 { 166.905549455530f, -34.0625862919868f},
104 { -71.4765158530160f, -53.8002805142714f},
105 { -166.904587570338f, 34.0633858486074f},
106 { -108.515564585463f, 53.7864186881779f},
107 { -13.0869589355977f, -34.0644403811701f},
108 { 108.517274377512f, -53.7853093207457f},
109 { -55.2337689585088f, -10.8200079671294f},
110 { 124.767519417537f, -10.8096092876561f},
111 { -105.493359369733f, -68.1345228940484f},
112 { -111.151973933085f, -5.71277564515985f},
113 { 74.5244447329726f, -68.1205741555505f},
114 { -173.885132403874f, -21.0401043953034f},
115 { -68.8521018079939f, 5.70313885775370f},
116 { 173.885050918764f, 21.0419786777516f},
117 { 68.8513569996117f, -5.70297394874866f},
118 { 6.12041448982713f, -21.0387333986971f},
119 { 111.151515131908f, 5.71357243375474f},
120 { -6.11913621739966f, 21.0397756114589f},
121 { 105.487055344890f, 68.1331981897040f},
122 { -74.5188619841755f, 68.1214716326340f},
123 { 35.2822222163987f, -15.1801841162885f},
124 { -25.1732516880600f, 51.9826514887145f},
125 { -144.722913967824f, -15.1859965048827f},
126 { 108.386507250934f, 33.8824333892584f},
127 { -154.839566662519f, -51.9856067440744f},
128 { -108.385758587361f, -33.8826426573830f},
129 { 154.840828582605f, 51.9884126722963f},
130 { -71.6110721306039f, 33.8714084774643f},
131 { 25.1699762263473f, -51.9843011897216f},
132 { 71.6126173250777f, -33.8705490198003f},
133 { -35.2810594358470f, 15.1763090469469f},
134 { 144.722474074749f, 15.1863112389402f},
135 { -125.277803641269f, -28.5561977838671f},
136 { -146.317489805034f, -30.4888082061806f},
137 { 54.7220842889970f, -28.5463137051834f},
138 { -133.292600372594f, -45.8199818171681f},
139 { -33.6854220654234f, 30.4794807422719f},
140 { 133.295169860873f, 45.8200619710773f},
141 { 33.6830420572493f, -30.4828689919959f},
142 { 46.7098267598019f, -45.8106991831118f},
143 { 146.318736830907f, 30.4889588527258f},
144 { -46.7107531920589f, 45.8077510168776f},
145 { 125.278543193551f, 28.5567151663926f},
146 { -54.7226679373581f, 28.5424675755949f},
147 { -144.402199049652f, 54.7141577397485f},
148 { 112.382216591782f, -28.0100385212576f},
149 { 35.5834085793474f, 54.7193853715013f},
150 { -29.9155874729000f, -19.6471282266303f},
151 { 67.6163420587218f, 28.0211878299760f},
152 { 29.9151078604395f, 19.6461577548916f},
153 { -67.6164804090156f, -28.0221553885221f},
154 { 150.081679085309f, -19.6396879622134f},
155 { -112.381365317985f, 28.0105570315277f},
156 { -150.081127534239f, 19.6412999777121f},
157 { 144.402936805264f, -54.7127597303097f},
158 { -35.5837994140428f, -54.7203576209200f},
159 { 68.5348504928164f, -52.8527273534571f},
160 { -54.8218918027732f, 12.7570858971645f},
161 { -111.464947340552f, -52.8652964226689f},
162 { 164.510735700738f, 34.1892226850382f},
163 { -125.181243085238f, -12.7710900404128f},
164 { -164.510172672569f, -34.1865270720665f},
165 { 125.180742749445f, 12.7714932994183f},
166 { -15.4967238792034f, 34.1855682977571f}};
190 int aziIndex, elevIndex, N_azi, idx3d;
192 float_complex weights_cmplx[3], hrtf_fb3[
NUM_EARS][3];
193 float aziRes, elevRes, weights[3], itds3[3], itdInterp;
195 const float_complex calpha = cmplxf(1.0f, 0.0f), cbeta = cmplxf(0.0f, 0.0f);
200 N_azi = (int)(360.0f / aziRes + 0.5f) + 1;
201 aziIndex = (int)(
matlab_fmodf(azimuth_deg + 180.0f, 360.0f) / aziRes + 0.5f);
202 elevIndex = (int)((elevation_deg + 90.0f) / elevRes + 0.5f);
203 idx3d = elevIndex * N_azi + aziIndex;
204 for (i = 0; i < 3; i++)
209 for (i = 0; i < 3; i++)
210 weights_cmplx[i] = cmplxf(weights[i], 0.0f);
212 for (i = 0; i < 3; i++){
216 cblas_cgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans,
NUM_EARS, 1, 3, &calpha,
217 (float_complex*)hrtf_fb3, 3,
218 (float_complex*)weights_cmplx, 1, &cbeta,
219 (float_complex*)h_intrp[band], 1);
225 for (i = 0; i < 3; i++) {
234 cblas_sgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans, 1, 1, 3, 1.0f,
236 (
float*)itds3, 1, 0.0f,
239 cblas_sgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans, 1, 2, 3, 1.0f,
241 (
float*)magnitudes3[band], 2, 0.0f,
242 (
float*)magInterp[band], 2);
250 ipd = cmplxf(0.0f, 0.0f);
251 h_intrp[band][0] = crmulf(cexpf(ipd), magInterp[band][0]);
252 h_intrp[band][1] = crmulf(conjf(cexpf(ipd)), magInterp[band][1]);
262 float* hrtf_vbap_gtable;
263#ifdef SAF_ENABLE_SOFA_READER_MODULE
272#ifdef SAF_ENABLE_SOFA_READER_MODULE
280 saf_print_warning(
"Unable to load the specified SOFA file, or it contained something other than 2 channels. Using default HRIR data instead.");
316 float* hrirs_resampled;
317 int hrir_length_resample;
322 pData->
hrir_len = hrir_length_resample;
327 free(hrirs_resampled);
342 hrtf_vbap_gtable = NULL;
347 if(hrtf_vbap_gtable==NULL){
382 saf_print_warning(
"Too many grid points to calculate grid weights. Assuming that the HRTF measurement grid was uniform.");
399 free(hrtf_vbap_gtable);
409 if(pData->
hSTFT==NULL)
422 _Atomic_INT32* newNCH,
431 case SOURCE_CONFIG_PRESET_DEFAULT:
433 for(ch=0; ch<nCH; ch++)
435 dirs_deg[ch][i] = 0.0f;
437 case SOURCE_CONFIG_PRESET_MONO:
439 for(ch=0; ch<nCH; ch++)
443 case SOURCE_CONFIG_PRESET_STEREO:
445 for(ch=0; ch<nCH; ch++)
449 case SOURCE_CONFIG_PRESET_5PX:
451 for(ch=0; ch<nCH; ch++)
455 case SOURCE_CONFIG_PRESET_7PX:
457 for(ch=0; ch<nCH; ch++)
461 case SOURCE_CONFIG_PRESET_8PX:
463 for(ch=0; ch<nCH; ch++)
467 case SOURCE_CONFIG_PRESET_9PX:
469 for(ch=0; ch<nCH; ch++)
473 case SOURCE_CONFIG_PRESET_10PX:
475 for(ch=0; ch<nCH; ch++)
479 case SOURCE_CONFIG_PRESET_11PX:
481 for(ch=0; ch<nCH; ch++)
485 case SOURCE_CONFIG_PRESET_11PX_7_4:
487 for(ch=0; ch<nCH; ch++)
491 case SOURCE_CONFIG_PRESET_13PX:
493 for(ch=0; ch<nCH; ch++)
497 case SOURCE_CONFIG_PRESET_22PX:
499 for(ch=0; ch<nCH; ch++)
503 case SOURCE_CONFIG_PRESET_22P2_9_10_3:
505 for(ch=0; ch<nCH; ch++)
509 case SOURCE_CONFIG_PRESET_PROTOOLS_STEREO:
511 for(ch=0; ch<nCH; ch++)
515 case SOURCE_CONFIG_PRESET_PROTOOLS_LCR:
517 for(ch=0; ch<nCH; ch++)
521 case SOURCE_CONFIG_PRESET_PROTOOLS_QUAD:
523 for(ch=0; ch<nCH; ch++)
527 case SOURCE_CONFIG_PRESET_PROTOOLS_5_0:
529 for(ch=0; ch<nCH; ch++)
533 case SOURCE_CONFIG_PRESET_PROTOOLS_5_0_2:
535 for(ch=0; ch<nCH; ch++)
539 case SOURCE_CONFIG_PRESET_PROTOOLS_5_0_4:
541 for(ch=0; ch<nCH; ch++)
545 case SOURCE_CONFIG_PRESET_PROTOOLS_7_0:
547 for(ch=0; ch<nCH; ch++)
551 case SOURCE_CONFIG_PRESET_PROTOOLS_7_0_2:
553 for(ch=0; ch<nCH; ch++)
557 case SOURCE_CONFIG_PRESET_PROTOOLS_7_0_4:
559 for(ch=0; ch<nCH; ch++)
563 case SOURCE_CONFIG_PRESET_PROTOOLS_7_0_6:
565 for(ch=0; ch<nCH; ch++)
569 case SOURCE_CONFIG_PRESET_PROTOOLS_9_0_4:
571 for(ch=0; ch<nCH; ch++)
575 case SOURCE_CONFIG_PRESET_PROTOOLS_9_0_6:
577 for(ch=0; ch<nCH; ch++)
581 case SOURCE_CONFIG_PRESET_AALTO_MCC:
583 for(ch=0; ch<nCH; ch++)
587 case SOURCE_CONFIG_PRESET_AALTO_MCC_SUBSET:
589 for(ch=0; ch<nCH; ch++)
593 case SOURCE_CONFIG_PRESET_AALTO_APAJA:
595 for(ch=0; ch<nCH; ch++)
599 case SOURCE_CONFIG_PRESET_AALTO_LR:
601 for(ch=0; ch<nCH; ch++)
605 case SOURCE_CONFIG_PRESET_DTU_AVIL:
607 for(ch=0; ch<nCH; ch++)
611 case SOURCE_CONFIG_PRESET_ZYLIA_LAB:
613 for(ch=0; ch<nCH; ch++)
617 case SOURCE_CONFIG_PRESET_T_DESIGN_4:
619 for(ch=0; ch<nCH; ch++)
623 case SOURCE_CONFIG_PRESET_T_DESIGN_12:
625 for(ch=0; ch<nCH; ch++)
629 case SOURCE_CONFIG_PRESET_T_DESIGN_24:
631 for(ch=0; ch<nCH; ch++)
635 case SOURCE_CONFIG_PRESET_T_DESIGN_36:
637 for(ch=0; ch<nCH; ch++)
641 case SOURCE_CONFIG_PRESET_T_DESIGN_48:
643 for(ch=0; ch<nCH; ch++)
647 case SOURCE_CONFIG_PRESET_T_DESIGN_60:
649 for(ch=0; ch<nCH; ch++)
653 case SOURCE_CONFIG_PRESET_SPH_COV_9:
655 for(ch=0; ch<nCH; ch++)
659 case SOURCE_CONFIG_PRESET_SPH_COV_16:
661 for(ch=0; ch<nCH; ch++)
665 case SOURCE_CONFIG_PRESET_SPH_COV_25:
667 for(ch=0; ch<nCH; ch++)
671 case SOURCE_CONFIG_PRESET_SPH_COV_49:
673 for(ch=0; ch<nCH; ch++)
677 case SOURCE_CONFIG_PRESET_SPH_COV_64:
679 for(ch=0; ch<nCH; ch++)
698 for(i=0; i<nCH; i++){
699 sum_elev += dirs_deg[i][1];
#define MAX_NUM_INPUTS
Maximum number of input channels supported.
SOURCE_CONFIG_PRESETS
Available source configurations presets to use for encoding/panning.
CODEC_STATUS
Current status of the codec.
@ CODEC_STATUS_NOT_INITIALISED
Codec has not yet been initialised, or the codec configuration has changed.
@ CODEC_STATUS_INITIALISING
Codec is currently being initialised, input audio should not be processed.
void afSTFT_clearBuffers(void *const hSTFT)
Flushes time-domain buffers with zeros.
void afSTFT_create(void **const phSTFT, int nCHin, int nCHout, int hopsize, int lowDelayMode, int hybridmode, AFSTFT_FDDATA_FORMAT format)
Creates an instance of afSTFT.
void afSTFT_channelChange(void *const hSTFT, int new_nCHin, int new_nCHout)
Re-allocates memory to support a change in the number of input/output channels.
@ AFSTFT_BANDS_CH_TIME
nBands x nChannels x nTimeHops
#define HOP_SIZE
STFT hop size.
#define HYBRID_BANDS
Number of frequency bands.
INTERP_MODES
Available interpolation modes.
@ INTERP_TRI
Triangular interpolation.
@ INTERP_TRI_PS
Triangular interpolation (with phase-simplification)
const float binauraliser_defaultSourceDirections[MAX_NUM_INPUTS][2]
Default source directions.
const int binauraliser_defaultNumSources
Default number of Sources.
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_loadPreset(SOURCE_CONFIG_PRESETS preset, _Atomic_FLOAT32 dirs_deg[MAX_NUM_INPUTS][2], _Atomic_INT32 *newNCH, int *nDims)
Returns the source directions for a specified source config preset.
void binauraliser_setCodecStatus(void *const hBin, CODEC_STATUS newStatus)
Sets codec status (see CODEC_STATUS enum)
void binauraliser_initTFT(void *const hBin)
Initialise the filterbank used by binauraliser.
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.
Convolves input audio (up to 64 channels) with interpolated HRTFs in the time-frequency domain.
const int __default_N_hrir_dirs
The number of directions/measurements in the default HRIR dataset.
const float __default_hrirs[836][2][256]
The default HRIR data for SAF.
const float __default_hrir_dirs_deg[836][2]
The measurement directions used for the default HRIR dataset.
const int __default_hrir_len
The length of the filters, in samples, for the default HRIR dataset.
const int __default_hrir_fs
The samplerate used to measure the default HRIR filters.
void diffuseFieldEqualiseHRTFs(int N_dirs, float *itds_s, float *centreFreq, int N_bands, float *weights, int applyEQ, int applyPhase, float_complex *hrtfs)
Applies pre-processing to a set of HRTFs, which can either be diffuse-field EQ of an (optionally weig...
void resampleHRIRs(float *hrirs_in, int hrirs_N_dirs, int hrirs_in_len, int hrirs_in_fs, int hrirs_out_fs, int padToNextPow2, float **hrirs_out, int *hrirs_out_len)
Resamples a set of HRIRs from its original samplerate to a new samplerate.
void estimateITDs(float *hrirs, int N_dirs, int hrir_len, int fs, float *itds_s)
Estimates the interaural time-differences (ITDs) for each HRIR based on the cross-correlation between...
void HRIRs2HRTFs_afSTFT(float *hrirs, int N_dirs, int hrir_len, int hopsize, int LDmode, int hybridmode, float_complex *hrtf_fb)
Passes zero padded HRIRs through the afSTFT filterbank.
int calculateGridWeights(float *dirs_rad, int nDirs, int order, float *w)
Computes approximation of quadrature/integration weights for a given grid.
void saf_sofa_close(saf_sofa_container *c)
Frees all SOFA data in a sofa_container.
SAF_SOFA_ERROR_CODES saf_sofa_open(saf_sofa_container *h, char *sofa_filepath, SAF_SOFA_READER_OPTIONS option)
Fills a 'sofa_container' with data found in a SOFA file (GeneralFIR or SimpleFreeFieldHRIR),...
SAF_SOFA_ERROR_CODES
SOFA loader error codes.
@ SAF_SOFA_READER_OPTION_DEFAULT
The default option is SAF_SOFA_READER_OPTION_LIBMYSOFA.
@ SAF_SOFA_OK
None of the error checks failed.
const float __Zylia_Lab_dirs_deg[22][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for the 22.x setup, at Zylia Labs.
const float __protools_Quad_dirs_deg[4][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for ProTools Quadraphonic.
const int __protools_mapping_5p0_to_discrete[5]
Indices to map a 5p0 bus to a discrete bus in ProTools.
#define SAF_PI
pi constant (single precision)
const int __protools_mapping_7p0p4_to_discrete[11]
Indices to map a 7p0p4 bus to a discrete bus in ProTools.
const float __9pX_dirs_deg[9][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for a 9.x setup.
const float __SphCovering_16_dirs_deg[16][2]
Directions [azimuth, Elevation] in degrees, for sphere covering: 16 dirs.
const float __Aalto_MCC_dirs_deg[45][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for the multi-channel anechoic chamber (MCC),...
const float __SphCovering_49_dirs_deg[49][2]
Directions [azimuth, Elevation] in degrees, for sphere covering: 49 dirs.
void convert_0_360To_m180_180(float *dirs_deg, int nDirs)
Wraps around any angles exeeding 180 degrees (e.g., 200-> -160)
#define NUM_EARS
2 (true for most humans)
float matlab_fmodf(float x, float y)
C fmodf function, except it behaves like 'mod' in Matlab (i.e.
const float __mono_dirs_deg[1][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for a mono setup.
const float __5pX_dirs_deg[5][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for a 5.x setup.
const float __11pX_dirs_deg[11][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for a 11.x setup.
const float __Tdesign_degree_9_dirs_deg[48][2]
Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 9.
const float __Tdesign_degree_2_dirs_deg[4][2]
Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 2.
const float __11pX_7_4_dirs_deg[11][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for a 7.4.x setup.
const float __Tdesign_degree_8_dirs_deg[36][2]
Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 8.
const float __9_10_3p2_dirs_deg[24][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for a 9+10+3.2 setup BS 2051 recommedation: h...
const float __default_LScoords128_deg[128][2]
Default Loudspeaker directions [azimuth, Elevation] - to replace above!
const float __protools_7p0_dirs_deg[7][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for ProTools 7.0 surround L C R Lss Rss Lsr R...
const float __protools_7p0p2_dirs_deg[9][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for ProTools 7.0.2 surround L C R Lss Rss Lsr...
const float __Aalto_MCCsubset_dirs_deg[37][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for the multi-channel anechoic chamber (MCC) ...
const int __protools_mapping_stereo_to_discrete[2]
Indices to map a stereo bus to a discrete bus in ProTools.
const float __Aalto_Apaja_dirs_deg[29][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for the audio-visual listening room (Apaja),...
const int __protools_mapping_7p0p2_to_discrete[9]
Indices to map a 7p0p2 bus to a discrete bus in ProTools.
const int __protools_mapping_5p0p2_to_discrete[7]
Indices to map a 5p0p2 bus to a discrete bus in ProTools.
const float __SphCovering_9_dirs_deg[9][2]
Directions [azimuth, Elevation] in degrees, for sphere covering: 9 dirs.
const int __protools_mapping_LCR_to_discrete[3]
Indices to map a LCR bus to a discrete bus in ProTools.
const float __protools_7p0p6_dirs_deg[13][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for ProTools 7.0.6 surround L R C Lss Rss Lsr...
const float __protools_5p0_dirs_deg[5][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for ProTools 5.0 surround (Film) L C R Ls Rs.
const float __stereo_dirs_deg[2][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for a stereo setup.
const float __SphCovering_64_dirs_deg[64][2]
Directions [azimuth, Elevation] in degrees, for sphere covering: 64 dirs.
const int __protools_mapping_7p0p6_to_discrete[13]
Indices to map a 7p0p6 bus to a discrete bus in ProTools.
const float __Tdesign_degree_4_dirs_deg[12][2]
Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 4.
void sphElev2incl(float *dirsElev, int nDirs, int degreesFlag, float *dirsIncl)
Converts spherical coordinates of unit length from elevation to inclination.
const float __Aalto_LR_dirs_deg[13][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for the ITU standard listening room (LR),...
const float __DTU_AVIL_dirs_deg[64][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for the Audio Visual Immersion Lab (AVIL),...
const float __8pX_dirs_deg[8][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for a 8.x setup.
const float __protools_LCR_dirs_deg[3][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for ProTools Left-centre-right.
const float __Tdesign_degree_6_dirs_deg[24][2]
Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 6.
const float __protools_stereo_dirs_deg[2][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for ProTools stereo pair.
const float __protools_9p0p6_dirs_deg[15][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for ProTools 9.0.6 surround L R C Lss Rss Lsr...
const float __13pX_dirs_deg[13][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for a 13.x setup.
const float __7pX_dirs_deg[7][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for a 7.x setup.
#define saf_print_warning(message)
Macro to print a warning message along with the filename and line number.
const int __protools_mapping_9p0p4_to_discrete[13]
Indices to map a 9p0p4 bus to a discrete bus in ProTools.
const float __22pX_dirs_deg[22][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for a 22.x setup.
const int __protools_mapping_5p0p4_to_discrete[9]
Indices to map a 5p0p4 bus to a discrete bus in ProTools.
const float __protools_5p0p4_dirs_deg[9][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for ProTools 5.0.4 surround L R C Ls Rs Ltf R...
const float __SphCovering_25_dirs_deg[25][2]
Directions [azimuth, Elevation] in degrees, for sphere covering: 25 dirs.
const int __protools_mapping_Quad_to_discrete[4]
Indices to map a Quad bus to a discrete bus in ProTools.
const int __protools_mapping_7p0_to_discrete[7]
Indices to map a 7p0 bus to a discrete bus in ProTools.
const float __protools_5p0p2_dirs_deg[7][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for ProTools 5.0.2 surround L R C Ls Rs Ltm R...
const float __protools_7p0p4_dirs_deg[11][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for ProTools 7.0.4 surround L R C Lss Rss Lsr...
const float __protools_9p0p4_dirs_deg[13][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for ProTools 9.0.4 surround L R C Lss Rss Lsr...
const int __protools_mapping_9p0p6_to_discrete[15]
Indices to map a 9p0p9 bus to a discrete bus in ProTools.
const float __Tdesign_degree_10_dirs_deg[60][2]
Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 10.
const float __10pX_dirs_deg[10][2]
Loudspeaker directions [azimuth, Elevation] in degrees, for a 10.x setup.
void generateVBAPgainTable3D(float *ls_dirs_deg, int L, int az_res_deg, int el_res_deg, int omitLargeTriangles, int enableDummies, float spread, float **gtable, int *N_gtable, int *nTriangles)
Generates a 3-D VBAP gain table based on specified loudspeaker directions, with optional spreading [2...
void compressVBAPgainTable3D(float *vbap_gtable, int nTable, int nDirs, float *vbap_gtableComp, int *vbap_gtableIdx)
Compresses a VBAP gain table to use less memory and CPU (by removing the elements which are just zero...
void * malloc1d(size_t dim1_data_size)
1-D malloc (same as malloc, but with error checking)
void * realloc1d(void *ptr, size_t dim1_data_size)
1-D realloc (same as realloc, but with error checking)
Main structure for binauraliser.
_Atomic_INT32 hrir_len
length of the loaded HRIRs, in samples
float * hrtf_vbap_gtableComp
N_hrtf_vbap_gtable x 3.
_Atomic_INT32 enableHRIRsDiffuseEQ
flag to diffuse-field equalisation to the currently loaded HRTFs
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 * hrir_dirs_deg
directions of the HRIRs in degrees [azi elev]; FLAT: N_hrir_dirs x 2
_Atomic_FLOAT32 fs
Host sampling rate, in Hz.
float * weights
Integration weights for the HRIR measurement grid; N_hrir_dirs x 1.
float * itds_s
interaural-time differences for each HRIR (in seconds); nBands x 1
int * hrtf_vbap_gtableIdx
N_hrtf_vbap_gtable x 3.
_Atomic_INT32 hrir_fs
sampling rate of the HRIRs being used for processing (after any resampling)
int hrtf_vbapTableRes[2]
[0] azimuth, and [1] elevation grid resolution, in degrees
_Atomic_INT32 hrir_orig_fs
Can be different from hrir_fs if HRIRs were resampled.
char * progressBarText
Current (re)initialisation step, string.
void * hSTFT
afSTFT handle
_Atomic_INT32 recalc_hrtf_interpFLAG[MAX_NUM_INPUTS]
1: re-calculate/interpolate the HRTF, 0: do not
float * hrtf_fb_mag
magnitudes of the hrtf filterbank coefficients; nBands x nCH x N_hrirs
_Atomic_FLOAT32 progressBar0_1
Current (re)initialisation progress, between [0..1].
_Atomic_INT32 N_hrir_dirs
number of HRIR directions in the current sofa file
_Atomic_INT32 useDefaultHRIRsFLAG
1: use default HRIRs in database, 0: use those from SOFA file
char * sofa_filepath
absolute/relevative file path for a sofa file
_Atomic_CODEC_STATUS codecStatus
see CODEC_STATUS
int nTriangles
Number of triangles in the convex hull of the spherical arrangement of HRIR directions/points.
float freqVector[HYBRID_BANDS]
Frequency vector (filterbank centre frequencies)
_Atomic_INT32 new_nSources
New number of input/source signals (current value will be replaced by this after next re-init)
_Atomic_INT32 nSources
Current number of input/source signals.
SOFA container struct comprising all possible data that can be extracted from SOFA 1....
int DataLengthIR
Length of the IRs, in samples.
int nSources
Number of source/measurement positions.
float * SourcePosition
Source positions (refer to SourcePositionType & SourcePositionUnits for the convention and units); FL...
float DataSamplingRate
Sampling rate used to measure the IRs.
int nReceivers
Number of ears/number of mics etc.
float * DataIR
The impulse response (IR) Data; FLAT:nSources x nReceivers x DataLengthIR.