Functions

int dspl_conv (double *a, int na, double *b, int nb, double *c)
 Linear convolution for real input vectors. More...
 
int dspl_conv_cmplx (double *aR, double *aI, int na, double *bR, double *bI, int nb, double *cR, double *cI)
 Linear convolution for real input vectors. More...
 
int dspl_filter_iir (double *b, double *a, int ord, double *x, int n, double *y)
 IIR filter output for real filter coefficients and real signals. More...
 

Detailed Description

Functions for digital convolution and digital filtration.

Function Documentation

◆ dspl_conv()

int dspl_conv ( double *  a,
int  na,
double *  b,
int  nb,
double *  c 
)

Linear convolution for real input vectors.

This function calculates a linear convolution of two real vectors.

Parameters
[in]aFirst input vector pointer.
Vector size is [na x 1].

[in]naFirst vector length.

[in]bSecond input vector pointer.
Vector size is [nb x 1].

[in]nbSecond vector length.

[out]cLinear convolution vector real part pointer.
Vector size is [na + nb - 1 x 1].
Memory must be allocated.

Returns
DSPL_OK if convolution is calculated successfully;

DSPL_ERROR_PTR if pointer are wrong.
This situation can be if a is NULL or b is NULL or c is NULL.

DSPL_ERROR_SIZE if na<1 or nb < 1.

Author
Sergey Bakhurin. www.dsplib.org

◆ dspl_conv_cmplx()

int dspl_conv_cmplx ( double *  aR,
double *  aI,
int  na,
double *  bR,
double *  bI,
int  nb,
double *  cR,
double *  cI 
)

Linear convolution for real input vectors.

This function calculates a linear convolution of two real vectors \( c = a * b\).

Parameters
[in]aRFirst input vector real part pointer.
Vector size is [na x 1].

[in]aIFirst input vector image part pointer.
Vector size is [na x 1].
This pointer can be NULL if a is real vector

[in]naFirst vector length.

[in]bRSecond input vector real part pointer.
Vector size is [nb x 1].

[in]bISecond input vector image part pointer.
Vector size is [nb x 1].
This pointer can be NULL if b is real vector.

[in]nbSecond vector length.

[out]cRLinear convolution vector real part pointer.
Vector size is [na + nb - 1 x 1].
Memory must be allocated.

[out]cILinear convolution vector real part pointer.
Vector size is [na + nb - 1 x 1].
Memory must be allocated.
This pointer can be NULL if aI and bI are NULL pointers.

Returns
DSPL_OK if convolution is calculated successfully

DSPL_ERROR_PTR if pointer are wrong. This situation can be if:
aR is NULL or bR is NULL or cR is NULL.
cI is NULL if aI or bI isn't NULL.

DSPL_ERROR_SIZE if na<1 or nb < 1.

Author
Sergey Bakhurin. www.dsplib.org

◆ dspl_filter_iir()

int dspl_filter_iir ( double *  b,
double *  a,
int  ord,
double *  x,
int  n,
double *  y 
)

IIR filter output for real filter coefficients and real signals.

Function Calculates IIR filter output. IIR filter transfer function is

\[ H(z) = \frac{\sum_{n = 0}^{N-1} b_n \cdot z^{-n}} {1+{\frac{1}{a_0}}\sum_{m = 1}^{M-1} a_m \cdot z^{-n}}, \]

here \(a_0\) cannot be zero, \(N=M=\)ord.

Parameters
[in]bIIR filter transfer function numerator coefficients pointer. Vector size is [ord + 1 x 1].
[in]aIIR filter transfer function denominator coefficients pointer. Vector size is [ord + 1 x 1]. This pointer can be NULL. Filter becomes FIR in this case with impulse response corresponds to vector b
[in]ordFilter order.
[in]xInput signal pointer. Vector size is [n x 1].
[in]nInput signal vector length.
[out]yIIR filter output vector pointer. Vector size is [n x 1]. Memory must be allocated.
Returns
DSPL_OK if filter output is calculated successfully.
DSPL_ERROR_PTR if pointer are wrong. This situation can be if: b is NULL or x is NULL or y is NULL.
DSPL_ERROR_SIZE if ord < 1 or n < 1.
DSPL_ERROR_FILTER_A0 if a[0] is zero.
Author
Sergey Bakhurin. www.dsplib.org

Select spelling error with your mouse and press
Description(not nessesary)
Close X