![]() |
libdspl-2.0
Digital Signal Processing Algorithm Library
|
Functions | |
int DSPL_API | acos_cmplx (complex_t *x, int n, complex_t *y) |
The inverse of the cosine function the complex vector argument x . More... | |
int DSPL_API | asin_cmplx (complex_t *x, int n, complex_t *y) |
The inverse of the sine function the complex vector argument x . More... | |
int DSPL_API | cos_cmplx (complex_t *x, int n, complex_t *y) |
The cosine function the complex vector argument x . More... | |
int DSPL_API | sin_cmplx (complex_t *x, int n, complex_t *y) |
The sine function the complex vector argument x . More... | |
Detailed Description
Function Documentation
◆ acos_cmplx()
The inverse of the cosine function the complex vector argument x
.
Function calculates the inverse of the cosine function as:
\[ \textrm{Arccos}(x) = \frac{\pi}{2} - \textrm{Arcsin}(x) = \frac{\pi}{2} -j \textrm{Ln}\left( j x + \sqrt{1 - x^2} \right) \]
- Parameters
-
[in] x Pointer to the argument vector x
.
Vector size is[n x 1]
.
[in] n Input vector x
and the inverse cosine 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:
Output is:
acos_cmplx(1.0+2.0j) = 1.144-1.529j acos_cmplx(3.0+4.0j) = 0.937-2.306j acos_cmplx(5.0+6.0j) = 0.880-2.749j
Definition at line 141 of file math.c.
Referenced by ellip_acd_cmplx().
◆ asin_cmplx()
The inverse of the sine function the complex vector argument x
.
Function calculates the inverse of the sine function as:
\[ \textrm{Arcsin}(x) = j \textrm{Ln}\left( j x + \sqrt{1 - x^2} \right) \]
- Parameters
-
[in] x Pointer to the argument vector x
.
Vector size is[n x 1]
.
[in] n Input vector x
and the inverse sine 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;asin_cmplx(x, 3, y);for(k = 0; k < 3; k++)printf("asin_cmplx(%.1f%+.1fj) = %.3f%+.3fj\n",
Output is:
asin_cmplx(1.0+2.0j) = 0.427+1.529j asin_cmplx(3.0+4.0j) = 0.634+2.306j asin_cmplx(5.0+6.0j) = 0.691+2.749j
Definition at line 271 of file math.c.
Referenced by acos_cmplx(), and ellip_asn_cmplx().
◆ cos_cmplx()
The cosine function the complex vector argument x
.
Function calculates the cosine function as:
\[ \textrm{cos}(x) = \frac{\exp(jx) + \exp(-jx)}{2} \]
- Parameters
-
[in] x Pointer to the argument vector x
.
Vector size is[n x 1]
.
[in] n Input vector x
and the cosine 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:
Output is:
cos_cmplx(1.0+2.0j) = 2.033 -3.052j cos_cmplx(3.0+4.0j) = -27.035 -3.851j cos_cmplx(5.0+6.0j) = 57.219 +193.428j
Definition at line 585 of file math.c.
Referenced by ellip_cd_cmplx().
◆ sin_cmplx()
The sine function the complex vector argument x
.
Function calculates the sine function as:
\[ \textrm{cos}(x) = \frac{\exp(jx) - \exp(-jx)}{2j} \]
- Parameters
-
[in] x Pointer to the argument vector x
.
Vector size is[n x 1]
.
[in] n Input vector x
and the sine 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;sin_cmplx(x, 3, y);for(k = 0; k < 3; k++)printf("sin_cmplx(%.1f%+.1fj) = %9.3f%+9.3fj\n",
Output is:
sin_cmplx(1.0+2.0j) = 3.166 +1.960j sin_cmplx(3.0+4.0j) = 3.854 -27.017j sin_cmplx(5.0+6.0j) = -193.430 +57.218j
Definition at line 849 of file math.c.
Referenced by ellip_sn_cmplx().
Generated on Mon Dec 14 2020 14:02:36 for libdspl-2.0 by
