SAF
Loading...
Searching...
No Matches
saf_utilities

Files

file  saf_utilities.h
 Main header for the utilities module (SAF_UTILITIES_MODULE)
 
file  saf_utility_bessel.c
 A collection of routines for computing spherical and cylindrical Bessel and Hankel functions, including their derivatives.
 
file  saf_utility_bessel.h
 A collection of routines for computing spherical and cylindrical Bessel and Hankel functions, including their derivatives.
 
file  saf_utility_complex.c
 Contains wrappers for handling complex numbers across both C99-compliant compilers and Microsoft Visual Compiler (MSVC)
 
file  saf_utility_complex.h
 Contains wrappers for handling complex numbers across both C99-compliant compilers and Microsoft Visual Compiler (MSVC)
 
file  saf_utility_decor.c
 A collection of signal decorrelators.
 
file  saf_utility_decor.h
 A collection of signal decorrelators.
 
file  saf_utility_dvf.c
 Distance variation function filter coefficient data [1].
 
file  saf_utility_dvf.h
 Distance variation function filter coefficient data [1].
 
file  saf_utility_fft.c
 Wrappers for optimised discrete/fast Fourier transform (FFT) routines.
 
file  saf_utility_fft.h
 Wrappers for optimised discrete/fast Fourier transform (FFT) routines.
 
file  saf_utility_filters.c
 A collection of IIR/FIR filter and filterbank designs.
 
file  saf_utility_filters.h
 A collection of IIR/FIR filter and filterbank designs.
 
file  saf_utility_geometry.c
 A collection of computational geometry related functions.
 
file  saf_utility_geometry.h
 A collection of computational geometry related functions.
 
file  saf_utility_latticeCoeffs.c
 Lattice allpass coefficients which are useful for decorrelation.
 
file  saf_utility_loudspeaker_presets.c
 A collection of loudspeaker array directions and (nearly) uniform spherical grids.
 
file  saf_utility_loudspeaker_presets.h
 A collection of loudspeaker array directions and (nearly) uniform spherical grids.
 
file  saf_utility_matrixConv.c
 Matrix and multi-channel convolvers.
 
file  saf_utility_matrixConv.h
 Matrix and multi-channel convolvers.
 
file  saf_utility_misc.c
 A collection of miscellaneous functions.
 
file  saf_utility_misc.h
 A collection of miscellaneous functions.
 
file  saf_utility_pitch.c
 A collection of pitch shifting algorithms.
 
file  saf_utility_pitch.h
 A collection of pitch shifting algorithms.
 
file  saf_utility_qmf.c
 An implementation of the complex Quadrature Mirror Filterbank (QMF) described in [1].
 
file  saf_utility_qmf.h
 An implementation of the complex Quadrature Mirror Filterbank (QMF) described in [1].
 
file  saf_utility_sensorarray_presets.c
 A collection of microphone array sensor directions.
 
file  saf_utility_sensorarray_presets.h
 A collection of microphone array sensor directions.
 
file  saf_utility_sort.c
 A collection of useful sorting functions.
 
file  saf_utility_sort.h
 A collection of useful sorting functions.
 
file  saf_utility_veclib.c
 Wrappers for optimised linear algebra routines, utilising CBLAS and LAPACK, and/or SIMD intrinsics.
 
file  saf_utility_veclib.h
 Wrappers for optimised linear algebra routines, utilising CBLAS and LAPACK, and/or SIMD intrinsics.
 

Data Structures

struct  quaternion_data
 Quaternion data structure. More...
 
struct  voronoi_data
 Data structure for Voronoi diagrams. More...
 

Macros

#define NUM_EARS   2
 2 (true for most humans)
 
#define SAF_MIN(a, b)   (( (a) < (b) ) ? (a) : (b))
 Returns the minimum of the two values.
 
#define SAF_MAX(a, b)   (( (a) > (b) ) ? (a) : (b))
 Returns the maximum of the two values.
 
#define SAF_CLAMP(a, min, max)   (SAF_MAX(min, SAF_MIN(max, a)))
 Ensures value "a" is clamped between the "min" and "max" values.
 
#define SAF_TRUE   ( 1 )
 Boolean true.
 
#define SAF_FALSE   ( 0 )
 Boolean false.
 
#define SAF_PI   ( 3.14159265358979323846264338327950288f )
 pi constant (single precision)
 
#define SAF_PId   ( 3.14159265358979323846264338327950288 )
 pi constant (double precision)
 
#define SAF_ISPOW2(x)   (((x & ~(x-1))==x) ? x : 0)
 Returns 0 if "x" is not a power of 2.
 
#define ISEVEN(n)   ((n%2 == 0) ? 1 : 0)
 Returns 1 if "n" is even valued, and 0 if it is not.
 
#define ISODD(n)   ((n%2 != 0) ? 1 : 0)
 Returns 1 if "n" is odd valued, and 0 if it is not.
 
#define SQRT4PI   ( 3.544907701811032f )
 sqrt(4pi) (single precision)
 
#define FOURPI   ( 12.566370614359172f )
 4pi (single precision)
 
#define ELEV2INCL(E)   ( (SAF_PI/2.0f - E) )
 Converts elevation to inclincation, (in radians)
 
#define DEG2RAD(x)   (x * SAF_PI / 180.0f)
 Converts degrees to radians.
 
#define RAD2DEG(x)   (x * 180.0f / SAF_PI)
 Converts radians to degrees

 
#define MKSTRING_(s)   #s
 Used to make strings inside of Macros.
 
#define MKSTRING(s)   MKSTRING_(s)
 Used to make strings inside of Macros.
 
#define SAF_UNUSED(x)   (void)(x)
 Indicates that a particular variable is unused (& squelches any warnings)
 
#define saf_print_warning(message)
 Macro to print a warning message along with the filename and line number.
 
#define saf_print_error(message)
 Macro to print a error message along with the filename and line number.
 
#define saf_assert(x, message)
 Macro to make an assertion, along with a string explaining its purpose.
 
#define SAF_CASSERT(predicate, file)   _impl_CASSERT_LINE(predicate,__LINE__,file)
 A compile time assertion check.
 
#define _impl_PASTE(a, b)   a##b
 CASSERT helper macro.
 
#define _impl_CASSERT_LINE(predicate, line, file)    typedef char _impl_PASTE(assertion_failed_##file##_,line)[2*!!(predicate)-1];
 CASSERT helper macro.
 

Enumerations

enum  SAF_STFT_FDDATA_FORMAT { SAF_STFT_BANDS_CH_TIME , SAF_STFT_TIME_CH_BANDS }
 Options for how the frequency domain data is permuted when using saf_stft. More...
 
enum  BIQUAD_FILTER_TYPES {
  BIQUAD_FILTER_LPF , BIQUAD_FILTER_LPF_EQCB , BIQUAD_FILTER_HPF , BIQUAD_FILTER_HPF_EQCB ,
  BIQUAD_FILTER_PEAK , BIQUAD_FILTER_PEAK_EQCB , BIQUAD_FILTER_LOW_SHELF , BIQUAD_FILTER_LOW_SHELF_EQCB ,
  BIQUAD_FILTER_HI_SHELF , BIQUAD_FILTER_HI_SHELF_EQCB
}
 Bi-quadratic (second-order) IIR filter design options. More...
 
enum  BUTTER_FILTER_TYPES { BUTTER_FILTER_LPF , BUTTER_FILTER_HPF , BUTTER_FILTER_BPF , BUTTER_FILTER_BSF }
 Butterworth Infinite Impulse Response (IIR) filter design options. More...
 
enum  FIR_FILTER_TYPES { FIR_FILTER_LPF , FIR_FILTER_HPF , FIR_FILTER_BPF , FIR_FILTER_BSF }
 Finite Impulse Response (FIR) filter design options. More...
 
enum  WINDOWING_FUNCTION_TYPES {
  WINDOWING_FUNCTION_RECTANGULAR , WINDOWING_FUNCTION_HAMMING , WINDOWING_FUNCTION_HANN , WINDOWING_FUNCTION_BARTLETT ,
  WINDOWING_FUNCTION_BLACKMAN , WINDOWING_FUNCTION_NUTTALL , WINDOWING_FUNCTION_BLACKMAN_NUTTALL , WINDOWING_FUNCTION_BLACKMAN_HARRIS
}
 Windowing function types. More...
 
enum  EULER_ROTATION_CONVENTIONS { EULER_ROTATION_Y_CONVENTION , EULER_ROTATION_X_CONVENTION , EULER_ROTATION_YAW_PITCH_ROLL , EULER_ROTATION_ROLL_PITCH_YAW }
 Available euler2rotationMatrix() conventions. More...
 
enum  QMF_FDDATA_FORMAT { QMF_BANDS_CH_TIME , QMF_TIME_CH_BANDS }
 Options for how the frequency domain data is permuted when using qmf. More...
 
