31#define NUM_INPUT_ARGS ( 6 )
32#define NUM_OUTPUT_ARGS ( 1 )
67 float* ls_dirs_deg = NULL;
69 int L, az_res_deg, el_res_deg, omitLargeTriangles, enableDummies;
70 int N_gtable, nTriangles;
76 az_res_deg = (int)mxGetScalar(prhs[1]);
77 el_res_deg = (int)mxGetScalar(prhs[2]);
78 omitLargeTriangles = (int)mxGetScalar(prhs[3]);
79 enableDummies = (int)mxGetScalar(prhs[4]);
80 spread = (float)mxGetScalar(prhs[5]);
84 mexErrMsgIdAndTxt(
"MyToolbox:inputError",
"the second dimension of the first argument should be of size: 2");
94 enableDummies, spread, >able, &N_gtable, &nTriangles);
98 pDims =
realloc1d(pDims, nDims*
sizeof(
int));
void generateVBAPgainTable3D(float *ls_dirs_deg, int L, int az_res_deg, int el_res_deg, int omitLargeTriangles, int enableDummies, float spread, float **gtable, int *N_gtable, int *nTriangles)
Generates a 3-D VBAP gain table based on specified loudspeaker directions, with optional spreading [2...
void * realloc1d(void *ptr, size_t dim1_data_size)
1-D realloc (same as realloc, but with error checking)
Main include header for safmex.
void MEXdouble2SAFsingle(const mxArray *in, float **out, int *nDims, int **pDims)
Convert a mex double-precision array into single precision array for SAF.
MEX_DATA_TYPES
Supported SAF/MEX data conversions.
@ SM_DOUBLE_REAL
Scalar, real valued; 1 x 1.
@ SM_INT32
Integer; 1 x 1.
@ SM_DOUBLE_REAL_2D
Real 2-D matrix; N x M.
void SAFsingle2MEXdouble(float *in, int nDims, int *dims, mxArray **out)
Convert a single precision array used by SAF to mex double-precision array.
void checkNumInOutArgs(int nInputs, int nOutputs, int nInputs_expected, int nOutputs_expected)
Helper function to check number of inputs/outputs arguments are as expected.
void checkArgDataTypes(mxArray **hData, MEX_DATA_TYPES *dataTypes, int nArgs)
Helper function to check the format of the input/output arguments are as expected.