29#ifndef __REVERB_INTERNAL_H_INCLUDED__
30#define __REVERB_INTERNAL_H_INCLUDED__
46#define IMS_NUM_WALLS_SHOEBOX ( 6 )
48#define IMS_FIR_FILTERBANK_ORDER ( 400 )
50#define IMS_IIR_FILTERBANK_ORDER ( 3 )
52#define IMS_CIRC_BUFFER_LENGTH ( 4*8192U )
54#define IMS_CIRC_BUFFER_LENGTH_MASK ( IMS_CIRC_BUFFER_LENGTH - 1U )
56#define IMS_MAX_NSAMPLES_PER_FRAME ( 20000 )
58#define IMS_LAGRANGE_ORDER ( 2 )
60#define IMS_LAGRANGE_LOOKUP_TABLE_SIZE ( 100 )
62#define IMS_EG_CURRENT ( 0 )
64#define IMS_EG_PREV ( 1 )
66#define IMS_EG_NUM_SLOTS ( 2 )
68#define IMS_UNASSIGNED ( -1 )
75typedef struct _ims_pos_xyz {
93typedef struct _ims_src_obj
102typedef struct _ims_rec_obj
113typedef struct _echogram_data
155typedef struct _ims_core_workspace
167 int lengthVec, numImageSources;
171 int* iII, *iJJ, *iKK;
172 float* s_x, *s_y, *s_z, *s_d, *s_t, *s_att;
190 float rir_len_seconds;
200typedef struct _ims_scene_data
278 int include_rt_vars);
407 int fractionalDelayFLAG,
#define IMS_MAX_NUM_SOURCES
TODO: Arbitrary array receiver option; Directional source option; finish ims_shoebox_renderRIRs() fun...
#define IMS_MAX_NUM_RECEIVERS
Maximum number of receivers supported by an instance of the IMS simulator.
Include header for SAF externals.
Main header for the reverb processing module (SAF_REVERB_MODULE)
void ims_shoebox_coreWorkspaceCreate(void **phWork, int nBands)
Creates an instance of the core workspace.
RECEIVER_TYPES
Supported receiver types.
@ RECEIVER_SH
Spherical harmonic receiver.
#define IMS_LAGRANGE_ORDER
Order of lagrange interpolation filters.
void ims_shoebox_coreWorkspaceDestroy(void **phWork)
Destroys an instance of the core workspace.
void ims_shoebox_coreRecModuleSH(void *hWork, int sh_order)
Imposes spherical harmonic directivies onto the echogram computed with ims_shoebox_coreInit() for a s...
#define IMS_LAGRANGE_LOOKUP_TABLE_SIZE
Lagrange interpolator look-up table size.
void ims_shoebox_echogramResize(void *hEcho, int numImageSources, int nChannels)
Resizes an echogram container.
void ims_shoebox_coreAbsorptionModule(void *hWork, float **abs_wall)
Applies boundary absoption per frequency band, onto the echogram computed with ims_shoebox_coreRecMod...
void ims_shoebox_renderRIR(void *hWork, int fractionalDelayFLAG, float fs, float **H_filt, ims_rir *rir)
Renders a room impulse response for a specific source/reciever combination.
void ims_shoebox_echogramCreate(void **phEcho, int include_rt_vars)
Creates an instance of an echogram container.
void ims_shoebox_echogramCopy(void *hEchoX, void *hEchoY)
Copies echogram data from container 'X' into container 'Y' (also resizing 'Y' as needed)
void ims_shoebox_coreInitN(void *hWork, float room[3], ims_pos_xyz src, ims_pos_xyz rec, int maxN, float c_ms)
Calculates an echogram of a rectangular space using the image source method, for a specific source/re...
void ims_shoebox_echogramDestroy(void **phEcho)
Destroys an instance of an echogram container.
void * voidPtr
Void pointer (just to improve code readability when working with arrays of handles)
void ims_shoebox_coreInitT(void *hWork, float room[3], ims_pos_xyz src, ims_pos_xyz rec, float maxTime, float c_ms)
Calculates an echogram of a rectangular space using the image source method, for a specific source/re...
#define IMS_EG_NUM_SLOTS
Number of echogram slots.
Main header for the Spherical Harmonic Transform and Spherical Array Processing module (SAF_SH_MODULE...
Main header for the utilities module (SAF_UTILITIES_MODULE)
float ** value
Echogram magnitudes per image source and channel; nChannels x numImageSources.
float ** contrib
Total contribution (i.e.
int numImageSources
Number of image sources in current echogram.
int ** order
Reflection order for each image and dimension; numImageSources x 3.
int * rIdx
Current circular buffer read indices; numImageSources x 1.
ims_pos_xyz * coords
Reflection coordinates (Cartesian); numImageSources x 3.
int nChannels
Number of channels.
float ** h_frac
Current fractional delay coeffs; (IMS_LAGRANGE_ORDER+1) x numImageSources x.
float ** cb_vals
Current circular buffer values (per channel & image source); nChannels x numImageSources.
int include_rt_vars
0: the below vars are disabled, 1: enabled
float * time
Propagation time (in seconds) for each image source; numImageSources x 1.
int * sortedIdx
Indices that sort the echogram based on propagation time in ascending order; numImageSources x 1.
float * tmp1
1st temporary vector; numImageSources x 1
float * ones_dummy
Just a vector of ones, for the cblas_sdot sum hack, and fmodf; numImageSources x 1.
float * tmp2
2nd temporary vector; numImageSources x 1
Helper structure, comprising variables used when computing echograms and rendering RIRs.
void * hEchogram_rec
Echogram with the receiver directivities applied (multi-channel)
voidPtr * hPrevEchogram_abs
Previous echograms (hEchogram_abs), one per band, which can be used for cross- fading.
ims_pos_xyz rec
Receiver position.
voidPtr * hEchogram_abs
Echograms with the receiver directivities and also wall absorption applied (multi- channel); one echo...
int refreshEchogramFLAG
1: Refresh needed, 0: refresh not needed
void * hEchogram
Pressure echogram (single-channel)
int N_max
Maximum reflection order.
ims_pos_xyz src
Source position.
int nBands
Number of bands.
float d_max
Maximum distance, in meters.
Union struct for Cartesian coordinates (access as .x,.y,.z, or .v[3])
float y
y Cartesian coordinate, in metres
float z
z Cartesian coordinate, in metres
float x
x Cartesian coordinate, in metres
RECEIVER_TYPES type
Receiver type (see RECEIVER_TYPES enum)
int nChannels
Number of channels for receiver.
ims_pos_xyz pos
Receiver position.
int ID
Unique receiver ID.
float ** sigs
Receiver signal pointers (one per channel)
Output format of the rendered room impulse responses (RIR)
float * band_cutofffreqs
Octave band CUTOFF frequencies; (nBands-1) x 1.
long nSources
Current number of sources.
float c_ms
Speed of sound, in ms^1.
float * interpolator_fIn
framesize x 1
int nBands
Number of frequency bands.
float ** abs_wall
Wall aborption coeffs per wall; nBands x 6.
float *** src_sigs_bands
nSources x nBands x nSamples
float * band_centerfreqs
Octave band CENTRE frequencies; nBands x 1.
float * tmp_frame
framesize x 1
int framesize
Curent framesize in samples.
long nReceivers
Current number of receivers.
voidPtr ** hCoreWrkSpc
One per source/receiver combination.
ims_rir ** rirs
One per source/receiver combination.
float ** H_filt
nBands x (IMS_FIR_FILTERBANK_ORDER+1)
float * interpolator_fOut
framesize x 1
voidPtr * hFaFbank
One per source.
ims_pos_xyz pos
Source position.
float * sig
Source signal pointer.