30 float mov_src_pos[3], mov_rec_pos[3];
31 int sourceID_1, sourceID_2, sourceID_3, sourceID_4, sourceID_5, receiverID;
35 const int sh_order = 3;
37 const float abs_wall[7][6] =
38 { {0.180791250f, 0.207307300f, 0.134990800f, 0.229002250f, 0.212128400f, 0.241055000f},
39 {0.225971250f, 0.259113700f, 0.168725200f, 0.286230250f, 0.265139600f, 0.301295000f},
40 {0.258251250f, 0.296128100f, 0.192827600f, 0.327118250f, 0.303014800f, 0.344335000f},
41 {0.301331250f, 0.345526500f, 0.224994001f, 0.381686250f, 0.353562000f, 0.401775000f},
42 {0.361571250f, 0.414601700f, 0.269973200f, 0.457990250f, 0.424243600f, 0.482095000f},
43 {0.451931250f, 0.518214500f, 0.337442000f, 0.572446250f, 0.530266000f, 0.602575000f},
44 {0.602591250f, 0.690971300f, 0.449934800f, 0.763282250f, 0.707040400f, 0.803455000f} };
45 const float src_pos[3] = {5.1f, 6.0f, 1.1f};
46 const float src2_pos[3] = {2.1f, 1.0f, 1.3f};
47 const float src3_pos[3] = {4.4f, 3.0f, 1.4f};
48 const float src4_pos[3] = {6.4f, 4.0f, 1.3f};
49 const float src5_pos[3] = {8.5f, 5.0f, 1.8f};
50 const float rec_pos[3] = {8.8f, 5.5f, 0.9f};
51 const float roomdims[3] = {10.0f, 7.0f, 3.0f};
54 ims_shoebox_create(&hIms, (
float*)roomdims, (
float*)abs_wall, 125.0f, nBands, 343.0f, 48e3f);
61 memcpy(mov_src_pos, src_pos, 3*
sizeof(
float));
62 memcpy(mov_rec_pos, rec_pos, 3*
sizeof(
float));
64 mov_src_pos[1] = 2.0f + (float)i/100.0f;
65 mov_rec_pos[0] = 3.0f + (float)i/100.0f;
86 mov_src_pos[1] = 2.0f + (float)i/10.0f;
87 mov_rec_pos[0] = 3.0f + (float)i/10.0f;
101 float mov_src_pos[3], mov_rec_pos[3];
102 float** src_sigs, ***rec_sh_outsigs;
103 int sourceIDs[4], receiverIDs[1];
107 const int signalLength = 10000;
108 const int sh_order = 3;
109 const int nBands = 5;
110 const float abs_wall[5][6] =
111 { {0.180791250f, 0.207307300f, 0.134990800f, 0.229002250f, 0.212128400f, 0.241055000f},
112 {0.225971250f, 0.259113700f, 0.168725200f, 0.286230250f, 0.265139600f, 0.301295000f},
113 {0.258251250f, 0.296128100f, 0.192827600f, 0.327118250f, 0.303014800f, 0.344335000f},
114 {0.301331250f, 0.345526500f, 0.224994001f, 0.381686250f, 0.353562000f, 0.401775000f},
115 {0.361571250f, 0.414601700f, 0.269973200f, 0.457990250f, 0.424243600f, 0.482095000f} };
116 const float src_pos[3] = {5.1f, 6.0f, 1.1f};
117 const float src2_pos[3] = {2.1f, 1.0f, 1.3f};
118 const float src3_pos[3] = {3.1f, 5.0f, 2.3f};
119 const float src4_pos[3] = {7.1f, 2.0f, 1.4f};
120 const float rec_pos[3] = {8.8f, 5.5f, 0.9f};
121 const float roomdims[3] = {10.0f, 7.0f, 3.0f};
124 rec_sh_outsigs = (
float***)
malloc3d(1,
ORDER2NSH(sh_order), signalLength,
sizeof(float));
125 src_sigs = (
float**)
malloc2d(4, signalLength,
sizeof(
float));
129 ims_shoebox_create(&hIms, (
float*)roomdims, (
float*)abs_wall, 250.0f, nBands, 343.0f, 48e3f);
138 memcpy(mov_src_pos, src_pos, 3*
sizeof(
float));
139 memcpy(mov_rec_pos, rec_pos, 3*
sizeof(
float));
141 mov_src_pos[1] = 2.0f + (float)i/100.0f;
142 mov_rec_pos[0] = 3.0f + (float)i/100.0f;
151 free(rec_sh_outsigs);
void ims_shoebox_applyEchogramTD(void *hIms, long receiverID, int nSamples, int fractionalDelaysFLAG)
Applies the currently computed echograms in the time-domain, for all sources, for one specified recei...
void ims_shoebox_create(void **phIms, float roomDimensions[3], float *abs_wall, float lowestOctaveBand, int nOctBands, float c_ms, float fs)
Creates an instance of ims_shoebox room simulator.