SAF
Loading...
Searching...
No Matches
saf_reverb_internal.c File Reference

Internal source for the reverb processing module (SAF_REVERB_MODULE) More...

#include "saf_reverb.h"
#include "saf_reverb_internal.h"

Go to the source code of this file.

Functions

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_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_coreInitT (void *hWork, float room[3], ims_pos_xyz src, ims_pos_xyz rec, float maxTime_s, 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.
 

Detailed Description

Internal source for the reverb processing module (SAF_REVERB_MODULE)

A collection of reverb and room simulation algorithms.

Author
Leo McCormack
Date
06.05.2020
License
ISC

Definition in file saf_reverb_internal.c.

Function Documentation

◆ ims_shoebox_coreAbsorptionModule()

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-].

Note
Call ims_shoebox_coreRecModuleX before applying the absoption
Parameters
[in]hWorkworkspace handle
[in]abs_wallAbsorption coefficients; nBands x 6

Definition at line 576 of file saf_reverb_internal.c.

◆ ims_shoebox_coreInitN()

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.

Parameters
[in]hWorkworkspace handle
[in]roomRoom dimensions, in meters
[in]srcSource position, in meters
[in]recReceiver position, in meters
[in]maxNMaximum propagation time to compute the echogram, seconds
[in]c_msSpeed of source, in meters per second

Definition at line 399 of file saf_reverb_internal.c.

◆ ims_shoebox_coreInitT()

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
*
* 
Parameters
[in]hWorkworkspace handle
[in]roomRoom dimensions, in meters
[in]srcSource position, in meters
[in]recReceiver position, in meters
[in]maxTimeMaximum propagation time to compute the echogram, seconds
[in]c_msSpeed of source, in meters per second

Definition at line 269 of file saf_reverb_internal.c.

◆ ims_shoebox_coreRecModuleSH()

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.

Note
Call ims_shoebox_coreInit() before applying the directivities
Parameters
[in]hWorkworkspace handle
[in]sh_orderSpherical harmonic order

Definition at line 523 of file saf_reverb_internal.c.

◆ ims_shoebox_coreWorkspaceCreate()

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.

Parameters
[in]phWork(&) address of the workspace handle
[in]nBandsNumber of bands

Definition at line 173 of file saf_reverb_internal.c.

◆ ims_shoebox_coreWorkspaceDestroy()

void ims_shoebox_coreWorkspaceDestroy ( void ** phWork)

Destroys an instance of the core workspace.

Parameters
[in]phWork(&) address of the workspace handle

Definition at line 224 of file saf_reverb_internal.c.

◆ ims_shoebox_echogramCopy()

void ims_shoebox_echogramCopy ( void * hEchoX,
void * hEchoY )

Copies echogram data from container 'X' into container 'Y' (also resizing 'Y' as needed)

Warning
Helper variables are resized (if needed), but do not copy values!
Parameters
[in]hEchoXechogram container X
[in]hEchoYechogram container Y

Definition at line 107 of file saf_reverb_internal.c.

◆ ims_shoebox_echogramCreate()

void ims_shoebox_echogramCreate ( void ** phEcho,
int include_rt_vars )

Creates an instance of an echogram container.

Parameters
[in]phEcho(&) address of the echogram container
[in]include_rt_vars1: optional run-time helper functions enabled, 0: disabled

Definition at line 36 of file saf_reverb_internal.c.

◆ ims_shoebox_echogramDestroy()

void ims_shoebox_echogramDestroy ( void ** phEcho)

Destroys an instance of an echogram container.

Parameters
[in]phEcho(&) address of the echogram container

Definition at line 138 of file saf_reverb_internal.c.

◆ ims_shoebox_echogramResize()

void ims_shoebox_echogramResize ( void * hEcho,
int numImageSources,
int nChannels )

Resizes an echogram container.

Note
The container is only resized if the number of image sources or channels have changed.
Parameters
[in]hEchoechogram container
[in]numImageSourcesNew number of image sources
[in]nChannelsNew number of channels

Definition at line 70 of file saf_reverb_internal.c.

◆ ims_shoebox_renderRIR()

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.

Note
Call ims_shoebox_coreAbsorptionModule() before rendering rir
Parameters
[in]hWorkworkspace handle
[in]fractionalDelayFLAG0: disabled, 1: use Lagrange interpolation
[in]fsSampleRate, Hz
[in]H_filtfilterbank; nBands x (filterOrder+1)
[out]rirRoom impulse response

Definition at line 640 of file saf_reverb_internal.c.