TwiceAsNice
2019-02-18
|
Macros | |
#define | min(a, b) |
#define | max(a, b) |
#define | M_PI 3.14159265358979323846 |
#define | DLL_EXPORT extern |
Enumerations | |
enum | dspau_conversiontype { magnitude = 0, magnitude_dbv = 1, magnitude_rooted = 2, magnitude_squared = 3, phase_degrees = 4, phase_radians = 5 } |
Functions | |
DLL_EXPORT int | dspau_spectrum (double *in, double *out, int dims, int *sizes, int conversion) |
Create a spectrum from a double array of values. More... | |
DLL_EXPORT int | dspau_squarelawfilter (double *in, double *out, int len) |
A square law filter. More... | |
DLL_EXPORT int | dspau_lowpassfilter (double *in, double *out, int len, double samplingfrequency, double frequency, double q) |
A low pass filter. More... | |
DLL_EXPORT int | dspau_highpassfilter (double *in, double *out, int len, double samplingfrequency, double frequency, double q) |
A high pass filter. More... | |
DLL_EXPORT int | dspau_bandpassfilter (double *in, double *out, int len, double samplingfrequency, double frequency, double q) |
A band pass filter. More... | |
DLL_EXPORT int | dspau_bandrejectfilter (double *in, double *out, int len, double samplingfrequency, double frequency, double q) |
A band reject filter. More... | |
DLL_EXPORT int | dspau_autocorrelate (double *in, double *out, int *len) |
An auto-correlator. More... | |
double | dspau_crosscorrelate (double *in1, double *in2, double *out, int len1, int len2, int *len) |
A cross-correlator. More... | |
DLL_EXPORT int | dspau_bandpasscorrelate (double *in, double *out, int *len, int skip, double Q) |
A band-pass auto-correlator (Warning: high memory usage!) More... | |
double | dspau_minmidmax (double *in, int len, double *min, double *max) |
Gets minimum, mid, and maximum values of the input stream. More... | |
double | dspau_mean (double *in, int len) |
A mean calculator. More... | |
DLL_EXPORT int | dspau_removemean (double *in, double *out, int len) |
Subtract mean from stream. More... | |
DLL_EXPORT int | dspau_stretch (double *in, double *out, int len, double min, double max) |
Stretch minimum and maximum values of the input stream. More... | |
DLL_EXPORT int | dspau_normalize (double *in, double *out, int len, double min, double max) |
Normalize the input stream to the minimum and maximum values. More... | |
DLL_EXPORT int | dspau_sub (double *in1, double *in2, double *out, int len) |
Subtract elements of one stream from another's. More... | |
DLL_EXPORT int | dspau_sum (double *in1, double *in2, double *out, int len) |
Sum elements of one stream to another's. More... | |
DLL_EXPORT int | dspau_div (double *in1, double *in2, double *out, int len) |
Divide elements of one stream to another's. More... | |
DLL_EXPORT int | dspau_mul (double *in1, double *in2, double *out, int len) |
Multiply elements of one stream to another's. More... | |
DLL_EXPORT int | dspau_sub1 (double *in, double *out, int len, double val) |
Subtract a value from elements of the input stream. More... | |
DLL_EXPORT int | dspau_sum1 (double *in, double *out, int len, double val) |
Sum elements of the input stream to a value. More... | |
DLL_EXPORT int | dspau_div1 (double *in, double *out, int len, double val) |
Divide elements of the input stream to a value. More... | |
DLL_EXPORT int | dspau_mul1 (double *in, double *out, int len, double val) |
Multiply elements of the input stream to a value. More... | |
DLL_EXPORT int | dspau_median (double *in, double *out, int len, int size, int median) |
Median elements of the inut stream. More... | |
DLL_EXPORT int | dspau_u8todouble (unsigned char *in, double *out, int len) |
Convert an 8bit unsigned array into a double array. More... | |
DLL_EXPORT int | dspau_u16todouble (unsigned short int *in, double *out, int len) |
Convert a 16bit unsigned array into a double array. More... | |
DLL_EXPORT int | dspau_u32todouble (unsigned int *in, double *out, int len) |
Convert a 32bit unsigned array into a double array. More... | |
DLL_EXPORT int | dspau_u64todouble (unsigned long int *in, double *out, int len) |
Convert a 64bit unsigned array into a double array. More... | |
DLL_EXPORT int | dspau_s8todouble (signed char *in, double *out, int len) |
Convert an 8bit signed array into a double array. More... | |
DLL_EXPORT int | dspau_s16todouble (signed short int *in, double *out, int len) |
Convert a 16bit signed array into a double array. More... | |
DLL_EXPORT int | dspau_s32todouble (signed int *in, double *out, int len) |
Convert a 32bit signed array into a double array. More... | |
DLL_EXPORT int | dspau_s64todouble (signed long int *in, double *out, int len) |
Convert a 64bit signed array into a double array. More... | |
DLL_EXPORT int | dspau_doubletou8 (double *in, unsigned char *out, int len) |
Convert a double array into a 8bit unsigned array. More... | |
DLL_EXPORT int | dspau_doubletou16 (double *in, unsigned short int *out, int len) |
Convert a double array into a 16bit unsigned array. More... | |
DLL_EXPORT int | dspau_doubletou32 (double *in, unsigned int *out, int len) |
Convert a double array into a 32bit unsigned array. More... | |
DLL_EXPORT int | dspau_doubletou64 (double *in, unsigned long int *out, int len) |
Convert a double array into a 64bit unsigned array. More... | |
DLL_EXPORT int | dspau_doubletos8 (double *in, signed char *out, int len) |
Convert a double array into an 8bit signed array. More... | |
DLL_EXPORT int | dspau_doubletos16 (double *in, signed short int *out, int len) |
Convert a double array into a 16bit signed array. More... | |
DLL_EXPORT int | dspau_doubletos32 (double *in, signed int *out, int len) |
Convert a double array into a 32bit signed array. More... | |
DLL_EXPORT int | dspau_doubletos64 (double *in, signed long int *out, int len) |
Convert a double array into a 64bit signed array. More... | |
#define DLL_EXPORT extern |
#define M_PI 3.14159265358979323846 |
#define max | ( | a, | |
b | |||
) |
#define min | ( | a, | |
b | |||
) |
enum dspau_conversiontype |
DLL_EXPORT int dspau_autocorrelate | ( | double * | in, |
double * | out, | ||
int * | len | ||
) |
An auto-correlator.
in | the input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream (input/output). |
skip | skip n values at beginning (resulting len will be reduced). |
DLL_EXPORT int dspau_bandpasscorrelate | ( | double * | in, |
double * | out, | ||
int * | len, | ||
int | skip, | ||
double | Q | ||
) |
A band-pass auto-correlator (Warning: high memory usage!)
in | the input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. (input/output) |
skip | skip n values at beginning (resulting len will be reduced). |
Q | the slope of the band-pass filters. |
DLL_EXPORT int dspau_bandpassfilter | ( | double * | in, |
double * | out, | ||
int | len, | ||
double | samplingfrequency, | ||
double | frequency, | ||
double | q | ||
) |
A band pass filter.
in | the input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
samplingfrequency | the sampling frequency of the input stream. |
frequency | the center frequency of the filter. |
q | the cutoff slope. |
DLL_EXPORT int dspau_bandrejectfilter | ( | double * | in, |
double * | out, | ||
int | len, | ||
double | samplingfrequency, | ||
double | frequency, | ||
double | q | ||
) |
A band reject filter.
in | the input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
samplingfrequency | the sampling frequency of the input stream. |
frequency | the center frequency of the filter. |
q | the cutoff slope. |
double dspau_crosscorrelate | ( | double * | in1, |
double * | in2, | ||
double * | out, | ||
int | len1, | ||
int | len2, | ||
int * | len | ||
) |
A cross-correlator.
in1 | the first input stream. (input) |
in2 | the second input stream. (input) |
out | the output stream. (output) |
len1 | the length of the first input stream. (input) |
len2 | the length of the second input stream. (input) |
len | the length of the output stream. (output) |
DLL_EXPORT int dspau_div | ( | double * | in1, |
double * | in2, | ||
double * | out, | ||
int | len | ||
) |
Divide elements of one stream to another's.
in1 | the Numerators input stream. (input) |
in2 | the Denominators input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
DLL_EXPORT int dspau_div1 | ( | double * | in, |
double * | out, | ||
int | len, | ||
double | val | ||
) |
Divide elements of the input stream to a value.
in | the Numerators input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
val | the denominator. |
DLL_EXPORT int dspau_doubletos16 | ( | double * | in, |
signed short int * | out, | ||
int | len | ||
) |
Convert a double array into a 16bit signed array.
in | the input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
DLL_EXPORT int dspau_doubletos32 | ( | double * | in, |
signed int * | out, | ||
int | len | ||
) |
Convert a double array into a 32bit signed array.
in | the input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
DLL_EXPORT int dspau_doubletos64 | ( | double * | in, |
signed long int * | out, | ||
int | len | ||
) |
Convert a double array into a 64bit signed array.
in | the input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
DLL_EXPORT int dspau_doubletos8 | ( | double * | in, |
signed char * | out, | ||
int | len | ||
) |
Convert a double array into an 8bit signed array.
in | the input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
DLL_EXPORT int dspau_doubletou16 | ( | double * | in, |
unsigned short int * | out, | ||
int | len | ||
) |
Convert a double array into a 16bit unsigned array.
in | the input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
DLL_EXPORT int dspau_doubletou32 | ( | double * | in, |
unsigned int * | out, | ||
int | len | ||
) |
Convert a double array into a 32bit unsigned array.
in | the input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
DLL_EXPORT int dspau_doubletou64 | ( | double * | in, |
unsigned long int * | out, | ||
int | len | ||
) |
Convert a double array into a 64bit unsigned array.
in | the input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
DLL_EXPORT int dspau_doubletou8 | ( | double * | in, |
unsigned char * | out, | ||
int | len | ||
) |
Convert a double array into a 8bit unsigned array.
in | the input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
DLL_EXPORT int dspau_highpassfilter | ( | double * | in, |
double * | out, | ||
int | len, | ||
double | samplingfrequency, | ||
double | frequency, | ||
double | q | ||
) |
A high pass filter.
in | the input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
samplingfrequency | the sampling frequency of the input stream. |
frequency | the cutoff frequency of the filter. |
q | the cutoff slope. |
DLL_EXPORT int dspau_lowpassfilter | ( | double * | in, |
double * | out, | ||
int | len, | ||
double | samplingfrequency, | ||
double | frequency, | ||
double | q | ||
) |
A low pass filter.
in | the input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
samplingfrequency | the sampling frequency of the input stream. |
frequency | the cutoff frequency of the filter. |
q | the cutoff slope. |
double dspau_mean | ( | double * | in, |
int | len | ||
) |
A mean calculator.
in | the input stream. (input) |
len | the length of the input stream. |
DLL_EXPORT int dspau_median | ( | double * | in, |
double * | out, | ||
int | len, | ||
int | size, | ||
int | median | ||
) |
Median elements of the inut stream.
in | the input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
size | the length of the median. |
median | the location of the median value. |
double dspau_minmidmax | ( | double * | in, |
int | len, | ||
double * | min, | ||
double * | max | ||
) |
Gets minimum, mid, and maximum values of the input stream.
in | the input stream. (input) |
len | the length of the input stream. |
min | the minimum value (output). |
max | the maximum value (output). |
DLL_EXPORT int dspau_mul | ( | double * | in1, |
double * | in2, | ||
double * | out, | ||
int | len | ||
) |
Multiply elements of one stream to another's.
in1 | the first input stream. (input) |
in2 | the second input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
DLL_EXPORT int dspau_mul1 | ( | double * | in, |
double * | out, | ||
int | len, | ||
double | val | ||
) |
Multiply elements of the input stream to a value.
in | the first input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
val | the value used for this operation. |
DLL_EXPORT int dspau_normalize | ( | double * | in, |
double * | out, | ||
int | len, | ||
double | min, | ||
double | max | ||
) |
Normalize the input stream to the minimum and maximum values.
in | the input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
min | the clamping minimum value. |
max | the clamping maximum value. |
Return 0 if success. Return -1 if any error occurs.
DLL_EXPORT int dspau_removemean | ( | double * | in, |
double * | out, | ||
int | len | ||
) |
Subtract mean from stream.
in | the input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
DLL_EXPORT int dspau_s16todouble | ( | signed short int * | in, |
double * | out, | ||
int | len | ||
) |
Convert a 16bit signed array into a double array.
in | the input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
DLL_EXPORT int dspau_s32todouble | ( | signed int * | in, |
double * | out, | ||
int | len | ||
) |
Convert a 32bit signed array into a double array.
in | the input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
DLL_EXPORT int dspau_s64todouble | ( | signed long int * | in, |
double * | out, | ||
int | len | ||
) |
Convert a 64bit signed array into a double array.
in | the input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
DLL_EXPORT int dspau_s8todouble | ( | signed char * | in, |
double * | out, | ||
int | len | ||
) |
Convert an 8bit signed array into a double array.
in | the input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
DLL_EXPORT int dspau_spectrum | ( | double * | in, |
double * | out, | ||
int | dims, | ||
int * | sizes, | ||
int | conversion | ||
) |
Create a spectrum from a double array of values.
in | the input stream. (input) |
out | the output stream. (output) |
dims | the number of dimensions of the input stream (input). |
sizes | array with the lengths of each dimension of the input stream (input). |
conversion | the output magnitude dspau_conversiontype type. |
DLL_EXPORT int dspau_squarelawfilter | ( | double * | in, |
double * | out, | ||
int | len | ||
) |
A square law filter.
in | the input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
DLL_EXPORT int dspau_stretch | ( | double * | in, |
double * | out, | ||
int | len, | ||
double | min, | ||
double | max | ||
) |
Stretch minimum and maximum values of the input stream.
in | the input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
min | the desired minimum value. |
max | the desired maximum value. |
DLL_EXPORT int dspau_sub | ( | double * | in1, |
double * | in2, | ||
double * | out, | ||
int | len | ||
) |
Subtract elements of one stream from another's.
in1 | the input stream to be subtracted. (input) |
in2 | the input stream with subtraction values. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
DLL_EXPORT int dspau_sub1 | ( | double * | in, |
double * | out, | ||
int | len, | ||
double | val | ||
) |
Subtract a value from elements of the input stream.
in | the Numerators input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
val | the value to be subtracted. |
DLL_EXPORT int dspau_sum | ( | double * | in1, |
double * | in2, | ||
double * | out, | ||
int | len | ||
) |
Sum elements of one stream to another's.
in1 | the first input stream. (input) |
in2 | the second input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
DLL_EXPORT int dspau_sum1 | ( | double * | in, |
double * | out, | ||
int | len, | ||
double | val | ||
) |
Sum elements of the input stream to a value.
in | the first input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
val | the value used for this operation. |
DLL_EXPORT int dspau_u16todouble | ( | unsigned short int * | in, |
double * | out, | ||
int | len | ||
) |
Convert a 16bit unsigned array into a double array.
in | the input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
DLL_EXPORT int dspau_u32todouble | ( | unsigned int * | in, |
double * | out, | ||
int | len | ||
) |
Convert a 32bit unsigned array into a double array.
in | the input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
DLL_EXPORT int dspau_u64todouble | ( | unsigned long int * | in, |
double * | out, | ||
int | len | ||
) |
Convert a 64bit unsigned array into a double array.
in | the input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |
DLL_EXPORT int dspau_u8todouble | ( | unsigned char * | in, |
double * | out, | ||
int | len | ||
) |
Convert an 8bit unsigned array into a double array.
in | the input stream. (input) |
out | the output stream. (output) |
len | the length of the input stream. |