SAF
|
Internal header for the reverb processing module (SAF_REVERB_MODULE) More...
#include "saf_reverb.h"
#include "saf_externals.h"
#include "../saf_utilities/saf_utilities.h"
#include "../saf_sh/saf_sh.h"
Go to the source code of this file.
Data Structures | |
struct | ims_pos_xyz |
Union struct for Cartesian coordinates (access as .x,.y,.z, or .v[3]) More... | |
struct | ims_src_obj |
Source object. More... | |
struct | ims_rec_obj |
Receiver object. More... | |
struct | echogram_data |
Echogram structure. More... | |
struct | ims_core_workspace |
Helper structure, comprising variables used when computing echograms and rendering RIRs. More... | |
struct | ims_scene_data |
Main structure for IMS. More... | |
Macros | |
#define | IMS_NUM_WALLS_SHOEBOX ( 6 ) |
Number of wall for a shoebox room. | |
#define | IMS_FIR_FILTERBANK_ORDER ( 400 ) |
FIR filter order (must be even) | |
#define | IMS_IIR_FILTERBANK_ORDER ( 3 ) |
IIR filter order (1st or 3rd) | |
#define | IMS_CIRC_BUFFER_LENGTH ( 4*8192U ) |
Circular buffer length. | |
#define | IMS_CIRC_BUFFER_LENGTH_MASK ( IMS_CIRC_BUFFER_LENGTH - 1U ) |
Circular buffer length, minus 1. | |
#define | IMS_MAX_NSAMPLES_PER_FRAME ( 20000 ) |
Maximum number of samples that ims should expect to process at a time. | |
#define | IMS_LAGRANGE_ORDER ( 2 ) |
Order of lagrange interpolation filters. | |
#define | IMS_LAGRANGE_LOOKUP_TABLE_SIZE ( 100 ) |
Lagrange interpolator look-up table size. | |
#define | IMS_EG_CURRENT ( 0 ) |
Index for the current echogram slot. | |
#define | IMS_EG_PREV ( 1 ) |
Index for the previous echogram slot. | |
#define | IMS_EG_NUM_SLOTS ( 2 ) |
Number of echogram slots. | |
#define | IMS_UNASSIGNED ( -1 ) |
While a source or receiver ID is yet to be active, it is "IMS_UNASSIGNED". | |
Typedefs | |
typedef void * | voidPtr |
Void pointer (just to improve code readability when working with arrays of handles) | |
Enumerations | |
enum | RECEIVER_TYPES { RECEIVER_SH } |
Supported receiver types. More... | |
Functions | |
void | ims_shoebox_coreWorkspaceCreate (void **phWork, int nBands) |
Creates an instance of the core workspace. | |
void | ims_shoebox_coreWorkspaceDestroy (void **phWork) |
Destroys an instance of the core workspace. | |
void | ims_shoebox_echogramCreate (void **phEcho, int include_rt_vars) |
Creates an instance of an echogram container. | |
void | ims_shoebox_echogramResize (void *hEcho, int numImageSources, int nChannels) |
Resizes 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_echogramDestroy (void **phEcho) |
Destroys an instance of an echogram container. | |
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/reciever combination up to a maximum propagation time. | |
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/reciever combination up to a maximum reflection order. | |
void | ims_shoebox_coreRecModuleSH (void *hWork, int sh_order) |
Imposes spherical harmonic directivies onto the echogram computed with ims_shoebox_coreInit() for a specific source/reciever combination. | |
void | ims_shoebox_coreAbsorptionModule (void *hWork, float **abs_wall) |
Applies boundary absoption per frequency band, onto the echogram computed with ims_shoebox_coreRecModuleSH() for a specific source/reciever combination. | |
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. | |
Internal header for the reverb processing module (SAF_REVERB_MODULE)
A collection of reverb and room simulation algorithms.
Definition in file saf_reverb_internal.h.
#define IMS_CIRC_BUFFER_LENGTH ( 4*8192U ) |
Circular buffer length.
Definition at line 52 of file saf_reverb_internal.h.
#define IMS_CIRC_BUFFER_LENGTH_MASK ( IMS_CIRC_BUFFER_LENGTH - 1U ) |
Circular buffer length, minus 1.
Definition at line 54 of file saf_reverb_internal.h.
#define IMS_EG_CURRENT ( 0 ) |
Index for the current echogram slot.
Definition at line 62 of file saf_reverb_internal.h.
#define IMS_EG_NUM_SLOTS ( 2 ) |
Number of echogram slots.
Definition at line 66 of file saf_reverb_internal.h.
#define IMS_EG_PREV ( 1 ) |
Index for the previous echogram slot.
Definition at line 64 of file saf_reverb_internal.h.
#define IMS_FIR_FILTERBANK_ORDER ( 400 ) |
FIR filter order (must be even)
Definition at line 48 of file saf_reverb_internal.h.
#define IMS_IIR_FILTERBANK_ORDER ( 3 ) |
IIR filter order (1st or 3rd)
Definition at line 50 of file saf_reverb_internal.h.
#define IMS_LAGRANGE_LOOKUP_TABLE_SIZE ( 100 ) |
Lagrange interpolator look-up table size.
Definition at line 60 of file saf_reverb_internal.h.
#define IMS_LAGRANGE_ORDER ( 2 ) |
Order of lagrange interpolation filters.
Definition at line 58 of file saf_reverb_internal.h.
#define IMS_MAX_NSAMPLES_PER_FRAME ( 20000 ) |
Maximum number of samples that ims should expect to process at a time.
Definition at line 56 of file saf_reverb_internal.h.
#define IMS_NUM_WALLS_SHOEBOX ( 6 ) |
Number of wall for a shoebox room.
Definition at line 46 of file saf_reverb_internal.h.
#define IMS_UNASSIGNED ( -1 ) |
While a source or receiver ID is yet to be active, it is "IMS_UNASSIGNED".
Definition at line 68 of file saf_reverb_internal.h.
typedef void* voidPtr |
Void pointer (just to improve code readability when working with arrays of handles)
Definition at line 72 of file saf_reverb_internal.h.
enum RECEIVER_TYPES |
Supported receiver types.
Enumerator | |
---|---|
RECEIVER_SH | Spherical harmonic receiver. |
Definition at line 86 of file saf_reverb_internal.h.
void ims_shoebox_coreAbsorptionModule | ( | void * | hWork, |
float ** | abs_wall ) |
Applies boundary absoption per frequency band, onto the echogram computed with ims_shoebox_coreRecModuleSH() for a specific source/reciever combination.
Absorption coefficients are given for each of the walls on the respective planes [x+ y+ z+; x- y- z-].
[in] | hWork | workspace handle |
[in] | abs_wall | Absorption coefficients; nBands x 6 |
Definition at line 576 of file saf_reverb_internal.c.
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/reciever combination up to a maximum reflection order.
[in] | hWork | workspace handle |
[in] | room | Room dimensions, in meters |
[in] | src | Source position, in meters |
[in] | rec | Receiver position, in meters |
[in] | maxN | Maximum propagation time to compute the echogram, seconds |
[in] | c_ms | Speed of source, in meters per second |
Definition at line 399 of file saf_reverb_internal.c.
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/reciever combination up to a maximum propagation time.
Note the coordinates of source/receiver are specified from the left ground corner of the room:
* * ^x * __|__ _ * | | | | * | | | | * y<----. | | l * | | | * | | | * o_____| - * * |-----| * w * *
[in] | hWork | workspace handle |
[in] | room | Room dimensions, in meters |
[in] | src | Source position, in meters |
[in] | rec | Receiver position, in meters |
[in] | maxTime | Maximum propagation time to compute the echogram, seconds |
[in] | c_ms | Speed of source, in meters per second |
Definition at line 269 of file saf_reverb_internal.c.
void ims_shoebox_coreRecModuleSH | ( | void * | hWork, |
int | sh_order ) |
Imposes spherical harmonic directivies onto the echogram computed with ims_shoebox_coreInit() for a specific source/reciever combination.
[in] | hWork | workspace handle |
[in] | sh_order | Spherical harmonic order |
Definition at line 523 of file saf_reverb_internal.c.
void ims_shoebox_coreWorkspaceCreate | ( | void ** | phWork, |
int | nBands ) |
Creates an instance of the core workspace.
The idea is that there is one core workspace instance per source/receiver combination.
[in] | phWork | (&) address of the workspace handle |
[in] | nBands | Number of bands |
Definition at line 173 of file saf_reverb_internal.c.
void ims_shoebox_coreWorkspaceDestroy | ( | void ** | phWork | ) |
Destroys an instance of the core workspace.
[in] | phWork | (&) address of the workspace handle |
Definition at line 224 of file saf_reverb_internal.c.
void ims_shoebox_echogramCopy | ( | void * | hEchoX, |
void * | hEchoY ) |
Copies echogram data from container 'X' into container 'Y' (also resizing 'Y' as needed)
[in] | hEchoX | echogram container X |
[in] | hEchoY | echogram container Y |
Definition at line 107 of file saf_reverb_internal.c.
void ims_shoebox_echogramCreate | ( | void ** | phEcho, |
int | include_rt_vars ) |
Creates an instance of an echogram container.
[in] | phEcho | (&) address of the echogram container |
[in] | include_rt_vars | 1: optional run-time helper functions enabled, 0: disabled |
Definition at line 36 of file saf_reverb_internal.c.
void ims_shoebox_echogramDestroy | ( | void ** | phEcho | ) |
Destroys an instance of an echogram container.
[in] | phEcho | (&) address of the echogram container |
Definition at line 138 of file saf_reverb_internal.c.
void ims_shoebox_echogramResize | ( | void * | hEcho, |
int | numImageSources, | ||
int | nChannels ) |
Resizes an echogram container.
[in] | hEcho | echogram container |
[in] | numImageSources | New number of image sources |
[in] | nChannels | New number of channels |
Definition at line 70 of file saf_reverb_internal.c.
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.
[in] | hWork | workspace handle |
[in] | fractionalDelayFLAG | 0: disabled, 1: use Lagrange interpolation |
[in] | fs | SampleRate, Hz |
[in] | H_filt | filterbank; nBands x (filterOrder+1) |
[out] | rir | Room impulse response |
Definition at line 640 of file saf_reverb_internal.c.