SAF
|
A sound-field visualiser, which utilises spherical harmonic signals as input; note this code is a remnant from the work conducted in [1]. More...
#include "_common.h"
Go to the source code of this file.
Enumerations | |
enum | POWERMAP_MODES { PM_MODE_PWD = 1 , PM_MODE_MVDR , PM_MODE_CROPAC_LCMV , PM_MODE_MUSIC , PM_MODE_MUSIC_LOG , PM_MODE_MINNORM , PM_MODE_MINNORM_LOG } |
Available power-map/activity-map options. More... | |
Functions | |
void | powermap_create (void **const phPm) |
Creates an instance of the powermap. | |
void | powermap_destroy (void **const phPm) |
Destroys an instance of the powermap. | |
void | powermap_init (void *const hPm, float samplerate) |
Initialises an instance of powermap with default settings. | |
void | powermap_initCodec (void *const hPm) |
Intialises the codec variables, based on current global/user parameters. | |
void | powermap_analysis (void *const hPm, const float *const *inputs, int nInputs, int nSamples, int isPlaying) |
Analyses the input spherical harmonic signals to generate an activity-map. | |
void | powermap_refreshSettings (void *const hPm) |
Sets all intialisation flags to 1; re-initialising all settings/variables as powermap is currently configured, at next available opportunity. | |
void | powermap_setPowermapMode (void *const hPm, int newMode) |
Sets the powermap/activity-map approach, (see POWERMAP_MODES enum) | |
void | powermap_setMasterOrder (void *const hPm, int newValue) |
Sets the maximum input/analysis order (see SH_ORDERS enum) | |
void | powermap_setAnaOrder (void *const hPm, int newValue, int bandIdx) |
Sets the input/analysis order for one specific frequency band index. | |
void | powermap_setAnaOrderAllBands (void *const hPm, int newValue) |
Sets the input/analysis order for all frequency bands. | |
void | powermap_setPowermapEQ (void *const hPm, float newValue, int bandIdx) |
Sets the weighting coefficient for a particular frequency band, allowing one to "equalise" the activity-map. | |
void | powermap_setPowermapEQAllBands (void *const hPm, float newValue) |
Sets the weighting coefficient for all frequency bands. | |
void | powermap_setCovAvgCoeff (void *const hPm, float newAvg) |
Sets the covariance matrix averaging coefficient, 0..1. | |
void | powermap_setChOrder (void *const hPm, int newOrder) |
Sets the Ambisonic channel ordering convention to decode with, in order to match the convention employed by the input signals (see CH_ORDER enum) | |
void | powermap_setNormType (void *const hPm, int newType) |
Sets the Ambisonic normalisation convention to decode with, in order to match with the convention employed by the input signals (see NORM_TYPES enum) | |
void | powermap_setSourcePreset (void *const hPm, int newPresetID) |
Sets an input preset; the microphone/hyrophone array used to capture the input signals, (see MIC_PRESETS enum) | |
void | powermap_setNumSources (void *const hPm, int newValue) |
Sets the number of sources present in the input sound scene. | |
void | powermap_setDispFOV (void *const hPm, int newOption) |
Sets the visualisation display window horizontal field-of-view (FOV) (see HFOV_OPTIONS enum) | |
void | powermap_setAspectRatio (void *const hPm, int newOption) |
Sets the visualisation display window aspect-ratio (see ASPECT_RATIO_OPTIONS enum) | |
void | powermap_setPowermapAvgCoeff (void *const hPm, float newValue) |
Sets the activity-map averaging coefficient, 0..1. | |
void | powermap_requestPmapUpdate (void *const hPm) |
Informs powermap that it should compute a new activity-map at its own convenience, if it would be so kind; thank you, God bless. | |
int | powermap_getFrameSize (void) |
Returns the processing framesize (i.e., number of samples processed with every _process() call ) | |
CODEC_STATUS | powermap_getCodecStatus (void *const hPm) |
Returns current codec status (see CODEC_STATUS enum) | |
float | powermap_getProgressBar0_1 (void *const hPm) |
(Optional) Returns current intialisation/processing progress, between 0..1 | |
void | powermap_getProgressBarText (void *const hPm, char *text) |
(Optional) Returns current intialisation/processing progress text | |
int | powermap_getMasterOrder (void *const hPm) |
Returns the current maximum analysis/input order (see SH_ORDERS enum) | |
int | powermap_getPowermapMode (void *const hPm) |
Returns the powermap/activity-map mode to employed for the analysis see POWERMAP_MODES enum. | |
int | powermap_getSamplingRate (void *const hPm) |
Returns the current sampling rate, in Hz. | |
float | powermap_getCovAvgCoeff (void *const hPm) |
Returns the current covariance averaging coefficient value, in Hz. | |
int | powermap_getNumberOfBands (void) |
Returns the number of frequency bands used for the analysis. | |
int | powermap_getNSHrequired (void *const hPm) |
Returns the number of spherical harmonic signals required by the current analysis order: (current_order + 1)^2. | |
float | powermap_getPowermapEQ (void *const hPm, int bandIdx) |
Returns the weighting coefficient for a particular frequency band index, allowing one to "equalise" the activity-map. | |
float | powermap_getPowermapEQAllBands (void *const hPm) |
Returns the weighting coefficient for the first frequency band. | |
void | powermap_getPowermapEQHandle (void *const hPm, float **pX_vector, float **pY_values, int *pNpoints) |
Returns the weighting coefficient for all frequency bands. | |
int | powermap_getAnaOrder (void *const hPm, int bandIdx) |
Returns the input/analysis order for one specific frequency band. | |
int | powermap_getAnaOrderAllBands (void *const hPm) |
Returns the input/analysis order for the first frequency band. | |
void | powermap_getAnaOrderHandle (void *const hPm, float **pX_vector, int **pY_values, int *pNpoints) |
Returns the input/analysis order for all frequency bands. | |
int | powermap_getChOrder (void *const hPm) |
Returns the Ambisonic channel ordering convention currently being used to decode with, which should match the convention employed by the input signals (see CH_ORDER enum) | |
int | powermap_getNormType (void *const hPm) |
Returns the Ambisonic normalisation convention currently being usedto decode with, which should match the convention employed by the input signals (see NORM_TYPES enum) | |
int | powermap_getNumSources (void *const hPm) |
Returns the number of sources present in the input sound scene. | |
int | powermap_getDispFOV (void *const hPm) |
Returns the current visualisation display window horizontal field-of-view (FOV) (see HFOV_OPTIONS enum) | |
int | powermap_getAspectRatio (void *const hPm) |
Returns the current visualisation display window aspect-ratio (see ASPECT_RATIO_OPTIONS enum) | |
float | powermap_getPowermapAvgCoeff (void *const hPm) |
Returns the current activity-map averaging coefficient, 0..1. | |
int | powermap_getPmap (void *const hPm, float **grid_dirs, float **pmap, int *nDirs, int *pmapWidth, int *hfov, int *aspectRatio) |
Returns the latest computed activity-map if it is ready. | |
int | powermap_getProcessingDelay (void) |
Returns the processing delay in samples (may be used for delay compensation features) | |
A sound-field visualiser, which utilises spherical harmonic signals as input; note this code is a remnant from the work conducted in [1].
Definition in file powermap.h.
enum POWERMAP_MODES |
Available power-map/activity-map options.
Enumerator | |
---|---|
PM_MODE_PWD | Activity-map based on the energy of hyper-cardioid [plane-wave decomposition (PWD)] beamformers. |
PM_MODE_MVDR | Activity-map based on the energy of minimum- variance distortionless response (MVDR) beamformers. |
PM_MODE_CROPAC_LCMV | Experimental! activity-map based on a linearly- contrained minimum-variance (LCMV) formulation of the Cross-Pattern Coherence (CroPaC) spatial filter. |
PM_MODE_MUSIC | Activity-map based on the sub-space method: multiple signal classification (MUSIC) |
PM_MODE_MUSIC_LOG | Same as PM_MODE_MUSIC, but log(out_values) |
PM_MODE_MINNORM | Activity-map based on the sub-space method: minimum-norm (Min-Norm) |
PM_MODE_MINNORM_LOG | Same as PM_MODE_MINNORM, but log(out_values) |
Definition at line 58 of file powermap.h.
void powermap_analysis | ( | void *const | hPm, |
const float *const * | inputs, | ||
int | nInputs, | ||
int | nSamples, | ||
int | isPlaying ) |
Analyses the input spherical harmonic signals to generate an activity-map.
[in] | hPm | powermap handle |
[in] | inputs | Input channel buffers; 2-D array: nInputs x nSamples |
[in] | nInputs | Number of input channels |
[in] | nSamples | Number of samples in 'inputs'/'output' matrices |
[in] | isPlaying | flag to say if there is audio in the input buffers, 0: no audio, reduced processing, 1: audio, full processing |
Definition at line 187 of file powermap.c.
void powermap_create | ( | void **const | phPm | ) |
Creates an instance of the powermap.
[in] | phPm | (&) address of powermap handle |
Definition at line 35 of file powermap.c.
void powermap_destroy | ( | void **const | phPm | ) |
Destroys an instance of the powermap.
[in] | phPm | (&) address of powermap handle |
Definition at line 95 of file powermap.c.
int powermap_getAnaOrder | ( | void *const | hPm, |
int | bandIdx ) |
Returns the input/analysis order for one specific frequency band.
Definition at line 648 of file powermap.c.
int powermap_getAnaOrderAllBands | ( | void *const | hPm | ) |
Returns the input/analysis order for the first frequency band.
Definition at line 654 of file powermap.c.
void powermap_getAnaOrderHandle | ( | void *const | hPm, |
float ** | pX_vector, | ||
int ** | pY_values, | ||
int * | pNpoints ) |
Returns the input/analysis order for all frequency bands.
[in] | hPm | powermap handle |
[out] | pX_vector | (&) frequency vector; pNpoints x 1 |
[out] | pY_values | (&) input/analysis orders; pNpoints x 1 |
[out] | pNpoints | (&) number of frequency bands |
Definition at line 660 of file powermap.c.
int powermap_getAspectRatio | ( | void *const | hPm | ) |
Returns the current visualisation display window aspect-ratio (see ASPECT_RATIO_OPTIONS enum)
Definition at line 709 of file powermap.c.
int powermap_getChOrder | ( | void *const | hPm | ) |
Returns the Ambisonic channel ordering convention currently being used to decode with, which should match the convention employed by the input signals (see CH_ORDER enum)
Definition at line 685 of file powermap.c.
CODEC_STATUS powermap_getCodecStatus | ( | void *const | hPm | ) |
Returns current codec status (see CODEC_STATUS enum)
Definition at line 580 of file powermap.c.
float powermap_getCovAvgCoeff | ( | void *const | hPm | ) |
Returns the current covariance averaging coefficient value, in Hz.
Definition at line 616 of file powermap.c.
int powermap_getDispFOV | ( | void *const | hPm | ) |
Returns the current visualisation display window horizontal field-of-view (FOV) (see HFOV_OPTIONS enum)
Definition at line 703 of file powermap.c.
int powermap_getFrameSize | ( | void | ) |
Returns the processing framesize (i.e., number of samples processed with every _process() call )
Definition at line 575 of file powermap.c.
int powermap_getMasterOrder | ( | void *const | hPm | ) |
Returns the current maximum analysis/input order (see SH_ORDERS enum)
Definition at line 598 of file powermap.c.
int powermap_getNormType | ( | void *const | hPm | ) |
Returns the Ambisonic normalisation convention currently being usedto decode with, which should match the convention employed by the input signals (see NORM_TYPES enum)
Definition at line 691 of file powermap.c.
int powermap_getNSHrequired | ( | void *const | hPm | ) |
Returns the number of spherical harmonic signals required by the current analysis order: (current_order + 1)^2.
Definition at line 679 of file powermap.c.
int powermap_getNumberOfBands | ( | void | ) |
Returns the number of frequency bands used for the analysis.
Definition at line 674 of file powermap.c.
int powermap_getNumSources | ( | void *const | hPm | ) |
Returns the number of sources present in the input sound scene.
Definition at line 697 of file powermap.c.
int powermap_getPmap | ( | void *const | hPm, |
float ** | grid_dirs, | ||
float ** | pmap, | ||
int * | nDirs, | ||
int * | pmapWidth, | ||
int * | hfov, | ||
int * | aspectRatio ) |
Returns the latest computed activity-map if it is ready.
Otherwise it returns 0, and you'll just have to wait a bit
[in] | hPm | powermap handle |
[out] | grid_dirs | (&) scanning grid directions, in DEGREES; nDirs x 1 |
[out] | pmap | (&) activity-map values; nDirs x 1 |
[out] | nDirs | (&) number of directions |
[out] | pmapWidth | (&) activity-map width in pixels |
[out] | hfov | (&) horizontal FOV used to generate activity-map |
[out] | aspectRatio | (&) aspect ratio used to generate activity-map |
Definition at line 721 of file powermap.c.
float powermap_getPowermapAvgCoeff | ( | void *const | hPm | ) |
Returns the current activity-map averaging coefficient, 0..1.
Definition at line 715 of file powermap.c.
float powermap_getPowermapEQ | ( | void *const | hPm, |
int | bandIdx ) |
Returns the weighting coefficient for a particular frequency band index, allowing one to "equalise" the activity-map.
Definition at line 622 of file powermap.c.
float powermap_getPowermapEQAllBands | ( | void *const | hPm | ) |
Returns the weighting coefficient for the first frequency band.
Definition at line 628 of file powermap.c.
void powermap_getPowermapEQHandle | ( | void *const | hPm, |
float ** | pX_vector, | ||
float ** | pY_values, | ||
int * | pNpoints ) |
Returns the weighting coefficient for all frequency bands.
[in] | hPm | powermap handle |
[out] | pX_vector | (&) frequency vector; pNpoints x 1 |
[out] | pY_values | (&) weighting coefficients; pNpoints x 1 |
[out] | pNpoints | (&) number of frequency bands |
Definition at line 634 of file powermap.c.
int powermap_getPowermapMode | ( | void *const | hPm | ) |
Returns the powermap/activity-map mode to employed for the analysis see POWERMAP_MODES enum.
Definition at line 604 of file powermap.c.
int powermap_getProcessingDelay | ( | void | ) |
Returns the processing delay in samples (may be used for delay compensation features)
Definition at line 746 of file powermap.c.
float powermap_getProgressBar0_1 | ( | void *const | hPm | ) |
(Optional) Returns current intialisation/processing progress, between 0..1
Definition at line 586 of file powermap.c.
void powermap_getProgressBarText | ( | void *const | hPm, |
char * | text ) |
(Optional) Returns current intialisation/processing progress text
Definition at line 592 of file powermap.c.
int powermap_getSamplingRate | ( | void *const | hPm | ) |
Returns the current sampling rate, in Hz.
Definition at line 610 of file powermap.c.
void powermap_init | ( | void *const | hPm, |
float | samplerate ) |
Initialises an instance of powermap with default settings.
[in] | hPm | powermap handle |
[in] | samplerate | Host samplerate. |
Definition at line 136 of file powermap.c.
void powermap_initCodec | ( | void *const | hPm | ) |
Intialises the codec variables, based on current global/user parameters.
[in] | hPm | powermap handle |
Definition at line 158 of file powermap.c.
void powermap_refreshSettings | ( | void *const | hPm | ) |
Sets all intialisation flags to 1; re-initialising all settings/variables as powermap is currently configured, at next available opportunity.
Definition at line 386 of file powermap.c.
void powermap_requestPmapUpdate | ( | void *const | hPm | ) |
Informs powermap that it should compute a new activity-map at its own convenience, if it would be so kind; thank you, God bless.
Definition at line 567 of file powermap.c.
void powermap_setAnaOrder | ( | void *const | hPm, |
int | newValue, | ||
int | bandIdx ) |
Sets the input/analysis order for one specific frequency band index.
Definition at line 499 of file powermap.c.
void powermap_setAnaOrderAllBands | ( | void *const | hPm, |
int | newValue ) |
Sets the input/analysis order for all frequency bands.
Definition at line 505 of file powermap.c.
void powermap_setAspectRatio | ( | void *const | hPm, |
int | newOption ) |
Sets the visualisation display window aspect-ratio (see ASPECT_RATIO_OPTIONS enum)
Definition at line 552 of file powermap.c.
void powermap_setChOrder | ( | void *const | hPm, |
int | newOrder ) |
Sets the Ambisonic channel ordering convention to decode with, in order to match the convention employed by the input signals (see CH_ORDER enum)
Definition at line 529 of file powermap.c.
void powermap_setCovAvgCoeff | ( | void *const | hPm, |
float | newAvg ) |
Sets the covariance matrix averaging coefficient, 0..1.
Definition at line 414 of file powermap.c.
void powermap_setDispFOV | ( | void *const | hPm, |
int | newOption ) |
Sets the visualisation display window horizontal field-of-view (FOV) (see HFOV_OPTIONS enum)
Definition at line 543 of file powermap.c.
void powermap_setMasterOrder | ( | void *const | hPm, |
int | newValue ) |
Sets the maximum input/analysis order (see SH_ORDERS enum)
Definition at line 400 of file powermap.c.
void powermap_setNormType | ( | void *const | hPm, |
int | newType ) |
Sets the Ambisonic normalisation convention to decode with, in order to match with the convention employed by the input signals (see NORM_TYPES enum)
Definition at line 536 of file powermap.c.
void powermap_setNumSources | ( | void *const | hPm, |
int | newValue ) |
Sets the number of sources present in the input sound scene.
Definition at line 420 of file powermap.c.
void powermap_setPowermapAvgCoeff | ( | void *const | hPm, |
float | newValue ) |
Sets the activity-map averaging coefficient, 0..1.
Definition at line 561 of file powermap.c.
void powermap_setPowermapEQ | ( | void *const | hPm, |
float | newValue, | ||
int | bandIdx ) |
Sets the weighting coefficient for a particular frequency band, allowing one to "equalise" the activity-map.
Definition at line 514 of file powermap.c.
void powermap_setPowermapEQAllBands | ( | void *const | hPm, |
float | newValue ) |
Sets the weighting coefficient for all frequency bands.
Definition at line 520 of file powermap.c.
void powermap_setPowermapMode | ( | void *const | hPm, |
int | newMode ) |
Sets the powermap/activity-map approach, (see POWERMAP_MODES enum)
Definition at line 391 of file powermap.c.
void powermap_setSourcePreset | ( | void *const | hPm, |
int | newPresetID ) |
Sets an input preset; the microphone/hyrophone array used to capture the input signals, (see MIC_PRESETS enum)
Definition at line 426 of file powermap.c.