31#define NUM_INPUT_ARGS ( 2 )
32#define NUM_OUTPUT_ARGS ( 1 )
63 float* dirs_rad = NULL;
64 float_complex* Y = NULL;
65 int order, nSH, nDirs;
68 order = (int)mxGetScalar(prhs[0]);
72 Y =
malloc1d(nSH*nDirs*
sizeof(float_complex));
76 mexErrMsgIdAndTxt(
"MyToolbox:inputError",
"the second dimension of the second argument should be of size: 2");
#define ORDER2NSH(order)
Converts spherical harmonic order to number of spherical harmonic components i.e: (order+1)^2.
void getSHcomplex(int order, float *dirs_rad, int nDirs, float_complex *Y)
Computes complex-valued spherical harmonics [1] for each given direction on the unit sphere.
void * malloc1d(size_t dim1_data_size)
1-D malloc (same as malloc, but with error checking)
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_INT32
Integer; 1 x 1.
@ SM_DOUBLE_REAL_1D_OR_2D
Real 2-D matrix or 1-D vector; N x M | N x 1.
@ SM_DOUBLE_COMPLEX_1D_OR_2D
Complex 2-D matrix or 1-D vector; N x M | N x 1.
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 SAFsingle2MEXdouble_complex(float_complex *in, int nDims, int *dims, mxArray **out)
Convert a single precision array used by SAF to mex double-precision array (complex valued)
void checkArgDataTypes(mxArray **hData, MEX_DATA_TYPES *dataTypes, int nArgs)
Helper function to check the format of the input/output arguments are as expected.