vbap  0.0.1
The vector based amplitude panning
Typedefs | Functions
vbapf

The single point precision part of the library. More...

Typedefs

typedef struct _vbapf t_vbapf
 The opaque type used to compute vbap.
 

Functions

t_vbapfvbapf_new (void)
 Allocates a new vbap structure. More...
 
void vbapf_free (t_vbapf *vbap)
 Frees a vbap structure. More...
 
size_t vbapf_nls (t_vbapf const *vbap)
 Gets the current number of loudspeakers. More...
 
unsigned char vbapf_dimension (t_vbapf const *vbap)
 Gets the current dimension. More...
 
char vbapf_2d_prepare (t_vbapf *vbap, size_t const nls, float const *angles)
 Prepares the vbap structure for a specific 2d configuration. More...
 
void vbapf_2d_perform (t_vbapf const *vbap, float const azimuth, float *gains)
 Computes the gains of the loudspeakers for a specified angle. More...
 
char vbapf_3d_prepare (t_vbapf *vbap, size_t const nls, float const *angles)
 Prepares the vbap structure for a specific 3d configuration. More...
 
void vbapf_3d_perform (t_vbapf const *vbap, float const azimuth, float const elevation, float *gains)
 Computes the gains of the loudspeakers for a specified angle. More...
 

Detailed Description

The single point precision part of the library.

Function Documentation

void vbapf_2d_perform ( t_vbapf const *  vbap,
float const  azimuth,
float *  gains 
)

Computes the gains of the loudspeakers for a specified angle.

The function finds the best pair of loudspeakers depending on the azimuth of the
virtual source and computes the gains coeffcients of this loudspeakers. The vector of
gains must be at least the size of the number of loudspeakers.

Parameters
vbapThe pointer to the vbap structure.
azimuthThe azimuth of the virtual source.
gainsThe vector to fill with the gains of the loudspkeakers.
char vbapf_2d_prepare ( t_vbapf vbap,
size_t const  nls,
float const *  angles 
)

Prepares the vbap structure for a specific 2d configuration.

The function finds the functional pairs of loudspeakers and computes their
matrices. The function expects a vector of angles in degrees that defines the azimuth of
the loudspkeakers.

Parameters
vbapThe pointer to the vbap structure.
nlsThe number of loudspeakers.
anglesThe angles of the loudspeakers.
void vbapf_3d_perform ( t_vbapf const *  vbap,
float const  azimuth,
float const  elevation,
float *  gains 
)

Computes the gains of the loudspeakers for a specified angle.

The function finds the best triplet of loudspeakers depending on the azimuth of
the virtual source and computes the gains coeffcients of this loudspeakers. The vector of
gains must be at least the size of the number of loudspeakers.

Parameters
vbapThe pointer to the vbap structure.
azimuthThe azimuth of the virtual source.
elevationThe elevation of the virtual source.
gainsThe vector to fill with the gains of the loudspkeakers.
char vbapf_3d_prepare ( t_vbapf vbap,
size_t const  nls,
float const *  angles 
)

Prepares the vbap structure for a specific 3d configuration.

The function finds the functional triplets of loudspeakers and computes their
matrices. The function expects a vector of pair of angles in degrees that defines the
azimuth and the elevation of the loudspkeakers.

Parameters
vbapThe pointer to the vbap structure.
nlsThe number of loudspeakers.
anglesThe angles of the loudspeakers.
Todo:
Check the variable max
unsigned char vbapf_dimension ( t_vbapf const *  vbap)

Gets the current dimension.

The dimension can be 0 if the vbap structure has not been prepared yet, 2 if the
the vbap structure has been prepared for a 2 dimensional application and 3 if thee vbap
structure has been prepared for a 2 dimensional application.

Parameters
vbapThe pointer to the vbap structure.
Returns
The dimension.
void vbapf_free ( t_vbapf vbap)

Frees a vbap structure.

The function frees a vbap structure. For convenience, the pointer is verified so
it can be NULL without generating any error.

Parameters
vbapThe pointer to the vbap structure to free.
t_vbapf* vbapf_new ( void  )

Allocates a new vbap structure.

The function allocates and initializes a vbap structure that can be used for both
2d and 3d applications.

Returns
A pointer to a new vbap structure or NULL if the allocation failed.
size_t vbapf_nls ( t_vbapf const *  vbap)

Gets the current number of loudspeakers.

Parameters
vbapThe pointer to the vbap structure.
Returns
The current number of loudspeakers.