TwiceAsNice  2019-02-18
Functions
libdspau-buffer.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <float.h>
#include "libdspau.h"
Include dependency graph for libdspau-buffer.c:

Functions

int dspau_removemean (double *in, double *out, int len)
 Subtract mean from stream. More...
 
int dspau_stretch (double *in, double *out, int len, double min, double max)
 Stretch minimum and maximum values of the input stream. More...
 
int dspau_normalize (double *in, double *out, int len, double min, double max)
 Normalize the input stream to the minimum and maximum values. More...
 
int dspau_sub (double *in1, double *in2, double *out, int len)
 Subtract elements of one stream from another's. More...
 
int dspau_sum (double *in1, double *in2, double *out, int len)
 Sum elements of one stream to another's. More...
 
int dspau_div (double *in1, double *in2, double *out, int len)
 Divide elements of one stream to another's. More...
 
int dspau_mul (double *in1, double *in2, double *out, int len)
 Multiply elements of one stream to another's. More...
 
int dspau_sub1 (double *in, double *out, int len, double val)
 Subtract a value from elements of the input stream. More...
 
int dspau_sum1 (double *in, double *out, int len, double val)
 Sum elements of the input stream to a value. More...
 
int dspau_div1 (double *in, double *out, int len, double val)
 Divide elements of the input stream to a value. More...
 
int dspau_mul1 (double *in, double *out, int len, double val)
 Multiply elements of the input stream to a value. More...
 
static int compare (const void *a, const void *b)
 
int dspau_median (double *in, double *out, int len, int size, int median)
 Median elements of the inut stream. More...
 

Function Documentation

◆ compare()

static int compare ( const void *  a,
const void *  b 
)
static

◆ dspau_div()

int dspau_div ( double *  in1,
double *  in2,
double *  out,
int  len 
)

Divide elements of one stream to another's.

Parameters
in1the Numerators input stream. (input)
in2the Denominators input stream. (input)
outthe output stream. (output)
lenthe length of the input stream.
Returns
the output stream if successfull elaboration. NULL if an error is encountered. Return 0 if success. Return -1 if any error occurs.

◆ dspau_div1()

int dspau_div1 ( double *  in,
double *  out,
int  len,
double  val 
)

Divide elements of the input stream to a value.

Parameters
inthe Numerators input stream. (input)
outthe output stream. (output)
lenthe length of the input stream.
valthe denominator.
Returns
the output stream if successfull elaboration. NULL if an error is encountered. Return 0 if success. Return -1 if any error occurs.

◆ dspau_median()

int dspau_median ( double *  in,
double *  out,
int  len,
int  size,
int  median 
)

Median elements of the inut stream.

Parameters
inthe input stream. (input)
outthe output stream. (output)
lenthe length of the input stream.
sizethe length of the median.
medianthe location of the median value.
Returns
the output stream if successfull elaboration. NULL if an error is encountered. Return 0 if success. Return -1 if any error occurs.

◆ dspau_mul()

int dspau_mul ( double *  in1,
double *  in2,
double *  out,
int  len 
)

Multiply elements of one stream to another's.

Parameters
in1the first input stream. (input)
in2the second input stream. (input)
outthe output stream. (output)
lenthe length of the input stream.
Returns
the output stream if successfull elaboration. NULL if an error is encountered. Return 0 if success. Return -1 if any error occurs.

◆ dspau_mul1()

int dspau_mul1 ( double *  in,
double *  out,
int  len,
double  val 
)

Multiply elements of the input stream to a value.

Parameters
inthe first input stream. (input)
outthe output stream. (output)
lenthe length of the input stream.
valthe value used for this operation.
Returns
the output stream if successfull elaboration. NULL if an error is encountered. Return 0 if success. Return -1 if any error occurs.

◆ dspau_normalize()

int dspau_normalize ( double *  in,
double *  out,
int  len,
double  min,
double  max 
)

Normalize the input stream to the minimum and maximum values.

Parameters
inthe input stream. (input)
outthe output stream. (output)
lenthe length of the input stream.
minthe clamping minimum value.
maxthe clamping maximum value.
Returns
the output stream if successfull elaboration. NULL if an error is encountered.

Return 0 if success. Return -1 if any error occurs.

◆ dspau_removemean()

int dspau_removemean ( double *  in,
double *  out,
int  len 
)

Subtract mean from stream.

Parameters
inthe input stream. (input)
outthe output stream. (output)
lenthe length of the input stream.
Returns
the output stream if successfull elaboration. NULL if an error is encountered. Return 0 if success. Return -1 if any error occurs.

◆ dspau_stretch()

int dspau_stretch ( double *  in,
double *  out,
int  len,
double  min,
double  max 
)

Stretch minimum and maximum values of the input stream.

Parameters
inthe input stream. (input)
outthe output stream. (output)
lenthe length of the input stream.
minthe desired minimum value.
maxthe desired maximum value.
Returns
the output stream if successfull elaboration. NULL if an error is encountered. Return 0 if success. Return -1 if any error occurs.

◆ dspau_sub()

int dspau_sub ( double *  in1,
double *  in2,
double *  out,
int  len 
)

Subtract elements of one stream from another's.

Parameters
in1the input stream to be subtracted. (input)
in2the input stream with subtraction values. (input)
outthe output stream. (output)
lenthe length of the input stream.
Returns
the output stream if successfull elaboration. NULL if an error is encountered. Return 0 if success. Return -1 if any error occurs.

◆ dspau_sub1()

int dspau_sub1 ( double *  in,
double *  out,
int  len,
double  val 
)

Subtract a value from elements of the input stream.

Parameters
inthe Numerators input stream. (input)
outthe output stream. (output)
lenthe length of the input stream.
valthe value to be subtracted.
Returns
the output stream if successfull elaboration. NULL if an error is encountered. Return 0 if success. Return -1 if any error occurs.

◆ dspau_sum()

int dspau_sum ( double *  in1,
double *  in2,
double *  out,
int  len 
)

Sum elements of one stream to another's.

Parameters
in1the first input stream. (input)
in2the second input stream. (input)
outthe output stream. (output)
lenthe length of the input stream.
Returns
the output stream if successfull elaboration. NULL if an error is encountered. Return 0 if success. Return -1 if any error occurs.

◆ dspau_sum1()

int dspau_sum1 ( double *  in,
double *  out,
int  len,
double  val 
)

Sum elements of the input stream to a value.

Parameters
inthe first input stream. (input)
outthe output stream. (output)
lenthe length of the input stream.
valthe value used for this operation.
Returns
the output stream if successfull elaboration. NULL if an error is encountered. Return 0 if success. Return -1 if any error occurs.