libdspl-2.0
Digital Signal Processing Algorithm Library
|
Basic math functions of the real and complex arguments.
Functions | |
int DSPL_API | log_cmplx (complex_t *x, int n, complex_t *y) |
The logarithm function the complex vector argument x . More... | |
int DSPL_API | sinc (double *x, int n, double a, double *y) |
Function \( \textrm{sinc}(x,a) = \frac{\sin(ax)}{ax}\) for the real vector x . More... | |
int DSPL_API | sqrt_cmplx (complex_t *x, int n, complex_t *y) |
Square root of the complex vector argguument x . More... | |
Detailed Description
Function Documentation
◆ log_cmplx()
The logarithm function the complex vector argument x
.
Function calculates the logarithm function as:
\[ \textrm{Ln}(x) = j \varphi + \ln(|x|), \]
here \(\varphi\) - the complex number phase.
- Parameters
-
[in] x Pointer to the argument vector x
.
Vector size is[n x 1]
.
[in] n Input vector x
and the logarithm vectory
size.
[out] y Pointer to the output complex vector y
, corresponds to the input vectorx
.
Vector size is[n x 1]
.
Memory must be allocated.
- Returns
RES_OK
if function calculated successfully.
Else code error.
Example:
complex_t x[3] = {{1.0, 2.0}, {3.0, 4.0}, {5.0, 6.0}};complex_t y[3];int k;log_cmplx(x, 3, y);for(k = 0; k < 3; k++)printf("log_cmplx(%.1f%+.1fj) = %.3f%+.3fj\n",int DSPL_API log_cmplx(complex_t *x, int n, complex_t *y)The logarithm function the complex vector argument x.Definition: log_cmplx.c:139
Output is:
log_cmplx(1.0+2.0j) = 0.805+1.107j log_cmplx(3.0+4.0j) = 1.609+0.927j log_cmplx(5.0+6.0j) = 2.055+0.876j
Definition at line 139 of file log_cmplx.c.
Referenced by asin_cmplx().
◆ sinc()
int sinc | ( | double * | x, |
int | n, | ||
double | a, | ||
double * | y | ||
) |
Function \( \textrm{sinc}(x,a) = \frac{\sin(ax)}{ax}\) for the real vector x
.
- Parameters
-
[in] x Pointer to the input vector \( x \).
Vector size is[n x 1]
.
[in] n Input and output vectors size.
[in] a Function parameter \( \textrm{sinc}(x,a) = \frac{\sin(ax)}{ax}\).
[out] y Pointer to the sinc
function output vector.
Vector size is[n x 1]
.
Memory must be allocated.
- Returns
RES_OK
if function calculated successfully.
Else code error.
◆ sqrt_cmplx()
Square root of the complex vector argguument x
.
Function calculates square root value of vector x
length n
:
\[ y(k) = \sqrt{x(k)}, \qquad k = 0 \ldots n-1. \]
- Parameters
-
[in] x Pointer to the input complex vector x
.
Vector size is[n x 1]
.
[in] n Size of input and output vectors x
andy
.
[out] y Pointer to the square root vector y
.
Vector size is[n x 1]
.
Memory must be allocated.
- Returns
RES_OK
if function is calculated successfully.
Else code error.
Examplecomplex_t x[3] = {{1.0, 2.0}, {3.0, 4.0}, {5.0, 6.0}};complex_t y[3]int k;sqrt_cmplx(x, 3, y);for(k = 0; k < 3; k++)printf("sqrt_cmplx(%.1f%+.1fj) = %.3f%+.3fj\n",int DSPL_API sqrt_cmplx(complex_t *x, int n, complex_t *y)Square root of the complex vector argguument x.Definition: sqrt_cmplx.c:136
Result:
sqrt_cmplx(1.0+2.0j) = 1.272+0.786j sqrt_cmplx(3.0+4.0j) = 2.000+1.000j sqrt_cmplx(5.0+6.0j) = 2.531+1.185j
Definition at line 136 of file sqrt_cmplx.c.
Referenced by asin_cmplx(), ellip_acd_cmplx(), and ellip_asn_cmplx().
Generated on Wed Jan 5 2022 12:44:37 for libdspl-2.0 by 1.9.2