Skip to content

Commit ad66336

Browse files
added more default value arrays
1 parent 911a2a1 commit ad66336

File tree

8 files changed

+423
-2
lines changed

8 files changed

+423
-2
lines changed

examples/include/array2sh.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,12 @@ typedef enum {
224224
/** Maximum baffle radius supported, mm */
225225
#define ARRAY2SH_BAFFLE_RADIUS_MAX_VALUE ( 400.0f )
226226

227+
/** Default number of microphones */
228+
extern const int array2sh_defaultNumSensors;
229+
230+
/** Default microphone directions (degrees) */
231+
extern const float array2sh_defaultSensorsDirections[MAX_NUM_INPUTS][2];
232+
227233

228234
/* ========================================================================== */
229235
/* Main Functions */

examples/include/beamformer.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@
4444
extern "C" {
4545
#endif /* __cplusplus */
4646

47+
/** Default number of beams */
48+
extern const int beamformer_defaultNumBeams;
49+
50+
/** Default beam directions */
51+
extern const float beamformer_defaultBeamDirections[MAX_NUM_INPUTS][2];
52+
53+
4754
/* ========================================================================== */
4855
/* Main Functions */
4956
/* ========================================================================== */

examples/include/binauraliser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ typedef enum {
6363
/** Default number of Sources */
6464
extern const int binauraliser_defaultNumSources;
6565

66-
/** Default Loudspeaker directions */
66+
/** Default source directions */
6767
extern const float binauraliser_defaultSourceDirections[MAX_NUM_INPUTS][2];
6868

6969

examples/src/ambi_dec/ambi_dec_internal.c

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,78 @@ void loadLoudspeakerArrayPreset
327327
case LOUDSPEAKER_ARRAY_PRESET_22P2_9_10_3:
328328
saf_print_error("Not suitable, since it contains LFE channels");
329329
break;
330+
case LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_STEREO:
331+
nCH = 2;
332+
for(ch=0; ch<nCH; ch++)
333+
for(i=0; i<2; i++)
334+
dirs_deg[ch][i] = __protools_stereo_dirs_deg[__protools_mapping_discrete_to_stereo[ch]][i];
335+
break;
336+
case LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_LCR:
337+
nCH = 3;
338+
for(ch=0; ch<nCH; ch++)
339+
for(i=0; i<2; i++)
340+
dirs_deg[ch][i] = __protools_LCR_dirs_deg[__protools_mapping_discrete_to_LCR[ch]][i];
341+
break;
342+
case LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_QUAD:
343+
nCH = 4;
344+
for(ch=0; ch<nCH; ch++)
345+
for(i=0; i<2; i++)
346+
dirs_deg[ch][i] = __protools_Quad_dirs_deg[__protools_mapping_discrete_to_Quad[ch]][i];
347+
break;
348+
case LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_5_0:
349+
nCH = 5;
350+
for(ch=0; ch<nCH; ch++)
351+
for(i=0; i<2; i++)
352+
dirs_deg[ch][i] = __protools_5p0_dirs_deg[__protools_mapping_discrete_to_5p0[ch]][i];
353+
break;
354+
case LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_5_0_2:
355+
nCH = 7;
356+
for(ch=0; ch<nCH; ch++)
357+
for(i=0; i<2; i++)
358+
dirs_deg[ch][i] = __protools_5p0p2_dirs_deg[__protools_mapping_discrete_to_5p0p2[ch]][i];
359+
break;
360+
case LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_5_0_4:
361+
nCH = 9;
362+
for(ch=0; ch<nCH; ch++)
363+
for(i=0; i<2; i++)
364+
dirs_deg[ch][i] = __protools_5p0p4_dirs_deg[__protools_mapping_discrete_to_5p0p4[ch]][i];
365+
break;
366+
case LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_7_0:
367+
nCH = 7;
368+
for(ch=0; ch<nCH; ch++)
369+
for(i=0; i<2; i++)
370+
dirs_deg[ch][i] = __protools_7p0_dirs_deg[__protools_mapping_discrete_to_7p0[ch]][i];
371+
break;
372+
case LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_7_0_2:
373+
nCH = 9;
374+
for(ch=0; ch<nCH; ch++)
375+
for(i=0; i<2; i++)
376+
dirs_deg[ch][i] = __protools_7p0p2_dirs_deg[__protools_mapping_discrete_to_7p0p2[ch]][i];
377+
break;
378+
case LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_7_0_4:
379+
nCH = 11;
380+
for(ch=0; ch<nCH; ch++)
381+
for(i=0; i<2; i++)
382+
dirs_deg[ch][i] = __protools_7p0p4_dirs_deg[__protools_mapping_discrete_to_7p0p4[ch]][i];
383+
break;
384+
case LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_7_0_6:
385+
nCH = 13;
386+
for(ch=0; ch<nCH; ch++)
387+
for(i=0; i<2; i++)
388+
dirs_deg[ch][i] = __protools_7p0p6_dirs_deg[__protools_mapping_discrete_to_7p0p6[ch]][i];
389+
break;
390+
case LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_9_0_4:
391+
nCH = 13;
392+
for(ch=0; ch<nCH; ch++)
393+
for(i=0; i<2; i++)
394+
dirs_deg[ch][i] = __protools_9p0p4_dirs_deg[__protools_mapping_discrete_to_9p0p4[ch]][i];
395+
break;
396+
case LOUDSPEAKER_ARRAY_PRESET_PROTOOLS_9_0_6:
397+
nCH = 15;
398+
for(ch=0; ch<nCH; ch++)
399+
for(i=0; i<2; i++)
400+
dirs_deg[ch][i] = __protools_9p0p6_dirs_deg[__protools_mapping_discrete_to_9p0p6[ch]][i];
401+
break;
330402
case LOUDSPEAKER_ARRAY_PRESET_AALTO_MCC:
331403
nCH = 45;
332404
for(ch=0; ch<nCH; ch++)

examples/src/ambi_enc/ambi_enc_internal.c

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,78 @@ void loadSourceConfigPreset
243243
case SOURCE_CONFIG_PRESET_22P2_9_10_3:
244244
saf_print_error("Not suitable, since it contains LFE channels");
245245
break;
246+
case SOURCE_CONFIG_PRESET_PROTOOLS_STEREO:
247+
nCH = 2;
248+
for(ch=0; ch<nCH; ch++)
249+
for(i=0; i<2; i++)
250+
dirs_deg[ch][i] = __protools_stereo_dirs_deg[__protools_mapping_stereo_to_discrete[ch]][i];
251+
break;
252+
case SOURCE_CONFIG_PRESET_PROTOOLS_LCR:
253+
nCH = 3;
254+
for(ch=0; ch<nCH; ch++)
255+
for(i=0; i<2; i++)
256+
dirs_deg[ch][i] = __protools_LCR_dirs_deg[__protools_mapping_LCR_to_discrete[ch]][i];
257+
break;
258+
case SOURCE_CONFIG_PRESET_PROTOOLS_QUAD:
259+
nCH = 4;
260+
for(ch=0; ch<nCH; ch++)
261+
for(i=0; i<2; i++)
262+
dirs_deg[ch][i] = __protools_Quad_dirs_deg[__protools_mapping_Quad_to_discrete[ch]][i];
263+
break;
264+
case SOURCE_CONFIG_PRESET_PROTOOLS_5_0:
265+
nCH = 5;
266+
for(ch=0; ch<nCH; ch++)
267+
for(i=0; i<2; i++)
268+
dirs_deg[ch][i] = __protools_5p0_dirs_deg[__protools_mapping_5p0_to_discrete[ch]][i];
269+
break;
270+
case SOURCE_CONFIG_PRESET_PROTOOLS_5_0_2:
271+
nCH = 7;
272+
for(ch=0; ch<nCH; ch++)
273+
for(i=0; i<2; i++)
274+
dirs_deg[ch][i] = __protools_5p0p2_dirs_deg[__protools_mapping_5p0p2_to_discrete[ch]][i];
275+
break;
276+
case SOURCE_CONFIG_PRESET_PROTOOLS_5_0_4:
277+
nCH = 9;
278+
for(ch=0; ch<nCH; ch++)
279+
for(i=0; i<2; i++)
280+
dirs_deg[ch][i] = __protools_5p0p4_dirs_deg[__protools_mapping_5p0p4_to_discrete[ch]][i];
281+
break;
282+
case SOURCE_CONFIG_PRESET_PROTOOLS_7_0:
283+
nCH = 7;
284+
for(ch=0; ch<nCH; ch++)
285+
for(i=0; i<2; i++)
286+
dirs_deg[ch][i] = __protools_7p0_dirs_deg[__protools_mapping_7p0_to_discrete[ch]][i];
287+
break;
288+
case SOURCE_CONFIG_PRESET_PROTOOLS_7_0_2:
289+
nCH = 9;
290+
for(ch=0; ch<nCH; ch++)
291+
for(i=0; i<2; i++)
292+
dirs_deg[ch][i] = __protools_7p0p2_dirs_deg[__protools_mapping_7p0p2_to_discrete[ch]][i];
293+
break;
294+
case SOURCE_CONFIG_PRESET_PROTOOLS_7_0_4:
295+
nCH = 11;
296+
for(ch=0; ch<nCH; ch++)
297+
for(i=0; i<2; i++)
298+
dirs_deg[ch][i] = __protools_7p0p4_dirs_deg[__protools_mapping_7p0p4_to_discrete[ch]][i];
299+
break;
300+
case SOURCE_CONFIG_PRESET_PROTOOLS_7_0_6:
301+
nCH = 13;
302+
for(ch=0; ch<nCH; ch++)
303+
for(i=0; i<2; i++)
304+
dirs_deg[ch][i] = __protools_7p0p6_dirs_deg[__protools_mapping_7p0p6_to_discrete[ch]][i];
305+
break;
306+
case SOURCE_CONFIG_PRESET_PROTOOLS_9_0_4:
307+
nCH = 13;
308+
for(ch=0; ch<nCH; ch++)
309+
for(i=0; i<2; i++)
310+
dirs_deg[ch][i] = __protools_9p0p4_dirs_deg[__protools_mapping_9p0p4_to_discrete[ch]][i];
311+
break;
312+
case SOURCE_CONFIG_PRESET_PROTOOLS_9_0_6:
313+
nCH = 15;
314+
for(ch=0; ch<nCH; ch++)
315+
for(i=0; i<2; i++)
316+
dirs_deg[ch][i] = __protools_9p0p6_dirs_deg[__protools_mapping_9p0p6_to_discrete[ch]][i];
317+
break;
246318
case SOURCE_CONFIG_PRESET_AALTO_MCC:
247319
nCH = 45;
248320
for(ch=0; ch<nCH; ch++)

examples/src/array2sh/array2sh_internal.c

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,138 @@
4949

5050
#include "array2sh_internal.h"
5151

52+
const int array2sh_defaultNumSensors = 4;
53+
54+
const float array2sh_defaultSensorsDirections[MAX_NUM_INPUTS][2] =
55+
{ { 45.0f, 35.264f},
56+
{ -45.0f, -35.264f},
57+
{ 135.0f, -35.264f},
58+
{ -135.0f, 35.264f},
59+
{ -59.5674172539630f, -69.7763953095265f},
60+
{ -107.629493132161f, 10.0801907586439f},
61+
{ 59.5651193014662f, 69.7750019669784f},
62+
{ -72.3715136529922f, -10.0909592824967f},
63+
{ 120.418832045969f, -69.7630732527928f},
64+
{ 72.3705387467529f, 10.0908849630425f},
65+
{ 10.5699823270029f, 17.3489915451677f},
66+
{ -169.426851150349f, 17.3476277272366f},
67+
{ -30.7728814706980f, 68.2546206344998f},
68+
{ 101.529181734204f, 18.5653877408229f},
69+
{ 149.250234431564f, 68.2619792676765f},
70+
{ 18.9183978612362f, -10.9197242075287f},
71+
{ 78.4729799557400f, -18.5558892226653f},
72+
{ -18.9161109968480f, 10.9195275229078f},
73+
{ -78.4723066816396f, 18.5565169424192f},
74+
{ -161.085243560336f, -10.9220975953767f},
75+
{ -101.530063994217f, -18.5648176173994f},
76+
{ 161.085855454581f, 10.9237834974412f},
77+
{ 30.7790837424989f, -68.2562996173874f},
78+
{ -149.255648697558f, -68.2594892022576f},
79+
{ 56.4638592172755f, 41.2645742763346f},
80+
{ 46.4626904606488f, 24.5386896277818f},
81+
{ -123.528839291756f, 41.2565889648213f},
82+
{ 32.1932295461248f, 38.8027347956192f},
83+
{ 133.534545076742f, -24.5310453346374f},
84+
{ -32.1935458377634f, -38.8041545028931f},
85+
{ -133.533477606995f, 24.5319420428588f},
86+
{ -147.797881221742f, 38.7980990097138f},
87+
{ -46.4626630742447f, -24.5400749997299f},
88+
{ 147.799544204027f, -38.7965984357137f},
89+
{ -56.4649576930965f, -41.2658215291547f},
90+
{ 123.530547454259f, -41.2555316199835f},
91+
{ 84.7385596473317f, 27.3132538556364f},
92+
{ 27.4072860474693f, 4.67593317316088f},
93+
{ -95.2612516264878f, 27.3036967398252f},
94+
{ 10.0607591758466f, 62.2287426217158f},
95+
{ 152.592710471291f, -4.67007594116539f},
96+
{ -10.0604693351594f, -62.2317767049329f},
97+
{ -152.592615409799f, 4.67188744845125f},
98+
{ -169.918387889403f, 62.2272712110016f},
99+
{ -27.4047652820400f, -4.67684895484045f},
100+
{ 169.918493477140f, -62.2246416140826f},
101+
{ -84.7390238025025f, -27.3120311727342f},
102+
{ 95.2622793653641f, -27.3027426350066f},
103+
{ 136.272846725200f, -0.726139068263599f},
104+
{ -1.05456977390436f, -46.2698051615206f},
105+
{ -43.7263256019408f, -0.737666959763443f},
106+
{ -91.0084089447853f, 43.7170295842697f},
107+
{ -178.936314291048f, 46.2682278552731f},
108+
{ 91.0100541861312f, -43.7163112498585f},
109+
{ 178.938490558618f, -46.2666218304286f},
110+
{ 88.9860902890987f, 43.7285680951606f},
111+
{ 1.05095788619312f, 46.2682407577363f},
112+
{ -88.9851906686018f, -43.7278600822776f},
113+
{ -136.273314433943f, 0.726484363994244f},
114+
{ 43.7273191822901f, 0.733967099281741f},
115+
{ 55.2321077221357f, 10.8187456245361f},
116+
{ 13.0867814081219f, 34.0654299770448f},
117+
{ -124.767898552651f, 10.8099467408727f},
118+
{ 71.4751302534919f, 53.7984109774923f},
119+
{ 166.905549455530f, -34.0625862919868f},
120+
{ -71.4765158530160f, -53.8002805142714f},
121+
{ -166.904587570338f, 34.0633858486074f},
122+
{ -108.515564585463f, 53.7864186881779f},
123+
{ -13.0869589355977f, -34.0644403811701f},
124+
{ 108.517274377512f, -53.7853093207457f},
125+
{ -55.2337689585088f, -10.8200079671294f},
126+
{ 124.767519417537f, -10.8096092876561f},
127+
{ -105.493359369733f, -68.1345228940484f},
128+
{ -111.151973933085f, -5.71277564515985f},
129+
{ 74.5244447329726f, -68.1205741555505f},
130+
{ -173.885132403874f, -21.0401043953034f},
131+
{ -68.8521018079939f, 5.70313885775370f},
132+
{ 173.885050918764f, 21.0419786777516f},
133+
{ 68.8513569996117f, -5.70297394874866f},
134+
{ 6.12041448982713f, -21.0387333986971f},
135+
{ 111.151515131908f, 5.71357243375474f},
136+
{ -6.11913621739966f, 21.0397756114589f},
137+
{ 105.487055344890f, 68.1331981897040f},
138+
{ -74.5188619841755f, 68.1214716326340f},
139+
{ 35.2822222163987f, -15.1801841162885f},
140+
{ -25.1732516880600f, 51.9826514887145f},
141+
{ -144.722913967824f, -15.1859965048827f},
142+
{ 108.386507250934f, 33.8824333892584f},
143+
{ -154.839566662519f, -51.9856067440744f},
144+
{ -108.385758587361f, -33.8826426573830f},
145+
{ 154.840828582605f, 51.9884126722963f},
146+
{ -71.6110721306039f, 33.8714084774643f},
147+
{ 25.1699762263473f, -51.9843011897216f},
148+
{ 71.6126173250777f, -33.8705490198003f},
149+
{ -35.2810594358470f, 15.1763090469469f},
150+
{ 144.722474074749f, 15.1863112389402f},
151+
{ -125.277803641269f, -28.5561977838671f},
152+
{ -146.317489805034f, -30.4888082061806f},
153+
{ 54.7220842889970f, -28.5463137051834f},
154+
{ -133.292600372594f, -45.8199818171681f},
155+
{ -33.6854220654234f, 30.4794807422719f},
156+
{ 133.295169860873f, 45.8200619710773f},
157+
{ 33.6830420572493f, -30.4828689919959f},
158+
{ 46.7098267598019f, -45.8106991831118f},
159+
{ 146.318736830907f, 30.4889588527258f},
160+
{ -46.7107531920589f, 45.8077510168776f},
161+
{ 125.278543193551f, 28.5567151663926f},
162+
{ -54.7226679373581f, 28.5424675755949f},
163+
{ -144.402199049652f, 54.7141577397485f},
164+
{ 112.382216591782f, -28.0100385212576f},
165+
{ 35.5834085793474f, 54.7193853715013f},
166+
{ -29.9155874729000f, -19.6471282266303f},
167+
{ 67.6163420587218f, 28.0211878299760f},
168+
{ 29.9151078604395f, 19.6461577548916f},
169+
{ -67.6164804090156f, -28.0221553885221f},
170+
{ 150.081679085309f, -19.6396879622134f},
171+
{ -112.381365317985f, 28.0105570315277f},
172+
{ -150.081127534239f, 19.6412999777121f},
173+
{ 144.402936805264f, -54.7127597303097f},
174+
{ -35.5837994140428f, -54.7203576209200f},
175+
{ 68.5348504928164f, -52.8527273534571f},
176+
{ -54.8218918027732f, 12.7570858971645f},
177+
{ -111.464947340552f, -52.8652964226689f},
178+
{ 164.510735700738f, 34.1892226850382f},
179+
{ -125.181243085238f, -12.7710900404128f},
180+
{ -164.510172672569f, -34.1865270720665f},
181+
{ 125.180742749445f, 12.7714932994183f},
182+
{ -15.4967238792034f, 34.1855682977571f}};
183+
52184
/**
53185
* Takes the bNs computed up to N+1, and replicates them to be of length
54186
* (N+1)^2 (replicating the 1st order bNs 3 times, 2nd -> 5 times etc.)

0 commit comments

Comments
 (0)