enum  CONJ_FLAG { NO_CONJ = 1 , CONJ = 2 }
 Whether a vector should be conjugated or not (e.g. More...
 

Functions

void bessel_Jn (int N, double *z, int nZ, double *J_n, double *dJ_n)
 Computes the values of the (cylindrical) Bessel function of the first kind (Jn) and it's derivative (dJn)
 
void bessel_Jn_ALL (int N, double *z, int nZ, double *J_n, double *dJ_n)
 Computes the (cylindrical) Bessel function of the first kind (Jn) and their derivatives (dJn) for ALL orders from 0 to N.
 
void bessel_Yn (int N, double *z, int nZ, double *Y_n, double *dY_n)
 Computes the values of the (cylindrical) Bessel function of the second kind (Yn) and it's derivative (dYn)
 
void bessel_Yn_ALL (int N, double *z, int nZ, double *Y_n, double *dY_n)
 Computes the (cylindrical) Bessel function of the second kind (Yn) and their derivatives (dYn) for ALL orders from 0 to N.
 
void hankel_Hn1 (int N, double *z, int nZ, double_complex *Hn1_n, double_complex *dHn1_n)
 Computes the values of the (cylindrical) Hankel function of the first kind (Hn1) and it's derivative (dHn1)
 
void hankel_Hn1_ALL (int N, double *z, int nZ, double_complex *Hn1_n, double_complex *dHn1_n)
 Computes the (cylindrical) Hankel function of the first kind (Hn1) and their derivatives (dHn1) for ALL orders from 0 to N.
 
void hankel_Hn2 (int N, double *z, int nZ, double_complex *Hn2_n, double_complex *dHn2_n)
 Computes the values of the (cylindrical) Hankel function of the second kind (Hn2) and it's derivative (dHn2)
 
void hankel_Hn2_ALL (int N, double *z, int nZ, double_complex *Hn2_n, double_complex *dHn2_n)
 Computes the (cylindrical) Hankel function of the second kind (Hn2) and their derivatives (dHn2) for ALL orders from 0 to N.
 
int bessel_jn (int N, double *z, int nZ, double *j_n, double *dj_n)
 Computes the values of the spherical Bessel function of the first kind (jn) and it's derivative (djn)
 
void bessel_jn_ALL (int N, double *z, int nZ, int *maxN, double *j_n, double *dj_n)
 Computes the spherical Bessel function of the first kind (jn) and their derivatives (djn) for ALL orders from 0 to N.
 
int bessel_in (int N, double *z, int nZ, double *i_n, double *di_n)
 Computes the values of the modified spherical Bessel function of the first kind (in) and it's derivative (din)
 
void bessel_in_ALL (int N, double *z, int nZ, int *maxN, double *i_n, double *di_n)
 Computes the modified spherical Bessel function of the first kind (in) and their derivatives (din) for ALL orders from 0 to N.
 
int bessel_yn (int N, double *z, int nZ, double *y_n, double *dy_n)
 Computes the values of the spherical Bessel function of the second kind (yn) and it's derivative (dyn)
 
void bessel_yn_ALL (int N, double *z, int nZ, int *maxN, double *y_n, double *dy_n)
 Computes the spherical Bessel function of the second kind (yn) and their derivatives (dyn) for ALL orders from 0 to N.
 
int bessel_kn (int N, double *z, int nZ, double *k_n, double *dk_n)
 Computes the values of the modified spherical Bessel function of the second kind (kn) and it's derivative (dkn)
 
void bessel_kn_ALL (int N, double *z, int nZ, int *maxN, double *k_n, double *dk_n)
 Computes the modified spherical Bessel function of the second kind (kn) and their derivatives (dkn) for ALL orders from 0 to N.
 
int hankel_hn1 (int N, double *z, int nZ, double_complex *h_n1, double_complex *dh_n1)
 Computes the values of the spherical Hankel function of the first kind (hn1) and it's derivative (dhn1)
 
void hankel_hn1_ALL (int N, double *z, int nZ, int *maxN, double_complex *h_n1, double_complex *dh_n1)
 Computes the spherical Hankel function of the first kind (hn1) and their derivatives (dhn1) for ALL orders from 0 to N.
 
int hankel_hn2 (int N, double *z, int nZ, double_complex *h_n2, double_complex *dh_n2)
 Computes the values of the spherical Hankel function of the second kind (hn2) and it's derivative (dhn2)
 
void hankel_hn2_ALL (int N, double *z, int nZ, int *maxN, double_complex *h_n2, double_complex *dh_n2)
 Computes the spherical Hankel function of the second kind (hn2) and their derivatives (dhn2) for ALL orders from 0 to N.
 
void getDecorrelationDelays (int nChannels, float *freqs, int nFreqs, float fs, int maxTFdelay, int hopSize, int *delayTF)
 Returns delay values for multiple channels per frequency, such that once applied to an input signal (via simple frequency-dependent delay lines), the resulting signal is decorrelated w.r.t the original.
 
void synthesiseNoiseReverb (int nChannels, float fs, float *t60, float *fcen_oct, int nBands, int flattenFLAG, float **rir_filt, int *rir_len)
 Returns quick and dirty exponentially decaying noise bursts.
 
void latticeDecorrelator_create (void **phDecor, float fs, int hopsize, float *freqVector, int nBands, int nCH, int *orders, float *freqCutoffs, int nCutoffs, int maxDelay, int lookupOffset, float enComp_coeff)
 Creates an instance of the lattice all-pass-filter-based multi-channel signal decorrelator.
 
void latticeDecorrelator_destroy (void **phDecor)
 Destroys an instance of the lattice all-pass-filter-based multi-channel signal decorrelator.
 
void latticeDecorrelator_reset (void *hDecor)
 Sets the internal buffers to zero.
 
void latticeDecorrelator_apply (void *hDecor, float_complex ***inFrame, int nTimeSlots, float_complex ***decorFrame)
 Applies the lattice all-pass-filter-based multi-channel signal decorrelator.
 
void transientDucker_create (void **phDucker, int nCH, int nBands)
 Creates an instance of the transient ducker/extractor.
 
void transientDucker_destroy (void **phDucker)
 Destroys an instance of the transient ducker.
 
void transientDucker_apply (void *hDucker, float_complex ***inFrame, int nTimeSlots, float alpha, float beta, float_complex ***residualFrame, float_complex ***transientFrame)
 Applies the transient ducker, returning either the "ducked" input frame, or the transient part of the input frame, or both.
 
void calcDVFCoeffs (float alpha, float rho, float fs, float *b, float *a)
 Calculate the Distance Variation Function (DVF) filter coefficients, as described in [1].
 
void interpDVFShelfParams (float theta, float rho, float *iG0, float *iGInf, float *iFc)
 Calculate the shelving filter parameters for the Distance Variation Function filter from the source (ipsilateral) azimuth and distance.
 
void dvfShelfCoeffs (float g0, float gInf, float fc, float fs, float *b0, float *b1, float *a1)
 Calculate the DVF filter coefficients from shelving filter parameters.
 
void calcDVFShelfParams (int i, float rho, float *g0, float *gInf, float *fc)
 Calculate the high shelf gains and cutoff parameters, given a azimuth index i and distance rho.
 
void doaToIpsiInteraural (float azimuth, float elevation, float *alphaLR, float *betaLR)
 Convert a frontal azimuth/elevation to a modified Interaural-Polar coordinate.
 
void getUniformFreqVector (int fftSize, float fs, float *freqVector)
 Calculates the frequencies (in Hz) of uniformly spaced bins, for a given FFT size and sampling rate.
 
void fftconv (float *x, float *h, int x_len, int h_len, int nCH, float *y)
 FFT-based convolution of signal 'x' with filter 'h'.
 
void fftfilt (float *x, float *h, int x_len, int h_len, int nCH, float *y)
 FFT-based convolution for FIR filters.
 
void hilbert (float_complex *x, int x_len, float_complex *y)
 Computes the discrete-time analytic signal via the Hilbert transform [1].
 
void saf_stft_create (void **const phSTFT, int winsize, int hopsize, int nCHin, int nCHout, SAF_STFT_FDDATA_FORMAT FDformat)
 Creates an instance of saf_stft.
 
void saf_stft_destroy (void **const phSTFT)
 Destroys an instance of saf_stft.
 
void saf_stft_forward (void *const hSTFT, float **dataTD, int framesize, float_complex ***dataFD)
 Performs the forward-STFT operation for the current frame.
 
void saf_stft_backward (void *const hSTFT, float_complex ***dataFD, int framesize, float **dataTD)
 Performs the backward-STFT operation for the current frame.
 
void saf_stft_flushBuffers (void *const hSTFT)
 Flushes the internal buffers with zeros.
 
void saf_stft_channelChange (void *const hSTFT, int new_nCHin, int new_nCHout)
 Changes the number of input/output channels.
 
void saf_rfft_create (void **const phFFT, int N)
 Creates an instance of saf_rfft; real<->half-complex (conjugate-symmetric) FFT.
 
void saf_rfft_destroy (void **const phFFT)
 Destroys an instance of saf_rfft.
 
void saf_rfft_forward (void *const hFFT, float *inputTD, float_complex *outputFD)
 Performs the forward-FFT operation; use for real to complex (conjugate symmetric) transformations.
 
void saf_rfft_backward (void *const hFFT, float_complex *inputFD, float *outputTD)
 Performs the backward-FFT operation; use for complex (conjugate symmetric) to real transformations.
 
void saf_fft_create (void **const phFFT, int N)
 Creates an instance of saf_fft; complex<->complex FFT.
 
void saf_fft_destroy (void **const phFFT)
 Destroys an instance of saf_fft.
 
void saf_fft_forward (void *const hFFT, float_complex *inputTD, float_complex *outputFD)
 Performs the forward-FFT operation; use for complex to complex transformations.
 
void saf_fft_backward (void *const hFFT, float_complex *inputFD, float_complex *outputTD)
 Performs the backward-FFT operation; use for complex to complex transformations.
 
void getWindowingFunction (WINDOWING_FUNCTION_TYPES type, int winlength, float *win)
 Computes the weights of a specific windowing function.
 
void getOctaveBandCutoffFreqs (float *centreFreqs, int nCentreFreqs, float *cutoffFreqs)
 Converts octave band CENTRE frequencies into CUTOFF frequencies.
 
void flattenMinphase (float *x, int len)
 Equalises input sequence by its minimum phase form, in order to bring its magnitude response to unity, as described in [1].
 
void interpolateFiltersH (int inFFTsize, int outFFTsize, int nFilters, float_complex *filters_in, float_complex *filters_out)
 Interpolate filters (w.r.t.
 
float convertBW2Q (float BW)
 Converts filter octave band-width to Q-factor.
 
float convertQ2BW (float Q)
 Converts filter Q-factor to octave band-width.
 
void biQuadCoeffs (BIQUAD_FILTER_TYPES filterType, float fc, float fs, float Q, float gain_dB, float b[3], float a[3])
 Calculates 2nd order IIR filter coefficients [1].
 
void applyBiQuadFilter (float b[3], float a[3], float w_z_12[2], float *signal, int nSamples)
 Applies biQuad filter to an input signal using the direct form II difference equation: https://en.wikipedia.org/wiki/Digital_biquad_filter.
 
void evalBiQuadTransferFunction (float b[3], float a[3], float *freqs, int nFreqs, float fs, int mag2dB, float *magnitude, float *phase_rad)
 Evaluates the 2nd order IIR transfer function at one or more frequencies, returning its magnitude and/or phase response.
 
void evalIIRTransferFunction (double *b, double *a, int nCoeffs, float *freqs, int nFreqs, float fs, int mag2dB, float *magnitude, float *phase_rad)
 Computes magnitude and phase response of an IIR filter from its coefficients at user-specified frequencies (Hz).
 
void evalIIRTransferFunctionf (float *b, float *a, int nCoeffs, float *freqs, int nFreqs, float fs, int mag2dB, float *magnitude, float *phase_rad)
 Computes magnitude and phase response of an IIR filter from its coefficients (floats) at user-specified frequencies (Hz).
 
void applyIIR (float *in_signal, int nSamples, int nCoeffs, float *b, float *a, float *wz, float *out_signal)
 Applies an IIR filter to a time-domain signal (using the direct form II difference equation)
 
void butterCoeffs (BUTTER_FILTER_TYPES filterType, int order, float cutoff1, float cutoff2, float sampleRate, double *b_coeffs, double *a_coeffs)
 Computes Butterworth IIR filter coefficients [1].
 
void faf_IIRFilterbank_create (void **phFaF, int order, float *fc, int nCutoffFreqs, float sampleRate, int maxNumSamples)
 Computes a bank of IIR filter coefficients required to divide a signal into frequency bands, based on the design by Favrot & Faller [1].
 
void faf_IIRFilterbank_apply (void *hFaF, float *inSig, float **outBands, int nSamples)
 Applies the Favrot & Faller filterbank.
 
void faf_IIRFilterbank_flushBuffers (void *hFaF)
 Zeros the delay lines used during faf_IIRFilterbank_apply()
 
void faf_IIRFilterbank_destroy (void **hFaF)
 Destroys an instance of the Favrot & Faller filterbank.
 
void FIRCoeffs (FIR_FILTER_TYPES filterType, int order, float cutoff1, float cutoff2, float sampleRate, WINDOWING_FUNCTION_TYPES windowType, int scalingFLAG, float *filter)
 Computes FIR filter coefficients by windowing.
 
void FIRFilterbank (int order, float *fc, int nCutoffFreqs, float sampleRate, WINDOWING_FUNCTION_TYPES windowType, int scalingFLAG, float *filterbank)
 Computes a bank of FIR filter coefficients required to divide a signal into frequency bands.
 
void quaternion2rotationMatrix (quaternion_data *Q, float R[3][3])
 Constructs a 3x3 rotation matrix based on a quaternion.
 
void rotationMatrix2quaternion (float R[3][3], quaternion_data *Q)
 Calculates the quaternion corresponding to a 3x3 rotation matrix.
 
void euler2Quaternion (float alpha, float beta, float gamma, int degreesFlag, EULER_ROTATION_CONVENTIONS convention, quaternion_data *Q)
 Converts Euler angles to a quaternion.
 
void quaternion2euler (quaternion_data *Q, int degreesFlag, EULER_ROTATION_CONVENTIONS convention, float *alpha, float *beta, float *gamma)
 Converts a quaternion to Euler angles.
 
void euler2rotationMatrix (float alpha, float beta, float gamma, int degreesFlag, EULER_ROTATION_CONVENTIONS convention, float R[3][3])
 Constructs a 3x3 rotation matrix from the Euler angles.
 
void yawPitchRoll2Rzyx (float yaw, float pitch, float roll, int rollPitchYawFLAG, float R[3][3])
 Constructs a 3x3 rotation matrix from the Euler angles, using the yaw-pitch-roll (zyx) convention.
 
void sph2cart (float *sph, int nDirs, int anglesInDegreesFLAG, float *cart)
 Converts spherical coordinates to Cartesian coordinates.
 
void cart2sph (float *cart, int nDirs, int anglesInDegreesFLAG, float *sph)
 Converts Cartesian coordinates to spherical coordinates.
 
void unitSph2cart (float *dirs, int nDirs, int anglesInDegreesFLAG, float *dirs_xyz)
 Converts spherical coordinates to Cartesian coordinates of unit length.
 
void unitCart2sph (float *dirs_xyz, int nDirs, int anglesInDegreesFLAG, float *dirs)
 Converts Cartesian coordinates of unit length to spherical coordinates.
 
void sphElev2incl (float *dirsElev, int nDirs, int degreesFlag, float *dirsIncl)
 Converts spherical coordinates of unit length from elevation to inclination.
 
void sphIncl2Elev (float *dirsIncl, int nDirs, int degreesFlag, float *dirsElev)
 Converts spherical coordinates of unit length from inclination to elevation.
 
float L2_norm3 (float v[3])
 Returns the L2 (Euclidean) norm of a 3-element vector.
 
float L2_norm (float *v, int lenV)
 Returns the L2 (Euclidean) norm of an arbitrary length vector.
 
float Frob_norm (float *M, int lenX, int lenY)
 Returns the Frobenius Norm of a matrix M, of dimensions: lenX x lenY.
 
void crossProduct3 (float a[3], float b[3], float c[3])
 Cross product between two 3-element floating point vectors (c = a x b)
 
float getDistBetweenPointAndLine (float point[3], float v1[3], float v2[3])
 Returns the distance between a "point" and an infinite line described by the two points "v1" and "v2".
 
float getDistBetween2Points (float point_a[3], float point_b[3])
 Returns the distance between "point_a" and "point_b".
 
void convhull3d (const float *vertices, const int nVert, int **faces, int *nFaces)
 Builds the convex hull of an arrangement of vertices in 3-dimensional space.
 
void convhullnd (const float *points, const int nPoints, const int nd, int **faces, int *nFaces)
 Builds the convex hull of an arrangement of points in N-dimensional space.
 
void delaunaynd (const float *points, const int nPoints, const int nd, int **DT, int *nDT)
 Computes the Delaunay triangulation of an arrangement of points in N-dimensional space.
 
void sphDelaunay (const float *dirs_deg, const int nDirs, int **faces, int *nFaces, float *vertices)
 Delaunay triangulation of a spherical arrangement of points.
 
void sphVoronoi (int *faces, int nFaces, float *vertices, int nDirs, voronoi_data *voronoi)
 Computes the Voronoi diagram for a spherical arrangement of points.
 
void sphVoronoiAreas (voronoi_data *voronoi, float *areas)
 Computes the areas of a Voronoi diagram on the unit sphere [sum(areas)=4pi].
 
void getVoronoiWeights (float *dirs_deg, int nDirs, int diagFLAG, float *weights)
 Computes the integration weights, based on the areas of each face of the corresponding Voronoi diagram [sum(weights)=4pi].
 
void saf_matrixConv_create (void **const phMC, int hopSize, float *H, int length_h, int nCHin, int nCHout, int usePartFLAG)
 Creates an instance of matrixConv.
 
void saf_matrixConv_destroy (void **const phMC)
 Destroys an instance of matrixConv.
 
void saf_matrixConv_reset (void *const hMC)
 Flushes internal buffers with zeros.
 
void saf_matrixConv_apply (void *const hMC, float *inputSigs, float *outputSigs)
 Performs the matrix convolution.
 
void saf_multiConv_create (void **const phMC, int hopSize, float *H, int length_h, int nCH, int usePartFLAG)
 Creates an instance of multiConv.
 
void saf_multiConv_destroy (void **const phMC)
 Destroys an instance of multiConv.
 
void saf_multiConv_reset (void *const hMC)
 Flushes internal buffers with zeros.
 
void saf_multiConv_apply (void *const hMC, float *inputSigs, float *outputSigs)
 Performs the multi-channel convolution.
 
void saf_TVConv_create (void **const phTVC, int hopSize, float **H, int length_h, int nIRs, int nCHout, int initIdx)
 Creates an instance of TVConv.
 
void saf_TVConv_destroy (void **const phTVC)
 Destroys an instance of matrixConv.
 
void saf_TVConv_apply (void *const hTVC, float *inputSigs, float *outputSigs, int irIdx)
 Performs the matrix convolution.
 
void convert_0_360To_m180_180 (float *dirs_deg, int nDirs)
 Wraps around any angles exeeding 180 degrees (e.g., 200-> -160)
 
int nextpow2 (int numsamp)
 A simple function which returns the next power of 2.
 
void lagrangeWeights (int N, float *x, int len_x, float *weights)
 Computes Lagrange interpolation weights of order 'N' for value 'x'.
 
void findERBpartitions (float *centerFreq, int nBands, float maxFreqLim, int **erb_idx, float **erb_freqs, int *nERBBands)
 This function takes a frequency vector and groups its frequencies into critical bands [Equivalent-Rectangular Bandwidth (ERB)].
 
void randperm (int len, int *randperm_inds)
 Returns the indices required to randomly permute a vector of length 'len'.
 
long double factorial (int n)
 Factorial, accurate up to n<=25.
 
float matlab_fmodf (float x, float y)
 C fmodf function, except it behaves like 'mod' in Matlab (i.e.
 
void cxcorr (float *a, float *b, float *x_ab, size_t la, size_t lb)
 Calculates the cross correlation between two vectors.
 
void rand_m1_1 (float *vector, int length)
 Generates random numbers between -1 and 1 and stores them in the input vector.
 
void rand_cmplx_m1_1 (float_complex *vector, int length)
 Generates random numbers between -1 and 1 and stores them in the input vector for both the real and imaginary parts.
 
void rand_0_1 (float *vector, int length)
 Generates random numbers between 0 and 1 and stores them in the input vector.
 
void convd (double *x, double *h, int len_x, int len_h, double *y)
 Basic 1-D direct convolution in the time-domain (real double precision)
 
void convz (double_complex *x, double_complex *h, int len_x, int len_h, double_complex *y)
 Basic 1-D direct convolution in the time-domain (complex double precision)
 
void polyd_v (double *x, double *poly, int len_x)
 Convert roots of a vector to polynomial (real double precision)
 
void polyz_v (double_complex *x, double_complex *poly, int len_x)
 Convert roots of a vector to polynomial (complex double precision)
 
void polyd_m (double *X, double_complex *poly, int size_x)
 Convert roots of a matrix to polynomial (real double precision)
 
float sumf (float *values, int nValues)
 Returns the sum of all values.
 
int anyLessThanf (float *values, int nValues, float threshold)
 Returns 1, if any value in 'values' (nValues x 1) is less than 'threshold', otherwise, it returns 0.
 
void unique_i (int *input, int nInputs, int **uniqueVals, int **uniqueInds, int *nUnique)
 Finds the unique values (and their indices) of the input vector.
 
void findCombinations (int *arrValues, int nValues, int nElements, int **comb, int *nComb)
 Given an array of values, find all the possible combinations (nCr) for subgroups of "nElements"; derived based on [1].
 
void gexpm (float *D, int sizeD, int m1, float *Y)
 Numerically solves first-order, linear, homogeneous differential equation systems, with non-constant coefficients, by generalization of the Pade- approximant method for exponential matrices.
 
void smb_pitchShift_create (void **hSmb, int nCH, int fftFrameSize, int osamp, float sampleRate)
 Creates an instance of SMB PitchShifter.
 
void smb_pitchShift_destroy (void **const hSmb)
 Destroys an instance of SMB PitchShifter.
 
void smb_pitchShift_apply (void *hSmb, float pitchShift, int frameSize, float *inFrame, float *outFrame)
 Performs pitch shifting of the input signals, while retaining the same time duration as the original using the algorithm detailed in [1].
 
void qmf_create (void **const phQMF, int nCHin, int nCHout, int hopsize, int hybridmode, QMF_FDDATA_FORMAT format)
 Creates an instance of the qmf filterbank.
 
void qmf_destroy (void **const phQMF)
 Destroys an instance of the qmf filterbank.
 
void qmf_analysis (void *const hQMF, float **dataTD, int framesize, float_complex ***dataFD)
 Performs QMF analysis of the input time-domain signals.
 
void qmf_synthesis (void *const hQMF, float_complex ***dataFD, int framesize, float **dataTD)
 Performs QMF synthesis of the input frequency-domain signals.
 
void qmf_channelChange (void *const hQMF, int new_nCHin, int new_nCHout)
 Changes the number input and/or output channels.
 
void qmf_clearBuffers (void *const hQMF)
 Flushes the analysis and synthesis buffers with zeros.
 
int qmf_getProcDelay (void *const hQMF)
 Returns the processing delay in samples.
 
int qmf_getNBands (void *const hQMF)
 Returns the number of frequency bands.
 
void qmf_getCentreFreqs (void *const hQMF, float fs, int nBands, float *centreFreq)
 Computes the QMF/hybrid-QMF centre frequencies.
 
void qmf_FIRtoFilterbankCoeffs (float *hIR, int N_dirs, int nCH, int ir_len, int hopSize, int hybridmode, float_complex *hFB)
 Converts FIR filters into Filterbank Coefficients by passing them through the QMF filterbank.
 
void sorti (int *in_vec, int *out_vec, int *new_indices, int len, int descendFLAG)
 Sort a vector of integer values into ascending/decending order (optionally returning the new indices as well)
 
void sortf (float *in_vec, float *out_vec, int *new_indices, int len, int descendFLAG)
 Sort a vector of floating-point values into ascending/decending order (optionally returning the new indices as well)
 
void sortd (double *in_vec, double *out_vec, int *new_indices, int len, int descendFLAG)
 Sort a vector of double floating-point values into ascending/decending order (optionally returning the new indices as well)
 
void sortc (float_complex *in_vec, float_complex *out_vec, int len, int descendFLAG)
 Sort a vector of complex floating-point values into ascending/decending order.
 
void sortz (double_complex *in_vec, double_complex *out_vec, int len, int descendFLAG)
 Sort a vector of complex double floating-point values into ascending/ decending order.
 
void cmplxPairUp (double_complex *in_vec, double_complex *out_vec, int len)
 Pairs up complex numbers and sorts them in ascending order based on their real parts first, and then on their imaginary parts.
 
void findClosestGridPoints (float *grid_dirs, int nGrid, float *target_dirs, int nTarget, int degFLAG, int *idx_closest, float *dirs_closest, float *angle_diff)
 Finds indicies into "grid_dirs" that are the closest to "target dirs".
 
void findClosestGridPointsCartesian (float *grid_dirs_xyz, int nGrid, float *target_dirs_xyz, int nTarget, int *idx_closest, float *dirs_xyz_closest, float *angle_diff)
 Finds indicies into "grid_dirs_xyz" that are the closest to "target dirs_xyz".
 
void utility_siminv (const float *a, const int len, int *index)
 Single-precision, index of minimum absolute value in a vector, i.e.
 
void utility_ciminv (const float_complex *a, const int len, int *index)
 Single-precision, complex, index of maximum absolute value in a vector, i.e.
 
void utility_diminv (const double *a, const int len, int *index)
 Double-precision, index of minimum absolute value in a vector, i.e.
 
void utility_ziminv (const double_complex *a, const int len, int *index)
 Double-precision, complex, index of maximum absolute value in a vector, i.e.
 
void utility_simaxv (const float *a, const int len, int *index)
 Single-precision, index of maximum absolute value in a vector, i.e.
 
void utility_cimaxv (const float_complex *a, const int len, int *index)
 Single-precision, complex, index of maximum absolute value in a vector, i.e.
 
void utility_dimaxv (const double *a, const int len, int *index)
 Double-precision, index of maximum absolute value in a vector, i.e.
 
void utility_zimaxv (const double_complex *a, const int len, int *index)
 Double-precision, complex, index of maximum absolute value in a vector, i.e.
 
void utility_svabs (const float *a, const int len, float *c)
 Single-precision, absolute values of vector elements, i.e.
 
void utility_cvabs (const float_complex *a, const int len, float *c)
 Single-precision, complex, absolute values of vector elements, i.e.
 
void utility_svmod (const float *a, const float *b, const int len, float *c)
 Single-precision, modulus of vector elements, i.e.
 
void utility_svrecip (const float *a, const int len, float *c)
 Single-precision, vector-reciprocal/inversion, i.e.
 
void utility_cvconj (const float_complex *a, const int len, float_complex *c)
 Single-precision, complex, vector-conjugate, i.e.
 
void utility_zvconj (const double_complex *a, const int len, double_complex *c)
 Double-precision, complex, vector-conjugate, i.e.
 
void utility_svvcopy (const float *a, const int len, float *c)
 Single-precision, vector-vector copy, i.e.
 
void utility_cvvcopy (const float_complex *a, const int len, float_complex *c)
 Single-precision, complex, vector-vector copy, i.e.
 
void utility_dvvcopy (const double *a, const int len, double *c)
 double-precision, vector-vector copy, i.e.
 
void utility_zvvcopy (const double_complex *a, const int len, double_complex *c)
 double-precision, complex, vector-vector copy, i.e.
 
void utility_svvadd (const float *a, const float *b, const int len, float *c)
 Single-precision, vector-vector addition, i.e.
 
void utility_cvvadd (const float_complex *a, const float_complex *b, const int len, float_complex *c)
 Single-precision, complex, vector-vector addition, i.e.
 
void utility_dvvadd (const double *a, const double *b, const int len, double *c)
 Double-precision, vector-vector addition, i.e.
 
void utility_zvvadd (const double_complex *a, const double_complex *b, const int len, double_complex *c)
 Double-precision, complex, vector-vector addition, i.e.
 
void utility_svvsub (const float *a, const float *b, const int len, float *c)
 Single-precision, vector-vector subtraction, i.e.
 
void utility_cvvsub (const float_complex *a, const float_complex *b, const int len, float_complex *c)
 Single-precision, complex, vector-vector subtraction, i.e.
 
void utility_dvvsub (const double *a, const double *b, const int len, double *c)
 Double-precision, vector-vector subtraction, i.e.
 
void utility_zvvsub (const double_complex *a, const double_complex *b, const int len, double_complex *c)
 Double-precision, complex, vector-vector subtraction, i.e.
 
void utility_svvmul (const float *a, const float *b, const int len, float *c)
 Single-precision, element-wise vector-vector multiplication i.e.
 
void utility_cvvmul (const float_complex *a, const float_complex *b, const int len, float_complex *c)
 Single-precision, complex, element-wise vector-vector multiplication i.e.
 
void utility_svvdot (const float *a, const float *b, const int len, float *c)
 Single-precision, vector-vector dot product, i.e.
 
void utility_cvvdot (const float_complex *a, const float_complex *b, const int len, CONJ_FLAG flag, float_complex *c)
 Single-precision, complex, vector-vector dot product, i.e.
 
void utility_svsmul (float *a, const float *s, const int len, float *c)
 Single-precision, multiplies each element in vector 'a' with a scalar 's', i.e.
 
void utility_cvsmul (float_complex *a, const float_complex *s, const int len, float_complex *c)
 Single-precision, complex, multiplies each element in vector 'a' with a scalar 's', i.e.
 
void utility_dvsmul (double *a, const double *s, const int len, double *c)
 Double-precision, multiplies each element in vector 'a' with a scalar 's', i.e.
 
void utility_zvsmul (double_complex *a, const double_complex *s, const int len, double_complex *c)
 Double-precision, complex, multiplies each element in vector 'a' with a scalar 's', i.e.
 
void utility_svsdiv (const float *a, const float *s, const int len, float *c)
 Single-precision, divides each element in vector 'a' with a scalar 's', i.e.
 
void utility_svsadd (float *a, const float *s, const int len, float *c)
 Single-precision, adds each element in vector 'a' with a scalar 's', i.e.
 
void utility_svssub (float *a, const float *s, const int len, float *c)
 Single-precision, subtracts each element in vector 'a' with a scalar 's', i.e.
 
void utility_ssv2cv_inds (const float *sv, const int *inds, const int len, float *cv)
 Single-precision, sparse-vector to compressed vector given known indices i.e.
 
void utility_csv2cv_inds (const float_complex *sv, const int *inds, const int len, float_complex *cv)
 Single-precision complex, sparse-vector to compressed vector given known indices.
 
void utility_dsv2cv_inds (const double *sv, const int *inds, const int len, double *cv)
 Double-precision, sparse-vector to compressed vector given known indices i.e.
 
void utility_zsv2cv_inds (const double_complex *sv, const int *inds, const int len, double_complex *cv)
 Double-precision complex, sparse-vector to compressed vector given known indices.
 
void utility_ssvd_create (void **const phWork, int maxDim1, int maxDim2)
 (Optional) Pre-allocate the working struct used by utility_ssvd()
 
void utility_ssvd_destroy (void **const phWork)
 De-allocate the working struct used by utility_ssvd()
 
void utility_ssvd (void *const hWork, const float *A, const int dim1, const int dim2, float *U, float *S, float *V, float *sing)
 Singular value decomposition: single precision, i.e.
 
void utility_csvd_create (void **const phWork, int maxDim1, int maxDim2)
 (Optional) Pre-allocate the working struct used by utility_csvd()
 
void utility_csvd_destroy (void **const phWork)
 De-allocate the working struct used by utility_csvd()
 
void utility_csvd (void *const hWork, const float_complex *A, const int dim1, const int dim2, float_complex *U, float_complex *S, float_complex *V, float *sing)
 Singular value decomposition: single precision complex, i.e.
 
void utility_sseig_create (void **const phWork, int maxDim)
 (Optional) Pre-allocate the working struct used by utility_sseig()
 
void utility_sseig_destroy (void **const phWork)
 De-allocate the working struct used by utility_sseig()
 
void utility_sseig (void *const hWork, const float *A, const int dim, int sortDecFLAG, float *V, float *D, float *eig)
 Eigenvalue decomposition of a SYMMETRIC matrix: single precision, i.e.
 
void utility_cseig_create (void **const phWork, int maxDim)
 (Optional) Pre-allocate the working struct used by utility_cseig()
 
void utility_cseig_destroy (void **const phWork)
 De-allocate the working struct used by utility_cseig()
 
void utility_cseig (void *const hWork, const float_complex *A, const int dim, int sortDecFLAG, float_complex *V, float_complex *D, float *eig)
 Eigenvalue decomposition of a SYMMETRIC/HERMITION matrix: single precision complex, i.e.
 
void utility_ceigmp_create (void **const phWork, int maxDim)
 (Optional) Pre-allocate the working struct used by utility_ceigmp()
 
void utility_ceigmp_destroy (void **const phWork)
 De-allocate the working struct used by utility_ceigmp()
 
void utility_ceigmp (void *const hWork, const float_complex *A, const float_complex *B, const int dim, float_complex *VL, float_complex *VR, float_complex *D)
 Computes eigenvalues of a matrix pair using the QZ method, single precision complex, i.e.
 
void utility_zeigmp_create (void **const phWork, int maxDim)
 (Optional) Pre-allocate the working struct used by utility_zeigmp()
 
void utility_zeigmp_destroy (void **const phWork)
 De-allocate the working struct used by utility_zeigmp()
 
void utility_zeigmp (void *const hWork, const double_complex *A, const double_complex *B, const int dim, double_complex *VL, double_complex *VR, double_complex *D)
 Computes eigenvalues of a matrix pair using the QZ method, double precision complex, i.e.
 
void utility_ceig_create (void **const phWork, int maxDim)
 (Optional) Pre-allocate the working struct used by utility_ceig()
 
void utility_ceig_destroy (void **const phWork)
 De-allocate the working struct used by utility_ceig()
 
void utility_ceig (void *const hWork, const float_complex *A, const int dim, float_complex *VL, float_complex *VR, float_complex *D, float_complex *eig)
 Eigenvalue decomposition of a NON-SYMMETRIC matrix: single precision complex, i.e.
 
void utility_zeig_create (void **const phWork, int maxDim)
 (Optional) Pre-allocate the working struct used by utility_zeig()
 
void utility_zeig_destroy (void **const phWork)
 De-allocate the working struct used by utility_zeig()
 
void utility_zeig (void *const hWork, const double_complex *A, const int dim, double_complex *VL, double_complex *VR, double_complex *D, double_complex *eig)
 Eigenvalue decomposition of a NON-SYMMETRIC matrix: double precision complex, i.e.
 
void utility_sglslv_create (void **const phWork, int maxDim, int maxNCol)
 (Optional) Pre-allocate the working struct used by utility_sglslv()
 
void utility_sglslv_destroy (void **const phWork)
 De-allocate the working struct used by utility_sglslv()
 
void utility_sglslv (void *const hWork, const float *A, const int dim, float *B, int nCol, float *X)
 General linear solver: single precision, i.e.
 
void utility_cglslv_create (void **const phWork, int maxDim, int maxNCol)
 (Optional) Pre-allocate the working struct used by utility_cglslv()
 
void utility_cglslv_destroy (void **const phWork)
 De-allocate the working struct used by utility_cglslv()
 
void utility_cglslv (void *const hWork, const float_complex *A, const int dim, float_complex *B, int nCol, float_complex *X)
 General linear solver: single precision complex, i.e.
 
void utility_dglslv_create (void **const phWork, int maxDim, int maxNCol)
 (Optional) Pre-allocate the working struct used by utility_dglslv()
 
void utility_dglslv_destroy (void **const phWork)
 De-allocate the working struct used by utility_dglslv()
 
void utility_dglslv (void *const hWork, const double *A, const int dim, double *B, int nCol, double *X)
 General linear solver: double precision, i.e.
 
void utility_zglslv_create (void **const phWork, int maxDim, int maxNCol)
 (Optional) Pre-allocate the working struct used by utility_zglslv()
 
void utility_zglslv_destroy (void **const phWork)
 De-allocate the working struct used by utility_zglslv()
 
void utility_zglslv (void *const hWork, const double_complex *A, const int dim, double_complex *B, int nCol, double_complex *X)
 General linear solver: double precision complex, i.e.
 
void utility_sglslvt_create (void **const phWork, int maxDim, int maxNCol)
 (Optional) Pre-allocate the working struct used by utility_sglslvt()
 
void utility_sglslvt_destroy (void **const phWork)
 De-allocate the working struct used by utility_sglslvt()
 
void utility_sglslvt (void *const hWork, const float *A, const int dim, float *B, int nCol, float *X)
 General linear solver (the other way): single precision, i.e.
 
void utility_sslslv_create (void **const phWork, int maxDim, int maxNCol)
 (Optional) Pre-allocate the working struct used by utility_sslslv()
 
void utility_sslslv_destroy (void **const phWork)
 De-allocate the working struct used by utility_sslslv()
 
void utility_sslslv (void *const hWork, const float *A, const int dim, float *B, int nCol, float *X)
 Linear solver for SYMMETRIC positive-definate 'A': single precision, i.e.
 
void utility_cslslv_create (void **const phWork, int maxDim, int maxNCol)
 (Optional) Pre-allocate the working struct used by utility_cslslv()
 
void utility_cslslv_destroy (void **const phWork)
 De-allocate the working struct used by utility_cslslv()
 
void utility_cslslv (void *const hWork, const float_complex *A, const int dim, float_complex *B, int nCol, float_complex *X)
 Linear solver for HERMITIAN positive-definate 'A': single precision complex, i.e.
 
void utility_spinv_create (void **const phWork, int maxDim1, int maxDim2)
 (Optional) Pre-allocate the working struct used by utility_spinv()
 
void utility_spinv_destroy (void **const phWork)
 De-allocate the working struct used by utility_spinv()
 
void utility_spinv (void *const hWork, const float *A, const int dim1, const int dim2, float *B)
 General matrix pseudo-inverse (the svd way): single precision, i.e.
 
void utility_cpinv_create (void **const phWork, int maxDim1, int maxDim2)
 (Optional) Pre-allocate the working struct used by utility_cpinv()
 
void utility_cpinv_destroy (void **const phWork)
 De-allocate the working struct used by utility_cpinv()
 
void utility_cpinv (void *const hWork, const float_complex *A, const int dim1, const int dim2, float_complex *B)
 General matrix pseudo-inverse (the svd way): single precision complex, i.e.
 
void utility_dpinv_create (void **const phWork, int maxDim1, int maxDim2)
 (Optional) Pre-allocate the working struct used by utility_dpinv()
 
void utility_dpinv_destroy (void **const phWork)
 De-allocate the working struct used by utility_dpinv()
 
void utility_dpinv (void *const hWork, const double *A, const int dim1, const int dim2, double *B)
 General matrix pseudo-inverse (the svd way): double precision, i.e.
 
void utility_zpinv_create (void **const phWork, int maxDim1, int maxDim2)
 (Optional) Pre-allocate the working struct used by utility_zpinv()
 
void utility_zpinv_destroy (void **const phWork)
 De-allocate the working struct used by utility_zpinv()
 
void utility_zpinv (void *const hWork, const double_complex *A, const int dim1, const int dim2, double_complex *B)
 General matrix pseudo-inverse (the svd way): double precision complex, i.e.
 
void utility_schol_create (void **const phWork, int maxDim)
 (Optional) Pre-allocate the working struct used by utility_schol()
 
void utility_schol_destroy (void **const phWork)
 De-allocate the working struct used by utility_schol()
 
void utility_schol (void *const hWork, const float *A, const int dim, float *X)
 Cholesky factorisation of a symmetric matrix positive-definate matrix: single precision, i.e.
 
void utility_cchol_create (void **const phWork, int maxDim)
 (Optional) Pre-allocate the working struct used by utility_cchol()
 
void utility_cchol_destroy (void **const phWork)
 De-allocate the working struct used by utility_cchol()
 
void utility_cchol (void *const hWork, const float_complex *A, const int dim, float_complex *X)
 Cholesky factorisation of a hermitian positive-definate matrix: single precision complex, i.e.
 
void utility_sdet_create (void **const phWork, int maxN)
 (Optional) Pre-allocate the working struct used by utility_sdet()
 
void utility_sdet_destroy (void **const phWork)
 De-allocate the working struct used by utility_sdet()
 
float utility_sdet (void *const hWork, float *A, int N)
 Determinant of a Matrix, single precision, i,e.
 
void utility_ddet_create (void **const phWork, int maxN)
 (Optional) Pre-allocate the working struct used by utility_ddet()
 
void utility_ddet_destroy (void **const phWork)
 De-allocate the working struct used by utility_ddet()
 
double utility_ddet (void *const hWork, double *A, int N)
 Determinant of a Matrix, double precision, i,e.
 
void utility_sinv_create (void **const phWork, int maxDim)
 (Optional) Pre-allocate the working struct used by utility_sinv()
 
void utility_sinv_destroy (void **const phWork)
 De-allocate the working struct used by utility_sinv()
 
void utility_sinv (void *const hWork, float *A, float *B, const int dim)
 Matrix inversion: single precision, i.e.
 
void utility_dinv_create (void **const phWork, int maxDim)
 (Optional) Pre-allocate the working struct used by utility_dinv()
 
void utility_dinv_destroy (void **const phWork)
 De-allocate the working struct used by utility_dinv()
 
void utility_dinv (void *const hWork, double *A, double *B, const int dim)
 Matrix inversion: double precision, i.e.
 
void utility_cinv_create (void **const phWork, int maxDim)
 (Optional) Pre-allocate the working struct used by utility_cinv()
 
void utility_cinv_destroy (void **const phWork)
 De-allocate the working struct used by utility_cinv()
 
void utility_cinv (void *const hWork, float_complex *A, float_complex *B, const int dim)
 Matrix inversion: double precision complex, i.e.
 

Variables

const float __lattice_coeffs_o20 [256][20]
 Lattice all-pass filter coeffs (numerator) for 256 channels, 20th order.
 
const float __lattice_coeffs_o18 [256][18]
 Lattice all-pass filter coeffs (numerator) for 256 channels, 18th order.
 
const float __lattice_coeffs_o16 [256][16]
 Lattice all-pass filter coeffs (numerator) for 256 channels, 16th order.
 
const float __lattice_coeffs_o15 [256][15]
 Lattice all-pass filter coeffs (numerator) for 256 channels, 15th order.
 
const float __lattice_coeffs_o14 [256][14]
 Lattice all-pass filter coeffs (numerator) for 256 channels, 14th order.
 
const float __lattice_coeffs_o12 [256][12]
 Lattice all-pass filter coeffs (numerator) for 256 channels, 12th order.
 
const float __lattice_coeffs_o10 [256][10]
 Lattice all-pass filter coeffs (numerator) for 256 channels, 10th order.
 
const float __lattice_coeffs_o8 [256][8]
 Lattice all-pass filter coeffs (numerator) for 256 channels, 8th order.
 
const float __lattice_coeffs_o6 [256][6]
 Lattice all-pass filter coeffs (numerator) for 256 channels, 6th order.
 
const float __lattice_coeffs_o4 [256][4]
 Lattice all-pass filter coeffs (numerator) for 256 channels, 4th order.
 
const float __lattice_coeffs_o3 [256][3]
 Lattice all-pass filter coeffs (numerator) for 256 channels, 3rd order.
 
const float __lattice_coeffs_o2 [256][2]
 Lattice all-pass filter coeffs (numerator) for 256 channels, 2nd order.
 
const float __mono_dirs_deg [1][2]
 Loudspeaker directions [azimuth, Elevation] in degrees, for a mono setup.
 
const float __stereo_dirs_deg [2][2]
 Loudspeaker directions [azimuth, Elevation] in degrees, for a stereo setup.
 
const float __5pX_dirs_deg [5][2]
 Loudspeaker directions [azimuth, Elevation] in degrees, for a 5.x setup.
 
const float __7pX_dirs_deg [7][2]
 Loudspeaker directions [azimuth, Elevation] in degrees, for a 7.x setup.
 
const float __8pX_dirs_deg [8][2]
 Loudspeaker directions [azimuth, Elevation] in degrees, for a 8.x setup.
 
const float __9pX_dirs_deg [9][2]
 Loudspeaker directions [azimuth, Elevation] in degrees, for a 9.x setup.
 
const float __10pX_dirs_deg [10][2]
 Loudspeaker directions [azimuth, Elevation] in degrees, for a 10.x setup.
 
const float __11pX_dirs_deg [11][2]
 Loudspeaker directions [azimuth, Elevation] in degrees, for a 11.x setup.
 
const float __11pX_7_4_dirs_deg [11][2]
 Loudspeaker directions [azimuth, Elevation] in degrees, for a 7.4.x setup.
 
const float __13pX_dirs_deg [13][2]
 Loudspeaker directions [azimuth, Elevation] in degrees, for a 13.x setup.
 
const float __22pX_dirs_deg [22][2]
 Loudspeaker directions [azimuth, Elevation] in degrees, for a 22.x setup.
 
const float __9_10_3p2_dirs_deg [24][2]
 Loudspeaker directions [azimuth, Elevation] in degrees, for a 9+10+3.2 setup BS 2051 recommedation: https://www.itu.int/rec/R-REC-BS.2051/en.
 
const float __Aalto_MCC_dirs_deg [45][2]
 Loudspeaker directions [azimuth, Elevation] in degrees, for the multi-channel anechoic chamber (MCC), at Aalto University.
 
const float __Aalto_MCCsubset_dirs_deg [37][2]
 Loudspeaker directions [azimuth, Elevation] in degrees, for the multi-channel anechoic chamber (MCC) sub-set, at Aalto University.
 
const float __Aalto_Apaja_dirs_deg [29][2]
 Loudspeaker directions [azimuth, Elevation] in degrees, for the audio-visual listening room (Apaja), at Aalto University.
 
const float __Aalto_LR_dirs_deg [13][2]
 Loudspeaker directions [azimuth, Elevation] in degrees, for the ITU standard listening room (LR), at Aalto University.
 
const float __DTU_AVIL_dirs_deg [64][2]
 Loudspeaker directions [azimuth, Elevation] in degrees, for the Audio Visual Immersion Lab (AVIL), at the Technical University of Denmark (DTU)
 
const float __Zylia_Lab_dirs_deg [22][2]
 Loudspeaker directions [azimuth, Elevation] in degrees, for the 22.x setup, at Zylia Labs.
 
const float __default_LScoords64_rad [64][2]
 Default Loudspeaker directions [azimuth, Elevation] in RADIANS!
 
const float __default_LScoords128_deg [128][2]
 Default Loudspeaker directions [azimuth, Elevation] - to replace above!
 
const int __Tdesign_degree_1_nPoints
 Number of directions in a minimum Tdesign of degree: 1.
 
const int __Tdesign_degree_2_nPoints
 Number of directions in a minimum Tdesign of degree: 2.
 
const int __Tdesign_degree_3_nPoints
 Number of directions in a minimum Tdesign of degree: 3.
 
const int __Tdesign_degree_4_nPoints
 Number of directions in a minimum Tdesign of degree: 4.
 
const int __Tdesign_degree_5_nPoints
 Number of directions in a minimum Tdesign of degree: 5.
 
const int __Tdesign_degree_6_nPoints
 Number of directions in a minimum Tdesign of degree: 6.
 
const int __Tdesign_degree_7_nPoints
 Number of directions in a minimum Tdesign of degree: 7.
 
const int __Tdesign_degree_8_nPoints
 Number of directions in a minimum Tdesign of degree: 8.
 
const int __Tdesign_degree_9_nPoints
 Number of directions in a minimum Tdesign of degree: 9.
 
const int __Tdesign_degree_10_nPoints
 Number of directions in a minimum Tdesign of degree: 10.
 
const int __Tdesign_degree_11_nPoints
 Number of directions in a minimum Tdesign of degree: 11.
 
const int __Tdesign_degree_12_nPoints
 Number of directions in a minimum Tdesign of degree: 12.
 
const int __Tdesign_degree_13_nPoints
 Number of directions in a minimum Tdesign of degree: 13.
 
const int __Tdesign_degree_14_nPoints
 Number of directions in a minimum Tdesign of degree: 14.
 
const int __Tdesign_degree_15_nPoints
 Number of directions in a minimum Tdesign of degree: 15.
 
const int __Tdesign_degree_16_nPoints
 Number of directions in a minimum Tdesign of degree: 16.
 
const int __Tdesign_degree_17_nPoints
 Number of directions in a minimum Tdesign of degree: 17.
 
const int __Tdesign_degree_18_nPoints
 Number of directions in a minimum Tdesign of degree: 18.
 
const int __Tdesign_degree_19_nPoints
 Number of directions in a minimum Tdesign of degree: 19.
 
const int __Tdesign_degree_20_nPoints
 Number of directions in a minimum Tdesign of degree: 20.
 
const int __Tdesign_degree_21_nPoints
 Number of directions in a minimum Tdesign of degree: 21.
 
const int __Tdesign_degree_30_nPoints
 Number of directions in a minimum Tdesign of degree: 30.
 
const int __Tdesign_degree_40_nPoints
 Number of directions in a minimum Tdesign of degree: 40.
 
const int __Tdesign_degree_50_nPoints
 Number of directions in a minimum Tdesign of degree: 50.
 
const int __Tdesign_degree_60_nPoints
 Number of directions in a minimum Tdesign of degree: 60.
 
const int __Tdesign_degree_70_nPoints
 Number of directions in a minimum Tdesign of degree: 70.
 
const int __Tdesign_degree_80_nPoints
 Number of directions in a minimum Tdesign of degree: 80.
 
const int __Tdesign_degree_90_nPoints
 Number of directions in a minimum Tdesign of degree: 90.
 
const int __Tdesign_degree_100_nPoints
 Number of directions in a minimum Tdesign of degree: 100.
 
const int __Tdesign_degree_124_nPoints
 Number of directions in a minimum Tdesign of degree: 124.
 
const float __Tdesign_degree_1_dirs_deg [2][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 1.
 
const float __Tdesign_degree_2_dirs_deg [4][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 2.
 
const float __Tdesign_degree_3_dirs_deg [6][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 3.
 
const float __Tdesign_degree_4_dirs_deg [12][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 4.
 
const float __Tdesign_degree_5_dirs_deg [12][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 5.
 
const float __Tdesign_degree_6_dirs_deg [24][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 6.
 
const float __Tdesign_degree_7_dirs_deg [24][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 7.
 
const float __Tdesign_degree_8_dirs_deg [36][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 8.
 
const float __Tdesign_degree_9_dirs_deg [48][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 9.
 
const float __Tdesign_degree_10_dirs_deg [60][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 10.
 
const float __Tdesign_degree_11_dirs_deg [70][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 11.
 
const float __Tdesign_degree_12_dirs_deg [84][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 12.
 
const float __Tdesign_degree_13_dirs_deg [94][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 13.
 
const float __Tdesign_degree_14_dirs_deg [108][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 14.
 
const float __Tdesign_degree_15_dirs_deg [120][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 15.
 
const float __Tdesign_degree_16_dirs_deg [144][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 16.
 
const float __Tdesign_degree_17_dirs_deg [156][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 17.
 
const float __Tdesign_degree_18_dirs_deg [180][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 18.
 
const float __Tdesign_degree_19_dirs_deg [204][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 19.
 
const float __Tdesign_degree_20_dirs_deg [216][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 20.
 
const float __Tdesign_degree_21_dirs_deg [240][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 21.
 
const float __Tdesign_degree_30_dirs_deg [480][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 30.
 
const float __Tdesign_degree_40_dirs_deg [840][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 40.
 
const float __Tdesign_degree_50_dirs_deg [1296][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 50.
 
const float __Tdesign_degree_60_dirs_deg [1860][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 60.
 
const float __Tdesign_degree_70_dirs_deg [2520][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 70.
 
const float __Tdesign_degree_80_dirs_deg [3276][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 80.
 
const float __Tdesign_degree_90_dirs_deg [4140][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 90.
 
const float __Tdesign_degree_100_dirs_deg [5100][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 100.
 
const float __Tdesign_degree_124_dirs_deg [7812][2]
 Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 124.
 
const float * __HANDLES_Tdesign_dirs_deg [21]
 minimum T-design HANDLES (up to degree 21 only).
 
const int __Tdesign_nPoints_per_degree [21]
 Number of points in each t-design (up to degree 21 only).
 
const float __SphCovering_4_dirs_deg [4][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 4 dirs.
 
const float __SphCovering_5_dirs_deg [5][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 5 dirs.
 
const float __SphCovering_6_dirs_deg [6][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 6 dirs.
 
const float __SphCovering_7_dirs_deg [7][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 7 dirs.
 
const float __SphCovering_8_dirs_deg [8][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 8 dirs.
 
const float __SphCovering_9_dirs_deg [9][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 9 dirs.
 
const float __SphCovering_10_dirs_deg [10][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 10 dirs.
 
const float __SphCovering_11_dirs_deg [11][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 11 dirs.
 
const float __SphCovering_12_dirs_deg [12][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 12 dirs.
 
const float __SphCovering_13_dirs_deg [13][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 13 dirs.
 
const float __SphCovering_14_dirs_deg [14][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 14 dirs.
 
const float __SphCovering_15_dirs_deg [15][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 15 dirs.
 
const float __SphCovering_16_dirs_deg [16][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 16 dirs.
 
const float __SphCovering_17_dirs_deg [17][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 17 dirs.
 
const float __SphCovering_18_dirs_deg [18][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 18 dirs.
 
const float __SphCovering_19_dirs_deg [19][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 19 dirs.
 
const float __SphCovering_20_dirs_deg [20][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 20 dirs.
 
const float __SphCovering_21_dirs_deg [21][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 21 dirs.
 
const float __SphCovering_22_dirs_deg [22][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 22 dirs.
 
const float __SphCovering_23_dirs_deg [23][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 23 dirs.
 
const float __SphCovering_24_dirs_deg [24][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 24 dirs.
 
const float __SphCovering_25_dirs_deg [25][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 25 dirs.
 
const float __SphCovering_26_dirs_deg [26][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 26 dirs.
 
const float __SphCovering_27_dirs_deg [27][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 27 dirs.
 
const float __SphCovering_28_dirs_deg [28][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 28 dirs.
 
const float __SphCovering_29_dirs_deg [29][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 29 dirs.
 
const float __SphCovering_30_dirs_deg [30][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 30 dirs.
 
const float __SphCovering_31_dirs_deg [31][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 31 dirs.
 
const float __SphCovering_32_dirs_deg [32][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 32 dirs.
 
const float __SphCovering_33_dirs_deg [33][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 33 dirs.
 
const float __SphCovering_34_dirs_deg [34][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 34 dirs.
 
const float __SphCovering_35_dirs_deg [35][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 35 dirs.
 
const float __SphCovering_36_dirs_deg [36][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 36 dirs.
 
const float __SphCovering_37_dirs_deg [37][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 37 dirs.
 
const float __SphCovering_38_dirs_deg [38][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 38 dirs.
 
const float __SphCovering_39_dirs_deg [39][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 39 dirs.
 
const float __SphCovering_40_dirs_deg [40][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 40 dirs.
 
const float __SphCovering_41_dirs_deg [41][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 41 dirs.
 
const float __SphCovering_42_dirs_deg [42][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 42 dirs.
 
const float __SphCovering_43_dirs_deg [43][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 43 dirs.
 
const float __SphCovering_44_dirs_deg [44][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 44 dirs.
 
const float __SphCovering_45_dirs_deg [45][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 45 dirs.
 
const float __SphCovering_46_dirs_deg [46][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 46 dirs.
 
const float __SphCovering_47_dirs_deg [47][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 47 dirs.
 
const float __SphCovering_48_dirs_deg [48][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 48 dirs.
 
const float __SphCovering_49_dirs_deg [49][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 49 dirs.
 
const float __SphCovering_50_dirs_deg [50][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 50 dirs.
 
const float __SphCovering_51_dirs_deg [51][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 51 dirs.
 
const float __SphCovering_52_dirs_deg [52][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 52 dirs.
 
const float __SphCovering_53_dirs_deg [53][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 53 dirs.
 
const float __SphCovering_54_dirs_deg [54][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 54 dirs.
 
const float __SphCovering_55_dirs_deg [55][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 55 dirs.
 
const float __SphCovering_56_dirs_deg [56][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 56 dirs.
 
const float __SphCovering_57_dirs_deg [57][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 57 dirs.
 
const float __SphCovering_58_dirs_deg [58][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 58 dirs.
 
const float __SphCovering_59_dirs_deg [59][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 59 dirs.
 
const float __SphCovering_60_dirs_deg [60][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 60 dirs.
 
const float __SphCovering_61_dirs_deg [61][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 61 dirs.
 
const float __SphCovering_62_dirs_deg [62][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 62 dirs.
 
const float __SphCovering_63_dirs_deg [63][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 63 dirs.
 
const float __SphCovering_64_dirs_deg [64][2]
 Directions [azimuth, Elevation] in degrees, for sphere covering: 64 dirs.
 
const float * __HANDLES_SphCovering_dirs_deg [64]
 Sphere covering handles ( between 4..64 points only)
 
const int __geosphere_ico_0_0_nPoints
 Number of directions in a ico geosphere of degree: 0.
 
const int __geosphere_ico_1_0_nPoints
 Number of directions in a ico geosphere of degree: 1.
 
const int __geosphere_ico_2_0_nPoints
 Number of directions in a ico geosphere of degree: 2.
 
const int __geosphere_ico_3_0_nPoints
 Number of directions in a ico geosphere of degree: 3.
 
const int __geosphere_ico_4_0_nPoints
 Number of directions in a ico geosphere of degree: 4.
 
const int __geosphere_ico_5_0_nPoints
 Number of directions in a ico geosphere of degree: 5.
 
const int __geosphere_ico_6_0_nPoints
 Number of directions in a ico geosphere of degree: 6.
 
const int __geosphere_ico_7_0_nPoints
 Number of directions in a ico geosphere of degree: 7.
 
const int __geosphere_ico_8_0_nPoints
 Number of directions in a ico geosphere of degree: 8.
 
const int __geosphere_ico_9_0_nPoints
 Number of directions in a ico geosphere of degree: 9.
 
const int __geosphere_ico_10_0_nPoints
 Number of directions in a ico geosphere of degree: 10.
 
const int __geosphere_ico_11_0_nPoints
 Number of directions in a ico geosphere of degree: 11.
 
const int __geosphere_ico_12_0_nPoints
 Number of directions in a ico geosphere of degree: 12.
 
const int __geosphere_ico_13_0_nPoints
 Number of directions in a ico geosphere of degree: 13.
 
const int __geosphere_ico_14_0_nPoints
 Number of directions in a ico geosphere of degree: 14.
 
const int __geosphere_ico_15_0_nPoints
 Number of directions in a ico geosphere of degree: 15.
 
const int __geosphere_ico_16_0_nPoints
 Number of directions in a ico geosphere of degree: 16.
 
const float __geosphere_ico_0_0_dirs_deg [12][2]
 Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 0.
 
const float __geosphere_ico_1_0_dirs_deg [32][2]
 Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 1.
 
const float __geosphere_ico_2_0_dirs_deg [42][2]
 Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 2.
 
const float __geosphere_ico_3_0_dirs_deg [92][2]
 Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 3.
 
const float __geosphere_ico_4_0_dirs_deg [162][2]
 Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 4.
 
const float __geosphere_ico_5_0_dirs_deg [252][2]
 Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 5.
 
const float __geosphere_ico_6_0_dirs_deg [362][2]
 Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 6.
 
const float __geosphere_ico_7_0_dirs_deg [492][2]
 Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 7.
 
const float __geosphere_ico_8_0_dirs_deg [642][2]
 Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 8.
 
const float __geosphere_ico_9_0_dirs_deg [812][2]
 Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 9.
 
const float __geosphere_ico_10_0_dirs_deg [1002][2]
 Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 10.
 
const float __geosphere_ico_11_0_dirs_deg [1212][2]
 Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 11.
 
const float __geosphere_ico_12_0_dirs_deg [1442][2]
 Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 12.
 
const float __geosphere_ico_13_0_dirs_deg [1692][2]
 Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 13.
 
const float __geosphere_ico_14_0_dirs_deg [1962][2]
 Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 14.
 
const float __geosphere_ico_15_0_dirs_deg [2252][2]
 Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 15.
 
const float __geosphere_ico_16_0_dirs_deg [2562][2]
 Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 16.
 
const int __geosphere_oct_0_0_nPoints
 Number of directions in a oct geosphere of degree: 0.
 
const int __geosphere_oct_1_0_nPoints
 Number of directions in a oct geosphere of degree: 1.
 
const int __geosphere_oct_2_0_nPoints
 Number of directions in a oct geosphere of degree: 2.
 
const int __geosphere_oct_3_0_nPoints
 Number of directions in a oct geosphere of degree: 3.
 
const int __geosphere_oct_4_0_nPoints
 Number of directions in a oct geosphere of degree: 4.
 
const int __geosphere_oct_5_0_nPoints
 Number of directions in a oct geosphere of degree: 5.
 
const int __geosphere_oct_6_0_nPoints
 Number of directions in a oct geosphere of degree: 6.
 
const int __geosphere_oct_7_0_nPoints
 Number of directions in a oct geosphere of degree: 7.
 
const int __geosphere_oct_8_0_nPoints
 Number of directions in a oct geosphere of degree: 8.
 
const int __geosphere_oct_9_0_nPoints
 Number of directions in a oct geosphere of degree: 9.
 
const int __geosphere_oct_10_0_nPoints
 Number of directions in a oct geosphere of degree: 10.
 
const int __geosphere_oct_11_0_nPoints
 Number of directions in a oct geosphere of degree: 11.
 
const int __geosphere_oct_12_0_nPoints
 Number of directions in a oct geosphere of degree: 12.
 
const int __geosphere_oct_13_0_nPoints
 Number of directions in a oct geosphere of degree: 13.
 
const int __geosphere_oct_14_0_nPoints
 Number of directions in a oct geosphere of degree: 14.
 
const int __geosphere_oct_15_0_nPoints
 Number of directions in a oct geosphere of degree: 15.
 
const int __geosphere_oct_16_0_nPoints
 Number of directions in a oct geosphere of degree: 16.
 
const float __geosphere_oct_0_0_dirs_deg [6][2]
 Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 0.
 
const float __geosphere_oct_1_0_dirs_deg [14][2]
 Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 1.
 
const float __geosphere_oct_2_0_dirs_deg [18][2]
 Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 2.
 
const float __geosphere_oct_3_0_dirs_deg [38][2]
 Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 3.
 
const float __geosphere_oct_4_0_dirs_deg [66][2]
 Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 4.
 
const float __geosphere_oct_5_0_dirs_deg [102][2]
 Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 5.
 
const float __geosphere_oct_6_0_dirs_deg [146][2]
 Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 6.
 
const float __geosphere_oct_7_0_dirs_deg [198][2]
 Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 7.
 
const float __geosphere_oct_8_0_dirs_deg [258][2]
 Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 8.
 
const float __geosphere_oct_9_0_dirs_deg [326][2]
 Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 9.
 
const float __geosphere_oct_10_0_dirs_deg [402][2]
 Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 10.
 
const float __geosphere_oct_11_0_dirs_deg [486][2]
 Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 11.
 
const float __geosphere_oct_12_0_dirs_deg [578][2]
 Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 12.
 
const float __geosphere_oct_13_0_dirs_deg [678][2]
 Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 13.
 
const float __geosphere_oct_14_0_dirs_deg [786][2]
 Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 14.
 
const float __geosphere_oct_15_0_dirs_deg [902][2]
 Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 15.
 
const float __geosphere_oct_16_0_dirs_deg [1026][2]
 Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 16.
 
const float * __HANDLES_geosphere_ico_dirs_deg [17]
 3LD geosphere HANDLES (freq = [0 0], [1 0],..., [16 0])
 
const float * __HANDLES_geosphere_oct_dirs_deg [17]
 3LD geosphere HANDLES (freq = [0 0], [1 0],..., [16 0])
 
const int __geosphere_ico_nPoints [17]
 3LD geosphere number of points (freq = [0 0], [1 0],..., [16 0])
 
const int __geosphere_oct_nPoints [17]
 3LD geosphere number of points (freq = [0 0], [1 0],..., [16 0])
 
const float __Aalto_Hydrophone_coords_rad [4][2]
 Sensor array coordinates for the custom hydrophone array made at Aalto University [1].
 
const float __Sennheiser_Ambeo_coords_rad [4][2]
 Sensor array coordinates for the Sennheiser Ambeo.
 
const float __Core_Sound_TetraMic_coords_rad [4][2]
 Sensor array coordinates for the Core Sound TetraMic.
 
const float __Sound_field_SPS200_coords_rad [4][2]
 Sensor array coordinates for the Sound-field SPS200.
 
const float __Zoom_H3VR_coords_rad [4][2]
 Sensor array coordinates for the Zoom H3VR.
 
const float __Zylia1D_coords_rad [19][2]
 Sensor array coordinates for the Zylia mic.
 
const float __Eigenmike32_coords_rad [32][2]
 Sensor array coordinates for the Eigenmike32.
 
const float __DTU_mic_coords_rad [52][2]
 Sensor array coordinates for the custom 52-sensor array built at the Technical University of Denmark (DTU) [1].
 
const float __Eigenmike64_coords_rad [64][2]
 Sensor array coordinates for the Eigenmike64.
 
const float __default_SENSORcoords64_rad [64][2]
 Default sensor array coordinates.
 
const float __default_SENSORcoords128_deg [128][2]
 Default sensor array coordinates.
 
const int __Aalto_Hydrophone_maxOrder
 Max spherical harmonic order for the custom hydrophone array made at Aalto University.
 
const int __Sennheiser_Ambeo_maxOrder
 Max spherical harmonic order for the Sennheiser Ambeo.
 
const int __Core_Sound_TetraMic_maxOrder
 Max spherical harmonic order for the Core Sound TetraMic.
 
const int __Sound_field_SPS200_maxOrder
 Max spherical harmonic order for the Sound-field SPS200.
 
const int __Zylia_maxOrder
 Max spherical harmonic order for the Zylia mic.
 
const int __Eigenmike32_maxOrder
 Max spherical harmonic order for the Eigenmike32.
 
const int __DTU_mic_maxOrder
 Max spherical harmonic order for the custom 52-sensor array built at the Technical University of Denmark (DTU)
 
const int __Eigenmike64_maxOrder
 Max spherical harmonic order for the Eigenmike64.
 
const float __Zylia_freqRange [4]
 Sensor array frequency ranges for each SH order, for the Zylia array (should only be used as a rough estimate).
 
const float __Eigenmike32_freqRange [6]
 Sensor array frequency ranges for each SH order, for the Eigenmike32 (should only be used as a rough estimate)
 
const float __DTU_mic_freqRange [10]
 Sensor array frequency ranges for each SH order, for the DTU mic (should only be used as a rough estimate)
 

Detailed Description

Utilities module

Macro Definition Documentation

◆ _impl_CASSERT_LINE

#define _impl_CASSERT_LINE ( predicate,
line,
file )    typedef char _impl_PASTE(assertion_failed_##file##_,line)[2*!!(predicate)-1];

CASSERT helper macro.

Definition at line 88 of file saf_utility_misc.h.

◆ _impl_PASTE

#define _impl_PASTE ( a,
b )   a##b

CASSERT helper macro.

Definition at line 86 of file saf_utility_misc.h.

◆ DEG2RAD

#define DEG2RAD ( x)    (x * SAF_PI / 180.0f)

Converts degrees to radians.

Definition at line 99 of file saf_utilities.h.

◆ ELEV2INCL

#define ELEV2INCL ( E)    ( (SAF_PI/2.0f - E) )

Converts elevation to inclincation, (in radians)

Definition at line 95 of file saf_utilities.h.

◆ FOURPI

#define FOURPI   ( 12.566370614359172f )

4pi (single precision)

Definition at line 92 of file saf_utilities.h.

◆ ISEVEN

#define ISEVEN ( n)    ((n%2 == 0) ? 1 : 0)

Returns 1 if "n" is even valued, and 0 if it is not.

Definition at line 80 of file saf_utilities.h.

◆ ISODD

#define ISODD ( n)    ((n%2 != 0) ? 1 : 0)

Returns 1 if "n" is odd valued, and 0 if it is not.

Definition at line 85 of file saf_utilities.h.

◆ MKSTRING

#define MKSTRING ( s)    MKSTRING_(s)

Used to make strings inside of Macros.

Definition at line 114 of file saf_utilities.h.

◆ MKSTRING_

#define MKSTRING_ ( s)    #s

Used to make strings inside of Macros.

Definition at line 109 of file saf_utilities.h.

◆ NUM_EARS

#define NUM_EARS   2

2 (true for most humans)

Definition at line 52 of file saf_utilities.h.

◆ RAD2DEG

#define RAD2DEG ( x)    (x * 180.0f / SAF_PI)

Converts radians to degrees

Definition at line 104 of file saf_utilities.h.

◆ saf_assert

#define saf_assert ( x,
message )
Value:
if (!(x)) \
{printf("SAF ASSERTION FAILED: (%s), %s [%s LINE %u].\n", \
MKSTRING(x), message, __FILE__, __LINE__); \
exit(EXIT_FAILURE); }
#define MKSTRING(s)
Used to make strings inside of Macros.
char message[MSG_STR_LENGTH]
Current warning/error message.
Definition safmex.h:29

Macro to make an assertion, along with a string explaining its purpose.

Definition at line 133 of file saf_utilities.h.

◆ SAF_CASSERT

#define SAF_CASSERT ( predicate,
file )   _impl_CASSERT_LINE(predicate,__LINE__,file)

A compile time assertion check.

Validate at compile time that the predicate is true without generating code. This can be used at any point in a source file where typedef is legal.

On success, compilation proceeds normally.

On failure, attempts to typedef an array type of negative size. The offending line will look like: typedef assertion_failed_file_h_42[-1] where file is the content of the second parameter which should typically be related in some obvious way to the containing file name, 42 is the line number in the file on which the assertion appears, and -1 is the result of a calculation based on the predicate failing.

Parameters
[in]predicateThe predicate to test. It must evaluate to something that can be coerced to a normal C boolean.
[in]fileA sequence of legal identifier characters that should uniquely identify the source file in which this condition appears.

Taken from (no license): https://stackoverflow.com/questions/807244/c-compiler-asserts-how-to-implement

Definition at line 84 of file saf_utility_misc.h.

◆ SAF_CLAMP

#define SAF_CLAMP ( a,
min,
max )   (SAF_MAX(min, SAF_MIN(max, a)))

Ensures value "a" is clamped between the "min" and "max" values.

Definition at line 61 of file saf_utilities.h.

◆ SAF_FALSE

#define SAF_FALSE   ( 0 )

Boolean false.

Definition at line 67 of file saf_utilities.h.

◆ SAF_ISPOW2

#define SAF_ISPOW2 ( x)    (((x & ~(x-1))==x) ? x : 0)

Returns 0 if "x" is not a power of 2.

Definition at line 76 of file saf_utilities.h.

◆ SAF_MAX

#define SAF_MAX ( a,
b )   (( (a) > (b) ) ? (a) : (b))

Returns the maximum of the two values.

Definition at line 58 of file saf_utilities.h.

◆ SAF_MIN

#define SAF_MIN ( a,
b )   (( (a) < (b) ) ? (a) : (b))

Returns the minimum of the two values.

Definition at line 55 of file saf_utilities.h.

◆ SAF_PI

#define SAF_PI   ( 3.14159265358979323846264338327950288f )

pi constant (single precision)

Definition at line 70 of file saf_utilities.h.

◆ SAF_PId

#define SAF_PId   ( 3.14159265358979323846264338327950288 )

pi constant (double precision)

Definition at line 73 of file saf_utilities.h.

◆ saf_print_error

#define saf_print_error ( message)
Value:
{fprintf(stderr, \
"SAF ERROR: %s [%s LINE %u] \n", message, \
__FILE__, __LINE__); \
exit(EXIT_FAILURE);}

Macro to print a error message along with the filename and line number.

Definition at line 127 of file saf_utilities.h.

◆ saf_print_warning

#define saf_print_warning ( message)
Value:
{fprintf(stdout, \
"SAF WARNING: %s [%s LINE %u] \n", message,\
__FILE__, __LINE__);}

Macro to print a warning message along with the filename and line number.

Definition at line 122 of file saf_utilities.h.

◆ SAF_TRUE

#define SAF_TRUE   ( 1 )

Boolean true.

Examples
ambi_bin.h.

Definition at line 64 of file saf_utilities.h.

◆ SAF_UNUSED

#define SAF_UNUSED ( x)    (void)(x)

Indicates that a particular variable is unused (& squelches any warnings)

Definition at line 118 of file saf_utilities.h.

◆ SQRT4PI

#define SQRT4PI   ( 3.544907701811032f )

sqrt(4pi) (single precision)

Definition at line 89 of file saf_utilities.h.

Enumeration Type Documentation

◆ BIQUAD_FILTER_TYPES

Bi-quadratic (second-order) IIR filter design options.

Note
By default, the filter designs have been taken from [1]. While those with the "_EQCB" suffix have instead been taken from [2].
See also
[1] Zo"lzer, U., 2012. Digital audio effects (2nd edition). New York: Wiley.
[2] https://webaudio.github.io/Audio-EQ-Cookbook/audio-eq-cookbook.html
Enumerator
BIQUAD_FILTER_LPF 

low-pass filter (DAFx-Zolzer)

BIQUAD_FILTER_LPF_EQCB 

low-pass filter (EQ-cookbook)

BIQUAD_FILTER_HPF 

high-pass filter (DAFx-Zolzer)

BIQUAD_FILTER_HPF_EQCB 

high-pass filter (EQ-cookbook)

BIQUAD_FILTER_PEAK 

peaking filter (DAFx-Zolzer)

BIQUAD_FILTER_PEAK_EQCB 

peaking filter (EQ-cookbook)

BIQUAD_FILTER_LOW_SHELF 

low-shelving filter (DAFx-Zolzer)

BIQUAD_FILTER_LOW_SHELF_EQCB 

low-shelving filter (EQ-cookbook)

BIQUAD_FILTER_HI_SHELF 

high-shelving filter (DAFx-Zolzer)

BIQUAD_FILTER_HI_SHELF_EQCB 

high-shelving filter (EQ-cookbook)

Definition at line 51 of file saf_utility_filters.h.

◆ BUTTER_FILTER_TYPES

Butterworth Infinite Impulse Response (IIR) filter design options.

Enumerator
BUTTER_FILTER_LPF 

low-pass filter

BUTTER_FILTER_HPF 

high-pass filter

BUTTER_FILTER_BPF 

band-pass filter

BUTTER_FILTER_BSF 

band-stop filter

Definition at line 66 of file saf_utility_filters.h.

◆ CONJ_FLAG

enum CONJ_FLAG

Whether a vector should be conjugated or not (e.g.

prior to dot product)

Enumerator
NO_CONJ 

Do not take the conjugate.

CONJ 

Take the conjugate.

Definition at line 40 of file saf_utility_veclib.h.

◆ EULER_ROTATION_CONVENTIONS

Available euler2rotationMatrix() conventions.

Enumerator
EULER_ROTATION_Y_CONVENTION 

y-convention, 'zyz'

EULER_ROTATION_X_CONVENTION 

x-convention, 'zxz'

EULER_ROTATION_YAW_PITCH_ROLL 

yaw-pitch-roll, 'zyx'

EULER_ROTATION_ROLL_PITCH_YAW 

roll-pitch-yaw, 'xyz'

Definition at line 48 of file saf_utility_geometry.h.

◆ FIR_FILTER_TYPES

Finite Impulse Response (FIR) filter design options.

Enumerator
FIR_FILTER_LPF 

low-pass filter

FIR_FILTER_HPF 

high-pass filter

FIR_FILTER_BPF 

band-pass filter

FIR_FILTER_BSF 

band-stop filter

Definition at line 75 of file saf_utility_filters.h.

◆ QMF_FDDATA_FORMAT

Options for how the frequency domain data is permuted when using qmf.

Enumerator
QMF_BANDS_CH_TIME 

nBands x nChannels x nTimeHops

QMF_TIME_CH_BANDS 

nTimeHops x nChannels x nBands

Definition at line 43 of file saf_utility_qmf.h.

◆ SAF_STFT_FDDATA_FORMAT

Options for how the frequency domain data is permuted when using saf_stft.

Enumerator
SAF_STFT_BANDS_CH_TIME 

nBands x nChannels x nTimeHops

SAF_STFT_TIME_CH_BANDS 

nTimeHops x nChannels x nBands

Definition at line 49 of file saf_utility_fft.h.

◆ WINDOWING_FUNCTION_TYPES

Windowing function types.

Symmetric if winlength is odd, and asymmetric if winlength is even. Windows are evaluated: 0 <= n < winlength. Largely taken from: https://en.wikipedia.org/wiki/Window_function

Enumerator
WINDOWING_FUNCTION_RECTANGULAR 

Rectangular.

WINDOWING_FUNCTION_HAMMING 

Hamming.

WINDOWING_FUNCTION_HANN 

Hann.

WINDOWING_FUNCTION_BARTLETT 

Bartlett.

WINDOWING_FUNCTION_BLACKMAN 

Blackman.

WINDOWING_FUNCTION_NUTTALL 

Nuttall.

WINDOWING_FUNCTION_BLACKMAN_NUTTALL 

Blackman-Nuttall.

WINDOWING_FUNCTION_BLACKMAN_HARRIS 

Blackman-Harris.

Definition at line 90 of file saf_utility_filters.h.

Function Documentation

◆ anyLessThanf()

int anyLessThanf ( float * values,
int nValues,
float threshold )

Returns 1, if any value in 'values' (nValues x 1) is less than 'threshold', otherwise, it returns 0.

Definition at line 389 of file saf_utility_misc.c.

◆ applyBiQuadFilter()

void applyBiQuadFilter ( float b[3],
float a[3],
float w_z_12[2],
float * signal,
int nSamples )

Applies biQuad filter to an input signal using the direct form II difference equation: https://en.wikipedia.org/wiki/Digital_biquad_filter.

Note
input 'signal' is filtered in place (i.e. it becomes the output signal)
Warning
It is assumed that a[0] = 1.0f! Scale all coefficients by a[0] if this is not the case, prior to calling this function.
Parameters
[in]bb filter coefficients; 3 x 1
[in]aa filter coefficients; 3 x 1
[in,out]w_z_12Previous 2 wn samples (init as 0s); 2 x 1
[in,out]signalSignal to be filtered/filtered signal; nSamples x 1
[in]nSamplesNumber of samples in the signal

Definition at line 553 of file saf_utility_filters.c.

◆ applyIIR()

void applyIIR ( float * in_signal,
int nSamples,
int nCoeffs,
float * b,
float * a,
float * wz,
float * out_signal )

Applies an IIR filter to a time-domain signal (using the direct form II difference equation)

Note
The function assumes the numerator coefficents are the same length as the denominator. The output signal and input signal can also be the same.
Warning
It is assumed that a[0] = 1.0f! Scale all coefficients by a[0] if this is not the case, prior to calling this function.
Parameters
[in]in_signalInput signal; nSamples x 1
[in]nSamplesNumber of samples to process
[in]nCoeffsNumber of filter coefficients
[in]bFilter coefficients for numerator; nCoeffs x 1
[out]aFilter coefficients for denominator; nCoeffs x 1
[in,out]wzPrevious wn samples (initialise as 0s); (nCoeffs-1) x 1
[out]out_signalOutput signal; nSamples x 1

Definition at line 739 of file saf_utility_filters.c.

◆ bessel_in()

int bessel_in ( int N,
double * z,
int nZ,
double * i_n,
double * di_n )

Computes the values of the modified spherical Bessel function of the first kind (in) and it's derivative (din)

Note
If the function fails to compute the function at the specified order 'N', then the output values are set to zero, and this function will return 0.
Test
test__sphericalBesselFunctions()
Parameters
[in]NFunction order (highest is ~30 given numerical precision)
[in]zInput values; nZ x 1
[in]nZNumber of input values
[out]i_nBessel values (set as NULL if not required); FLAT: nZ x 1
[out]di_nBessel derivative values (set as NULL if not required); FLAT: nZ x 1
Returns
0: if the function failed to compute, 1: if it was successful

Definition at line 723 of file saf_utility_bessel.c.

◆ bessel_in_ALL()

void bessel_in_ALL ( int N,
double * z,
int nZ,
int * maxN,
double * i_n,
double * di_n )

Computes the modified spherical Bessel function of the first kind (in) and their derivatives (din) for ALL orders from 0 to N.

Note
If the function fails to compute the function up to the specified order 'N', then the function will compute up to maximum order possible, and let the user know via the 'maxN' parameter. (i.e., always check if N=maxN, and handle things accordingly if maxN is lower).
Parameters
[in]NFunction order (highest is ~30 given numerical precision)
[in]zInput values; nZ x 1
[in]nZNumber of input values
[out]maxN(&) maximum function order that could be computed <=N
[out]i_nBessel values (set as NULL if not required); FLAT: nZ x (N+1)
[out]di_nBessel derivative values (set as NULL if not required); FLAT: nZ x (N+1)

Definition at line 756 of file saf_utility_bessel.c.

◆ bessel_Jn()

void bessel_Jn ( int N,
double * z,
int nZ,
double * J_n,
double * dJ_n )

Computes the values of the (cylindrical) Bessel function of the first kind (Jn) and it's derivative (dJn)

Test
test__cylindricalBesselFunctions()
Parameters
[in]NFunction order (highest is ~30 given numerical precision)
[in]zInput values; nZ x 1
[in]nZNumber of input values
[out]J_nBessel values (set as NULL if not required); FLAT: nZ x 1
[out]dJ_nBessel derivative values (set as NULL if not required); FLAT: nZ x 1

Definition at line 380 of file saf_utility_bessel.c.

◆ bessel_jn()

int bessel_jn ( int N,
double * z,
int nZ,
double * j_n,
double * dj_n )

Computes the values of the spherical Bessel function of the first kind (jn) and it's derivative (djn)

Note
If the function fails to compute the function at the specified order 'N', then the output values are set to zero, and this function will return 0.
Test
test__sphericalBesselFunctions()
Parameters
[in]NFunction order (highest is ~30 given numerical precision)
[in]zInput values; nZ x 1
[in]nZNumber of input values
[out]j_nBessel values (set as NULL if not required); FLAT: nZ x 1
[out]dj_nBessel derivative values (set as NULL if not required); FLAT: nZ x 1
Returns
0: if the function failed to compute, 1: if it was successful

Definition at line 629 of file saf_utility_bessel.c.

◆ bessel_Jn_ALL()

void bessel_Jn_ALL ( int N,
double * z,
int nZ,
double * J_n,
double * dJ_n )

Computes the (cylindrical) Bessel function of the first kind (Jn) and their derivatives (dJn) for ALL orders from 0 to N.

Parameters
[in]NFunction order (highest is ~30 given numerical precision)
[in]zInput values; nZ x 1
[in]nZNumber of input values
[out]J_nBessel values (set as NULL if not required); FLAT: nZ x (N+1)
[out]dJ_nBessel derivative values (set as NULL if not required); FLAT: nZ x (N+1)

Definition at line 409 of file saf_utility_bessel.c.

◆ bessel_jn_ALL()

void bessel_jn_ALL ( int N,
double * z,
int nZ,
int * maxN,
double * j_n,
double * dj_n )

Computes the spherical Bessel function of the first kind (jn) and their derivatives (djn) for ALL orders from 0 to N.

Note
If the function fails to compute the function up to the specified order 'N', then the function will compute up to maximum order possible, and let the user know via the 'maxN' parameter. (i.e., always check if N=maxN, and handle things accordingly if maxN is lower).
Parameters
[in]NFunction order (highest is ~30 given numerical precision)
[in]zInput values; nZ x 1
[in]nZNumber of input values
[out]maxN(&) maximum function order that could be computed <=N
[out]j_nBessel values (set as NULL if not required); FLAT: nZ x (N+1)
[out]dj_nBessel derivative values (set as NULL if not required); FLAT: nZ x (N+1)

Definition at line 662 of file saf_utility_bessel.c.

◆ bessel_kn()

int bessel_kn ( int N,
double * z,
int nZ,
double * k_n,
double * dk_n )

Computes the values of the modified spherical Bessel function of the second kind (kn) and it's derivative (dkn)

Note
If the function fails to compute the function at the specified order 'N', then the output values are set to zero, and this function will return 0.
Test
test__sphericalBesselFunctions()
Parameters
[in]NFunction order (highest is ~30 given numerical precision)
[in]zInput values; nZ x 1
[in]nZNumber of input values
[out]k_nBessel values (set as NULL if not required); FLAT: nZ x 1
[out]dk_nBessel derivative values (set as NULL if not required); FLAT: nZ x 1
Returns
0: if the function failed to compute, 1: if it was successful

Definition at line 906 of file saf_utility_bessel.c.

◆ bessel_kn_ALL()

void bessel_kn_ALL ( int N,
double * z,
int nZ,
int * maxN,
double * k_n,
double * dk_n )

Computes the modified spherical Bessel function of the second kind (kn) and their derivatives (dkn) for ALL orders from 0 to N.

Note
If the function fails to compute the function up to the specified order 'N', then the function will compute up to maximum order possible, and let the user know via the 'maxN' parameter. (i.e., always check if N=maxN, and handle things accordingly if maxN is lower).
Parameters
[in]NFunction order (highest is ~30 given numerical precision)
[in]zInput values; nZ x 1
[in]nZNumber of input values
[out]maxN(&) maximum function order that could be computed <=N
[out]k_nBessel values (set as NULL if not required); FLAT: nZ x (N+1)
[out]dk_nBessel derivative values (set as NULL if not required); FLAT: nZ x (N+1)

Definition at line 939 of file saf_utility_bessel.c.

◆ bessel_Yn()

void bessel_Yn ( int N,
double * z,
int nZ,
double * Y_n,
double * dY_n )

Computes the values of the (cylindrical) Bessel function of the second kind (Yn) and it's derivative (dYn)

Test
test__cylindricalBesselFunctions()
Parameters
[in]NFunction order (highest is ~30 given numerical precision)
[in]zInput values; nZ x 1
[in]nZNumber of input values
[out]Y_nBessel values (set as NULL if not required); FLAT: nZ x 1
[out]dY_nBessel derivative values (set as NULL if not required); FLAT: nZ x 1

Definition at line 442 of file saf_utility_bessel.c.

◆ bessel_yn()

int bessel_yn ( int N,
double * z,
int nZ,
double * y_n,
double * dy_n )

Computes the values of the spherical Bessel function of the second kind (yn) and it's derivative (dyn)

Note
If the function fails to compute the function at the specified order 'N', then the output values are set to zero, and this function will return 0.
Test
test__sphericalBesselFunctions()
Parameters
[in]NFunction order (highest is ~30 given numerical precision)
[in]zInput values; nZ x 1
[in]nZNumber of input values
[out]y_nBessel values (set as NULL if not required); FLAT: nZ x 1
[out]dy_nBessel derivative values (set as NULL if not required); FLAT: nZ x 1
Returns
0: if the function failed to compute, 1: if it was successful

Definition at line 817 of file saf_utility_bessel.c.

◆ bessel_Yn_ALL()

void bessel_Yn_ALL ( int N,
double * z,
int nZ,
double * Y_n,
double * dY_n )

Computes the (cylindrical) Bessel function of the second kind (Yn) and their derivatives (dYn) for ALL orders from 0 to N.

Parameters
[in]NFunction order (highest is ~30 given numerical precision)
[in]zInput values; nZ x 1
[in]nZNumber of input values
[out]Y_nBessel values (set as NULL if not required); FLAT: nZ x (N+1)
[out]dY_nBessel derivative values (set as NULL if not required); FLAT: nZ x (N+1)

Definition at line 471 of file saf_utility_bessel.c.

◆ bessel_yn_ALL()

void bessel_yn_ALL ( int N,
double * z,
int nZ,
int * maxN,
double * y_n,
double * dy_n )

Computes the spherical Bessel function of the second kind (yn) and their derivatives (dyn) for ALL orders from 0 to N.

Note
If the function fails to compute the function up to the specified order 'N', then the function will compute up to maximum order possible, and let the user know via the 'maxN' parameter. (i.e., always check if N=maxN, and handle things accordingly if maxN is lower).
Parameters
[in]NFunction order (highest is ~30 given numerical precision)
[in]zInput values; nZ x 1
[in]nZNumber of input values
[out]maxN(&) maximum function order that could be computed <=N
[out]y_nBessel values (set as NULL if not required); FLAT: nZ x (N+1)
[out]dy_nBessel derivative values (set as NULL if not required); FLAT: nZ x (N+1)

Definition at line 850 of file saf_utility_bessel.c.

◆ biQuadCoeffs()

void biQuadCoeffs ( BIQUAD_FILTER_TYPES filterType,
float fc,
float fs,
float Q,
float gain_dB,
float b[3],
float a[3] )

Calculates 2nd order IIR filter coefficients [1].

Parameters
[in]filterTypeSee BIQUAD_FILTER_TYPES enum
[in]fcCentre frequency, Hz
[in]fsSampling frequency, Hz
[in]QQ-factor
[in]gain_dBGain, dB
[out]bb filter coefficients; 3 x 1
[out]aa filter coefficients; 3 x 1
See also
[1] Zo"lzer, U. (Ed.). (2011). DAFX: digital audio effects. John Wiley & Sons.

Definition at line 339 of file saf_utility_filters.c.

◆ butterCoeffs()

void butterCoeffs ( BUTTER_FILTER_TYPES filterType,
int order,
float cutoff1,
float cutoff2,
float sampleRate,
double * b_coeffs,
double * a_coeffs )

Computes Butterworth IIR filter coefficients [1].

The function is numerically identical to the default 'butter' function in Matlab

Warning
The function still shares the same limitations of the Matlab 'butter' function, which may also be made worse by applying the filter to single precision input data. Higher orders and lower cut-off frequencies can easily become unstable! Consider trying things out in Matlab before using this function.
Test
test__butterCoeffs()
Parameters
[in]filterTypeSee BUTTER_FILTER_TYPES enum
[in]orderFilter order (N)
[in]cutoff1Filter1 cutoff in Hz, for LPF/HPF, and lower cutoff for BPF/BSF
[in]cutoff2Filter2 cutoff in Hz, not needed for LPF/HPF, this is the upper cutoff for BPF/BSF
[in]sampleRateSampling rate in Hz
[out]b_coeffsFilter coefficients for the numerator; LPF/HPF: (order+1) x 1; BPF/BSF: (2*order+1) x 1
[out]a_coeffsFilter coefficients for the denominator; LPF/HPF: (order+1) x 1; BPF/BSF: (2*order+1) x 1
See also
[1] T. W. Parks and C. S. Burrus, Digital Filter Design, John Wiley & Sons, 1987, chapter 7, section 7.3.3.

Definition at line 813 of file saf_utility_filters.c.

◆ calcDVFCoeffs()

void calcDVFCoeffs ( float alpha,
float rho,
float fs,
float * b,
float * a )

Calculate the Distance Variation Function (DVF) filter coefficients, as described in [1].

See also
[1] S. Spagnol, E. Tavazzi, and F. Avanzini, “Distance rendering and perception of nearby virtual sound sources with a near-field filter model,” Applied Acoustics, vol. 115, pp. 61–73, Jan. 2017, doi: 10.1016/j.apacoust.2016.08.015.
Parameters
[in]alphaLateral angle, similar the interaural-polar convention, but specified as an offset from the interaural axis, [0, 180] (deg). See doaToIpsiInteraural() to convert frontal azimuth/elevation to the expected format.
[in]rhoSource distance, normalized to head radius, >= 1.
[in]fsSample rate.
[out]bNumerator coefficients for the DVF shelving filter.
[out]aDenominator coefficients for the DVF shelving filter

Definition at line 177 of file saf_utility_dvf.c.

◆ calcDVFShelfParams()

void calcDVFShelfParams ( int i,
float rho,
float * g0,
float * gInf,
float * fc )

Calculate the high shelf gains and cutoff parameters, given a azimuth index i and distance rho.

This will be called twice per parameter change and the shelf filter parameters will be linearly interpolated according to the azimuth.

Parameters
[in]iCoefficient table row index
[in]rhoNormalized source distance (1 = head radius)
[out]g0High shelf gain at DC [dB]
[out]gInfHigh shelf gain at Nyquist frequency [dB]
[out]fcShelf cutoff frequency [Hz]

Definition at line 81 of file saf_utility_dvf.c.

◆ cart2sph()

void cart2sph ( float * cart,
int nDirs,
int anglesInDegreesFLAG,
float * sph )

Converts Cartesian coordinates to spherical coordinates.

Parameters
[in]cartCartesian coordinates; FLAT: nDirs x 3
[in]nDirsNumber of directions/coordinates
[in]anglesInDegreesFLAG0: dirs wanted in radians, 1: degrees instead
[out]sphSpherical coordinates; FLAT: nDirs x 3

Definition at line 298 of file saf_utility_geometry.c.

◆ cmplxPairUp()

void cmplxPairUp ( double_complex * in_vec,
double_complex * out_vec,
int len )

Pairs up complex numbers and sorts them in ascending order based on their real parts first, and then on their imaginary parts.

Note
This function is the same as sortz() except that any values that are purely real, are pushed to the end of the output vector (and also in ascending order).
Test
test__cmplxPairUp()
Parameters
[in]in_vecVector to be sorted; len x 1
[out]out_vecOutput vector
[in]lenNumber of elements in vectors

Definition at line 340 of file saf_utility_sort.c.

◆ convd()

void convd ( double * x,
double * h,
int len_x,
int len_h,
double * y )

Basic 1-D direct convolution in the time-domain (real double precision)

Parameters
[in]xInput sequence; len_x x 1
[in]hFilter sequence; len_h x 1
[in]len_xLength of 'x'
[in]len_hLength of 'h'
[out]yOutput sequence; (len_x+len_h-1) x 1

Definition at line 260 of file saf_utility_misc.c.

◆ convert_0_360To_m180_180()

void convert_0_360To_m180_180 ( float * dirs_deg,
int nDirs )

Wraps around any angles exeeding 180 degrees (e.g., 200-> -160)

Definition at line 51 of file saf_utility_misc.c.

◆ convertBW2Q()

float convertBW2Q ( float BW)

Converts filter octave band-width to Q-factor.

Definition at line 318 of file saf_utility_filters.c.

◆ convertQ2BW()

float convertQ2BW ( float Q)

Converts filter Q-factor to octave band-width.

Definition at line 326 of file saf_utility_filters.c.

◆ convhull3d()

void convhull3d ( const float * vertices,
const int nVert,
int ** faces,
int * nFaces )

Builds the convex hull of an arrangement of vertices in 3-dimensional space.

This function employs algorithms originally implemented in MATLAB by George Papazafeiropoulos [1] (BSD 2-clause license), which are based on [2].

Warning
Currently, this does not check if there are duplicate vertices or whether any of them are co-linear!
Parameters
[in]verticesThe vertices; FLAT: nDirs x 3
[in]nVertNumber of vertices
[out]faces(&) The face indices; FLAT: nFaces x 3
[out]nFaces(&) Number of faces found
See also
[1] https://www.mathworks.com/matlabcentral/fileexchange/48509-computational-geometry-toolbox?focused=3851550&tab=example
[2] The Quickhull Algorithm for Convex Hull, C. Bradford Barber, David P. Dobkin and Hannu Huhdanpaa, Geometry Center Technical Report GCG53, July 30, 1993

Definition at line 512 of file saf_utility_geometry.c.

◆ convhullnd()

void convhullnd ( const float * points,
const int nPoints,
const int nd,
int ** faces,
int * nFaces )

Builds the convex hull of an arrangement of points in N-dimensional space.

This function employs algorithms originally implemented in MATLAB by George Papazafeiropoulos [1] (BSD 2-clause license), which are based on [2].

Parameters
[in]pointsThe input points; FLAT: nDirs x nd
[in]nPointsNumber of points
[in]ndThe number of dimensions (max=5)
[out]faces(&) The face indices; FLAT: nFaces x nd
[out]nFaces(&) Number of faces found
See also
[1] https://www.mathworks.com/matlabcentral/fileexchange/48509-computational-geometry-toolbox?focused=3851550&tab=example
[2] The Quickhull Algorithm for Convex Hull, C. Bradford Barber, David P. Dobkin and Hannu Huhdanpaa, Geometry Center Technical Report GCG53, July 30, 1993

Definition at line 539 of file saf_utility_geometry.c.

◆ convz()

void convz ( double_complex * x,
double_complex * h,
int len_x,
int len_h,
double_complex * y )

Basic 1-D direct convolution in the time-domain (complex double precision)

Parameters
[in]xInput sequence; len_x x 1
[in]hFilter sequence; len_h x 1
[in]len_xLength of 'x'
[in]len_hLength of 'h'
[out]yOutput sequence; (len_x+len_h-1) x 1

Definition at line 282 of file saf_utility_misc.c.

◆ crossProduct3()

void crossProduct3 ( float a[3],
float b[3],
float c[3] )

Cross product between two 3-element floating point vectors (c = a x b)

Definition at line 458 of file saf_utility_geometry.c.

◆ cxcorr()

void cxcorr ( float * a,
float * b,
float * x_ab,
size_t la,
size_t lb )

Calculates the cross correlation between two vectors.

Parameters
[in]aVector a; la x 1
[in]bVector b; lb x 1
[in]laLength of vector a
[in]lbLength of vector b
[out]x_abCross-correlation between a and b; (la + lb - 1) x 1

Definition at line 195 of file saf_utility_misc.c.

◆ delaunaynd()

void delaunaynd ( const float * points,
const int nPoints,
const int nd,
int ** DT,
int * nDT )

Computes the Delaunay triangulation of an arrangement of points in N-dimensional space.

This function employs algorithms originally implemented in MATLAB by George Papazafeiropoulos [1] (BSD 2-clause license), which are based on [2].

Note
If you know that your points all reside on a sphere, then you should use sphDelaunay() instead; as it is faster and more accurate.
Parameters
[in]pointsThe intput points; FLAT: nDirs x nd
[in]nPointsNumber of points
[in]ndThe number of dimensions (max=5)
[out]DT(&) The indices defining the Delaunay triangulation of the points; FLAT: nDT x (nd+1)
[out]nDT(&) Number of triangulations
See also
[1] https://www.mathworks.com/matlabcentral/fileexchange/48509-computational-geometry-toolbox?focused=3851550&tab=example
[2] The Quickhull Algorithm for Convex Hull, C. Bradford Barber, David P. Dobkin and Hannu Huhdanpaa, Geometry Center Technical Report GCG53, July 30, 1993

Definition at line 566 of file saf_utility_geometry.c.

◆ doaToIpsiInteraural()

void doaToIpsiInteraural ( float azimuth,
float elevation,
float * alphaLR,
float * betaLR )

Convert a frontal azimuth/elevation to a modified Interaural-Polar coordinate.

Whereas Interaural-Polar coordinates are with reference to the median plane, alpha [0, 90], beta [0, 180] this modification is with reference to the transverse plane (ipsilateral ear direction), alpha [0, 180], beta [0, 90]. This is intended for the input to interpDVFShelfParams() for calculating DVF filter parameters, which are framed as an offset from the interaural axis, and based on a spherical head model (i.e. elevation translates to a change in lateral angle).

Parameters
[in]azimuthSource DoA, 0˚ is forward-facing, angle increases counter-clockwise (deg, [-360, 360]).
[in]elevationSource elevation, angles increase upward from the horizon (deg, [-180, 180]).
[out]alphaLR2-element array of lateral angle alpha for left and right ear (deg, [0,180]]).
[out]betaLR2-element array of vertal angle beta for left and right ear (deg, [0,90]]).

Definition at line 191 of file saf_utility_dvf.c.

◆ dvfShelfCoeffs()

void dvfShelfCoeffs ( float g0,
float gInf,
float fc,
float fs,
float * b0,
float * b1,
float * a1 )

Calculate the DVF filter coefficients from shelving filter parameters.

Parameters
[in]g0High shelf gain at DC [dB].
[in]gInfHigh shelf gain at Nyquist frequency [dB].
[in]fcShelf cutoff frequency [Hz].
[out]fsSample rate.
[out]b0Numerator coefficient 1.
[out]b1Numerator coefficient 2.
[out]a1Denominator coefficient 2.

Definition at line 148 of file saf_utility_dvf.c.

◆ euler2Quaternion()

void euler2Quaternion ( float alpha,
float beta,
float gamma,
int degreesFlag,
EULER_ROTATION_CONVENTIONS convention,
quaternion_data * Q )

Converts Euler angles to a quaternion.

Definition at line 123 of file saf_utility_geometry.c.

◆ euler2rotationMatrix()

void euler2rotationMatrix ( float alpha,
float beta,
float gamma,
int degreesFlag,
EULER_ROTATION_CONVENTIONS convention,
float R[3][3] )

Constructs a 3x3 rotation matrix from the Euler angles.

Parameters
[in]alphafirst rotation angle
[in]betafirst rotation angle
[in]gammafirst rotation angle
[in]degreesFlag1: angles are in degrees, 0: angles are in radians
[in]conventionsee EULER_ROTATION_CONVENTIONS enum
[out]Rresulting 3x3 rotation matrix

Definition at line 213 of file saf_utility_geometry.c.

◆ evalBiQuadTransferFunction()

void evalBiQuadTransferFunction ( float b[3],
float a[3],
float * freqs,
int nFreqs,
float fs,
int mag2dB,
float * magnitude,
float * phase_rad )

Evaluates the 2nd order IIR transfer function at one or more frequencies, returning its magnitude and/or phase response.

Parameters
[in]bb filter coefficients; 3 x 1
[in]aa filter coefficients; 3 x 1
[in]freqsFrequencies at which to evaluate, Hz; nFreqs x 1
[in]nFreqsNumber of frequencies at which to avaluate
[in]fsSampling frequency, Hz
[in]mag2dB0: 'magnitude' returned in linear scale, 1: dB scale
[out]magnitudeMagnitude, at each frequency (set to NULL of not wanted); nFreqs x 1
[out]phase_radPhase, radians, at each frequency (set to NULL of not wanted); nFreqs x 1

Definition at line 575 of file saf_utility_filters.c.

◆ evalIIRTransferFunction()

void evalIIRTransferFunction ( double * b,
double * a,
int nCoeffs,
float * freqs,
int nFreqs,
float fs,
int mag2dB,
float * magnitude,
float * phase_rad )

Computes magnitude and phase response of an IIR filter from its coefficients at user-specified frequencies (Hz).

The function optionally returns magnitude and/or phase. The function is tested against Matlab's 'freqz' function.

Note
This function operates on filter coefficients of type double, for more accuracy for higher order filters, in particular at lower frequencies. See evalIIRTransferFunctionf() (operating on float type coefficients) for a more efficient implementation (e.g. for lower order filters).
Test
test__evalIIRTransferFunction()
Parameters
[in]bFilter coefficients for the numerator; nCoeffs x 1
[in]aFilter coefficients for the denominator; nCoeffs x 1
[in]nCoeffsNumber of filter coefficients
[in]freqsFrequencies at which to evaluate the magnitude/phase response (Hz); nFreqs x 1
[in]nFreqsNumber of frequencies
[in]fsSampling rate (Hz)
[in]mag2dB0: 'magnitude' returned in linear scale, 1: dB scale
[out]magnitudeMagnitudes at each frequency (set to NULL of not wanted); nFreqs x 1
[out]phase_radPhases at each frequency (radians; set to NULL of not wanted); nFreqs x 1

Definition at line 673 of file saf_utility_filters.c.

◆ evalIIRTransferFunctionf()

void evalIIRTransferFunctionf ( float * b,
float * a,
int nCoeffs,
float * freqs,
int nFreqs,
float fs,
int mag2dB,
float * magnitude,
float * phase_rad )

Computes magnitude and phase response of an IIR filter from its coefficients (floats) at user-specified frequencies (Hz).

Note
This function operates on filter coefficients of type float, and is suitable for low order filters, or otherwise less accuracy at low frequencies for higher order filters. For higher-order filters, especially when evaluated at low frequencies, evalIIRTransferFunction() is recommended.

The function optionally returns magnitude and/or phase. The function is tested against Matlab's 'freqz' function.

Test
test__evalIIRTransferFunction()
Parameters
[in]bFilter coefficients for the numerator; nCoeffs x 1
[in]aFilter coefficients for the denominator; nCoeffs x 1
[in]nCoeffsNumber of filter coefficients
[in]freqsFrequencies at which to evaluate the magnitude/phase response (Hz); nFreqs x 1
[in]nFreqsNumber of frequencies
[in]fsSampling rate (Hz)
[in]mag2dB0: 'magnitude' returned in linear scale, 1: dB scale
[out]magnitudeMagnitudes at each frequency (set to NULL of not wanted); nFreqs x 1
[out]phase_radPhases at each frequency (radians; set to NULL of not wanted); nFreqs x 1

Definition at line 609 of file saf_utility_filters.c.

◆ factorial()

long double factorial ( int n)

Factorial, accurate up to n<=25.

Note
The magnitude will still be correct above 25, but the precision will be truncated. The function also returns pre-computed values up to n=15 to make it faster (e.g. for up to 7th order SH computations...).
Parameters
[in]nOrder
Returns
factorial(n)

Definition at line 176 of file saf_utility_misc.c.

◆ faf_IIRFilterbank_apply()

void faf_IIRFilterbank_apply ( void * hFaF,
float * inSig,
float ** outBands,
int nSamples )

Applies the Favrot & Faller filterbank.

Parameters
[in]hFaFfaf_IIRFilterbank handle
[in]inSigInput signal; nSamples x 1
[out]outBandsOutput band signals; (nCutoffFreqs+1) x nSamples
[in]nSamplesNumber of samples to process

Definition at line 1175 of file saf_utility_filters.c.

◆ faf_IIRFilterbank_create()

void faf_IIRFilterbank_create ( void ** phFaF,
int order,
float * fc,
int nCutoffFreqs,
float sampleRate,
int maxNumSamples )

Computes a bank of IIR filter coefficients required to divide a signal into frequency bands, based on the design by Favrot & Faller [1].

The function employs the 'butterCoeffs' function to compute a low-pass filter for the first band, high-pass filter for the last band, and band-pass filter for the inbetween bands (nCutoffFreqs must be 2 or more).

Warning
Only odd valued orders work with this design! However, due to practical numerical limitations, only 1st and 3rd order options are numerically robust enough to make sense, which is why this implementation will only accept order = 1 or 3.
Test
test__faf_IIRFilterbank()
Parameters
[in]phFaF(&) address of the faf_IIRFilterbank handle
[in]orderFilter order, 1 or 3
[in]fcVector of cutoff frequencies; nCutoffFreqs x 1
[in]nCutoffFreqsNumber of cutoff frequencies in vector 'fc'.
[in]sampleRateSampling rate in Hz
[in]maxNumSamplesMaximum number of samples to expect at a time when calling faf_IIRFilterbank_apply()
See also
[1] Favrot, A. and Faller, C., 2010. Complementary N-band IIR filterbank based on 2-band complementary filters. Proc. Intl. Works. on Acoust. Echo and Noise Control (IWAENC).

Definition at line 1046 of file saf_utility_filters.c.

◆ faf_IIRFilterbank_destroy()

void faf_IIRFilterbank_destroy ( void ** hFaF)

Destroys an instance of the Favrot & Faller filterbank.

Parameters
[in]hFaF(&) address of the faf_IIRFilterbank handle

Definition at line 1240 of file saf_utility_filters.c.

◆ faf_IIRFilterbank_flushBuffers()

void faf_IIRFilterbank_flushBuffers ( void * hFaF)

Zeros the delay lines used during faf_IIRFilterbank_apply()

Parameters
[in]hFaFfaf_IIRFilterbank handle

Definition at line 1227 of file saf_utility_filters.c.

◆ fftconv()

void fftconv ( float * x,
float * h,
int x_len,
int h_len,
int nCH,
float * y )

FFT-based convolution of signal 'x' with filter 'h'.

Input channels and filters are zero padded to avoid circular convolution artefacts.

Note
The output must be of size: nCH x (x_len+h_len-1)
Parameters
[in]xInput(s); FLAT: nCH x x_len
[in]hFilter(s); FLAT: nCH x h_len
[in]x_lenLength of input signal, in samples
[in]h_lenLength of filter, in samples
[in]nCHNumber of channels
[out]yOutput signal(s); FLAT: nCH x (x_len+h_len-1)

Definition at line 157 of file saf_utility_fft.c.

◆ fftfilt()

void fftfilt ( float * x,
float * h,
int x_len,
int h_len,
int nCH,
float * y )

FFT-based convolution for FIR filters.

Similar to fftconv, other than only the first x_len samples of y are returned. It has parity with the fftfilt function in Matlab, except it just uses one big FFT (i.e. no overlap-add).

Parameters
[in]xInput(s); FLAT: nCH x x_len
[in]hFilter(s); FLAT: nCH x h_len
[in]x_lenLength of input signal, in samples
[in]h_lenLength of filter, in samples
[in]nCHNumber of channels
[out]yOutput signal(s); FLAT: nCH x x_len

Definition at line 210 of file saf_utility_fft.c.

◆ findClosestGridPoints()

void findClosestGridPoints ( float * grid_dirs,
int nGrid,
float * target_dirs,
int nTarget,
int degFLAG,
int * idx_closest,
float * dirs_closest,
float * angle_diff )

Finds indicies into "grid_dirs" that are the closest to "target dirs".

e.g. grid_dirs[idx_closest[0]] will be the closest direction in "grid_dirs" to target_dirs[0].

Parameters
[in]grid_dirsSpherical coordinates of grid directions; FLAT: nGrid x 2
[in]nGridNumber of directions in grid
[in]target_dirsSpherical coordinates of target directions; FLAT: nTarget x 2
[in]nTargetNumber of target directions to find
[in]degFLAG'0' coordinates are in RADIANS, '1' coords are in DEGREES
[out]idx_closestResulting indices (set to NULL to ignore); nTarget x 1
[out]dirs_closestgrid_dirs(idx_closest); (set to NULL to ignore); nTarget x 1
[out]angle_diffAngle diff between target and grid dir, in degrees (set to NULL to ignore); nTarget x 1

Definition at line 368 of file saf_utility_sort.c.

◆ findClosestGridPointsCartesian()

void findClosestGridPointsCartesian ( float * grid_dirs_xyz,
int nGrid,
float * target_dirs_xyz,
int nTarget,
int * idx_closest,
float * dirs_xyz_closest,
float * angle_diff )

Finds indicies into "grid_dirs_xyz" that are the closest to "target dirs_xyz".

Parameters
[in]grid_dirs_xyzGrid directions (Cartesian unit-length); FLAT: nGrid x 3
[in]nGridNumber of directions in grid
[in]target_dirs_xyzTarget directions (Cartesian unit-length); FLAT: nTarget x 3
[in]nTargetNumber of target directions to find
[out]idx_closestResulting indices (set to NULL to ignore); nTarget x 1
[out]dirs_xyz_closestgrid_dirs(idx_closest); (set to NULL to ignore); nTarget x 1
[out]angle_diffAngle diff between target and grid dir, in degrees (set to NULL to ignore); nTarget x 1

Definition at line 446 of file saf_utility_sort.c.

◆ findCombinations()

void findCombinations ( int * arrValues,
int nValues,
int nElements,
int ** comb,
int * nComb )

Given an array of values, find all the possible combinations (nCr) for subgroups of "nElements"; derived based on [1].

Parameters
[in]arrValuesThe array values; nValues x 1
[in]nValuesNumber of array values (n)
[in]nElementsNumber of elements per combination (r)
[out]comb(&) the combinations; FLAT: nComb x nElements
[out]nComb(&) the number of combinations (nCr)
See also
[1] https://www.geeksforgeeks.org/print-all-possible-combinations-of-r-elements-in-a-given-array-of-size-n/

Definition at line 491 of file saf_utility_misc.c.

◆ findERBpartitions()

void findERBpartitions ( float * centerFreq,
int nBands,
float maxFreqLim,
int ** erb_idx,
float ** erb_freqs,
int * nERBBands )

This function takes a frequency vector and groups its frequencies into critical bands [Equivalent-Rectangular Bandwidth (ERB)].

e.g.

  • centerFreq[erb_idx[0]] -> centerFreq[erb_idx[1]] is ERB band 1
  • centerFreq[erb_idx[1]] -> centerFreq[erb_idx[2]] is ERB band 2
Parameters
[in]centerFreqFrequency vector; nBands x 1
[in]nBandsNumber of bins/bands in frequency vector
[in]maxFreqLimPast this frequency the bands are grouped into 1 band
[out]erb_idx(&) ERB indices; nERBBands x 1
[out]erb_freqs(&) ERB frequencies; nERBBands x 1
[out]nERBBands(&) Number of ERB bands; 1 x 1

Definition at line 102 of file saf_utility_misc.c.

◆ FIRCoeffs()

void FIRCoeffs ( FIR_FILTER_TYPES filterType,
int order,
float cutoff1,
float cutoff2,
float sampleRate,
WINDOWING_FUNCTION_TYPES windowType,
int scalingFLAG,
float * filter )

Computes FIR filter coefficients by windowing.

When using the Hamming window, and scalingFLAG=1, the function is numerically identical to the default 'fir1' function in Matlab (when using it in single precision mode) [1].

Warning
Input argument 'order' cannot be odd valued!

Some guidelines regarding the approx order (N) for certain filters. i.e. the orders where you actually get the expected -6dB attenuation at the cutoff frequency specified (fs=48kHz, Hamming window, scalingFLAG=1). (Use these figures only just to get a rough idea)

  • LPF @ 100Hz - N~1400
  • LPF @ 250Hz - N~550
  • LPF @ 1kHz - N~150
  • LPF @ 4kHz - N~40
  • BPF @ 88-176Hz - N~2500
  • BPF @ 176-354Hz - N~1600
  • BPF @ 707-1410Hz - N~400
  • HPF @ 200Hz - N~450
  • HPF @ 4kHz - N~60
Parameters
[in]filterTypeSee FIR_FILTER_TYPES enum
[in]orderFilter order (N). Must be even.
[in]cutoff1Filter1 cutoff in Hz, for LPF/HPF, and lower cutoff for BPF/BSF
[in]cutoff2Filter2 cutoff in Hz, not needed for LPF/HPF, this is the upper cutoff for BPF/BSF
[in]sampleRateSampling rate in Hz
[in]windowTypeSee WINDOWING_FUNCTION_TYPES enum
[in]scalingFLAG'0' none, '1' scaling applied to ensure passband is at 0dB
[out]filterFilter coefficients/weights/taps; (order+1) x 1
See also
[1] "Programs for Digital Signal Processing", IEEE Press John Wiley & Sons, 1979, pg. 5.2-1.

Definition at line 1268 of file saf_utility_filters.c.

◆ FIRFilterbank()

void FIRFilterbank ( int order,
float * fc,
int nCutoffFreqs,
float sampleRate,
WINDOWING_FUNCTION_TYPES windowType,
int scalingFLAG,
float * filterbank )

Computes a bank of FIR filter coefficients required to divide a signal into frequency bands.

Provided the order is sufficient, the sum of the bands should reconstruct the original (although, shifted in time due to group delay) e.g fc[1] = { 1000 };

  • Band1, &filter[0*(order+1)] : LPF @ 1kHz
  • Band2, &filter[1*(order+1)] : HPF @ 1kHz

e.g fc[3] = { 1000, 2000, 4000 };

  • Band1, &filter[0*(order+1)] : LPF @ 1kHz
  • Band2, &filter[1*(order+1)] : BPF @ 1-2kHz
  • Band3, &filter[2*(order+1)] : BPF @ 2-4kHz
  • Band4, &filter[3*(order+1)] : HPF @ 4kHz
Parameters
[in]orderFilter order. Must be even.
[in]fcVector of cutoff frequencies; nCutoffFreqs x 1
[in]nCutoffFreqsNumber of cutoff frequencies in vector 'fc'.
[in]sampleRateSampling rate in Hz
[in]windowTypeSee WINDOWING_FUNCTION_TYPES enum
[in]scalingFLAG'0' none, '1' scaling applied to ensure passbands are at 0dB
[out]filterbankFilter coefficients/weights/taps; FLAT: (nCutoffFreqs+1) x (order+1)

Definition at line 1362 of file saf_utility_filters.c.

◆ flattenMinphase()

void flattenMinphase ( float * x,
int len )

Equalises input sequence by its minimum phase form, in order to bring its magnitude response to unity, as described in [1].

Parameters
[in,out]xInput; len x 1
[in]lenLength of input
See also
[1] Hawksford, M.J. and Harris, N., 2002, April. Diffuse signal processing and acoustic source characterization for applications in synthetic loudspeaker arrays. In Audio Engineering Society Convention 112. Audio Engineering Society.

Definition at line 226 of file saf_utility_filters.c.

◆ Frob_norm()

float Frob_norm ( float * M,
int lenX,
int lenY )

Returns the Frobenius Norm of a matrix M, of dimensions: lenX x lenY.

Definition at line 436 of file saf_utility_geometry.c.

◆ getDecorrelationDelays()

void getDecorrelationDelays ( int nChannels,
float * freqs,
int nFreqs,
float fs,
int maxTFdelay,
int hopSize,
int * delayTF )

Returns delay values for multiple channels per frequency, such that once applied to an input signal (via simple frequency-dependent delay lines), the resulting signal is decorrelated w.r.t the original.

Note
This is a very basic algorithm and sounds particulary bad for transient signals. Consider using a transient detector to "duck" the decorrelated signal during such transients, to improve signal fidelity. See e.g. transientDucker_create()
Parameters
[in]nChannelsNumber of channels
[in]freqsA vector with the centre frequency for each band in the filterbank or bin in the STFT. Use e.g. afSTFT_getCentreFreqs() or getUniformFreqVector() to obtain it; nFreqs x 1
[in]nFreqsNumber of elements in frequency vector
[in]fsSampling rate
[in]maxTFdelayMax number of time-slots to delay
[in]hopSizeSTFT hop size
[out]delayTFThe resulting time delays per channel and frequency; FLAT: nFreq x nChannels

Definition at line 71 of file saf_utility_decor.c.

◆ getDistBetween2Points()

float getDistBetween2Points ( float point_a[3],
float point_b[3] )

Returns the distance between "point_a" and "point_b".

Definition at line 488 of file saf_utility_geometry.c.

◆ getDistBetweenPointAndLine()

float getDistBetweenPointAndLine ( float point[3],
float v1[3],
float v2[3] )

Returns the distance between a "point" and an infinite line described by the two points "v1" and "v2".

Definition at line 470 of file saf_utility_geometry.c.

◆ getOctaveBandCutoffFreqs()

void getOctaveBandCutoffFreqs ( float * centreFreqs,
int nCentreFreqs,
float * cutoffFreqs )

Converts octave band CENTRE frequencies into CUTOFF frequencies.

The lower and upper CENTRE frequencies only have their upper and lower CUTOFF frequencies computed, respectively. e.g.:

  • centreFreqs[6] = { 125, 250, 500, 1000, 2000, 4000 },

becomes:

  • cutoffFreqs[5] = { 176, 354, 707, 1410, 2830 }

Passing cutoffFreqs[5] to FIRFilterbank(), will give filter coefficients for the following:

  • Band1: LPF @ 176Hz
  • Band2: BFP @ 176-354Hz
  • Band3: BFP @ 354-707Hz
  • Band4: BFP @ 707-1410Hz
  • Band5: BFP @ 1410-2830Hz
  • Band6: HPF @ 2830Hz

(Basically, band 125Hz also encapsulates everything down to DC, and band 4kHz also encapsulates everything up to Nyquist)

Note
cutoffFreqs vector is shorter than centreFreqs by 1 element.
Parameters
[in]centreFreqsCentre frequencies (octave bands); nCentreFreqs x 1
[in]nCentreFreqsNumber of centre frequencies
[out]cutoffFreqsCutoff frequencies, which encapsulate the specified centre frequencies by 1 octave; (nCentreFreqs-1) x 1

Definition at line 214 of file saf_utility_filters.c.

◆ getUniformFreqVector()

void getUniformFreqVector ( int fftSize,
float fs,
float * freqVector )

Calculates the frequencies (in Hz) of uniformly spaced bins, for a given FFT size and sampling rate.

Parameters
[in]fftSizeFFT size
[in]fsSampling rate
[out]freqVector0:fs/(fftSize/2):fs/2; (fftSize/2+1) x 1

Definition at line 145 of file saf_utility_fft.c.

◆ getVoronoiWeights()

void getVoronoiWeights ( float * dirs_deg,
int nDirs,
int diagFLAG,
float * weights )

Computes the integration weights, based on the areas of each face of the corresponding Voronoi diagram [sum(weights)=4pi].

Test
test__getVoronoiWeights()
Parameters
[in]dirs_degCoordinates for spherically arranged points, in degrees; FLAT: nDirs x 2
[in]nDirsNumber of points/directions
[in]diagFLAG0: weights returned as vector, 1: weights given along the diagonal of a square matrix
[out]weightsThe weights; nDirs x 1, or FLAT: nDirs x nDirs

Definition at line 943 of file saf_utility_geometry.c.

◆ getWindowingFunction()

void getWindowingFunction ( WINDOWING_FUNCTION_TYPES type,
int winlength,
float * win )

Computes the weights of a specific windowing function.

Weights are symmetric if winlength is odd, and are asymmetric if winlength is even.

i.e. if winlength is even:

  • index "winlength/2" = 1, and first value!=last value

if odd:

  • index "(winlength-1)/2" = 1, and first value==last value
Parameters
[in]typeSee WINDOWING_FUNCTION_TYPES enum
[in]winlengthWindow length in samples
[out]winWindowing function; winlength x 1

Definition at line 201 of file saf_utility_filters.c.

◆ gexpm()

void gexpm ( float * D,
int sizeD,
int m1,
float * Y )

Numerically solves first-order, linear, homogeneous differential equation systems, with non-constant coefficients, by generalization of the Pade- approximant method for exponential matrices.

The equations are described in matrix form as Y'(t) = D(t)*Y(t) where D and Y are square-matrix functions of scalar t. The initial condition is Y(0) = I (the identity matrix), and the result is Y(1). For the special case of a constant coefficient matrix D, gexpm is equivalent to the standard matrix exponential (expm).

m1: true or false, optional, default should be false. "minus 1" flag: if m1 = false the generalized exponential is Y; if true it is Y+I. gexpm is analogous to the expm1 function ("exponential-minus-1") when m1 is true.

Note
For both cases of constant and non-constant D, the solution is determined from a Pade approximation of order 6, using scale-and-square for constant D and multi-step integration for non-constant D. The form of the Pade approximant is outlined in the associated document KJohnson_2015_04_01.pdf. Notes on error control are in the code comments.

This function is based on the Matlab script found: mathworks.com/matlabcentral/fileexchange/50413-generalized-matrix-exponential

Copyright (c) 2015, Kenneth Johnson (BSD-3-clause license)

Definition at line 511 of file saf_utility_misc.c.

◆ hankel_hn1()

int hankel_hn1 ( int N,
double * z,
int nZ,
double_complex * h_n1,
double_complex * dh_n1 )

Computes the values of the spherical Hankel function of the first kind (hn1) and it's derivative (dhn1)

Note
If the function fails to compute the function at the specified order 'N', then the output values are set to zero, and this function will return 0.
Parameters
[in]NFunction order (highest is ~30 given numerical precision)
[in]zInput values; nZ x 1
[in]nZNumber of input values
[out]h_n1Hankel values (set as NULL if not required); FLAT: nZ x 1
[out]dh_n1Hankel derivative values (set as NULL if not required); FLAT: nZ x 1
Returns
0: if the function failed to compute, 1: if it was successful

Definition at line 995 of file saf_utility_bessel.c.

◆ hankel_Hn1()

void hankel_Hn1 ( int N,
double * z,
int nZ,
double_complex * Hn1_n,
double_complex * dHn1_n )

Computes the values of the (cylindrical) Hankel function of the first kind (Hn1) and it's derivative (dHn1)

Parameters
[in]NFunction order (highest is ~30 given numerical precision)
[in]zInput values; nZ x 1
[in]nZNumber of input values
[out]Hn1_nHankel values (set as NULL if not required); FLAT: nZ x 1
[out]dHn1_nHankel derivative values (set as NULL if not required); FLAT: nZ x 1

Definition at line 504 of file saf_utility_bessel.c.

◆ hankel_Hn1_ALL()

void hankel_Hn1_ALL ( int N,
double * z,
int nZ,
double_complex * Hn1_n,
double_complex * dHn1_n )

Computes the (cylindrical) Hankel function of the first kind (Hn1) and their derivatives (dHn1) for ALL orders from 0 to N.

Parameters
[in]NFunction order (highest is ~30 given numerical precision)
[in]zInput values; nZ x 1
[in]nZNumber of input values
[out]Hn1_nHankel values (set as NULL if not required); FLAT: nZ x (N+1)
[out]dHn1_nHankel derivative values (set as NULL if not required); FLAT: nZ x (N+1)

Definition at line 531 of file saf_utility_bessel.c.

◆ hankel_hn1_ALL()

void hankel_hn1_ALL ( int N,
double * z,
int nZ,
int * maxN,
double_complex * h_n1,
double_complex * dh_n1 )

Computes the spherical Hankel function of the first kind (hn1) and their derivatives (dhn1) for ALL orders from 0 to N.

Note
If the function fails to compute the function up to the specified order 'N', then the function will compute up to maximum order possible, and let the user know via the 'maxN' parameter. (i.e., always check if N=maxN, and handle things accordingly if maxN is lower).
Parameters
[in]NFunction order (highest is ~30 given numerical precision)
[in]zInput values; nZ x 1
[in]nZNumber of input values
[out]maxN(&) maximum function order that could be computed <=N
[out]h_n1Hankel values (set as NULL if not required); FLAT: nZ x (N+1)
[out]dh_n1Hankel derivative values (set as NULL if not required); FLAT: nZ x (N+1)

Definition at line 1028 of file saf_utility_bessel.c.

◆ hankel_hn2()

int hankel_hn2 ( int N,
double * z,
int nZ,
double_complex * h_n2,
double_complex * dh_n2 )

Computes the values of the spherical Hankel function of the second kind (hn2) and it's derivative (dhn2)

Note
If the function fails to compute the function at the specified order 'N', then the output values are set to zero, and this function will return 0.
Parameters
[in]NFunction order (highest is ~30 given numerical precision)
[in]zInput values; nZ x 1
[in]nZNumber of input values
[out]h_n2Hankel values (set as NULL if not required); FLAT: nZ x 1
[out]dh_n2Hankel derivative values (set as NULL if not required); FLAT: nZ x 1
Returns
0: if the function failed to compute, 1: if it was successful

Definition at line 1092 of file saf_utility_bessel.c.

◆ hankel_Hn2()

void hankel_Hn2 ( int N,
double * z,
int nZ,
double_complex * Hn2_n,
double_complex * dHn2_n )

Computes the values of the (cylindrical) Hankel function of the second kind (Hn2) and it's derivative (dHn2)

Parameters
[in]NFunction order (highest is ~30 given numerical precision)
[in]zInput values; nZ x 1
[in]nZNumber of input values
[out]Hn2_nHankel values (set as NULL if not required); FLAT: nZ x 1
[out]dHn2_nHankel derivative values (set as NULL if not required); FLAT: nZ x 1

Definition at line 562 of file saf_utility_bessel.c.

◆ hankel_Hn2_ALL()

void hankel_Hn2_ALL ( int N,
double * z,
int nZ,
double_complex * Hn2_n,
double_complex * dHn2_n )

Computes the (cylindrical) Hankel function of the second kind (Hn2) and their derivatives (dHn2) for ALL orders from 0 to N.

Parameters
[in]NFunction order (highest is ~30 given numerical precision)
[in]zInput values; nZ x 1
[in]nZNumber of input values
[out]Hn2_nHankel values (set as NULL if not required); FLAT: nZ x (N+1)
[out]dHn2_nHankel derivative values (set as NULL if not required); FLAT: nZ x (N+1)

Definition at line 591 of file saf_utility_bessel.c.

◆ hankel_hn2_ALL()

void hankel_hn2_ALL ( int N,
double * z,
int nZ,
int * maxN,
double_complex * h_n2,
double_complex * dh_n2 )

Computes the spherical Hankel function of the second kind (hn2) and their derivatives (dhn2) for ALL orders from 0 to N.

Note
If the function fails to compute the function up to the specified order 'N', then the function will compute up to maximum order possible, and let the user know via the 'maxN' parameter. (i.e., always check if N=maxN, and handle things accordingly if maxN is lower).
Parameters
[in]NFunction order (highest is ~30 given numerical precision)
[in]zInput values; nZ x 1
[in]nZNumber of input values
[out]maxN(&) maximum function order that could be computed <=N
[out]h_n2Hankel values (set as NULL if not required); FLAT: nZ x (N+1)
[out]dh_n2Hankel derivative values (set as NULL if not required); FLAT: nZ x (N+1)

Definition at line 1125 of file saf_utility_bessel.c.

◆ hilbert()

void hilbert ( float_complex * x,
int x_len,
float_complex * y )

Computes the discrete-time analytic signal via the Hilbert transform [1].

The magnitude of the output is the envelope, and imaginary part is the actual Hilbert transform. (Functionally identical to Matlab's 'hilbert' function)

Parameters
[in]xInput; x_len x 1
[in]x_lenLength of input signal, in samples
[out]yOutput analytic signal; x_len x 1
See also
[1] Marple, L., 1999. Computing the discrete-time" analytic" signal via FFT. IEEE Transactions on signal processing, 47(9), pp.2600-2603.

Definition at line 230 of file saf_utility_fft.c.

◆ interpDVFShelfParams()

void interpDVFShelfParams ( float theta,
float rho,
float * iG0,
float * iGInf,
float * iFc )

Calculate the shelving filter parameters for the Distance Variation Function filter from the source (ipsilateral) azimuth and distance.

Parameters
[in]thetaLateral angle, on the inter-aural axis [0..180] (deg)
[in]rhoSource distance, normalized to head radius, >= 1
[out]iG0Interpolated DC gain
[out]iGInfInterpolated high shelf gain
[out]iFcInterpolated high shelf cutoff frequency

Definition at line 107 of file saf_utility_dvf.c.

◆ interpolateFiltersH()

void interpolateFiltersH ( int inFFTsize,
int outFFTsize,
int nFilters,
float_complex * filters_in,
float_complex * filters_out )

Interpolate filters (w.r.t.

frequency) in the frequency-domain

Parameters
[in]inFFTsizeInput FFT size
[in]outFFTsizeOutput FFT size
[in]nFiltersNumber of filters to interpolate
[in]filters_inInput filters; FLAT: inFFTsize x nFilters
[out]filters_outOutput filters; FLAT: outFFTsize x nFilters

Definition at line 274 of file saf_utility_filters.c.

◆ L2_norm()

float L2_norm ( float * v,
int lenV )

Returns the L2 (Euclidean) norm of an arbitrary length vector.

Definition at line 422 of file saf_utility_geometry.c.

◆ L2_norm3()

float L2_norm3 ( float v[3])

Returns the L2 (Euclidean) norm of a 3-element vector.

Definition at line 414 of file saf_utility_geometry.c.

◆ lagrangeWeights()

void lagrangeWeights ( int N,
float * x,
int len_x,
float * weights )

Computes Lagrange interpolation weights of order 'N' for value 'x'.

Parameters
[in]NOrder
[in]xValues; len_x x 1
[in]len_xNumber of values
[out]weightsWeights; (ORDER+1) x len_x

Definition at line 81 of file saf_utility_misc.c.

◆ latticeDecorrelator_apply()

void latticeDecorrelator_apply ( void * hDecor,
float_complex *** inFrame,
int nTimeSlots,
float_complex *** decorFrame )

Applies the lattice all-pass-filter-based multi-channel signal decorrelator.

Parameters
[in]hDecorlattice decorrelator handle
[in]inFrameinput frame; nBands x nCH x nTimeSlots
[in]nTimeSlotsNumber of time slots per frame
[out]decorFramedecorrelated frame; nBands x nCH x nTimeSlots

Definition at line 340 of file saf_utility_decor.c.

◆ latticeDecorrelator_create()

void latticeDecorrelator_create ( void ** phDecor,
float fs,
int hopsize,
float * freqVector,
int nBands,
int nCH,
int * orders,
float * freqCutoffs,
int nCutoffs,
int maxDelay,
int lookupOffset,
float enComp_coeff )

Creates an instance of the lattice all-pass-filter-based multi-channel signal decorrelator.

This decorrelator is intended for decorrelating signals in the time-frequency domain, and is therefore well-suited for audio coding [1] or Direction Audio Coding (DirAC) [2] purposes.

Test
test__latticeDecorrelator()
Parameters
[in]phDecor(&) address of lattice decorrelator handle
[in]fsSampling rate
[in]hopsizeHopsize in samples
[in]freqVectorA vector with the centre frequency for each band in the filterbank or bin in the STFT. Use e.g. afSTFT_getCentreFreqs() or getUniformFreqVector() to obtain it; nBands x 1
[in]nBandsNumber of bands
[in]nCHNumber of channels
[in]ordersLattice all-pass filter orders (2,3,4,6,8,10,12,14, 15,16 18, or 20) per band grouping (except the last one); nCutoffs x 1
[in]freqCutoffsFrequency cut-offs defining the band groupings; nCutoffs x 1
[in]nCutoffsNumber of cutoff frequencies
[in]maxDelayMaximum static delay (hops, i.e. maxDelay*hopsize)
[in]lookupOffsetOptional offset for look-up tables (set to 0 if using just one instance)
[in]enComp_coeffEnergy compensation coefficient, [0..1]
See also
[1] Herre, J., Kjo"rling, K., Breebaart, J., Faller, C., Disch, S., Purnhagen, H., Koppens, J., Hilpert, J., Ro"den, J., Oomen, W. and Linzmeier, K., 2008. MPEG surround-the ISO/MPEG standard for efficient and compatible multichannel audio coding. Journal of the Audio Engineering Society, 56(11), pp.932–955
[2] Pulkki, V., 2007. Spatial sound reproduction with directional audio coding. Journal of the Audio Engineering Society, 55(6), pp.503-516

Definition at line 194 of file saf_utility_decor.c.

◆ latticeDecorrelator_destroy()

void latticeDecorrelator_destroy ( void ** phDecor)

Destroys an instance of the lattice all-pass-filter-based multi-channel signal decorrelator.

Parameters
[in]phDecor(&) address of lattice decorrelator handle

Definition at line 295 of file saf_utility_decor.c.

◆ latticeDecorrelator_reset()

void latticeDecorrelator_reset ( void * hDecor)

Sets the internal buffers to zero.

Definition at line 323 of file saf_utility_decor.c.

◆ matlab_fmodf()

float matlab_fmodf ( float x,
float y )

C fmodf function, except it behaves like 'mod' in Matlab (i.e.

with the wrap around for negative values of 'x')

Parameters
[in]xValue 'x'
[in]yValue 'y'
Returns
fmodf(n)

Definition at line 190 of file saf_utility_misc.c.

◆ nextpow2()

int nextpow2 ( int numsamp)

A simple function which returns the next power of 2.

Taken from (no license): https://github.com/amaggi/legacy-code

Definition at line 64 of file saf_utility_misc.c.

◆ polyd_m()

void polyd_m ( double * X,
double_complex * poly,
int size_x )

Convert roots of a matrix to polynomial (real double precision)

Parameters
[in]XSquare input matrix; size_x x size_x
[out]polyPolynomials; (size_x+1) x 1
[in]size_xDimensions of square matrix 'X'

Definition at line 340 of file saf_utility_misc.c.

◆ polyd_v()

void polyd_v ( double * x,
double * poly,
int len_x )

Convert roots of a vector to polynomial (real double precision)

Parameters
[in]xInput vector; len_x x 1
[out]polyPolynomials; (len_x+1) x 1
[in]len_xLength of vector 'x'

Definition at line 304 of file saf_utility_misc.c.

◆ polyz_v()

void polyz_v ( double_complex * x,
double_complex * poly,
int len_x )

Convert roots of a vector to polynomial (complex double precision)

Parameters
[in]xInput vector; len_x x 1
[out]polyPolynomials; (len_x+1) x 1
[in]len_xLength of vector 'x'

Definition at line 322 of file saf_utility_misc.c.

◆ qmf_analysis()

void qmf_analysis ( void *const hQMF,
float ** dataTD,
int framesize,
float_complex *** dataFD )

Performs QMF analysis of the input time-domain signals.

Parameters
[in]hQMFqmf handle
[in]dataTDTime-domain input; nCHin x framesize
[in]framesizeFrame size of time-domain data
[out]dataFDFrequency-domain output; see QMF_FDDATA_FORMAT enum

Definition at line 314 of file saf_utility_qmf.c.

◆ qmf_channelChange()

void qmf_channelChange ( void *const hQMF,
int new_nCHin,
int new_nCHout )

Changes the number input and/or output channels.

Parameters
[in]hQMFqmf handle
[in]new_nCHinNew number of input channels
[in]new_nCHoutNew number of output channels

Definition at line 538 of file saf_utility_qmf.c.

◆ qmf_clearBuffers()

void qmf_clearBuffers ( void *const hQMF)

Flushes the analysis and synthesis buffers with zeros.

Definition at line 587 of file saf_utility_qmf.c.

◆ qmf_create()

void qmf_create ( void **const phQMF,
int nCHin,
int nCHout,
int hopsize,
int hybridmode,
QMF_FDDATA_FORMAT format )

Creates an instance of the qmf filterbank.

Test
test__qmf()
Parameters
[in]phQMF(&) address of qmf handle
[in]nCHinNumber of input channels
[in]nCHoutNumber of output channels
[in]hopsizeHop size, in samples
[in]hybridmode0: disabled, 1: hybrid-filtering enabled
[in]formatfrequency-domain frame format, see QMF_FDDATA_FORMAT enum

Definition at line 149 of file saf_utility_qmf.c.

◆ qmf_destroy()

void qmf_destroy ( void **const phQMF)

Destroys an instance of the qmf filterbank.

Parameters
[in]phQMF(&) address of qmf handle

Definition at line 271 of file saf_utility_qmf.c.

◆ qmf_FIRtoFilterbankCoeffs()

void qmf_FIRtoFilterbankCoeffs ( float * hIR,
int N_dirs,
int nCH,
int ir_len,
int hopSize,
int hybridmode,
float_complex * hFB )

Converts FIR filters into Filterbank Coefficients by passing them through the QMF filterbank.

Parameters
[in]hIRTime-domain FIR; FLAT: N_dirs x nCH x ir_len
[in]N_dirsNumber of FIR sets
[in]nCHNumber of channels per FIR set
[in]ir_lenLength of the FIR
[in]hopSizeHop size
[in]hybridmode0: disabled, 1:enabled
[out]hFBThe FIRs as Filterbank coefficients; FLAT: N_bands x nCH x N_dirs

Definition at line 670 of file saf_utility_qmf.c.

◆ qmf_getCentreFreqs()

void qmf_getCentreFreqs ( void *const hQMF,
float fs,
int nBands,
float * centreFreq )

Computes the QMF/hybrid-QMF centre frequencies.

Note
'nBands' can be found with qmf_getNBands()
Parameters
[in]hQMFqmf handle
[in]fsSampling rate in Hz
[in]nBandsLength of 'centreFreq'
[out]centreFreqThe frequency vector: nBands x 1

Definition at line 627 of file saf_utility_qmf.c.

◆ qmf_getNBands()

int qmf_getNBands ( void *const hQMF)

Returns the number of frequency bands.

Definition at line 618 of file saf_utility_qmf.c.

◆ qmf_getProcDelay()

int qmf_getProcDelay ( void *const hQMF)

Returns the processing delay in samples.

Note
The QMF filterbank delay is broken down into the following: analysis delay: 5*hopsize
  • hybrid-filtering delay: 6*hopsize (or 0, if it is disabled)
  • synthesis delay 4*hopsize

Definition at line 609 of file saf_utility_qmf.c.

◆ qmf_synthesis()

void qmf_synthesis ( void *const hQMF,
float_complex *** dataFD,
int framesize,
float ** dataTD )

Performs QMF synthesis of the input frequency-domain signals.

Parameters
[in]hQMFqmf handle
[in]dataFDFrequency-domain input; see QMF_FDDATA_FORMAT enum
[in]framesizeFrame size of time-domain data
[out]dataTDTime-domain output; nCHout x framesize

Definition at line 437 of file saf_utility_qmf.c.

◆ quaternion2euler()

void quaternion2euler ( quaternion_data * Q,
int degreesFlag,
EULER_ROTATION_CONVENTIONS convention,
float * alpha,
float * beta,
float * gamma )

Converts a quaternion to Euler angles.

Definition at line 163 of file saf_utility_geometry.c.

◆ quaternion2rotationMatrix()

void quaternion2rotationMatrix ( quaternion_data * Q,
float R[3][3] )

Constructs a 3x3 rotation matrix based on a quaternion.

Definition at line 89 of file saf_utility_geometry.c.

◆ rand_0_1()

void rand_0_1 ( float * vector,
int length )

Generates random numbers between 0 and 1 and stores them in the input vector.

Parameters
[in,out]vectorVector to populate with random numbers; length x 1
[in]lengthLength of the vector

Definition at line 249 of file saf_utility_misc.c.

◆ rand_cmplx_m1_1()

void rand_cmplx_m1_1 ( float_complex * vector,
int length )

Generates random numbers between -1 and 1 and stores them in the input vector for both the real and imaginary parts.

Parameters
[in,out]vectorVector to populate with random numbers; length x 1
[in]lengthLength of the vector

Definition at line 238 of file saf_utility_misc.c.

◆ rand_m1_1()

void rand_m1_1 ( float * vector,
int length )

Generates random numbers between -1 and 1 and stores them in the input vector.

Parameters
[in,out]vectorVector to populate with random numbers; length x 1
[in]lengthLength of the vector

Definition at line 227 of file saf_utility_misc.c.

◆ randperm()

void randperm ( int len,
int * randperm_inds )

Returns the indices required to randomly permute a vector of length 'len'.

Definition at line 158 of file saf_utility_misc.c.

◆ rotationMatrix2quaternion()

void rotationMatrix2quaternion ( float R[3][3],
quaternion_data * Q )

Calculates the quaternion corresponding to a 3x3 rotation matrix.

Definition at line 107 of file saf_utility_geometry.c.

◆ saf_fft_backward()

void saf_fft_backward ( void *const hFFT,
float_complex * inputFD,
float_complex * outputTD )

Performs the backward-FFT operation; use for complex to complex transformations.

Parameters
[in]hFFTsaf_fft handle
[in]inputFDFrequency-domain input; N x 1
[out]outputTDTime-domain output; N x 1

Definition at line 934 of file saf_utility_fft.c.

◆ saf_fft_create()

void saf_fft_create ( void **const phFFT,
int N )

Creates an instance of saf_fft; complex<->complex FFT.

Note
Only Even FFT sizes are supported.
Parameters
[in]phFFT(&) address of saf_fft handle
[in]NFFT size

Definition at line 761 of file saf_utility_fft.c.

◆ saf_fft_destroy()

void saf_fft_destroy ( void **const phFFT)

Destroys an instance of saf_fft.

Parameters
[in]phFFT(&) address of saf_fft handle

Definition at line 843 of file saf_utility_fft.c.

◆ saf_fft_forward()

void saf_fft_forward ( void *const hFFT,
float_complex * inputTD,
float_complex * outputFD )

Performs the forward-FFT operation; use for complex to complex transformations.

Parameters
[in]hFFTsaf_fft handle
[in]inputTDTime-domain input; N x 1
[out]outputFDFrequency-domain output; N x 1

Definition at line 897 of file saf_utility_fft.c.

◆ saf_matrixConv_apply()

void saf_matrixConv_apply ( void *const hMC,
float * inputSigs,
float * outputSigs )

Performs the matrix convolution.

Note
If the number of input or output channels, the filters, or the hopsize need to change: simply destroy and re-create the matrixConv instance.
Parameters
[in]hMCmatrixConv handle
[in]inputSigsInput signals; FLAT: nCHin x hopSize
[out]outputSigsOutput signals; FLAT: nCHout x hopSize

Definition at line 177 of file saf_utility_matrixConv.c.

◆ saf_matrixConv_create()

void saf_matrixConv_create ( void **const phMC,
int hopSize,
float * H,
int length_h,
int nCHin,
int nCHout,
int usePartFLAG )

Creates an instance of matrixConv.

This is a matrix convolver intended for block-by-block processing.

Test
test__saf_matrixConv()
Parameters
[in]phMC(&) address of matrixConv handle
[in]hopSizeHop size in samples.
[in]HTime-domain filters; FLAT: nCHout x nCHin x length_h
[in]length_hLength of the filters
[in]nCHinNumber of input channels
[in]nCHoutNumber of output channels
[in]usePartFLAG'0': normal fft-based convolution, '1': fft-based partitioned convolution

Definition at line 49 of file saf_utility_matrixConv.c.

◆ saf_matrixConv_destroy()

void saf_matrixConv_destroy ( void **const phMC)

Destroys an instance of matrixConv.

Parameters
[in]phMC(&) address of matrixConv handle

Definition at line 132 of file saf_utility_matrixConv.c.

◆ saf_matrixConv_reset()

void saf_matrixConv_reset ( void *const hMC)

Flushes internal buffers with zeros.

Parameters
[in]hMCmatrixConv handle

Definition at line 164 of file saf_utility_matrixConv.c.

◆ saf_multiConv_apply()

void saf_multiConv_apply ( void *const hMC,
float * inputSigs,
float * outputSigs )

Performs the multi-channel convolution.

Parameters
[in]hMCmultiConv handle
[in]inputSigsInput signals; FLAT: nCH x hopSize
[out]outputSigsOutput signals; FLAT: nCH x hopSize

Definition at line 385 of file saf_utility_matrixConv.c.

◆ saf_multiConv_create()

void saf_multiConv_create ( void **const phMC,
int hopSize,
float * H,
int length_h,
int nCH,
int usePartFLAG )

Creates an instance of multiConv.

This is a multi-channel convolver intended for block-by-block processing.

Note
nCH can just be 1, in which case this is simply a single-channel convolver.
Parameters
[in]phMC(&) address of multiConv handle
[in]hopSizeHop size in samples.
[in]HTime-domain filters; FLAT: nCH x length_h
[in]length_hLength of the filters
[in]nCHNumber of filters & input/output channels
[in]usePartFLAG'0': normal fft-based convolution, '1': fft-based partitioned convolution

Definition at line 271 of file saf_utility_matrixConv.c.

◆ saf_multiConv_destroy()

void saf_multiConv_destroy ( void **const phMC)

Destroys an instance of multiConv.

Parameters
[in]phMC(&) address of multiConv handle

Definition at line 344 of file saf_utility_matrixConv.c.

◆ saf_multiConv_reset()

void saf_multiConv_reset ( void *const hMC)

Flushes internal buffers with zeros.

Parameters
[in]hMCmatrixConv handle

Definition at line 372 of file saf_utility_matrixConv.c.

◆ saf_rfft_backward()

void saf_rfft_backward ( void *const hFFT,
float_complex * inputFD,
float * outputTD )

Performs the backward-FFT operation; use for complex (conjugate symmetric) to real transformations.

Note
Only the first N/2 + 1 bins are needed to be passed in inputFD.
Parameters
[in]hFFTsaf_rfft handle
[in]inputFDFrequency-domain input; (N/2 + 1) x 1
[out]outputTDTime-domain output; N x 1

Definition at line 714 of file saf_utility_fft.c.

◆ saf_rfft_create()

void saf_rfft_create ( void **const phFFT,
int N )

Creates an instance of saf_rfft; real<->half-complex (conjugate-symmetric) FFT.

Note
Only Even FFT sizes are supported.

Example Usage

const int N = 256; // FFT size
float x_in[N]; // input buffer (time-domain)
x_in[0] = ... x_in[N-1] = // fill with data
float_complex x_out[(N/2+1)]; // output buffer (frequency-domain)
float test[N]; // test (time-domain)
void *hFFT; // safFFT handle
saf_rfft_create(&hFFT, N); // creates instance of safFFT
saf_rfft_forward(hFFT, x_in, x_out); // perform forward transform
saf_rfft_backward(hFFT, x_out, test); // perform backwards transform
// 'x_in' should equal 'test' (given some numerical error)
saf_rfft_destroy(&hFFT); // destroys instance of safFFT
void saf_rfft_create(void **const phFFT, int N)
Creates an instance of saf_rfft; real<->half-complex (conjugate-symmetric) FFT.
void saf_rfft_forward(void *const hFFT, float *inputTD, float_complex *outputFD)
Performs the forward-FFT operation; use for real to complex (conjugate symmetric) transformations.
void saf_rfft_backward(void *const hFFT, float_complex *inputFD, float *outputTD)
Performs the backward-FFT operation; use for complex (conjugate symmetric) to real transformations.
void saf_rfft_destroy(void **const phFFT)
Destroys an instance of saf_rfft.
Test
test__saf_rfft()
Parameters
[in]phFFT(&) address of saf_rfft handle
[in]NFFT size

Definition at line 531 of file saf_utility_fft.c.

◆ saf_rfft_destroy()

void saf_rfft_destroy ( void **const phFFT)

Destroys an instance of saf_rfft.

Parameters
[in]phFFT(&) address of saf_rfft handle

Definition at line 616 of file saf_utility_fft.c.

◆ saf_rfft_forward()

void saf_rfft_forward ( void *const hFFT,
float * inputTD,
float_complex * outputFD )

Performs the forward-FFT operation; use for real to complex (conjugate symmetric) transformations.

Note
Only the first N/2 + 1 bins are returned in outputFD.
Parameters
[in]hFFTsaf_rfft handle
[in]inputTDTime-domain input; N x 1
[out]outputFDFrequency-domain output; (N/2 + 1) x 1

Definition at line 669 of file saf_utility_fft.c.

◆ saf_stft_backward()

void saf_stft_backward ( void *const hSTFT,
float_complex *** dataFD,
int framesize,
float ** dataTD )

Performs the backward-STFT operation for the current frame.

Parameters
[in]hSTFTsaf_stft handle
[in]dataFDFrequency-domain output; see SAF_STFT_FDDATA_FORMAT
[in]framesizeFrame size of time-domain data
[out]dataTDTime-domain output; nCHout x framesize

Definition at line 438 of file saf_utility_fft.c.

◆ saf_stft_channelChange()

void saf_stft_channelChange ( void *const hSTFT,
int new_nCHin,
int new_nCHout )

Changes the number of input/output channels.

Parameters
[in]hSTFTsaf_stft handle
[in]new_nCHinNew number of input channels
[in]new_nCHoutNew number of ooutput channels

Definition at line 490 of file saf_utility_fft.c.

◆ saf_stft_create()

void saf_stft_create ( void **const phSTFT,
int winsize,
int hopsize,
int nCHin,
int nCHout,
SAF_STFT_FDDATA_FORMAT FDformat )

Creates an instance of saf_stft.

Test
test__saf_stft_50pc_overlap(), test__saf_stft_LTI()
Parameters
[in]phSTFT(&) address of saf_stft handle
[in]winsizeWindow size
[in]hopsizeHop size
[in]nCHinNumber of input channels
[in]nCHoutNumber of ooutput channels
[in]FDformatFormat for the frequency-domain data (see the SAF_STFT_FDDATA_FORMAT enum)

Definition at line 297 of file saf_utility_fft.c.

◆ saf_stft_destroy()

void saf_stft_destroy ( void **const phSTFT)

Destroys an instance of saf_stft.

Parameters
[in]phSTFT(&) address of saf_stft handle

Definition at line 346 of file saf_utility_fft.c.

◆ saf_stft_flushBuffers()

void saf_stft_flushBuffers ( void *const hSTFT)

Flushes the internal buffers with zeros.

Parameters
[in]hSTFTsaf_stft handle

Definition at line 479 of file saf_utility_fft.c.

◆ saf_stft_forward()

void saf_stft_forward ( void *const hSTFT,
float ** dataTD,
int framesize,
float_complex *** dataFD )

Performs the forward-STFT operation for the current frame.

Parameters
[in]hSTFTsaf_stft handle
[in]dataTDTime-domain input; nCHin x framesize
[in]framesizeFrame size of time-domain data
[out]dataFDFrequency-domain output; see SAF_STFT_FDDATA_FORMAT

Definition at line 366 of file saf_utility_fft.c.

◆ saf_TVConv_apply()

void saf_TVConv_apply ( void *const hTVC,
float * inputSigs,
float * outputSigs,
int irIdx )

Performs the matrix convolution.

Note
If the number of input or output channels, the filters, or the hopsize need to change: simply destroy and re-create the matrixConv instance.
Parameters
[in]hTVCTVConv handle
[in]inputSigsInput signals; FLAT: nCHin x hopSize
[out]outputSigsOutput signals; FLAT: nCHout x hopSize
[in]irIdxindex of IR to be used in this convolution

Definition at line 577 of file saf_utility_matrixConv.c.

◆ saf_TVConv_create()

void saf_TVConv_create ( void **const phTVC,
int hopSize,
float ** H,
int length_h,
int nIRs,
int nCHout,
int initIdx )

Creates an instance of TVConv.

This is a time-varying convolver intended for block-by-block processing. A set of IRs are pre-loaded and IR to be convolved with can be changed live. Crossfading is appled between the previous IR outputs to avoid clipping. The covnolution is partitioned (overlap-add).

Test
test__saf_matrixConv()
Parameters
[in]phTVC(&) address of TVConv handle
[in]hopSizeHop size in samples.
[in]HTime-domain filters; nIRs x (FLAT: nCHout x length_h)
[in]length_hLength of the filters,
[in]nIRsNumber or IRs.
[in]nCHoutNumber of output channels.
[in]initIdxInitial IR index to be used.

Definition at line 467 of file saf_utility_matrixConv.c.

◆ saf_TVConv_destroy()

void saf_TVConv_destroy ( void **const phTVC)

Destroys an instance of matrixConv.

Parameters
[in]phTVC(&) address of TVConv handle

Definition at line 541 of file saf_utility_matrixConv.c.

◆ smb_pitchShift_apply()

void smb_pitchShift_apply ( void * hSmb,
float pitchShift,
int frameSize,
float * inFrame,
float * outFrame )

Performs pitch shifting of the input signals, while retaining the same time duration as the original using the algorithm detailed in [1].

This implementation was orginally written by Stephan M. Bernsee (c) 1999-2015 distributed under the WOL license. It has been modified to better work with frame-by-frame processing. It also supports multiple input channels and employs saf_utility_fft.h and saf_utility_veclib.h for additional run-time optimisations.

Parameters
[in]hSmb(&) smb pitchShifter handle
[in]pitchShiftPitch shift factor, 0.5: down 1 octave, 1: no shift, 2: up 1 octave
[in]frameSizeNumber of samples in frame
[in]inFrameInput frame; FLAT: nCH x frameSize
[out]outFrameOutput frame; FLAT: nCH x frameSize
See also
[1] http://blogs.zynaptiq.com/bernsee/pitch-shifting-using-the-ft/ Copyright 1999-2015 Stephan M. Bernsee, The Wide Open License (WOL)

Definition at line 212 of file saf_utility_pitch.c.

◆ smb_pitchShift_create()

void smb_pitchShift_create ( void ** hSmb,
int nCH,
int fftFrameSize,
int osamp,
float sampleRate )

Creates an instance of SMB PitchShifter.

Note
Higher FFT sizes will permit more drastic pitch shifts. Increasing the Oversampling factor will increase latency, but also improve signal fidelity.
Test
test__smb_pitchShifter()
Parameters
[in]hSmb(&) address of smb pitchShifter handle
[in]nCHnumber of channels
[in]fftFrameSizeFFT size
[in]osampOversampling/overlapping factor
[in]sampleRateSampling rate, Hz

Definition at line 123 of file saf_utility_pitch.c.

◆ smb_pitchShift_destroy()

void smb_pitchShift_destroy ( void **const hSmb)

Destroys an instance of SMB PitchShifter.

Parameters
[in]hSmb(&) address of smb pitchShifter handle

Definition at line 169 of file saf_utility_pitch.c.

◆ sortc()

void sortc ( float_complex * in_vec,
float_complex * out_vec,
int len,
int descendFLAG )

Sort a vector of complex floating-point values into ascending/decending order.

Note
The values are first sorted based on their real parts. Values with identical real parts are then sorted based on their imaginary parts.
Parameters
[in]in_vecVector to be sorted; len x 1
[out]out_vecOutput vector
[in]lenNumber of elements in vectors
[in]descendFLAG'0' ascending, '1' descending

Definition at line 212 of file saf_utility_sort.c.

◆ sortd()

void sortd ( double * in_vec,
double * out_vec,
int * new_indices,
int len,
int descendFLAG )

Sort a vector of double floating-point values into ascending/decending order (optionally returning the new indices as well)

Parameters
[in]in_vecVector to be sorted; len x 1
[out]out_vecOutput vector (set to NULL if you don't want it)
[out]new_indicesIndices used to sort 'in_vec' (set to NULL if you don't want them)
[in]lenNumber of elements in vectors
[in]descendFLAG'0' ascending, '1' descending

Definition at line 182 of file saf_utility_sort.c.

◆ sortf()

void sortf ( float * in_vec,
float * out_vec,
int * new_indices,
int len,
int descendFLAG )

Sort a vector of floating-point values into ascending/decending order (optionally returning the new indices as well)

Test
test__sortf()
Parameters
[in]in_vecVector to be sorted; len x 1
[out]out_vecOutput vector (set to NULL if you don't want it)
[out]new_indicesIndices used to sort 'in_vec' (set to NULL if you don't want them)
[in]lenNumber of elements in vectors
[in]descendFLAG'0' ascending, '1' descending

Definition at line 152 of file saf_utility_sort.c.

◆ sorti()

void sorti ( int * in_vec,
int * out_vec,
int * new_indices,
int len,
int descendFLAG )

Sort a vector of integer values into ascending/decending order (optionally returning the new indices as well)

Parameters
[in]in_vecVector to be sorted; len x 1
[out]out_vecOutput vector (set to NULL if you don't want it)
[out]new_indicesIndices used to sort 'in_vec' (set to NULL if you don't want them)
[in]lenNumber of elements in vectors
[in]descendFLAG'0' ascending, '1' descending

Definition at line 122 of file saf_utility_sort.c.

◆ sortz()

void sortz ( double_complex * in_vec,
double_complex * out_vec,
int len,
int descendFLAG )

Sort a vector of complex double floating-point values into ascending/ decending order.

Note
The values are first sorted based on their real parts. Values with identical real parts are then sorted based on their imaginary parts.
Test
test__sortz()
Parameters
[in]in_vecVector to be sorted; len x 1
[out]out_vecOutput vector
[in]lenNumber of elements in vectors
[in]descendFLAG'0' ascending, '1' descending

Definition at line 276 of file saf_utility_sort.c.

◆ sph2cart()

void sph2cart ( float * sph,
int nDirs,
int anglesInDegreesFLAG,
float * cart )

Converts spherical coordinates to Cartesian coordinates.

Parameters
[in]sphSpherical coordinates; FLAT: nDirs x 3
[in]nDirsNumber of directions/coordinates
[in]anglesInDegreesFLAG0: dirs given in radians, 1: degrees instead
[out]cartCartesian coordinates; FLAT: nDirs x 3

Definition at line 272 of file saf_utility_geometry.c.

◆ sphDelaunay()

void sphDelaunay ( const float * dirs_deg,
const int nDirs,
int ** faces,
int * nFaces,
float * vertices )

Delaunay triangulation of a spherical arrangement of points.

Parameters
[in]dirs_degCoordinates for spherically arranged points, in degrees; FLAT: nDirs x 2
[in]nDirsNumber of points/directions
[out]faces(&) The face indices; FLAT: nFaces x 3
[out]nFaces(&) Number of faces found
[out]vertices(Optional) the vertices (x,y,z) of the points (set to NULL if not wanted); FLAT: nDirs x 3

Definition at line 665 of file saf_utility_geometry.c.

◆ sphElev2incl()

void sphElev2incl ( float * dirsElev,
int nDirs,
int degreesFlag,
float * dirsIncl )

Converts spherical coordinates of unit length from elevation to inclination.

Parameters
[in]dirsElevSpherical coordinates; FLAT: nDirs x 2
[in]nDirsNumber of directions/coordinates
[in]degreesFlag1: angles are in degrees, 0: angles are in radians
[out]dirsInclSpherical coordinates; FLAT: nDirs x 2

Definition at line 372 of file saf_utility_geometry.c.

◆ sphIncl2Elev()

void sphIncl2Elev ( float * dirsIncl,
int nDirs,
int degreesFlag,
float * dirsElev )

Converts spherical coordinates of unit length from inclination to elevation.

Parameters
[in]dirsInclSpherical coordinates; FLAT: nDirs x 2
[in]nDirsNumber of directions/coordinates
[in]degreesFlag1: angles are in degrees, 0: angles are in radians
[out]dirsElevSpherical coordinates; FLAT: nDirs x 2

Definition at line 393 of file saf_utility_geometry.c.

◆ sphVoronoi()

void sphVoronoi ( int * faces,
int nFaces,
float * vertices,
int nDirs,
voronoi_data * voronoi )

Computes the Voronoi diagram for a spherical arrangement of points.

Parameters
[in]facesThe face indices; FLAT: nFaces x 3
[in]nFacesNumber of faces
[in]verticesThe vertices (x,y,z) of the points; FLAT: nDirs x 3
[in]nDirsNumber of points/directions
[out]voronoi(&) The Voronoi diagram

Definition at line 699 of file saf_utility_geometry.c.

◆ sphVoronoiAreas()

void sphVoronoiAreas ( voronoi_data * voronoi,
float * areas )

Computes the areas of a Voronoi diagram on the unit sphere [sum(areas)=4pi].

Parameters
[in]voronoiThe Voronoi diagram
[out]areasThe areas; voronoi.nFaces x 1

Definition at line 876 of file saf_utility_geometry.c.

◆ sumf()

float sumf ( float * values,
int nValues )

Returns the sum of all values.

Definition at line 371 of file saf_utility_misc.c.

◆ synthesiseNoiseReverb()

void synthesiseNoiseReverb ( int nChannels,
float fs,
float * t60,
float * fcen_oct,
int nBands,
int flattenFLAG,
float ** rir_filt,
int * rir_len )

Returns quick and dirty exponentially decaying noise bursts.

With long T60 times, it can be used to approximate the late reverberation tail of room impulse responses. With much shorter t60 times, it can be used for decorrelation purposes.

Parameters
[in]nChannelsNumber of channels
[in]fsSampling rate
[in]t60T60 times (in seconds) per octave band; nBands x 1
[in]fcen_octOctave band centre frequencies; nBands x 1
[in]nBandsNumber of octave bands
[in]flattenFLAG'0' nothing, '1' flattens the magnitude response to unity
[out]rir_filt(&) the shaped noise bursts; FLAT: nChannels x rir_len
[out]rir_len(&) length of filters, in samples

Definition at line 121 of file saf_utility_decor.c.

◆ transientDucker_apply()

void transientDucker_apply ( void * hDucker,
float_complex *** inFrame,
int nTimeSlots,
float alpha,
float beta,
float_complex *** residualFrame,
float_complex *** transientFrame )

Applies the transient ducker, returning either the "ducked" input frame, or the transient part of the input frame, or both.

Parameters
[in]hDuckerducker handle
[in]inFrameinput frame; nBands x nCH x nTimeSlots
[in]nTimeSlotsNumber of time slots per frame
[in]alphaalpha value [0,1]; (e.g. alpha = 0.95f)
[in]betabeta value [0,1]; (e.g. beta = 0.995f)
[out]residualFrameResidual part (set to NULL if not wanted); nBands x nCH x nTimeSlots
[out]transientFrameTransient part (set to NULL if not wanted); nBands x nCH x nTimeSlots

Definition at line 460 of file saf_utility_decor.c.

◆ transientDucker_create()

void transientDucker_create ( void ** phDucker,
int nCH,
int nBands )

Creates an instance of the transient ducker/extractor.

Parameters
[in]phDucker(&) address of ducker handle
[in]nCHNumber of channels
[in]nBandsNumber of frequency bands

Definition at line 428 of file saf_utility_decor.c.

◆ transientDucker_destroy()

void transientDucker_destroy ( void ** phDucker)

Destroys an instance of the transient ducker.

Parameters
[in]phDucker(&) address of ducker handle

Definition at line 444 of file saf_utility_decor.c.

◆ unique_i()

void unique_i ( int * input,
int nInputs,
int ** uniqueVals,
int ** uniqueInds,
int * nUnique )

Finds the unique values (and their indices) of the input vector.

Note
this is equivalent to using "unique(vals, 'last')" in Matlab
Test
test__unique_i()
Parameters
[in]inputInput vector; nInputs x 1
[in]nInputsNumber of elements in the input vector
[out]uniqueVals(&) Unique values (set to NULL if not wanted); nUnique x 1
[out]uniqueInds(&) Indices corresponding to Unique values (set to NULL if not wanted); nUnique x 1
[out]nUnique(&) Number of Unique values; 1 x 1

Definition at line 403 of file saf_utility_misc.c.

◆ unitCart2sph()

void unitCart2sph ( float * dirs_xyz,
int nDirs,
int anglesInDegreesFLAG,
float * dirs )

Converts Cartesian coordinates of unit length to spherical coordinates.

Parameters
[in]dirs_xyzCartesian coordinates; FLAT: nDirs x 3
[in]nDirsNumber of directions/coordinates
[in]anglesInDegreesFLAG0: dirs wanted in radians, 1: degrees instead
[out]dirsSpherical coordinates; FLAT: nDirs x 2

Definition at line 351 of file saf_utility_geometry.c.

◆ unitSph2cart()

void unitSph2cart ( float * dirs,
int nDirs,
int anglesInDegreesFLAG,
float * dirs_xyz )

Converts spherical coordinates to Cartesian coordinates of unit length.

Parameters
[in]dirsSpherical coordinates; FLAT: nDirs x 2
[in]nDirsNumber of directions/coordinates
[in]anglesInDegreesFLAG0: dirs given in radians, 1: degrees instead
[out]dirs_xyzCartesian coordinates; FLAT: nDirs x 3

Definition at line 322 of file saf_utility_geometry.c.

◆ utility_cchol()

void utility_cchol ( void *const hWork,
const float_complex * A,
const int dim,
float_complex * X )

Cholesky factorisation of a hermitian positive-definate matrix: single precision complex, i.e.

X = chol(A); where A = X.'*X
Parameters
[in]hWorkHandle for the work struct (set to NULL if not available, in which case memory is allocated on the fly)
[in]AInput square symmetric positive-definate matrix; FLAT: dim x dim
[in]dimNumber of rows/colums in 'A'
[out]XThe solution; FLAT: dim x dim

Definition at line 4195 of file saf_utility_veclib.c.

◆ utility_cchol_create()

void utility_cchol_create ( void **const phWork,
int maxDim )

(Optional) Pre-allocate the working struct used by utility_cchol()

Parameters
[in]phWork(&) address of work handle, to give to utility_cchol()
[in]maxDim(&) max size 'dim' can be when calling utility_cchol()

Definition at line 4173 of file saf_utility_veclib.c.

◆ utility_cchol_destroy()

void utility_cchol_destroy ( void **const phWork)

De-allocate the working struct used by utility_cchol()

Definition at line 4182 of file saf_utility_veclib.c.

◆ utility_ceig()

void utility_ceig ( void *const hWork,
const float_complex * A,
const int dim,
float_complex * VL,
float_complex * VR,
float_complex * D,
float_complex * eig )

Eigenvalue decomposition of a NON-SYMMETRIC matrix: single precision complex, i.e.

[VL,VR,D] = eig(A); where A*VR = VR*D, and A*VR = VR*diag(eig)
Note
'D' contains the eigen values along the diagonal, while 'eig' are the eigen values as a vector
Parameters
[in]hWorkHandle for the work struct (set to NULL if not available, in which case memory is allocated on the fly)
[in]AInput NON-SYMMETRIC square matrix; FLAT: dim x dim
[in]dimDimensions for square matrix 'A'
[out]VLLeft Eigen vectors (set to NULL if not needed); FLAT: dim x dim
[out]VRRight Eigen vectors (set to NULL if not needed); FLAT: dim x dim
[out]DEigen values along the diagonal (set to NULL if not needed) FLAT: dim x dim
[out]eigEigen values not diagonalised (set to NULL if not needed); dim x 1

Definition at line 2530 of file saf_utility_veclib.c.

◆ utility_ceig_create()

void utility_ceig_create ( void **const phWork,
int maxDim )

(Optional) Pre-allocate the working struct used by utility_ceig()

Parameters
[in]phWork(&) address of work handle, to give to utility_ceig()
[in]maxDim(&) max size 'dim' can be when calling utility_ceig()

Definition at line 2497 of file saf_utility_veclib.c.

◆ utility_ceig_destroy()

void utility_ceig_destroy ( void **const phWork)

De-allocate the working struct used by utility_ceig()

Definition at line 2512 of file saf_utility_veclib.c.

◆ utility_ceigmp()

void utility_ceigmp ( void *const hWork,
const float_complex * A,
const float_complex * B,
const int dim,
float_complex * VL,
float_complex * VR,
float_complex * D )

Computes eigenvalues of a matrix pair using the QZ method, single precision complex, i.e.

[VL,VR,D] = eig(A,B,'qz'); where A*VL = B*VL*VR
Parameters
[in]hWorkHandle for the work struct (set to NULL if not available, in which case memory is allocated on the fly)
[in]AInput left square matrix; FLAT: dim x dim
[in]BInput right square matrix; FLAT: dim x dim
[in]dimDimensions for square matrices 'A' and 'B'
[out]VLLeft Eigen vectors (set to NULL if not needed); FLAT: dim x dim
[out]VRRight Eigen vectors (set to NULL if not needed); FLAT: dim x dim
[out]DEigen values along the diagonal (set to NULL if not needed) FLAT: dim x dim

Definition at line 2267 of file saf_utility_veclib.c.

◆ utility_ceigmp_create()

void utility_ceigmp_create ( void **const phWork,
int maxDim )

(Optional) Pre-allocate the working struct used by utility_ceigmp()

Parameters
[in]phWork(&) address of work handle, to give to utility_ceigmp()
[in]maxDim(&) max size 'dim' can be when calling utility_ceigmp()

Definition at line 2230 of file saf_utility_veclib.c.

◆ utility_ceigmp_destroy()

void utility_ceigmp_destroy ( void **const phWork)

De-allocate the working struct used by utility_ceigmp()

Definition at line 2247 of file saf_utility_veclib.c.

◆ utility_cglslv()

void utility_cglslv ( void *const hWork,
const float_complex * A,
const int dim,
float_complex * B,
int nCol,
float_complex * X )

General linear solver: single precision complex, i.e.

X = linsolve(A,B) = A\B; where, AX = B
Parameters
[in]hWorkHandle for the work struct (set to NULL if not available, in which case memory is allocated on the fly)
[in]AInput square matrix; FLAT: dim x dim
[in]dimDimensions for square matrix 'A'
[in]BRight hand side matrix; FLAT: dim x nCol
[in]nColNumber of columns in right hand side matrix
[out]XThe solution; FLAT: dim x nCol

Definition at line 2937 of file saf_utility_veclib.c.

◆ utility_cglslv_create()

void utility_cglslv_create ( void **const phWork,
int maxDim,
int maxNCol )

(Optional) Pre-allocate the working struct used by utility_cglslv()

Parameters
[in]phWork(&) address of work handle, to give to utility_cglslv()
[in]maxDim(&) max size 'dim' can be when calling utility_cglslv()
[in]maxNCol(&) max size 'nCol' can be when calling utility_cglslv()

Definition at line 2909 of file saf_utility_veclib.c.

◆ utility_cglslv_destroy()

void utility_cglslv_destroy ( void **const phWork)

De-allocate the working struct used by utility_cglslv()

Definition at line 2922 of file saf_utility_veclib.c.

◆ utility_cimaxv()

void utility_cimaxv ( const float_complex * a,
const int len,
int * index )

Single-precision, complex, index of maximum absolute value in a vector, i.e.

[~,ind] = max(abs(a))
Parameters
[in]aInput vector a; len x 1
[in]lenVector length
[out]index(&) index of maximum value; 1 x 1

Definition at line 400 of file saf_utility_veclib.c.

◆ utility_ciminv()

void utility_ciminv ( const float_complex * a,
const int len,
int * index )

Single-precision, complex, index of maximum absolute value in a vector, i.e.

[~,ind] = min(abs(a))
Parameters
[in]aInput vector a; len x 1
[in]lenVector length
[out]index(&) index of minimum value; 1 x 1

Definition at line 296 of file saf_utility_veclib.c.

◆ utility_cinv()

void utility_cinv ( void *const hWork,
float_complex * A,
float_complex * B,
const int dim )

Matrix inversion: double precision complex, i.e.

B = inv(A);
Parameters
[in]hWorkHandle for the work struct (set to NULL if not available, in which case memory is allocated on the fly)
[in]AInput square matrix; FLAT: dim x dim
[out]BInverted square matrix; FLAT: dim x dim
[in]dimsize of matrix

Definition at line 4739 of file saf_utility_veclib.c.

◆ utility_cinv_create()

void utility_cinv_create ( void **const phWork,
int maxDim )

(Optional) Pre-allocate the working struct used by utility_cinv()

Parameters
[in]phWork(&) address of work handle, to give to utility_cinv()
[in]maxDim(&) max size 'dim' can be when calling utility_cinv()

Definition at line 4713 of file saf_utility_veclib.c.

◆ utility_cinv_destroy()

void utility_cinv_destroy ( void **const phWork)

De-allocate the working struct used by utility_cinv()

Definition at line 4724 of file saf_utility_veclib.c.

◆ utility_cpinv()

void utility_cpinv ( void *const hWork,
const float_complex * A,
const int dim1,
const int dim2,
float_complex * B )

General matrix pseudo-inverse (the svd way): single precision complex, i.e.

B = pinv(A)
Parameters
[in]hWorkHandle for the work struct (set to NULL if not available, in which case memory is allocated on the fly)
[in]AInput matrix; FLAT: dim1 x dim2
[in]dim1Number of rows in 'A' / columns in 'B'
[in]dim2Number of columns in 'A' / rows in 'B'
[out]BThe solution; FLAT: dim2 x dim1

Definition at line 3695 of file saf_utility_veclib.c.

◆ utility_cpinv_create()

void utility_cpinv_create ( void **const phWork,
int maxDim1,
int maxDim2 )

(Optional) Pre-allocate the working struct used by utility_cpinv()

Parameters
[in]phWork(&) address of work handle, to give to utility_cpinv()
[in]maxDim1(&) max size 'dim1' can be when calling utility_cpinv()
[in]maxDim2(&) max size 'sim2' can be when calling utility_cpinv()

Definition at line 3660 of file saf_utility_veclib.c.

◆ utility_cpinv_destroy()

void utility_cpinv_destroy ( void **const phWork)

De-allocate the working struct used by utility_cpinv()

Definition at line 3677 of file saf_utility_veclib.c.

◆ utility_cseig()

void utility_cseig ( void *const hWork,
const float_complex * A,
const int dim,
int sortDecFLAG,
float_complex * V,
float_complex * D,
float * eig )

Eigenvalue decomposition of a SYMMETRIC/HERMITION matrix: single precision complex, i.e.

[V,D] = eig(A); where A*V = V*D, and A*V = V*diag(eig)
Note
'D' contains the eigen values along the diagonal, while 'eig' are the eigen values as a vector
Parameters
[in]hWorkHandle for the work struct (set to NULL if not available, in which case memory is allocated on the fly)
[in]AInput SYMMETRIC square matrix; FLAT: dim x dim
[in]dimDimensions for square matrix 'A'
[in]sortDecFLAG'1' sort eigen values and vectors in decending order. '0' ascending
[out]VEigen vectors (set to NULL if not needed); FLAT: dim x dim
[out]DEigen values along the diagonal (set to NULL if not needed); FLAT: dim x dim
[out]eigEigen values not diagonalised (set to NULL if not needed); dim x 1

Definition at line 2095 of file saf_utility_veclib.c.

◆ utility_cseig_create()

void utility_cseig_create ( void **const phWork,
int maxDim )

(Optional) Pre-allocate the working struct used by utility_cseig()

Parameters
[in]phWork(&) address of work handle, to give to utility_cseig()
[in]maxDim(&) max size 'dim' can be when calling utility_cseig()

Definition at line 2066 of file saf_utility_veclib.c.

◆ utility_cseig_destroy()

void utility_cseig_destroy ( void **const phWork)

De-allocate the working struct used by utility_cseig()

Definition at line 2079 of file saf_utility_veclib.c.

◆ utility_cslslv()

void utility_cslslv ( void *const hWork,
const float_complex * A,
const int dim,
float_complex * B,
int nCol,
float_complex * X )

Linear solver for HERMITIAN positive-definate 'A': single precision complex, i.e.

opts.LT=true
X = linsolve(A,B, opts); where, AX = B, and 'A' is a hermition matrix
Parameters
[in]hWorkHandle for the work struct (set to NULL if not available, in which case memory is allocated on the fly)
[in]AInput square SYMMETRIC positive-definate matrix; FLAT: dim x dim
[in]dimDimensions for square matrix 'A'
[in]BRight hand side matrix; FLAT: dim x nCol
[in]nColNumber of columns in right hand side matrix
[out]XThe solution; FLAT: dim x nCol

Definition at line 3444 of file saf_utility_veclib.c.

◆ utility_cslslv_create()

void utility_cslslv_create ( void **const phWork,
int maxDim,
int maxNCol )

(Optional) Pre-allocate the working struct used by utility_cslslv()

Parameters
[in]phWork(&) address of work handle, to give to utility_cslslv()
[in]maxDim(&) max size 'dim' can be when calling utility_cslslv()
[in]maxNCol(&) max size 'nCol' can be when calling utility_cslslv()

Definition at line 3419 of file saf_utility_veclib.c.

◆ utility_cslslv_destroy()

void utility_cslslv_destroy ( void **const phWork)

De-allocate the working struct used by utility_cslslv()

Definition at line 3430 of file saf_utility_veclib.c.

◆ utility_csv2cv_inds()

void utility_csv2cv_inds ( const float_complex * sv,
const int * inds,
const int len,
float_complex * cv )

Single-precision complex, sparse-vector to compressed vector given known indices.

i.e.

cv = sv(inds)
Warning
'sv' must be of at least max(inds) in length!
Parameters
[in]svInput sparse-vector; ? x 1
[in]indsIndices; len x 1
[in]lenCompressed-vector length/number of indices
[out]cvOutput compressed-vector; len x 1

Definition at line 1491 of file saf_utility_veclib.c.

◆ utility_csvd()

void utility_csvd ( void *const hWork,
const float_complex * A,
const int dim1,
const int dim2,
float_complex * U,
float_complex * S,
float_complex * V,
float * sing )

Singular value decomposition: single precision complex, i.e.

[U,S,V] = svd(A); such that A = U*S*V' = U*diag(sing)*V'
Note
'S' contains the singular values along the diagonal, whereas 'sing' are the singular values as a vector. Also, V is returned untransposed! (like in Matlab)
Parameters
[in]hWorkHandle for the work struct (set to NULL if not available, in which case memory is allocated on the fly)
[in]AInput matrix; FLAT: dim1 x dim2
[in]dim1First dimension of matrix 'A'
[in]dim2Second dimension of matrix 'A'
[out]ULeft matrix (set to NULL if not needed); FLAT: dim1 x dim1
[out]SSingular values along the diagonal min(dim1, dim2), (set to NULL if not needed); FLAT: dim1 x dim2
[out]VRight matrix (UNTRANSPOSED!) (set to NULL if not needed); FLAT: dim2 x dim2
[out]singSingular values as a vector, (set to NULL if not needed); min(dim1, dim2) x 1

Definition at line 1791 of file saf_utility_veclib.c.

◆ utility_csvd_create()

void utility_csvd_create ( void **const phWork,
int maxDim1,
int maxDim2 )

(Optional) Pre-allocate the working struct used by utility_csvd()

Parameters
[in]phWork(&) address of work handle, to give to utility_csvd()
[in]maxDim1(&) max size 'dim1' can be when calling utility_csvd()
[in]maxDim2(&) max size 'dim2' can be when calling utility_csvd()

Definition at line 1757 of file saf_utility_veclib.c.

◆ utility_csvd_destroy()

void utility_csvd_destroy ( void **const phWork)

De-allocate the working struct used by utility_csvd()

Definition at line 1773 of file saf_utility_veclib.c.

◆ utility_cvabs()

void utility_cvabs ( const float_complex * a,
const int len,
float * c )

Single-precision, complex, absolute values of vector elements, i.e.

c = abs(a)
Parameters
[in]aInput vector a; len x 1
[in]lenVector length
[out]cOutput vector c; len x 1

Definition at line 455 of file saf_utility_veclib.c.

◆ utility_cvconj()

void utility_cvconj ( const float_complex * a,
const int len,
float_complex * c )

Single-precision, complex, vector-conjugate, i.e.

c = conj(a)
Parameters
[in]aInput vector a; len x 1
[in]lenVector length
[out]cOutput vector c; len x 1

Definition at line 548 of file saf_utility_veclib.c.

◆ utility_cvsmul()

void utility_cvsmul ( float_complex * a,
const float_complex * s,
const int len,
float_complex * c )

Single-precision, complex, multiplies each element in vector 'a' with a scalar 's', i.e.

c = a.*s, OR: a = a.*s (if c==NULL)
Parameters
[in]aInput vector a, and output if c==NULL; len x 1
[in]s(&) input scalar s; 1 x 1
[in]lenVector length
[out]cOutput vector c (set to NULL if you want 'a' as output);

Definition at line 1271 of file saf_utility_veclib.c.

◆ utility_cvvadd()

void utility_cvvadd ( const float_complex * a,
const float_complex * b,
const int len,
float_complex * c )

Single-precision, complex, vector-vector addition, i.e.

c = a+b
Parameters
[in]aInput vector a; len x 1
[in]bInput vector b; len x 1
[in]lenVector length
[out]cOutput vector c; len x 1

Definition at line 684 of file saf_utility_veclib.c.

◆ utility_cvvcopy()

void utility_cvvcopy ( const float_complex * a,
const int len,
float_complex * c )

Single-precision, complex, vector-vector copy, i.e.

c = a
Parameters
[in]aInput vector a; len x 1
[in]lenVector length
[out]cOutput vector c; len x 1

Definition at line 593 of file saf_utility_veclib.c.

◆ utility_cvvdot()

void utility_cvvdot ( const float_complex * a,
const float_complex * b,
const int len,
CONJ_FLAG flag,
float_complex * c )

Single-precision, complex, vector-vector dot product, i.e.

c = a*b^T, (where size(c) = [1 1])
Parameters
[in]aInput vector a; len x 1
[in]bInput vector b; len x 1
[in]flag'0' do not take the conjugate of 'b', '1', take the conjugate of 'b'. (see CONJ_FLAG enum)
[in]lenVector length
[out]c(&) output vector c; 1 x 1

Definition at line 1218 of file saf_utility_veclib.c.

◆ utility_cvvmul()

void utility_cvvmul ( const float_complex * a,
const float_complex * b,
const int len,
float_complex * c )

Single-precision, complex, element-wise vector-vector multiplication i.e.

c = a.*b
Parameters
[in]aInput vector a; len x 1
[in]bInput vector b; len x 1
[in]lenVector length
[out]cOutput vector c; len x 1

Definition at line 1110 of file saf_utility_veclib.c.

◆ utility_cvvsub()

void utility_cvvsub ( const float_complex * a,
const float_complex * b,
const int len,
float_complex * c )

Single-precision, complex, vector-vector subtraction, i.e.

c = a-b
Parameters
[in]aInput vector a; len x 1
[in]bInput vector b; len x 1
[in]lenVector length
[out]cOutput vector c; len x 1

Definition at line 897 of file saf_utility_veclib.c.

◆ utility_ddet()

double utility_ddet ( void *const hWork,
double * A,
int N )

Determinant of a Matrix, double precision, i,e.

d = det(A);
Parameters
[in]hWorkHandle for the work struct (set to NULL if not available, in which case memory is allocated on the fly)
[in]AInput square matrix; FLAT: N x N
[in]Nsize of matrix
Returns
determinant

Definition at line 4410 of file saf_utility_veclib.c.

◆ utility_ddet_create()

void utility_ddet_create ( void **const phWork,
int maxN )

(Optional) Pre-allocate the working struct used by utility_ddet()

Parameters
[in]phWork(&) address of work handle, to give to utility_ddet()
[in]maxN(&) max size 'N' can be when calling utility_ddet()

Definition at line 4381 of file saf_utility_veclib.c.

◆ utility_ddet_destroy()

void utility_ddet_destroy ( void **const phWork)

De-allocate the working struct used by utility_ddet()

Definition at line 4394 of file saf_utility_veclib.c.

◆ utility_dglslv()

void utility_dglslv ( void *const hWork,
const double * A,
const int dim,
double * B,
int nCol,
double * X )

General linear solver: double precision, i.e.

X = linsolve(A,B) = A\B; where, AX = B
Parameters
[in]hWorkHandle for the work struct (set to NULL if not available, in which case memory is allocated on the fly)
[in]AInput square matrix; FLAT: dim x dim
[in]dimDimensions for square matrix 'A'
[in]BRight hand side matrix; FLAT: dim x nCol
[in]nColNumber of columns in right hand side matrix
[out]XThe solution; FLAT: dim x nCol

Definition at line 3040 of file saf_utility_veclib.c.

◆ utility_dglslv_create()

void utility_dglslv_create ( void **const phWork,
int maxDim,
int maxNCol )

(Optional) Pre-allocate the working struct used by utility_dglslv()

Parameters
[in]phWork(&) address of work handle, to give to utility_dglslv()
[in]maxDim(&) max size 'dim' can be when calling utility_dglslv()
[in]maxNCol(&) max size 'nCol' can be when calling utility_dglslv()

Definition at line 3013 of file saf_utility_veclib.c.

◆ utility_dglslv_destroy()

void utility_dglslv_destroy ( void **const phWork)

De-allocate the working struct used by utility_dglslv()

Definition at line 3025 of file saf_utility_veclib.c.

◆ utility_dimaxv()

void utility_dimaxv ( const double * a,
const int len,
int * index )

Double-precision, index of maximum absolute value in a vector, i.e.

[~,ind] = max(abs(a))
Parameters
[in]aInput vector a; len x 1
[in]lenVector length
[out]index(&) index of maximum value; 1 x 1

Definition at line 410 of file saf_utility_veclib.c.

◆ utility_diminv()

void utility_diminv ( const double * a,
const int len,
int * index )

Double-precision, index of minimum absolute value in a vector, i.e.

[~,ind] = min(abs(a))
Parameters
[in]aInput vector a; len x 1
[in]lenVector length
[out]index(&) Index of minimum value; 1 x 1

Definition at line 327 of file saf_utility_veclib.c.

◆ utility_dinv()

void utility_dinv ( void *const hWork,
double * A,
double * B,
const int dim )

Matrix inversion: double precision, i.e.

B = inv(A);
Parameters
[in]hWorkHandle for the work struct (set to NULL if not available, in which case memory is allocated on the fly)
[in]AInput square matrix; FLAT: dim x dim
[out]BInverted square matrix; FLAT: dim x dim
[in]dimsize of matrix

Definition at line 4643 of file saf_utility_veclib.c.

◆ utility_dinv_create()

void utility_dinv_create ( void **const phWork,
int maxDim )

(Optional) Pre-allocate the working struct used by utility_dinv()

Parameters
[in]phWork(&) address of work handle, to give to utility_dinv()
[in]maxDim(&) max size 'dim' can be when calling utility_dinv()

Definition at line 4617 of file saf_utility_veclib.c.

◆ utility_dinv_destroy()

void utility_dinv_destroy ( void **const phWork)

De-allocate the working struct used by utility_dinv()

Definition at line 4628 of file saf_utility_veclib.c.

◆ utility_dpinv()

void utility_dpinv ( void *const hWork,
const double * A,
const int dim1,
const int dim2,
double * B )

General matrix pseudo-inverse (the svd way): double precision, i.e.

B = pinv(A)
Parameters
[in]hWorkHandle for the work struct (set to NULL if not available, in which case memory is allocated on the fly)
[in]AInput matrix; FLAT: dim1 x dim2
[in]dim1Number of rows in 'A' / columns in 'B'
[in]dim2Number of columns in 'A' / rows in 'B'
[out]BThe solution; FLAT: dim2 x dim1

Definition at line 3837 of file saf_utility_veclib.c.

◆ utility_dpinv_create()

void utility_dpinv_create ( void **const phWork,
int maxDim1,
int maxDim2 )

(Optional) Pre-allocate the working struct used by utility_dpinv()

Parameters
[in]phWork(&) address of work handle, to give to utility_dpinv()
[in]maxDim1(&) max size 'dim1' can be when calling utility_dpinv()
[in]maxDim2(&) max size 'sim2' can be when calling utility_dpinv()

Definition at line 3803 of file saf_utility_veclib.c.

◆ utility_dpinv_destroy()

void utility_dpinv_destroy ( void **const phWork)

De-allocate the working struct used by utility_dpinv()

Definition at line 3819 of file saf_utility_veclib.c.

◆ utility_dsv2cv_inds()

void utility_dsv2cv_inds ( const double * sv,
const int * inds,
const int len,
double * cv )

Double-precision, sparse-vector to compressed vector given known indices i.e.

cv = sv(inds)
Warning
'sv' must be of at least max(inds) in length!
Parameters
[in]svInput sparse-vector; ? x 1
[in]indsIndices; len x 1
[in]lenCompressed-vector length/number of indices
[out]cvOutput compressed-vector; len x 1

Definition at line 1527 of file saf_utility_veclib.c.

◆ utility_dvsmul()

void utility_dvsmul ( double * a,
const double * s,
const int len,
double * c )

Double-precision, multiplies each element in vector 'a' with a scalar 's', i.e.

c = a.*s, OR: a = a.*s (if c==NULL)
Parameters
[in]aInput vector a, and output if c==NULL; len x 1
[in]s(&) input scalar s; 1 x 1
[in]lenVector length
[out]cOutput vector c (set to NULL if you want 'a' as output); len x 1

Definition at line 1287 of file saf_utility_veclib.c.

◆ utility_dvvadd()

void utility_dvvadd ( const double * a,
const double * b,
const int len,
double * c )

Double-precision, vector-vector addition, i.e.

c = a+b
Parameters
[in]aInput vector a; len x 1
[in]bInput vector b; len x 1
[in]lenVector length
[out]cOutput vector c; len x 1

Definition at line 743 of file saf_utility_veclib.c.

◆ utility_dvvcopy()

void utility_dvvcopy ( const double * a,
const int len,
double * c )

double-precision, vector-vector copy, i.e.

c = a
Parameters
[in]aInput vector a; len x 1
[in]lenVector length
[out]cOutput vector c; len x 1

Definition at line 603 of file saf_utility_veclib.c.

◆ utility_dvvsub()

void utility_dvvsub ( const double * a,
const double * b,
const int len,
double * c )

Double-precision, vector-vector subtraction, i.e.

c = a-b
Parameters
[in]aInput vector a; len x 1
[in]bInput vector b; len x 1
[in]lenVector length
[out]cOutput vector c; len x 1

Definition at line 956 of file saf_utility_veclib.c.

◆ utility_schol()

void utility_schol ( void *const hWork,
const float * A,
const int dim,
float * X )

Cholesky factorisation of a symmetric matrix positive-definate matrix: single precision, i.e.

X = chol(A); where A = X.'*X
Parameters
[in]hWorkHandle for the work struct (set to NULL if not available, in which case memory is allocated on the fly)
[in]AInput square symmetric positive-definate matrix; FLAT: dim x dim
[in]dimNumber of rows/colums in 'A'
[out]XThe solution; FLAT: dim x dim

Definition at line 4107 of file saf_utility_veclib.c.

◆ utility_schol_create()

void utility_schol_create ( void **const phWork,
int maxDim )

(Optional) Pre-allocate the working struct used by utility_schol()

Parameters
[in]phWork(&) address of work handle, to give to utility_schol()
[in]maxDim(&) max size 'dim' can be when calling utility_schol()

Definition at line 4085 of file saf_utility_veclib.c.

◆ utility_schol_destroy()

void utility_schol_destroy ( void **const phWork)

De-allocate the working struct used by utility_schol()

Definition at line 4094 of file saf_utility_veclib.c.

◆ utility_sdet()

float utility_sdet ( void *const hWork,
float * A,
int N )

Determinant of a Matrix, single precision, i,e.

d = det(A);
Parameters
[in]hWorkHandle for the work struct (set to NULL if not available, in which case memory is allocated on the fly)
[in]AInput square matrix; FLAT: N x N
[in]Nsize of matrix
Returns
determinant

Definition at line 4290 of file saf_utility_veclib.c.

◆ utility_sdet_create()

void utility_sdet_create ( void **const phWork,
int maxN )

(Optional) Pre-allocate the working struct used by utility_sdet()

Parameters
[in]phWork(&) address of work handle, to give to utility_sdet()
[in]maxN(&) max size 'N' can be when calling utility_sdet()

Definition at line 4266 of file saf_utility_veclib.c.

◆ utility_sdet_destroy()

void utility_sdet_destroy ( void **const phWork)

De-allocate the working struct used by utility_sdet()

Definition at line 4276 of file saf_utility_veclib.c.

◆ utility_sglslv()

void utility_sglslv ( void *const hWork,
const float * A,
const int dim,
float * B,
int nCol,
float * X )

General linear solver: single precision, i.e.

X = linsolve(A,B) = A\B; where, AX = B
Parameters
[in]hWorkHandle for the work struct (set to NULL if not available, in which case memory is allocated on the fly)
[in]AInput square matrix; FLAT: dim x dim
[in]dimDimensions for square matrix 'A'
[in]BRight hand side matrix; FLAT: dim x nCol
[in]nColNumber of columns in right hand side matrix
[out]XThe solution; FLAT: dim x nCol

Definition at line 2816 of file saf_utility_veclib.c.

◆ utility_sglslv_create()

void utility_sglslv_create ( void **const phWork,
int maxDim,
int maxNCol )

(Optional) Pre-allocate the working struct used by utility_sglslv()

Parameters
[in]phWork(&) address of work handle, to give to utility_sglslv()
[in]maxDim(&) max size 'dim' can be when calling utility_sglslv()
[in]maxNCol(&) max size 'nCol' can be when calling utility_sglslv()

Definition at line 2788 of file saf_utility_veclib.c.

◆ utility_sglslv_destroy()

void utility_sglslv_destroy ( void **const phWork)

De-allocate the working struct used by utility_sglslv()

Definition at line 2801 of file saf_utility_veclib.c.

◆ utility_sglslvt()

void utility_sglslvt ( void *const hWork,
const float * A,
const int dim,
float * B,
int nCol,
float * X )

General linear solver (the other way): single precision, i.e.

X = linsolve(B.',A.').' = A/B;
Parameters
[in]hWorkHandle for the work struct (set to NULL if not available, in which case memory is allocated on the fly)
[in]AInput square matrix; FLAT: dim x dim
[in]dimDimensions for square matrix 'A'
[in]BRight hand side matrix; FLAT: dim x nCol
[in]nColNumber of columns in right hand side matrix
[out]XThe solution; FLAT: dim x nCol

Definition at line 3251 of file saf_utility_veclib.c.

◆ utility_sglslvt_create()

void utility_sglslvt_create ( void **const phWork,
int maxDim,
int maxNCol )

(Optional) Pre-allocate the working struct used by utility_sglslvt()

Parameters
[in]phWork(&) address of work handle, to give to utility_sglslvt()
[in]maxDim(&) max size 'dim' can be when calling utility_sglslvt()
[in]maxNCol(&) max size 'nCol' can be when calling utility_sglslvt()

Definition at line 3224 of file saf_utility_veclib.c.

◆ utility_sglslvt_destroy()

void utility_sglslvt_destroy ( void **const phWork)

De-allocate the working struct used by utility_sglslvt()

Definition at line 3236 of file saf_utility_veclib.c.

◆ utility_simaxv()

void utility_simaxv ( const float * a,
const int len,
int * index )

Single-precision, index of maximum absolute value in a vector, i.e.

[~,ind] = max(abs(a))
Parameters
[in]aInput vector a; len x 1
[in]lenVector length
[out]index(&) index of maximum value; 1 x 1

Definition at line 390 of file saf_utility_veclib.c.

◆ utility_siminv()

void utility_siminv ( const float * a,
const int len,
int * index )

Single-precision, index of minimum absolute value in a vector, i.e.

[~,ind] = min(abs(a))
Parameters
[in]aInput vector a; len x 1
[in]lenVector length
[out]index(&) Index of minimum value; 1 x 1

Definition at line 269 of file saf_utility_veclib.c.

◆ utility_sinv()

void utility_sinv ( void *const hWork,
float * A,
float * B,
const int dim )

Matrix inversion: single precision, i.e.

B = inv(A);
Parameters
[in]hWorkHandle for the work struct (set to NULL if not available, in which case memory is allocated on the fly)
[in]AInput square matrix; FLAT: dim x dim
[out]BInverted square matrix; FLAT: dim x dim
[in]dimsize of matrix

Definition at line 4547 of file saf_utility_veclib.c.

◆ utility_sinv_create()

void utility_sinv_create ( void **const phWork,
int maxDim )

(Optional) Pre-allocate the working struct used by utility_sinv()

Parameters
[in]phWork(&) address of work handle, to give to utility_sinv()
[in]maxDim(&) max size 'dim' can be when calling utility_sinv()

Definition at line 4521 of file saf_utility_veclib.c.

◆ utility_sinv_destroy()

void utility_sinv_destroy ( void **const phWork)

De-allocate the working struct used by utility_sinv()

Definition at line 4532 of file saf_utility_veclib.c.

◆ utility_spinv()

void utility_spinv ( void *const hWork,
const float * A,
const int dim1,
const int dim2,
float * B )

General matrix pseudo-inverse (the svd way): single precision, i.e.

B = pinv(A)
Parameters
[in]hWorkHandle for the work struct (set to NULL if not available, in which case memory is allocated on the fly)
[in]AInput matrix; FLAT: dim1 x dim2
[in]dim1Number of rows in 'A' / columns in 'B'
[in]dim2Number of columns in 'A' / rows in 'B'
[out]BThe solution; FLAT: dim2 x dim1

Definition at line 3558 of file saf_utility_veclib.c.

◆ utility_spinv_create()

void utility_spinv_create ( void **const phWork,
int maxDim1,
int maxDim2 )

(Optional) Pre-allocate the working struct used by utility_spinv()

Parameters
[in]phWork(&) address of work handle, to give to utility_spinv()
[in]maxDim1(&) max size 'dim1' can be when calling utility_spinv()
[in]maxDim2(&) max size 'sim2' can be when calling utility_spinv()

Definition at line 3524 of file saf_utility_veclib.c.

◆ utility_spinv_destroy()

void utility_spinv_destroy ( void **const phWork)

De-allocate the working struct used by utility_spinv()

Definition at line 3540 of file saf_utility_veclib.c.

◆ utility_sseig()

void utility_sseig ( void *const hWork,
const float * A,
const int dim,
int sortDecFLAG,
float * V,
float * D,
float * eig )

Eigenvalue decomposition of a SYMMETRIC matrix: single precision, i.e.

[V,D] = eig(A); where A*V = V*D, and A*V = V*diag(eig)
Note
'D' contains the eigen values along the diagonal, while 'eig' are the eigen values as a vector
Parameters
[in]hWorkHandle for the work struct (set to NULL if not available, in which case memory is allocated on the fly)
[in]AInput SYMMETRIC square matrix; FLAT: dim x dim
[in]dimDimensions for square matrix 'A'
[in]sortDecFLAG'1' sort eigen values and vectors in decending order. '0' ascending
[out]VEigen vectors (set to NULL if not needed); FLAT: dim x dim
[out]DEigen values along the diagonal (set to NULL if not needed); FLAT: dim x dim
[out]eigEigen values not diagonalised (set to NULL if not needed); dim x 1

Definition at line 1954 of file saf_utility_veclib.c.

◆ utility_sseig_create()

void utility_sseig_create ( void **const phWork,
int maxDim )

(Optional) Pre-allocate the working struct used by utility_sseig()

Parameters
[in]phWork(&) address of work handle, to give to utility_sseig()
[in]maxDim(&) max size 'dim' can be when calling utility_sseig()

Definition at line 1927 of file saf_utility_veclib.c.

◆ utility_sseig_destroy()

void utility_sseig_destroy ( void **const phWork)

De-allocate the working struct used by utility_sseig()

Definition at line 1939 of file saf_utility_veclib.c.

◆ utility_sslslv()

void utility_sslslv ( void *const hWork,
const float * A,
const int dim,
float * B,
int nCol,
float * X )

Linear solver for SYMMETRIC positive-definate 'A': single precision, i.e.

opts.LT=true
X = linsolve(A,B, opts); where, AX = B, and 'A' is a symmetric matrix
Parameters
[in]hWorkHandle for the work struct (set to NULL if not available, in which case memory is allocated on the fly)
[in]AInput square SYMMETRIC positive-definate matrix; FLAT: dim x dim
[in]dimDimensions for square matrix 'A'
[in]BRight hand side matrix; FLAT: dim x nCol
[in]nColNumber of columns in right hand side matrix
[out]XThe solution; FLAT: dim x nCol

Definition at line 3344 of file saf_utility_veclib.c.

◆ utility_sslslv_create()

void utility_sslslv_create ( void **const phWork,
int maxDim,
int maxNCol )

(Optional) Pre-allocate the working struct used by utility_sslslv()

Parameters
[in]phWork(&) address of work handle, to give to utility_sslslv()
[in]maxDim(&) max size 'dim' can be when calling utility_sslslv()
[in]maxNCol(&) max size 'nCol' can be when calling utility_sslslv()

Definition at line 3319 of file saf_utility_veclib.c.

◆ utility_sslslv_destroy()

void utility_sslslv_destroy ( void **const phWork)

De-allocate the working struct used by utility_sslslv()

Definition at line 3330 of file saf_utility_veclib.c.

◆ utility_ssv2cv_inds()

void utility_ssv2cv_inds ( const float * sv,
const int * inds,
const int len,
float * cv )

Single-precision, sparse-vector to compressed vector given known indices i.e.

cv = sv(inds)
Warning
'sv' must be of at least max(inds) in length!
Parameters
[in]svInput sparse-vector; ? x 1
[in]indsIndices; len x 1
[in]lenCompressed-vector length/number of indices
[out]cvOutput compressed-vector; len x 1

Definition at line 1447 of file saf_utility_veclib.c.

◆ utility_ssvd()

void utility_ssvd ( void *const hWork,
const float * A,
const int dim1,
const int dim2,
float * U,
float * S,
float * V,
float * sing )

Singular value decomposition: single precision, i.e.

[U,S,V] = svd(A); such that A = U*S*V.' = U*diag(sing)*V.'
Note
'S' contains the singular values along the diagonal, whereas 'sing' are the singular values as a vector. Also, V is returned untransposed! (like in Matlab)
Parameters
[in]hWorkHandle for the work struct (set to NULL if not available, in which case memory is allocated on the fly)
[in]AInput matrix; FLAT: dim1 x dim2
[in]dim1First dimension of matrix 'A'
[in]dim2Second dimension of matrix 'A'
[out]ULeft matrix (set to NULL if not needed); FLAT: dim1 x dim1
[out]SSingular values along the diagonal min(dim1, dim2), (set to NULL if not needed); FLAT: dim1 x dim2
[out]VRight matrix (UNTRANSPOSED!) (set to NULL if not needed); FLAT: dim2 x dim2
[out]singSingular values as a vector, (set to NULL if not needed); min(dim1, dim2) x 1

Definition at line 1644 of file saf_utility_veclib.c.

◆ utility_ssvd_create()

void utility_ssvd_create ( void **const phWork,
int maxDim1,
int maxDim2 )

(Optional) Pre-allocate the working struct used by utility_ssvd()

Parameters
[in]phWork(&) address of work handle, to give to utility_ssvd()
[in]maxDim1(&) max size 'dim1' can be when calling utility_ssvd()
[in]maxDim2(&) max size 'dim2' can be when calling utility_ssvd()

Definition at line 1612 of file saf_utility_veclib.c.

◆ utility_ssvd_destroy()

void utility_ssvd_destroy ( void **const phWork)

De-allocate the working struct used by utility_ssvd()

Definition at line 1627 of file saf_utility_veclib.c.

◆ utility_svabs()

void utility_svabs ( const float * a,
const int len,
float * c )

Single-precision, absolute values of vector elements, i.e.

c = abs(a)
Parameters
[in]aInput vector a; len x 1
[in]lenVector length
[out]cOutput vector c; len x 1

Definition at line 435 of file saf_utility_veclib.c.

◆ utility_svmod()

void utility_svmod ( const float * a,
const float * b,
const int len,
float * c )

Single-precision, modulus of vector elements, i.e.

c = mod(a,b)
Parameters
[in]aInput vector a; len x 1
[in]bInput vector b; len x 1
[in]lenVector length
[out]cOutput vector c; len x 1

Definition at line 480 of file saf_utility_veclib.c.

◆ utility_svrecip()

void utility_svrecip ( const float * a,
const int len,
float * c )

Single-precision, vector-reciprocal/inversion, i.e.

c = 1/a
Parameters
[in]aInput vector a; len x 1
[in]lenVector length
[out]cOutput vector c; len x 1

Definition at line 504 of file saf_utility_veclib.c.

◆ utility_svsadd()

void utility_svsadd ( float * a,
const float * s,
const int len,
float * c )

Single-precision, adds each element in vector 'a' with a scalar 's', i.e.

c = a+s
Parameters
[in]aInput vector a; len x 1
[in]s(&) input scalar s; 1 x 1
[in]lenVector length
[out]cOutput vector c; len x 1

Definition at line 1363 of file saf_utility_veclib.c.

◆ utility_svsdiv()

void utility_svsdiv ( const float * a,
const float * s,
const int len,
float * c )

Single-precision, divides each element in vector 'a' with a scalar 's', i.e.

c = a./s
Parameters
[in]aInput vector a; len x 1
[in]s(&) input scalar s; 1 x 1
[in]lenVector length
[out]cOutput vector c; len x 1

Definition at line 1336 of file saf_utility_veclib.c.

◆ utility_svsmul()

void utility_svsmul ( float * a,
const float * s,
const int len,
float * c )

Single-precision, multiplies each element in vector 'a' with a scalar 's', i.e.

c = a.*s, OR: a = a.*s (if c==NULL)
Parameters
[in]aInput vector a, and output if c==NULL; len x 1
[in]s(&) input scalar s; 1 x 1
[in]lenVector length
[out]cOutput vector c (set to NULL if you want 'a' as output); len x 1

Definition at line 1243 of file saf_utility_veclib.c.

◆ utility_svssub()

void utility_svssub ( float * a,
const float * s,
const int len,
float * c )

Single-precision, subtracts each element in vector 'a' with a scalar 's', i.e.

c = a-s,
Parameters
[in]aInput vector a; len x 1
[in]s(&) input scalar s; 1 x 1
[in]lenVector length
[out]cOutput vector c; len x 1

Definition at line 1404 of file saf_utility_veclib.c.

◆ utility_svvadd()

void utility_svvadd ( const float * a,
const float * b,
const int len,
float * c )

Single-precision, vector-vector addition, i.e.

c = a+b
Parameters
[in]aInput vector a; len x 1
[in]bInput vector b; len x 1
[in]lenVector length
[out]cOutput vector c; len x 1

Definition at line 628 of file saf_utility_veclib.c.

◆ utility_svvcopy()

void utility_svvcopy ( const float * a,
const int len,
float * c )

Single-precision, vector-vector copy, i.e.

c = a
Parameters
[in]aInput vector a; len x 1
[in]lenVector length
[out]cOutput vector c; len x 1

Definition at line 583 of file saf_utility_veclib.c.

◆ utility_svvdot()

void utility_svvdot ( const float * a,
const float * b,
const int len,
float * c )

Single-precision, vector-vector dot product, i.e.

c = a*b^T, (where size(c) = [1 1])
Parameters
[in]aInput vector a; len x 1
[in]bInput vector b; len x 1
[in]lenVector length
[out]c(&) output vector c; 1 x 1

Definition at line 1207 of file saf_utility_veclib.c.

◆ utility_svvmul()

void utility_svvmul ( const float * a,
const float * b,
const int len,
float * c )

Single-precision, element-wise vector-vector multiplication i.e.

c = a.*b
Parameters
[in]aInput vector a; len x 1
[in]bInput vector b; len x 1
[in]lenVector length
[out]cOutput vector c

Definition at line 1054 of file saf_utility_veclib.c.

◆ utility_svvsub()

void utility_svvsub ( const float * a,
const float * b,
const int len,
float * c )

Single-precision, vector-vector subtraction, i.e.

c = a-b
Parameters
[in]aInput vector a; len x 1
[in]bInput vector b; len x 1
[in]lenVector length
[out]cOutput vector c; len x 1

Definition at line 841 of file saf_utility_veclib.c.

◆ utility_zeig()

void utility_zeig ( void *const hWork,
const double_complex * A,
const int dim,
double_complex * VL,
double_complex * VR,
double_complex * D,
double_complex * eig )

Eigenvalue decomposition of a NON-SYMMETRIC matrix: double precision complex, i.e.

[VL,VR,D] = eig(A); where A*VR = VR*D, and A*VR = VR*diag(eig)
Note
'D' contains the eigen values along the diagonal, while 'eig' are the eigen values as a vector.
Parameters
[in]hWorkHandle for the work struct (set to NULL if not available, in which case memory is allocated on the fly)
[in]AInput NON-SYMMETRIC square matrix; FLAT: dim x dim
[in]dimDimensions for square matrix 'A'
[out]VLLeft Eigen vectors (set to NULL if not needed); FLAT: dim x dim
[out]VRRight Eigen vectors (set to NULL if not needed); FLAT: dim x dim
[out]DEigen values along the diagonal (set to NULL if not needed) FLAT: dim x dim
[out]eigEigen values not diagonalised (set to NULL if not needed); dim x 1

Definition at line 2673 of file saf_utility_veclib.c.

◆ utility_zeig_create()

void utility_zeig_create ( void **const phWork,
int maxDim )

(Optional) Pre-allocate the working struct used by utility_zeig()

Parameters
[in]phWork(&) address of work handle, to give to utility_zeig()
[in]maxDim(&) max size 'dim' can be when calling utility_zeig()

Definition at line 2640 of file saf_utility_veclib.c.

◆ utility_zeig_destroy()

void utility_zeig_destroy ( void **const phWork)

De-allocate the working struct used by utility_zeig()

Definition at line 2655 of file saf_utility_veclib.c.

◆ utility_zeigmp()

void utility_zeigmp ( void *const hWork,
const double_complex * A,
const double_complex * B,
const int dim,
double_complex * VL,
double_complex * VR,
double_complex * D )

Computes eigenvalues of a matrix pair using the QZ method, double precision complex, i.e.

[VL,VR,D] = eig(A,B,'qz'); where A*VL = B*VL*VR
Parameters
[in]hWorkHandle for the work struct (set to NULL if not available, in which case memory is allocated on the fly)
[in]AInput left square matrix; FLAT: dim x dim
[in]BInput right square matrix; FLAT: dim x dim
[in]dimDimensions for square matrices 'A' and 'B'
[out]VLLeft Eigen vectors (set to NULL if not needed); FLAT: dim x dim
[out]VRRight Eigen vectors (set to NULL if not needed); FLAT: dim x dim
[out]DEigen values along the diagonal (set to NULL if not needed) FLAT: dim x dim

Definition at line 2398 of file saf_utility_veclib.c.

◆ utility_zeigmp_create()

void utility_zeigmp_create ( void **const phWork,
int maxDim )

(Optional) Pre-allocate the working struct used by utility_zeigmp()

Parameters
[in]phWork(&) address of work handle, to give to utility_zeigmp()
[in]maxDim(&) max size 'dim' can be when calling utility_zeigmp()

Definition at line 2361 of file saf_utility_veclib.c.

◆ utility_zeigmp_destroy()

void utility_zeigmp_destroy ( void **const phWork)

De-allocate the working struct used by utility_zeigmp()

Definition at line 2378 of file saf_utility_veclib.c.

◆ utility_zglslv()

void utility_zglslv ( void *const hWork,
const double_complex * A,
const int dim,
double_complex * B,
int nCol,
double_complex * X )

General linear solver: double precision complex, i.e.

X = linsolve(A,B) = A\B; where, AX = B
Parameters
[in]hWorkHandle for the work struct (set to NULL if not available, in which case memory is allocated on the fly)
[in]AInput square matrix; FLAT: dim x dim
[in]dimDimensions for square matrix 'A'
[in]BRight hand side matrix; FLAT: dim x nCol
[in]nColNumber of columns in right hand side matrix
[out]XThe solution; FLAT: dim x nCol

Definition at line 3143 of file saf_utility_veclib.c.

◆ utility_zglslv_create()

void utility_zglslv_create ( void **const phWork,
int maxDim,
int maxNCol )

(Optional) Pre-allocate the working struct used by utility_zglslv()

Parameters
[in]phWork(&) address of work handle, to give to utility_zglslv()
[in]maxDim(&) max size 'dim' can be when calling utility_zglslv()
[in]maxNCol(&) max size 'nCol' can be when calling utility_zglslv()

Definition at line 3116 of file saf_utility_veclib.c.

◆ utility_zglslv_destroy()

void utility_zglslv_destroy ( void **const phWork)

De-allocate the working struct used by utility_zglslv()

Definition at line 3128 of file saf_utility_veclib.c.

◆ utility_zimaxv()

void utility_zimaxv ( const double_complex * a,
const int len,
int * index )

Double-precision, complex, index of maximum absolute value in a vector, i.e.

[~,ind] = max(abs(a))
Parameters
[in]aInput vector a; len x 1
[in]lenVector length
[out]index(&) index of maximum value; 1 x 1

Definition at line 420 of file saf_utility_veclib.c.

◆ utility_ziminv()

void utility_ziminv ( const double_complex * a,
const int len,
int * index )

Double-precision, complex, index of maximum absolute value in a vector, i.e.

[~,ind] = min(abs(a))
Parameters
[in]aInput vector a; len x 1
[in]lenVector length
[out]index(&) index of minimum value; 1 x 1

Definition at line 354 of file saf_utility_veclib.c.

◆ utility_zpinv()

void utility_zpinv ( void *const hWork,
const double_complex * A,
const int dim1,
const int dim2,
double_complex * B )

General matrix pseudo-inverse (the svd way): double precision complex, i.e.

B = pinv(A)
Parameters
[in]hWorkHandle for the work struct (set to NULL if not available, in which case memory is allocated on the fly)
[in]AInput matrix; FLAT: dim1 x dim2
[in]dim1Number of rows in 'A' / columns in 'B'
[in]dim2Number of columns in 'A' / rows in 'B'
[out]BThe solution; FLAT: dim2 x dim1

Definition at line 3974 of file saf_utility_veclib.c.

◆ utility_zpinv_create()

void utility_zpinv_create ( void **const phWork,
int maxDim1,
int maxDim2 )

(Optional) Pre-allocate the working struct used by utility_zpinv()

Parameters
[in]phWork(&) address of work handle, to give to utility_zpinv()
[in]maxDim1(&) max size 'dim1' can be when calling utility_zpinv()
[in]maxDim2(&) max size 'sim2' can be when calling utility_zpinv()

Definition at line 3939 of file saf_utility_veclib.c.

◆ utility_zpinv_destroy()

void utility_zpinv_destroy ( void **const phWork)

De-allocate the working struct used by utility_zpinv()

Definition at line 3956 of file saf_utility_veclib.c.

◆ utility_zsv2cv_inds()

void utility_zsv2cv_inds ( const double_complex * sv,
const int * inds,
const int len,
double_complex * cv )

Double-precision complex, sparse-vector to compressed vector given known indices.

i.e.

cv = sv(inds)
Warning
'sv' must be of at least max(inds) in length!
Parameters
[in]svInput sparse-vector; ? x 1
[in]indsIndices; len x 1
[in]lenCompressed-vector length/number of indices
[out]cvOutput compressed-vector; len x 1

Definition at line 1563 of file saf_utility_veclib.c.

◆ utility_zvconj()

void utility_zvconj ( const double_complex * a,
const int len,
double_complex * c )

Double-precision, complex, vector-conjugate, i.e.

c = conj(a)
Parameters
[in]aInput vector a; len x 1
[in]lenVector length
[out]cOutput vector c; len x 1

Definition at line 563 of file saf_utility_veclib.c.

◆ utility_zvsmul()

void utility_zvsmul ( double_complex * a,
const double_complex * s,
const int len,
double_complex * c )

Double-precision, complex, multiplies each element in vector 'a' with a scalar 's', i.e.

c = a.*s, OR: a = a.*s (if c==NULL)
Parameters
[in]aInput vector a, and output if c==NULL; len x 1
[in]s(&) input scalar s; 1 x 1
[in]lenVector length
[out]cOutput vector c (set to NULL if you want 'a' as output);

Definition at line 1315 of file saf_utility_veclib.c.

◆ utility_zvvadd()

void utility_zvvadd ( const double_complex * a,
const double_complex * b,
const int len,
double_complex * c )

Double-precision, complex, vector-vector addition, i.e.

c = a+b
Parameters
[in]aInput vector a; len x 1
[in]bInput vector b; len x 1
[in]lenVector length
[out]cOutput vector c; len x 1

Definition at line 788 of file saf_utility_veclib.c.

◆ utility_zvvcopy()

void utility_zvvcopy ( const double_complex * a,
const int len,
double_complex * c )

double-precision, complex, vector-vector copy, i.e.

c = a
Parameters
[in]aInput vector a; len x 1
[in]lenVector length
[out]cOutput vector c; len x 1

Definition at line 613 of file saf_utility_veclib.c.

◆ utility_zvvsub()

void utility_zvvsub ( const double_complex * a,
const double_complex * b,
const int len,
double_complex * c )

Double-precision, complex, vector-vector subtraction, i.e.

c = a-b
Parameters
[in]aInput vector a; len x 1
[in]bInput vector b; len x 1
[in]lenVector length
[out]cOutput vector c; len x 1

Definition at line 1001 of file saf_utility_veclib.c.

◆ yawPitchRoll2Rzyx()

void yawPitchRoll2Rzyx ( float yaw,
float pitch,
float roll,
int rollPitchYawFLAG,
float R[3][3] )

Constructs a 3x3 rotation matrix from the Euler angles, using the yaw-pitch-roll (zyx) convention.

Note
DEPRICATED. This function now just calls: euler2rotationMatrix()
Parameters
[in]yawYaw angle in radians
[in]pitchPitch angle in radians
[in]rollRoll angle in radians
[in]rollPitchYawFLAG'1' to use Rxyz, i.e. apply roll, pitch and then yaw, '0' Rzyx / y-p-r
[out]Rzyx rotation matrix; 3 x 3

Definition at line 257 of file saf_utility_geometry.c.

Variable Documentation

◆ __10pX_dirs_deg

const float __10pX_dirs_deg[10][2]
extern

Loudspeaker directions [azimuth, Elevation] in degrees, for a 10.x setup.

Definition at line 81 of file saf_utility_loudspeaker_presets.c.

◆ __11pX_7_4_dirs_deg

const float __11pX_7_4_dirs_deg[11][2]
extern

Loudspeaker directions [azimuth, Elevation] in degrees, for a 7.4.x setup.

Definition at line 108 of file saf_utility_loudspeaker_presets.c.

◆ __11pX_dirs_deg

const float __11pX_dirs_deg[11][2]
extern

Loudspeaker directions [azimuth, Elevation] in degrees, for a 11.x setup.

Definition at line 94 of file saf_utility_loudspeaker_presets.c.

◆ __13pX_dirs_deg

const float __13pX_dirs_deg[13][2]
extern

Loudspeaker directions [azimuth, Elevation] in degrees, for a 13.x setup.

Definition at line 122 of file saf_utility_loudspeaker_presets.c.

◆ __22pX_dirs_deg

const float __22pX_dirs_deg[22][2]
extern

Loudspeaker directions [azimuth, Elevation] in degrees, for a 22.x setup.

Definition at line 138 of file saf_utility_loudspeaker_presets.c.

◆ __5pX_dirs_deg

const float __5pX_dirs_deg[5][2]
extern

Loudspeaker directions [azimuth, Elevation] in degrees, for a 5.x setup.

Definition at line 40 of file saf_utility_loudspeaker_presets.c.

◆ __7pX_dirs_deg

const float __7pX_dirs_deg[7][2]
extern

Loudspeaker directions [azimuth, Elevation] in degrees, for a 7.x setup.

Definition at line 48 of file saf_utility_loudspeaker_presets.c.

◆ __8pX_dirs_deg

const float __8pX_dirs_deg[8][2]
extern

Loudspeaker directions [azimuth, Elevation] in degrees, for a 8.x setup.

Definition at line 58 of file saf_utility_loudspeaker_presets.c.

◆ __9_10_3p2_dirs_deg

const float __9_10_3p2_dirs_deg[24][2]
extern

Loudspeaker directions [azimuth, Elevation] in degrees, for a 9+10+3.2 setup BS 2051 recommedation: https://www.itu.int/rec/R-REC-BS.2051/en.

Definition at line 163 of file saf_utility_loudspeaker_presets.c.

◆ __9pX_dirs_deg

const float __9pX_dirs_deg[9][2]
extern

Loudspeaker directions [azimuth, Elevation] in degrees, for a 9.x setup.

Definition at line 69 of file saf_utility_loudspeaker_presets.c.

◆ __Aalto_Apaja_dirs_deg

const float __Aalto_Apaja_dirs_deg[29][2]
extern

Loudspeaker directions [azimuth, Elevation] in degrees, for the audio-visual listening room (Apaja), at Aalto University.

Definition at line 277 of file saf_utility_loudspeaker_presets.c.

◆ __Aalto_Hydrophone_coords_rad

const float __Aalto_Hydrophone_coords_rad[4][2]
extern

Sensor array coordinates for the custom hydrophone array made at Aalto University [1].

See also
[1] Delikaris-Manias, S., McCormack, L., Huhtakallio, I., & Pulkki, V. (2018, May). Real-time underwater spatial audio: a feasibility study. In Audio Engineering Society Convention 144. Audio Engineering Society.

Definition at line 33 of file saf_utility_sensorarray_presets.c.

◆ __Aalto_Hydrophone_maxOrder

const int __Aalto_Hydrophone_maxOrder
extern

Max spherical harmonic order for the custom hydrophone array made at Aalto University.

Definition at line 455 of file saf_utility_sensorarray_presets.c.

◆ __Aalto_LR_dirs_deg

const float __Aalto_LR_dirs_deg[13][2]
extern

Loudspeaker directions [azimuth, Elevation] in degrees, for the ITU standard listening room (LR), at Aalto University.

Definition at line 309 of file saf_utility_loudspeaker_presets.c.

◆ __Aalto_MCC_dirs_deg

const float __Aalto_MCC_dirs_deg[45][2]
extern

Loudspeaker directions [azimuth, Elevation] in degrees, for the multi-channel anechoic chamber (MCC), at Aalto University.

Definition at line 190 of file saf_utility_loudspeaker_presets.c.

◆ __Aalto_MCCsubset_dirs_deg

const float __Aalto_MCCsubset_dirs_deg[37][2]
extern

Loudspeaker directions [azimuth, Elevation] in degrees, for the multi-channel anechoic chamber (MCC) sub-set, at Aalto University.

Definition at line 237 of file saf_utility_loudspeaker_presets.c.

◆ __Core_Sound_TetraMic_coords_rad

const float __Core_Sound_TetraMic_coords_rad[4][2]
extern

Sensor array coordinates for the Core Sound TetraMic.

Definition at line 45 of file saf_utility_sensorarray_presets.c.

◆ __Core_Sound_TetraMic_maxOrder

const int __Core_Sound_TetraMic_maxOrder
extern

Max spherical harmonic order for the Core Sound TetraMic.

Definition at line 457 of file saf_utility_sensorarray_presets.c.

◆ __default_LScoords128_deg

const float __default_LScoords128_deg[128][2]
extern

Default Loudspeaker directions [azimuth, Elevation] - to replace above!

Definition at line 483 of file saf_utility_loudspeaker_presets.c.

◆ __default_LScoords64_rad

const float __default_LScoords64_rad[64][2]
extern

Default Loudspeaker directions [azimuth, Elevation] in RADIANS!

Definition at line 417 of file saf_utility_loudspeaker_presets.c.

◆ __default_SENSORcoords128_deg

const float __default_SENSORcoords128_deg[128][2]
extern

Default sensor array coordinates.

Definition at line 325 of file saf_utility_sensorarray_presets.c.

◆ __default_SENSORcoords64_rad

const float __default_SENSORcoords64_rad[64][2]
extern

Default sensor array coordinates.

Definition at line 259 of file saf_utility_sensorarray_presets.c.

◆ __DTU_AVIL_dirs_deg

const float __DTU_AVIL_dirs_deg[64][2]
extern

Loudspeaker directions [azimuth, Elevation] in degrees, for the Audio Visual Immersion Lab (AVIL), at the Technical University of Denmark (DTU)

Definition at line 325 of file saf_utility_loudspeaker_presets.c.

◆ __DTU_mic_coords_rad

const float __DTU_mic_coords_rad[52][2]
extern

Sensor array coordinates for the custom 52-sensor array built at the Technical University of Denmark (DTU) [1].

See also
[1] Marschall, M., 2014. Capturing and reproducing realistic acoustic scenes for hearing research (Doctoral dissertation, Technical University of Denmark, Department of Electrical Engineering).

Definition at line 133 of file saf_utility_sensorarray_presets.c.

◆ __DTU_mic_freqRange

const float __DTU_mic_freqRange[10]
extern

Sensor array frequency ranges for each SH order, for the DTU mic (should only be used as a rough estimate)

Definition at line 470 of file saf_utility_sensorarray_presets.c.

◆ __DTU_mic_maxOrder

const int __DTU_mic_maxOrder
extern

Max spherical harmonic order for the custom 52-sensor array built at the Technical University of Denmark (DTU)

Definition at line 462 of file saf_utility_sensorarray_presets.c.

◆ __Eigenmike32_coords_rad

const float __Eigenmike32_coords_rad[32][2]
extern

Sensor array coordinates for the Eigenmike32.

Definition at line 94 of file saf_utility_sensorarray_presets.c.

◆ __Eigenmike32_freqRange

const float __Eigenmike32_freqRange[6]
extern

Sensor array frequency ranges for each SH order, for the Eigenmike32 (should only be used as a rough estimate)

Definition at line 467 of file saf_utility_sensorarray_presets.c.

◆ __Eigenmike32_maxOrder

const int __Eigenmike32_maxOrder
extern

Max spherical harmonic order for the Eigenmike32.

Definition at line 460 of file saf_utility_sensorarray_presets.c.

◆ __Eigenmike64_coords_rad

const float __Eigenmike64_coords_rad[64][2]
extern

Sensor array coordinates for the Eigenmike64.

Definition at line 188 of file saf_utility_sensorarray_presets.c.

◆ __Eigenmike64_maxOrder

const int __Eigenmike64_maxOrder
extern

Max spherical harmonic order for the Eigenmike64.

Definition at line 461 of file saf_utility_sensorarray_presets.c.

◆ __geosphere_ico_0_0_dirs_deg

const float __geosphere_ico_0_0_dirs_deg[12][2]
extern

Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 0.

See also
3LD - Library for Loudspeaker Layout Design; release 2, 2006/03/15 Copyright (c) 2006 Florian Hollerweger (floholl_AT_sbox.tugraz.at) and (c) 2002 Darren Weber.

Definition at line 32259 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_0_0_nPoints

const int __geosphere_ico_0_0_nPoints
extern

Number of directions in a ico geosphere of degree: 0.

Definition at line 32258 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_10_0_dirs_deg

const float __geosphere_ico_10_0_dirs_deg[1002][2]
extern

Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 10.

Definition at line 35199 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_10_0_nPoints

const int __geosphere_ico_10_0_nPoints
extern

Number of directions in a ico geosphere of degree: 10.

Definition at line 35198 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_11_0_dirs_deg

const float __geosphere_ico_11_0_dirs_deg[1212][2]
extern

Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 11.

Definition at line 36205 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_11_0_nPoints

const int __geosphere_ico_11_0_nPoints
extern

Number of directions in a ico geosphere of degree: 11.

Definition at line 36204 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_12_0_dirs_deg

const float __geosphere_ico_12_0_dirs_deg[1442][2]
extern

Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 12.

Definition at line 37421 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_12_0_nPoints

const int __geosphere_ico_12_0_nPoints
extern

Number of directions in a ico geosphere of degree: 12.

Definition at line 37420 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_13_0_dirs_deg

const float __geosphere_ico_13_0_dirs_deg[1692][2]
extern

Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 13.

Definition at line 38867 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_13_0_nPoints

const int __geosphere_ico_13_0_nPoints
extern

Number of directions in a ico geosphere of degree: 13.

Definition at line 38866 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_14_0_dirs_deg

const float __geosphere_ico_14_0_dirs_deg[1962][2]
extern

Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 14.

Definition at line 40563 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_14_0_nPoints

const int __geosphere_ico_14_0_nPoints
extern

Number of directions in a ico geosphere of degree: 14.

Definition at line 40562 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_15_0_dirs_deg

const float __geosphere_ico_15_0_dirs_deg[2252][2]
extern

Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 15.

Definition at line 42529 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_15_0_nPoints

const int __geosphere_ico_15_0_nPoints
extern

Number of directions in a ico geosphere of degree: 15.

Definition at line 42528 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_16_0_dirs_deg

const float __geosphere_ico_16_0_dirs_deg[2562][2]
extern

Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 16.

Definition at line 44785 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_16_0_nPoints

const int __geosphere_ico_16_0_nPoints
extern

Number of directions in a ico geosphere of degree: 16.

Definition at line 44784 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_1_0_dirs_deg

const float __geosphere_ico_1_0_dirs_deg[32][2]
extern

Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 1.

Definition at line 32275 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_1_0_nPoints

const int __geosphere_ico_1_0_nPoints
extern

Number of directions in a ico geosphere of degree: 1.

Definition at line 32274 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_2_0_dirs_deg

const float __geosphere_ico_2_0_dirs_deg[42][2]
extern

Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 2.

Definition at line 32311 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_2_0_nPoints

const int __geosphere_ico_2_0_nPoints
extern

Number of directions in a ico geosphere of degree: 2.

Definition at line 32310 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_3_0_dirs_deg

const float __geosphere_ico_3_0_dirs_deg[92][2]
extern

Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 3.

Definition at line 32357 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_3_0_nPoints

const int __geosphere_ico_3_0_nPoints
extern

Number of directions in a ico geosphere of degree: 3.

Definition at line 32356 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_4_0_dirs_deg

const float __geosphere_ico_4_0_dirs_deg[162][2]
extern

Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 4.

Definition at line 32453 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_4_0_nPoints

const int __geosphere_ico_4_0_nPoints
extern

Number of directions in a ico geosphere of degree: 4.

Definition at line 32452 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_5_0_dirs_deg

const float __geosphere_ico_5_0_dirs_deg[252][2]
extern

Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 5.

Definition at line 32619 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_5_0_nPoints

const int __geosphere_ico_5_0_nPoints
extern

Number of directions in a ico geosphere of degree: 5.

Definition at line 32618 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_6_0_dirs_deg

const float __geosphere_ico_6_0_dirs_deg[362][2]
extern

Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 6.

Definition at line 32875 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_6_0_nPoints

const int __geosphere_ico_6_0_nPoints
extern

Number of directions in a ico geosphere of degree: 6.

Definition at line 32874 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_7_0_dirs_deg

const float __geosphere_ico_7_0_dirs_deg[492][2]
extern

Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 7.

Definition at line 33241 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_7_0_nPoints

const int __geosphere_ico_7_0_nPoints
extern

Number of directions in a ico geosphere of degree: 7.

Definition at line 33240 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_8_0_dirs_deg

const float __geosphere_ico_8_0_dirs_deg[642][2]
extern

Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 8.

Definition at line 33737 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_8_0_nPoints

const int __geosphere_ico_8_0_nPoints
extern

Number of directions in a ico geosphere of degree: 8.

Definition at line 33736 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_9_0_dirs_deg

const float __geosphere_ico_9_0_dirs_deg[812][2]
extern

Directions [azimuth, Elevation] in degrees, for ico geosphere, degree: 9.

Definition at line 34383 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_9_0_nPoints

const int __geosphere_ico_9_0_nPoints
extern

Number of directions in a ico geosphere of degree: 9.

Definition at line 34382 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_ico_nPoints

const int __geosphere_ico_nPoints[17]
extern

3LD geosphere number of points (freq = [0 0], [1 0],..., [16 0])

Access as, e.g.

const int degree = 10; // between 0..16
float* geo_dirs_degree_10 = __HANDLES_geosphere_ico_dirs_deg[degree];
int num_dirs_degree_10 = __geosphere_ico_nPoints[degree];
const int __geosphere_ico_nPoints[17]
3LD geosphere number of points (freq = [0 0], [1 0],..., [16 0])
const float * __HANDLES_geosphere_ico_dirs_deg[17]
3LD geosphere HANDLES (freq = [0 0], [1 0],..., [16 0])

Definition at line 53488 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_0_0_dirs_deg

const float __geosphere_oct_0_0_dirs_deg[6][2]
extern

Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 0.

See also
3LD - Library for Loudspeaker Layout Design; release 2, 2006/03/15 Copyright (c) 2006 Florian Hollerweger (floholl_AT_sbox.tugraz.at) and (c) 2002 Darren Weber.

Definition at line 47351 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_0_0_nPoints

const int __geosphere_oct_0_0_nPoints
extern

Number of directions in a oct geosphere of degree: 0.

Definition at line 47350 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_10_0_dirs_deg

const float __geosphere_oct_10_0_dirs_deg[402][2]
extern

Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 10.

Definition at line 48563 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_10_0_nPoints

const int __geosphere_oct_10_0_nPoints
extern

Number of directions in a oct geosphere of degree: 10.

Definition at line 48562 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_11_0_dirs_deg

const float __geosphere_oct_11_0_dirs_deg[486][2]
extern

Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 11.

Definition at line 48969 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_11_0_nPoints

const int __geosphere_oct_11_0_nPoints
extern

Number of directions in a oct geosphere of degree: 11.

Definition at line 48968 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_12_0_dirs_deg

const float __geosphere_oct_12_0_dirs_deg[578][2]
extern

Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 12.

Definition at line 49459 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_12_0_nPoints

const int __geosphere_oct_12_0_nPoints
extern

Number of directions in a oct geosphere of degree: 12.

Definition at line 49458 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_13_0_dirs_deg

const float __geosphere_oct_13_0_dirs_deg[678][2]
extern

Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 13.

Definition at line 50041 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_13_0_nPoints

const int __geosphere_oct_13_0_nPoints
extern

Number of directions in a oct geosphere of degree: 13.

Definition at line 50040 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_14_0_dirs_deg

const float __geosphere_oct_14_0_dirs_deg[786][2]
extern

Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 14.

Definition at line 50723 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_14_0_nPoints

const int __geosphere_oct_14_0_nPoints
extern

Number of directions in a oct geosphere of degree: 14.

Definition at line 50722 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_15_0_dirs_deg

const float __geosphere_oct_15_0_dirs_deg[902][2]
extern

Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 15.

Definition at line 51513 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_15_0_nPoints

const int __geosphere_oct_15_0_nPoints
extern

Number of directions in a oct geosphere of degree: 15.

Definition at line 51512 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_16_0_dirs_deg

const float __geosphere_oct_16_0_dirs_deg[1026][2]
extern

Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 16.

Definition at line 52419 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_16_0_nPoints

const int __geosphere_oct_16_0_nPoints
extern

Number of directions in a oct geosphere of degree: 16.

Definition at line 52418 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_1_0_dirs_deg

const float __geosphere_oct_1_0_dirs_deg[14][2]
extern

Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 1.

Definition at line 47361 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_1_0_nPoints

const int __geosphere_oct_1_0_nPoints
extern

Number of directions in a oct geosphere of degree: 1.

Definition at line 47360 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_2_0_dirs_deg

const float __geosphere_oct_2_0_dirs_deg[18][2]
extern

Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 2.

Definition at line 47379 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_2_0_nPoints

const int __geosphere_oct_2_0_nPoints
extern

Number of directions in a oct geosphere of degree: 2.

Definition at line 47378 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_3_0_dirs_deg

const float __geosphere_oct_3_0_dirs_deg[38][2]
extern

Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 3.

Definition at line 47401 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_3_0_nPoints

const int __geosphere_oct_3_0_nPoints
extern

Number of directions in a oct geosphere of degree: 3.

Definition at line 47400 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_4_0_dirs_deg

const float __geosphere_oct_4_0_dirs_deg[66][2]
extern

Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 4.

Definition at line 47443 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_4_0_nPoints

const int __geosphere_oct_4_0_nPoints
extern

Number of directions in a oct geosphere of degree: 4.

Definition at line 47442 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_5_0_dirs_deg

const float __geosphere_oct_5_0_dirs_deg[102][2]
extern

Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 5.

Definition at line 47513 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_5_0_nPoints

const int __geosphere_oct_5_0_nPoints
extern

Number of directions in a oct geosphere of degree: 5.

Definition at line 47512 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_6_0_dirs_deg

const float __geosphere_oct_6_0_dirs_deg[146][2]
extern

Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 6.

Definition at line 47619 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_6_0_nPoints

const int __geosphere_oct_6_0_nPoints
extern

Number of directions in a oct geosphere of degree: 6.

Definition at line 47618 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_7_0_dirs_deg

const float __geosphere_oct_7_0_dirs_deg[198][2]
extern

Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 7.

Definition at line 47769 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_7_0_nPoints

const int __geosphere_oct_7_0_nPoints
extern

Number of directions in a oct geosphere of degree: 7.

Definition at line 47768 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_8_0_dirs_deg

const float __geosphere_oct_8_0_dirs_deg[258][2]
extern

Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 8.

Definition at line 47971 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_8_0_nPoints

const int __geosphere_oct_8_0_nPoints
extern

Number of directions in a oct geosphere of degree: 8.

Definition at line 47970 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_9_0_dirs_deg

const float __geosphere_oct_9_0_dirs_deg[326][2]
extern

Directions [azimuth, Elevation] in degrees, for oct geosphere, degree: 9.

Definition at line 48233 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_9_0_nPoints

const int __geosphere_oct_9_0_nPoints
extern

Number of directions in a oct geosphere of degree: 9.

Definition at line 48232 of file saf_utility_loudspeaker_presets.c.

◆ __geosphere_oct_nPoints

const int __geosphere_oct_nPoints[17]
extern

3LD geosphere number of points (freq = [0 0], [1 0],..., [16 0])

Access as, e.g.

const int degree = 10; // between 0..16
float* geo_dirs_degree_10 = __HANDLES_geosphere_oct_dirs_deg[degree];
int num_dirs_degree_10 = __geosphere_oct_nPoints[degree];
const int __geosphere_oct_nPoints[17]
3LD geosphere number of points (freq = [0 0], [1 0],..., [16 0])
const float * __HANDLES_geosphere_oct_dirs_deg[17]
3LD geosphere HANDLES (freq = [0 0], [1 0],..., [16 0])

Definition at line 53492 of file saf_utility_loudspeaker_presets.c.

◆ __HANDLES_geosphere_ico_dirs_deg

const float* __HANDLES_geosphere_ico_dirs_deg[17]
extern

3LD geosphere HANDLES (freq = [0 0], [1 0],..., [16 0])

Access as, e.g.

const int degree = 10; // between 0..16
float* geo_dirs_degree_10 = __HANDLES_geosphere_ico_dirs_deg[degree];
int num_dirs_degree_10 = __geosphere_ico_nPoints[degree];

Definition at line 53448 of file saf_utility_loudspeaker_presets.c.

◆ __HANDLES_geosphere_oct_dirs_deg

const float* __HANDLES_geosphere_oct_dirs_deg[17]
extern

3LD geosphere HANDLES (freq = [0 0], [1 0],..., [16 0])

Access as, e.g.

const int degree = 10; // between 0..16
float* geo_dirs_degree_10 = __HANDLES_geosphere_oct_dirs_deg[degree];
int num_dirs_degree_10 = __geosphere_oct_nPoints[degree];

Definition at line 53468 of file saf_utility_loudspeaker_presets.c.

◆ __HANDLES_SphCovering_dirs_deg

const float* __HANDLES_SphCovering_dirs_deg[64]
extern

Sphere covering handles ( between 4..64 points only)

Access as, e.g.

const int numPoints = 44; // between 4..64 points
float* sphCov_dirs_deg = __HANDLES_SphCovering_dirs_deg [numPoints-1];
const float * __HANDLES_SphCovering_dirs_deg[64]
Sphere covering handles ( between 4..64 points only)

Definition at line 32191 of file saf_utility_loudspeaker_presets.c.

◆ __HANDLES_Tdesign_dirs_deg

const float* __HANDLES_Tdesign_dirs_deg[21]
extern

minimum T-design HANDLES (up to degree 21 only).

Access as, e.g.

const int tdesign_degree = 7;
float* tdesign_dirs_deg = __HANDLES_Tdesign_dirs_deg [tdesign_degree-1];
int num_Tdesign_dirs = __Tdesign_nPoints_per_degree [tdesign_degree-1];
const float * __HANDLES_Tdesign_dirs_deg[21]
minimum T-design HANDLES (up to degree 21 only).
const int __Tdesign_nPoints_per_degree[21]
Number of points in each t-design (up to degree 21 only).

Definition at line 29910 of file saf_utility_loudspeaker_presets.c.

◆ __lattice_coeffs_o10

const float __lattice_coeffs_o10[256][10]
extern

Lattice all-pass filter coeffs (numerator) for 256 channels, 10th order.

Definition at line 1607 of file saf_utility_latticeCoeffs.c.

◆ __lattice_coeffs_o12

const float __lattice_coeffs_o12[256][12]
extern

Lattice all-pass filter coeffs (numerator) for 256 channels, 12th order.

Definition at line 1348 of file saf_utility_latticeCoeffs.c.

◆ __lattice_coeffs_o14

const float __lattice_coeffs_o14[256][14]
extern

Lattice all-pass filter coeffs (numerator) for 256 channels, 14th order.

Definition at line 1089 of file saf_utility_latticeCoeffs.c.

◆ __lattice_coeffs_o15

const float __lattice_coeffs_o15[256][15]
extern

Lattice all-pass filter coeffs (numerator) for 256 channels, 15th order.

Definition at line 830 of file saf_utility_latticeCoeffs.c.

◆ __lattice_coeffs_o16

const float __lattice_coeffs_o16[256][16]
extern

Lattice all-pass filter coeffs (numerator) for 256 channels, 16th order.

Definition at line 571 of file saf_utility_latticeCoeffs.c.

◆ __lattice_coeffs_o18

const float __lattice_coeffs_o18[256][18]
extern

Lattice all-pass filter coeffs (numerator) for 256 channels, 18th order.

Definition at line 312 of file saf_utility_latticeCoeffs.c.

◆ __lattice_coeffs_o2

const float __lattice_coeffs_o2[256][2]
extern

Lattice all-pass filter coeffs (numerator) for 256 channels, 2nd order.

Definition at line 2902 of file saf_utility_latticeCoeffs.c.

◆ __lattice_coeffs_o20

const float __lattice_coeffs_o20[256][20]
extern

Lattice all-pass filter coeffs (numerator) for 256 channels, 20th order.

Definition at line 53 of file saf_utility_latticeCoeffs.c.

◆ __lattice_coeffs_o3

const float __lattice_coeffs_o3[256][3]
extern

Lattice all-pass filter coeffs (numerator) for 256 channels, 3rd order.

Definition at line 2643 of file saf_utility_latticeCoeffs.c.

◆ __lattice_coeffs_o4

const float __lattice_coeffs_o4[256][4]
extern

Lattice all-pass filter coeffs (numerator) for 256 channels, 4th order.

Definition at line 2384 of file saf_utility_latticeCoeffs.c.

◆ __lattice_coeffs_o6

const float __lattice_coeffs_o6[256][6]
extern

Lattice all-pass filter coeffs (numerator) for 256 channels, 6th order.

Definition at line 2125 of file saf_utility_latticeCoeffs.c.

◆ __lattice_coeffs_o8

const float __lattice_coeffs_o8[256][8]
extern

Lattice all-pass filter coeffs (numerator) for 256 channels, 8th order.

Definition at line 1866 of file saf_utility_latticeCoeffs.c.

◆ __mono_dirs_deg

const float __mono_dirs_deg[1][2]
extern

Loudspeaker directions [azimuth, Elevation] in degrees, for a mono setup.

Definition at line 31 of file saf_utility_loudspeaker_presets.c.

◆ __Sennheiser_Ambeo_coords_rad

const float __Sennheiser_Ambeo_coords_rad[4][2]
extern

Sensor array coordinates for the Sennheiser Ambeo.

Definition at line 39 of file saf_utility_sensorarray_presets.c.

◆ __Sennheiser_Ambeo_maxOrder

const int __Sennheiser_Ambeo_maxOrder
extern

Max spherical harmonic order for the Sennheiser Ambeo.

Definition at line 456 of file saf_utility_sensorarray_presets.c.

◆ __Sound_field_SPS200_coords_rad

const float __Sound_field_SPS200_coords_rad[4][2]
extern

Sensor array coordinates for the Sound-field SPS200.

Definition at line 57 of file saf_utility_sensorarray_presets.c.

◆ __Sound_field_SPS200_maxOrder

const int __Sound_field_SPS200_maxOrder
extern

Max spherical harmonic order for the Sound-field SPS200.

Definition at line 458 of file saf_utility_sensorarray_presets.c.

◆ __SphCovering_10_dirs_deg

const float __SphCovering_10_dirs_deg[10][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 10 dirs.

Definition at line 29991 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_11_dirs_deg

const float __SphCovering_11_dirs_deg[11][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 11 dirs.

Definition at line 30004 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_12_dirs_deg

const float __SphCovering_12_dirs_deg[12][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 12 dirs.

Definition at line 30018 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_13_dirs_deg

const float __SphCovering_13_dirs_deg[13][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 13 dirs.

Definition at line 30033 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_14_dirs_deg

const float __SphCovering_14_dirs_deg[14][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 14 dirs.

Definition at line 30049 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_15_dirs_deg

const float __SphCovering_15_dirs_deg[15][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 15 dirs.

Definition at line 30066 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_16_dirs_deg

const float __SphCovering_16_dirs_deg[16][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 16 dirs.

Definition at line 30084 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_17_dirs_deg

const float __SphCovering_17_dirs_deg[17][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 17 dirs.

Definition at line 30103 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_18_dirs_deg

const float __SphCovering_18_dirs_deg[18][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 18 dirs.

Definition at line 30123 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_19_dirs_deg

const float __SphCovering_19_dirs_deg[19][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 19 dirs.

Definition at line 30144 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_20_dirs_deg

const float __SphCovering_20_dirs_deg[20][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 20 dirs.

Definition at line 30166 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_21_dirs_deg

const float __SphCovering_21_dirs_deg[21][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 21 dirs.

Definition at line 30189 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_22_dirs_deg

const float __SphCovering_22_dirs_deg[22][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 22 dirs.

Definition at line 30213 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_23_dirs_deg

const float __SphCovering_23_dirs_deg[23][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 23 dirs.

Definition at line 30238 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_24_dirs_deg

const float __SphCovering_24_dirs_deg[24][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 24 dirs.

Definition at line 30264 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_25_dirs_deg

const float __SphCovering_25_dirs_deg[25][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 25 dirs.

Definition at line 30291 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_26_dirs_deg

const float __SphCovering_26_dirs_deg[26][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 26 dirs.

Definition at line 30319 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_27_dirs_deg

const float __SphCovering_27_dirs_deg[27][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 27 dirs.

Definition at line 30348 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_28_dirs_deg

const float __SphCovering_28_dirs_deg[28][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 28 dirs.

Definition at line 30378 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_29_dirs_deg

const float __SphCovering_29_dirs_deg[29][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 29 dirs.

Definition at line 30409 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_30_dirs_deg

const float __SphCovering_30_dirs_deg[30][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 30 dirs.

Definition at line 30441 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_31_dirs_deg

const float __SphCovering_31_dirs_deg[31][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 31 dirs.

Definition at line 30474 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_32_dirs_deg

const float __SphCovering_32_dirs_deg[32][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 32 dirs.

Definition at line 30508 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_33_dirs_deg

const float __SphCovering_33_dirs_deg[33][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 33 dirs.

Definition at line 30543 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_34_dirs_deg

const float __SphCovering_34_dirs_deg[34][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 34 dirs.

Definition at line 30579 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_35_dirs_deg

const float __SphCovering_35_dirs_deg[35][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 35 dirs.

Definition at line 30616 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_36_dirs_deg

const float __SphCovering_36_dirs_deg[36][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 36 dirs.

Definition at line 30654 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_37_dirs_deg

const float __SphCovering_37_dirs_deg[37][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 37 dirs.

Definition at line 30693 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_38_dirs_deg

const float __SphCovering_38_dirs_deg[38][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 38 dirs.

Definition at line 30733 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_39_dirs_deg

const float __SphCovering_39_dirs_deg[39][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 39 dirs.

Definition at line 30774 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_40_dirs_deg

const float __SphCovering_40_dirs_deg[40][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 40 dirs.

Definition at line 30816 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_41_dirs_deg

const float __SphCovering_41_dirs_deg[41][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 41 dirs.

Definition at line 30859 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_42_dirs_deg

const float __SphCovering_42_dirs_deg[42][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 42 dirs.

Definition at line 30903 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_43_dirs_deg

const float __SphCovering_43_dirs_deg[43][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 43 dirs.

Definition at line 30948 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_44_dirs_deg

const float __SphCovering_44_dirs_deg[44][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 44 dirs.

Definition at line 30994 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_45_dirs_deg

const float __SphCovering_45_dirs_deg[45][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 45 dirs.

Definition at line 31041 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_46_dirs_deg

const float __SphCovering_46_dirs_deg[46][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 46 dirs.

Definition at line 31089 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_47_dirs_deg

const float __SphCovering_47_dirs_deg[47][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 47 dirs.

Definition at line 31138 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_48_dirs_deg

const float __SphCovering_48_dirs_deg[48][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 48 dirs.

Definition at line 31188 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_49_dirs_deg

const float __SphCovering_49_dirs_deg[49][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 49 dirs.

Definition at line 31239 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_4_dirs_deg

const float __SphCovering_4_dirs_deg[4][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 4 dirs.

See also
Belger, M. (1989). JH Conway, NJA Sloane. Sphere packings, lattices and groups. Springer Verlag New York–Berlin–Heidelberg–London–Paris Tokyo 1988, 663 pages, 112 illustrations, DM 178.00, ISBN 0–387–96617 –X. Crystal Research and Technology, 24(1), 90–90.

Definition at line 29934 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_50_dirs_deg

const float __SphCovering_50_dirs_deg[50][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 50 dirs.

Definition at line 31291 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_51_dirs_deg

const float __SphCovering_51_dirs_deg[51][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 51 dirs.

Definition at line 31344 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_52_dirs_deg

const float __SphCovering_52_dirs_deg[52][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 52 dirs.

Definition at line 31398 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_53_dirs_deg

const float __SphCovering_53_dirs_deg[53][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 53 dirs.

Definition at line 31453 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_54_dirs_deg

const float __SphCovering_54_dirs_deg[54][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 54 dirs.

Definition at line 31509 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_55_dirs_deg

const float __SphCovering_55_dirs_deg[55][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 55 dirs.

Definition at line 31566 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_56_dirs_deg

const float __SphCovering_56_dirs_deg[56][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 56 dirs.

Definition at line 31624 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_57_dirs_deg

const float __SphCovering_57_dirs_deg[57][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 57 dirs.

Definition at line 31683 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_58_dirs_deg

const float __SphCovering_58_dirs_deg[58][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 58 dirs.

Definition at line 31743 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_59_dirs_deg

const float __SphCovering_59_dirs_deg[59][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 59 dirs.

Definition at line 31804 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_5_dirs_deg

const float __SphCovering_5_dirs_deg[5][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 5 dirs.

Definition at line 29941 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_60_dirs_deg

const float __SphCovering_60_dirs_deg[60][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 60 dirs.

Definition at line 31866 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_61_dirs_deg

const float __SphCovering_61_dirs_deg[61][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 61 dirs.

Definition at line 31929 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_62_dirs_deg

const float __SphCovering_62_dirs_deg[62][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 62 dirs.

Definition at line 31993 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_63_dirs_deg

const float __SphCovering_63_dirs_deg[63][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 63 dirs.

Definition at line 32058 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_64_dirs_deg

const float __SphCovering_64_dirs_deg[64][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 64 dirs.

Definition at line 32124 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_6_dirs_deg

const float __SphCovering_6_dirs_deg[6][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 6 dirs.

Definition at line 29949 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_7_dirs_deg

const float __SphCovering_7_dirs_deg[7][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 7 dirs.

Definition at line 29958 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_8_dirs_deg

const float __SphCovering_8_dirs_deg[8][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 8 dirs.

Definition at line 29968 of file saf_utility_loudspeaker_presets.c.

◆ __SphCovering_9_dirs_deg

const float __SphCovering_9_dirs_deg[9][2]
extern

Directions [azimuth, Elevation] in degrees, for sphere covering: 9 dirs.

Definition at line 29979 of file saf_utility_loudspeaker_presets.c.

◆ __stereo_dirs_deg

const float __stereo_dirs_deg[2][2]
extern

Loudspeaker directions [azimuth, Elevation] in degrees, for a stereo setup.

Definition at line 35 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_100_dirs_deg

const float __Tdesign_degree_100_dirs_deg[5100][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 100.

Definition at line 16987 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_100_nPoints

const int __Tdesign_degree_100_nPoints
extern

Number of directions in a minimum Tdesign of degree: 100.

Definition at line 16986 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_10_dirs_deg

const float __Tdesign_degree_10_dirs_deg[60][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 10.

Definition at line 819 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_10_nPoints

const int __Tdesign_degree_10_nPoints
extern

Number of directions in a minimum Tdesign of degree: 10.

Definition at line 818 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_11_dirs_deg

const float __Tdesign_degree_11_dirs_deg[70][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 11.

Definition at line 883 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_11_nPoints

const int __Tdesign_degree_11_nPoints
extern

Number of directions in a minimum Tdesign of degree: 11.

Definition at line 882 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_124_dirs_deg

const float __Tdesign_degree_124_dirs_deg[7812][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 124.

Definition at line 22090 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_124_nPoints

const int __Tdesign_degree_124_nPoints
extern

Number of directions in a minimum Tdesign of degree: 124.

Definition at line 22089 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_12_dirs_deg

const float __Tdesign_degree_12_dirs_deg[84][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 12.

Definition at line 957 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_12_nPoints

const int __Tdesign_degree_12_nPoints
extern

Number of directions in a minimum Tdesign of degree: 12.

Definition at line 956 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_13_dirs_deg

const float __Tdesign_degree_13_dirs_deg[94][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 13.

Definition at line 1045 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_13_nPoints

const int __Tdesign_degree_13_nPoints
extern

Number of directions in a minimum Tdesign of degree: 13.

Definition at line 1044 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_14_dirs_deg

const float __Tdesign_degree_14_dirs_deg[108][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 14.

Definition at line 1143 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_14_nPoints

const int __Tdesign_degree_14_nPoints
extern

Number of directions in a minimum Tdesign of degree: 14.

Definition at line 1142 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_15_dirs_deg

const float __Tdesign_degree_15_dirs_deg[120][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 15.

Definition at line 1255 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_15_nPoints

const int __Tdesign_degree_15_nPoints
extern

Number of directions in a minimum Tdesign of degree: 15.

Definition at line 1254 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_16_dirs_deg

const float __Tdesign_degree_16_dirs_deg[144][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 16.

Definition at line 1379 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_16_nPoints

const int __Tdesign_degree_16_nPoints
extern

Number of directions in a minimum Tdesign of degree: 16.

Definition at line 1378 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_17_dirs_deg

const float __Tdesign_degree_17_dirs_deg[156][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 17.

Definition at line 1527 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_17_nPoints

const int __Tdesign_degree_17_nPoints
extern

Number of directions in a minimum Tdesign of degree: 17.

Definition at line 1526 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_18_dirs_deg

const float __Tdesign_degree_18_dirs_deg[180][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 18.

Definition at line 1687 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_18_nPoints

const int __Tdesign_degree_18_nPoints
extern

Number of directions in a minimum Tdesign of degree: 18.

Definition at line 1686 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_19_dirs_deg

const float __Tdesign_degree_19_dirs_deg[204][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 19.

Definition at line 1871 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_19_nPoints

const int __Tdesign_degree_19_nPoints
extern

Number of directions in a minimum Tdesign of degree: 19.

Definition at line 1870 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_1_dirs_deg

const float __Tdesign_degree_1_dirs_deg[2][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 1.

See also
McLaren's Improved Snub Cube and Other New Spherical Designs in Three Dimensions", R. H. Hardin and N. J. A. Sloane, Discrete and Computational Geometry, 15 (1996), pp. 429-441.

Definition at line 615 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_1_nPoints

const int __Tdesign_degree_1_nPoints
extern

Number of directions in a minimum Tdesign of degree: 1.

Definition at line 614 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_20_dirs_deg

const float __Tdesign_degree_20_dirs_deg[216][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 20.

Definition at line 2079 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_20_nPoints

const int __Tdesign_degree_20_nPoints
extern

Number of directions in a minimum Tdesign of degree: 20.

Definition at line 2078 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_21_dirs_deg

const float __Tdesign_degree_21_dirs_deg[240][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 21.

Definition at line 2299 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_21_nPoints

const int __Tdesign_degree_21_nPoints
extern

Number of directions in a minimum Tdesign of degree: 21.

Definition at line 2298 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_2_dirs_deg

const float __Tdesign_degree_2_dirs_deg[4][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 2.

Definition at line 621 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_2_nPoints

const int __Tdesign_degree_2_nPoints
extern

Number of directions in a minimum Tdesign of degree: 2.

Definition at line 620 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_30_dirs_deg

const float __Tdesign_degree_30_dirs_deg[480][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 30.

See also
Gra"f, M., & Potts, D. (2011). On the computation of spherical designs by a new optimization approach based on fast spherical Fourier transforms. Numerische Mathematik, 119(4), 699-724. Taken from: github.com/chris-hld/spaudiopy/blob/master/spaudiopy/n_designs_1_124.mat

Definition at line 2543 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_30_nPoints

const int __Tdesign_degree_30_nPoints
extern

Number of directions in a minimum Tdesign of degree: 30.

Definition at line 2542 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_3_dirs_deg

const float __Tdesign_degree_3_dirs_deg[6][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 3.

Definition at line 629 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_3_nPoints

const int __Tdesign_degree_3_nPoints
extern

Number of directions in a minimum Tdesign of degree: 3.

Definition at line 628 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_40_dirs_deg

const float __Tdesign_degree_40_dirs_deg[840][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 40.

Definition at line 3027 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_40_nPoints

const int __Tdesign_degree_40_nPoints
extern

Number of directions in a minimum Tdesign of degree: 40.

Definition at line 3026 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_4_dirs_deg

const float __Tdesign_degree_4_dirs_deg[12][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 4.

Definition at line 639 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_4_nPoints

const int __Tdesign_degree_4_nPoints
extern

Number of directions in a minimum Tdesign of degree: 4.

Definition at line 638 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_50_dirs_deg

const float __Tdesign_degree_50_dirs_deg[1296][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 50.

Definition at line 3871 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_50_nPoints

const int __Tdesign_degree_50_nPoints
extern

Number of directions in a minimum Tdesign of degree: 50.

Definition at line 3870 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_5_dirs_deg

const float __Tdesign_degree_5_dirs_deg[12][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 5.

Definition at line 655 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_5_nPoints

const int __Tdesign_degree_5_nPoints
extern

Number of directions in a minimum Tdesign of degree: 5.

Definition at line 654 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_60_dirs_deg

const float __Tdesign_degree_60_dirs_deg[1860][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 60.

Definition at line 5171 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_60_nPoints

const int __Tdesign_degree_60_nPoints
extern

Number of directions in a minimum Tdesign of degree: 60.

Definition at line 5170 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_6_dirs_deg

const float __Tdesign_degree_6_dirs_deg[24][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 6.

Definition at line 671 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_6_nPoints

const int __Tdesign_degree_6_nPoints
extern

Number of directions in a minimum Tdesign of degree: 6.

Definition at line 670 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_70_dirs_deg

const float __Tdesign_degree_70_dirs_deg[2520][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 70.

Definition at line 7036 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_70_nPoints

const int __Tdesign_degree_70_nPoints
extern

Number of directions in a minimum Tdesign of degree: 70.

Definition at line 7035 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_7_dirs_deg

const float __Tdesign_degree_7_dirs_deg[24][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 7.

Definition at line 699 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_7_nPoints

const int __Tdesign_degree_7_nPoints
extern

Number of directions in a minimum Tdesign of degree: 7.

Definition at line 698 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_80_dirs_deg

const float __Tdesign_degree_80_dirs_deg[3276][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 80.

Definition at line 9561 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_80_nPoints

const int __Tdesign_degree_80_nPoints
extern

Number of directions in a minimum Tdesign of degree: 80.

Definition at line 9560 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_8_dirs_deg

const float __Tdesign_degree_8_dirs_deg[36][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 8.

Definition at line 727 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_8_nPoints

const int __Tdesign_degree_8_nPoints
extern

Number of directions in a minimum Tdesign of degree: 8.

Definition at line 726 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_90_dirs_deg

const float __Tdesign_degree_90_dirs_deg[4140][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 90.

Definition at line 12842 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_90_nPoints

const int __Tdesign_degree_90_nPoints
extern

Number of directions in a minimum Tdesign of degree: 90.

Definition at line 12841 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_9_dirs_deg

const float __Tdesign_degree_9_dirs_deg[48][2]
extern

Directions [azimuth, Elevation] in degrees, for minimum Tdesign degree: 9.

Definition at line 767 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_degree_9_nPoints

const int __Tdesign_degree_9_nPoints
extern

Number of directions in a minimum Tdesign of degree: 9.

Definition at line 766 of file saf_utility_loudspeaker_presets.c.

◆ __Tdesign_nPoints_per_degree

const int __Tdesign_nPoints_per_degree[21]
extern

Number of points in each t-design (up to degree 21 only).

Access as, e.g.

const int tdesign_degree = 7;
float* tdesign_dirs_deg = __HANDLES_Tdesign_dirs_deg [tdesign_degree-1];
int num_Tdesign_dirs = __Tdesign_nPoints_per_degree [tdesign_degree-1];

Definition at line 29906 of file saf_utility_loudspeaker_presets.c.

◆ __Zoom_H3VR_coords_rad

const float __Zoom_H3VR_coords_rad[4][2]
extern

Sensor array coordinates for the Zoom H3VR.

Definition at line 51 of file saf_utility_sensorarray_presets.c.

◆ __Zylia1D_coords_rad

const float __Zylia1D_coords_rad[19][2]
extern

Sensor array coordinates for the Zylia mic.

Definition at line 68 of file saf_utility_sensorarray_presets.c.

◆ __Zylia_freqRange

const float __Zylia_freqRange[4]
extern

Sensor array frequency ranges for each SH order, for the Zylia array (should only be used as a rough estimate).

The upper frequency limits were selected as the point where the spatial correlation went <0.9. The lower frequency limits were selected as the point where the level difference exceeded 6dB (assuming a 15dB maximum amplification with the Tikhonov regularisation method for all mics).

For more information on determining the usable frequency range per spherical harmonic order, for a given microphone array, the reader is directed to [1].

See also
[1] Moreau, S., Daniel, J., & Bertet, S. (2006, May). 3D sound field recording with higher order ambisonics–objective measurements and validation of a 4th order spherical microphone. In 120th Convention of the AES (pp. 20-23).

Definition at line 464 of file saf_utility_sensorarray_presets.c.

◆ __Zylia_Lab_dirs_deg

const float __Zylia_Lab_dirs_deg[22][2]
extern

Loudspeaker directions [azimuth, Elevation] in degrees, for the 22.x setup, at Zylia Labs.

Definition at line 392 of file saf_utility_loudspeaker_presets.c.

◆ __Zylia_maxOrder

const int __Zylia_maxOrder
extern

Max spherical harmonic order for the Zylia mic.

Definition at line 459 of file saf_utility_sensorarray_presets.c.