kopia lustrzana https://github.com/Dsplib/libdspl-2.0
modified: README.md
modified: dspl/dox/en/array.dox modified: dspl/dox/en/complex.dox modified: dspl/dox/en/mainpage.dox modified: dspl/dox/footer_en.html modified: dspl/dox/header_en.html modified: dspl/src/array.c modified: dspl/src/cheby.c modified: dspl/src/complex.cpull/6/merge
rodzic
56edea350a
commit
e469ad7c6a
51
README.md
51
README.md
|
@ -1,8 +1,51 @@
|
|||
# libdspl-2.0 Digital signal processing library
|
||||
# libdspl-2.0 free вigital signal processing algorithm library
|
||||
|
||||
libdspl-2.0 — opensource cross-platform digital signal processing algorithm library, written in C language.
|
||||
Distributed under LGPL v3 license. This allows to use this library in all applications with dynamic linking.
|
||||
|
||||
libdspl-2.0 includes follow algorithms sets:
|
||||
* Digital spectral analysis, discrete and fast Fourier transform algorithms.
|
||||
* Analog and digital IIR filters design and analysis.
|
||||
* Digital FIR filters design and analysis.
|
||||
* Windows function collection includes 15 different parametric and nonparametric window functions.
|
||||
* Digital Hilbert transform algorithms.
|
||||
* Mathematical sections includes trigonometric, hyperbolic, elliptic functions of real and complex variables.
|
||||
* Pseudorandom numbers generation algorithms.
|
||||
* Statistic functions.
|
||||
* Linar algebra algorithms (BLAS and LAPACK packages are used under the hood of the DSPL-2.0 library).
|
||||
* Digital resampling algorithms.
|
||||
|
||||
|
||||
|
||||
libdspl-2.0 is free cross-platform library of digital signal processing algorithms.
|
||||
libdspl-2.0 includes the following groups of algorithms:
|
||||
### Build and run libdspl-2.0
|
||||
To build the DSPL-2.0 library on Windows, a special set of programs dsplib toolchain is provided. Dsplib toolchain includes GCC, GNUPLOT, CodeBlocks IDE, Far file manager and also Unix utilities for Windows OS.
|
||||
|
||||
|
||||
### Documentation content
|
||||
* Mathematical sections:
|
||||
* [Basic math functions of the real and complex arguments.](http://en.dsplib.org/dspl/group___s_p_e_c___m_a_t_h___c_o_m_m_o_n___g_r_o_u_p.html)
|
||||
* [Trigonometric and hyperbolic of functions the real and complex arguments.](http://en.dsplib.org/dspl/group___s_p_e_c___m_a_t_h___t_r_i_g___g_r_o_u_p.html)
|
||||
* [Transcendent math functions.]
|
||||
* [Elliptic Jacoby functions of the real and complex arguments.]
|
||||
* [Pseudo-random numbers generation.]
|
||||
* [Math statistic functions.]
|
||||
* [Linear algebra and matrix operations.]
|
||||
|
||||
* Digital spectral analysis:
|
||||
* [Discrete Fourier transform and fast Fourier transform algorithms.]
|
||||
* [Windows function for filter design and spectrum analysis.]
|
||||
* [Hilbert transform algorithms.]
|
||||
|
||||
* Analog and digital filters design and analysis:
|
||||
* [Convolution and digital filtration.]
|
||||
* [IIR filters design.]
|
||||
* [FIR filter design.]
|
||||
* [Analog and digital filter analysis.]
|
||||
|
||||
* Other algortithms:
|
||||
* [Digital samplerate conversion (resampling).]
|
||||
* [Input and output data from external files.]
|
||||
* [Plotting data by Gnuplot interface.]
|
||||
|
||||
* Appendix
|
||||
* [libdspl-2.0 data types.]
|
||||
* [Error codes.]
|
|
@ -1,3 +1,74 @@
|
|||
/*! ****************************************************************************
|
||||
\ingroup SPEC_MATH_COMMON_GROUP
|
||||
\fn int array_scale_lin(double* x, int n,
|
||||
double xmin, double xmax, double dx,
|
||||
double h, double* y)
|
||||
\brief Vector `x` linear transformation
|
||||
|
||||
Function transforms values \f$x(i)\f$, \f$i = 0,1,\ldots n\f$
|
||||
to the \f$y(i)\f$, accordint to equation:
|
||||
|
||||
\f[
|
||||
y(i) = k_x x(i) + d_x, \qquad k_x =
|
||||
\frac{h}{x_{\textrm{max}} - x_{\textrm{min}}}.
|
||||
\f]
|
||||
|
||||
All values of the vector `x` between
|
||||
\f$x_{\textrm{min}}\f$ and \f$x_{\textrm{max}}\f$, transforms to
|
||||
the vector `y` between \f$d_x\f$ and \f$h + d_x\f$.
|
||||
Parameter \f$d_x\f$ sets mean shift of the vector `y`.
|
||||
|
||||
This function is convenient for translating values
|
||||
of different dimensions. For example it can be used
|
||||
to transfer the values of the vector `x`
|
||||
to the graph of the height of` h`, where the height can
|
||||
be set in the number of pixels, in centimeters, etc.
|
||||
|
||||
\param[in] x
|
||||
Pointer to the input vector `x`. \n
|
||||
Vector size is `[n x 1]`. \n
|
||||
\n
|
||||
|
||||
\param[in] n
|
||||
Size of vector `x`. \n
|
||||
\n
|
||||
|
||||
\param[in] xmin
|
||||
Parameter \f$x_{\textrm{min}}\f$. \n
|
||||
\n
|
||||
|
||||
\param[in] xmax
|
||||
Parameter \f$x_{\textrm{min}}\f$. \n
|
||||
Value `xmax` must be more than `xmin`. \n
|
||||
\n
|
||||
|
||||
\param[in] dx
|
||||
Displacement after transformation. \n
|
||||
This parameter must have output vector `y`
|
||||
dimensions (pixels, centimeters). \n
|
||||
\n
|
||||
|
||||
\param[in] h
|
||||
Height of vector `y` after transforming between `dx` and `h+dx`. \n
|
||||
\n
|
||||
|
||||
\param[out] y
|
||||
Pointer to the output vector `y`. \n
|
||||
Vector size is `[n x 1]`. \n
|
||||
Memory must be allocated. \n
|
||||
\note
|
||||
Pointer `y` can be equal to `x`.
|
||||
Velues of vector `x` will be rewritten in this case. \n
|
||||
\n
|
||||
|
||||
\return
|
||||
`RES_OK` if function returns successfully. \n
|
||||
Else \ref ERROR_CODE_GROUP "code error".
|
||||
|
||||
\author Sergey Bakhurin www.dsplib.org
|
||||
**************************************************************************** */
|
||||
|
||||
|
||||
|
||||
/*! ****************************************************************************
|
||||
\fn int concat(void* a, size_t na, void* b, size_t nb, void* c)
|
||||
|
@ -54,9 +125,7 @@ Vector `c` keeps follow data:
|
|||
c = [1.0, 2.0, 3.0, 4.0, 5.0]
|
||||
\endverbatim
|
||||
|
||||
\author
|
||||
Sergey Bakhurin
|
||||
www.dsplib.org
|
||||
\author Sergey Bakhurin www.dsplib.org
|
||||
****************************************************************************** */
|
||||
|
||||
|
||||
|
@ -111,9 +180,7 @@ vector `y` will keep array:
|
|||
c = [0.0, 2.0, 4.0, 6.0, 8.0]
|
||||
\endverbatim
|
||||
|
||||
\author
|
||||
Sergey Bakhurin
|
||||
www.dsplib.org
|
||||
\author Sergey Bakhurin www.dsplib.org
|
||||
****************************************************************************** */
|
||||
|
||||
|
||||
|
@ -290,73 +357,67 @@ Program result:
|
|||
/*! ****************************************************************************
|
||||
\ingroup SPEC_MATH_COMMON_GROUP
|
||||
\fn int linspace(double x0, double x1, int n, int type, double* x)
|
||||
\brief Функция заполняет массив линейно-нарастающими, равноотстоящими
|
||||
значениями от `x0` до `x1`
|
||||
\brief Function fills a vector with `n` linearly spaced elements
|
||||
between `x0` and `x1`.
|
||||
|
||||
Заполняет массив `x` длиной `n` значениями в диапазоне
|
||||
от \f$x_0\f$ до \f$x_1\f$. Функция поддерживает два типа заполнения
|
||||
в соответствии с параметром `type`: \n
|
||||
Function supports two kinds of filling according to `type` parameter: \n
|
||||
|
||||
Симметричное заполнение согласно выражению (параметр `type=DSPL_SYMMETRIC`): \n
|
||||
Symmetric fill (parameter `type=DSPL_SYMMETRIC`): \n
|
||||
|
||||
\f$x(k) = x_0 + k \cdot dx\f$,
|
||||
\f$dx = \frac{x_1 - x_0}{n-1}\f$, \f$k = 0 \ldots n-1.\f$
|
||||
|
||||
Периодическое заполнение (параметр `type=DSPL_PERIODIC`) согласно выражению: \n
|
||||
Periodic fill (parameter `type=DSPL_PERIODIC`): \n
|
||||
|
||||
\f$x(k) = x_0 + k \cdot dx\f$,
|
||||
\f$dx = \frac{x_1 - x_0}{n}\f$, \f$k = 0 \ldots n-1.\f$
|
||||
|
||||
\param[in] x0
|
||||
Начальное показателя \f$x_0\f$. \n \n
|
||||
Start point \f$x_0\f$. \n \n
|
||||
|
||||
\param[in] x1
|
||||
Конечное значение \f$x_1\f$. \n \n
|
||||
End point \f$x_1\f$. \n \n
|
||||
|
||||
\param[in] n
|
||||
Количество точек массива `x`. \n \n
|
||||
Number of points `x` (size of vector `x`). \n \n
|
||||
|
||||
\param[in] type
|
||||
Тип заполнения: \n
|
||||
|
||||
`DSPL_SYMMETRIC` --- симметричное заполнение, \n
|
||||
`DSPL_PERIODIC` --- периодическое заполнение. \n \n
|
||||
Fill type: \n
|
||||
`DSPL_SYMMETRIC` --- symmetric, \n
|
||||
`DSPL_PERIODIC` --- periodic. \n \n
|
||||
|
||||
\param[in,out] x
|
||||
Указатель на вектор равноотстоящих значений . \n
|
||||
Размер вектора `[n x 1]`. \n
|
||||
Память должна быть выделена. \n \n
|
||||
Pointer to the output linearly spaced vector `x` . \n
|
||||
Vector size is `[n x 1]`. \n
|
||||
Memory must be allocated. \n \n
|
||||
|
||||
\return
|
||||
`RES_OK` --- функция выполнена успешно. \n
|
||||
В противном случае \ref ERROR_CODE_GROUP "код ошибки". \n \n
|
||||
`RES_OK` if function returns successfully. \n
|
||||
Else \ref ERROR_CODE_GROUP "error code".
|
||||
|
||||
\note
|
||||
Отличие периодического и симметричного заполнения можно
|
||||
понять из следующих примеров. \n
|
||||
Пример 1. Периодическое заполнение.
|
||||
\code{.cpp}
|
||||
Difference between symmetric and periodic filling we can
|
||||
understand from the follow examples. \n
|
||||
Example 1. Periodic fill.
|
||||
double x[5];
|
||||
linspace(0, 5, 5, DSPL_PERIODIC, x);
|
||||
\endcode
|
||||
В массиве `x` будут лежать значения:
|
||||
Values in the vector `x` are:
|
||||
\verbatim
|
||||
0, 1, 2, 3, 4
|
||||
\endverbatim
|
||||
\n \n
|
||||
Пример 2. Симметричное заполнение.
|
||||
Example 2. Symmetric fill.
|
||||
\code{.cpp}
|
||||
double x[5];
|
||||
linspace(0, 5, 5, DSPL_SYMMETRIC, x);
|
||||
\endcode
|
||||
В массиве `x` будут лежать значения:
|
||||
Values in the vector `x` are:
|
||||
\verbatim
|
||||
0, 1.25, 2.5, 3.75, 5
|
||||
\endverbatim
|
||||
|
||||
\author
|
||||
Бахурин Сергей
|
||||
www.dsplib.org
|
||||
\author Sergey Bakhurin www.dsplib.org
|
||||
***************************************************************************** */
|
||||
|
||||
|
||||
|
@ -366,76 +427,76 @@ www.dsplib.org
|
|||
/*! ****************************************************************************
|
||||
\ingroup SPEC_MATH_COMMON_GROUP
|
||||
\fn int logspace(double x0, double x1, int n, int type, double* x)
|
||||
\brief Функция заполняет массив значениями логарифмической шкале
|
||||
\brief Function fills a vector with `n` logarithmically spaced elements
|
||||
between \f$10^{x_0}\f$ and \f$10^{x_1}\f$.
|
||||
|
||||
Заполняет массив `x` длиной `n` значениями в диапазоне
|
||||
от \f$10^{x_0}\f$ до \f$10^{x_1}\f$. \n
|
||||
Функция поддерживает два типа заполнения в соответствии с параметром `type`: \n
|
||||
|
||||
Симметричное заполнение согласно выражению: \n
|
||||
Function supports two kinds of filling according to `type` parameter: \n
|
||||
|
||||
\f$x(k) = 10^{x_0} \cdot dx^k\f$, где \f$dx = \sqrt[n-1]{10^{x_1 - x_0}}\f$,
|
||||
Symmetric fill (parameter `type=DSPL_SYMMETRIC`): \n
|
||||
|
||||
\f$x(k) = 10^{x_0} \cdot dx^k\f$, here \f$dx = \sqrt[n-1]{10^{x_1 - x_0}}\f$,
|
||||
\f$k = 0 \ldots n-1.\f$
|
||||
|
||||
Периодическое заполнение согласно выражению:
|
||||
Periodic fill (parameter `type=DSPL_PERIODIC`): \n
|
||||
|
||||
\f$x(k) = 10^{x_0} \cdot dx^k\f$, где \f$dx = \sqrt[n]{10^{x_1 - x_0}}\f$,
|
||||
\f$x(k) = 10^{x_0} \cdot dx^k\f$, here \f$dx = \sqrt[n]{10^{x_1 - x_0}}\f$,
|
||||
\f$k = 0 \ldots n-1.\f$ \n
|
||||
|
||||
|
||||
\param[in] x0
|
||||
Начальное значение показателя \f$x_0\f$. \n \n
|
||||
Start exponent value \f$x_0\f$. \n \n
|
||||
|
||||
\param[in] x1
|
||||
Конечное значение показателя \f$x_1\f$. \n \n
|
||||
End exponent value \f$x_1\f$. \n \n
|
||||
|
||||
\param[in] n
|
||||
Количество точек массива `x`. \n \n
|
||||
Number of points `x` (size of vector `x`). \n \n
|
||||
|
||||
\param[in] type
|
||||
Тип заполнения: \n
|
||||
`DSPL_SYMMETRIC` --- симметричное заполнение, \n
|
||||
`DSPL_PERIODIC` --- периодическое заполнение. \n \n
|
||||
Fill type: \n
|
||||
`DSPL_SYMMETRIC` --- symmetric, \n
|
||||
`DSPL_PERIODIC` --- periodic. \n \n
|
||||
|
||||
\param[in,out] x
|
||||
Указатель на вектор значений в логарифмической шкале. \n
|
||||
Размер вектора `[n x 1]`. \n
|
||||
Память должна быть выделена. \n \n
|
||||
Pointer to the output logarithmically spaced vector `x` . \n
|
||||
Vector size is `[n x 1]`. \n
|
||||
Memory must be allocated. \n \n
|
||||
|
||||
\return
|
||||
`RES_OK` --- функция выполнена успешно. \n
|
||||
В противном случае \ref ERROR_CODE_GROUP "код ошибки".
|
||||
`RES_OK` if function returns successfully. \n
|
||||
Else \ref ERROR_CODE_GROUP "error code".
|
||||
|
||||
\note
|
||||
Отличие периодического и симметричного заполнения можно
|
||||
понять из следующих примеров. \n
|
||||
|
||||
Пример 1. Периодическое заполнение.
|
||||
Difference between symmetric and periodic filling we can
|
||||
understand from the follow examples. \n
|
||||
Example 1. Periodic fill.
|
||||
\code{.cpp}
|
||||
double x[5];
|
||||
logspace(-2, 3, 5, DSPL_PERIODIC, x);
|
||||
\endcode
|
||||
В массиве `x` будут лежать значения:
|
||||
|
||||
Values in the vector `x` are:
|
||||
|
||||
\verbatim
|
||||
0.01, 0.1, 1, 10, 100
|
||||
\endverbatim
|
||||
|
||||
\n \n
|
||||
|
||||
Пример 2. Симметричное заполнение.
|
||||
Example 2. Symmetric fill.
|
||||
\code{.cpp}
|
||||
double x[5];
|
||||
logspace(-2, 3, 5, DSPL_SYMMETRIC, x);
|
||||
\endcode
|
||||
|
||||
В массиве `x` будут лежать значения:
|
||||
Values in the vector `x` are:
|
||||
|
||||
\verbatim
|
||||
0.01 0.178 3.162 56.234 1000
|
||||
\endverbatim
|
||||
|
||||
\author
|
||||
Бахурин Сергей
|
||||
www.dsplib.org
|
||||
\author Sergey Bakhurin www.dsplib.org
|
||||
***************************************************************************** */
|
||||
|
||||
|
||||
|
@ -444,23 +505,23 @@ www.dsplib.org
|
|||
/*! ****************************************************************************
|
||||
\ingroup SPEC_MATH_COMMON_GROUP
|
||||
\fn int ones(double* x, int n)
|
||||
\brief Функция заполнения вещественного массива единицами
|
||||
\brief Function fills all real vector `x` by ones values.
|
||||
|
||||
\param[in, out] x
|
||||
Указатель на вещественный вектор `x`. \n
|
||||
Размер вектора `[n x 1]`. \n
|
||||
Значения данного вектора будут установлены в единицу. \n
|
||||
Pointer to the vector `x`. \n
|
||||
Vector size is `[n x 1]`. \n
|
||||
All elements on this vector will be set to one. \n
|
||||
\n
|
||||
|
||||
\param[in] n
|
||||
Размер вектора `x`. \n
|
||||
Size of vector `x`. \n
|
||||
\n
|
||||
|
||||
\return
|
||||
`RES_OK` если функция выполнена успешно. \n
|
||||
В противном случае \ref ERROR_CODE_GROUP "код ошибки".
|
||||
`RES_OK` if function returns successfully. \n
|
||||
Else \ref ERROR_CODE_GROUP "error code".
|
||||
|
||||
Пример:
|
||||
Example:
|
||||
\code{.cpp}
|
||||
double y[5] = {0};
|
||||
int i;
|
||||
|
@ -469,14 +530,12 @@ for(i = 0; i < 5; i++)
|
|||
printf("%6.1f% ", y[i]);
|
||||
\endcode
|
||||
\n
|
||||
Результат выполнения:
|
||||
Vector `y` values are:
|
||||
\verbatim
|
||||
1.0 1.0 1.0 1.0 1.0
|
||||
\endverbatim
|
||||
|
||||
\author
|
||||
Бахурин Сергей
|
||||
www.dsplib.org
|
||||
\author Sergey Bakhurin www.dsplib.org
|
||||
**************************************************************************** */
|
||||
|
||||
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
/*! ****************************************************************************
|
||||
\ingroup TYPES_GROUP
|
||||
\typedef complex_t
|
||||
\brief Описание комплексного типа данных.
|
||||
\brief Complex data type.
|
||||
|
||||
Комплексный тип данных в библиотеке DSPL-2.0 определен как
|
||||
массив из двух элементов типа `double`.
|
||||
При этом первый элемент массива определяет реальную часть
|
||||
комплексного числа, а второй - мнимую.
|
||||
DSPL-2.0 decribes complex numbers data type as an array
|
||||
of two `double` elements.
|
||||
First element sets real part, second --- imaginary part.
|
||||
|
||||
Например:
|
||||
For example:
|
||||
|
||||
\code{.cpp}
|
||||
complex_t z;
|
||||
|
@ -16,10 +15,10 @@
|
|||
z[1] = -2.0;
|
||||
\endcode
|
||||
|
||||
Переменная `z = 1-2j`, где `j` - мнимая единица.
|
||||
Variable `z = 1-2j`, here `j` - imaginary unit.
|
||||
|
||||
Для удобства работы с комплексными числами реализованы
|
||||
специальные макросы: \ref RE, \ref IM, \ref ABSSQR
|
||||
For the convenience of working with complex numbers implemented
|
||||
special macros: \ref RE, \ref IM, \ref ABSSQR
|
||||
***************************************************************************** */
|
||||
|
||||
|
||||
|
@ -33,15 +32,16 @@
|
|||
/*! ****************************************************************************
|
||||
\ingroup TYPES_GROUP
|
||||
\def ABSSQR(x)
|
||||
\brief Макрос возвращает квадрат модуля комплексного числа `x`.
|
||||
\brief
|
||||
The macro returns the square of the modulus of a complex number `x`.
|
||||
|
||||
Квадрат модуля комплексного числа \f$ x = a + j b \f$ равен:
|
||||
Square of the modulus of a complex number \f$ x = a + j b \f$ equals:
|
||||
|
||||
\f[
|
||||
|x|^2 = x x^* = a^2 + b^2.
|
||||
\f]
|
||||
|
||||
Например:
|
||||
Example:
|
||||
\code{.cpp}
|
||||
complex_t z;
|
||||
double y;
|
||||
|
@ -50,7 +50,7 @@
|
|||
y = ABSSQR(z);
|
||||
\endcode
|
||||
|
||||
Переменная `z = 1-2j`, где `j` - мнимая единица, а переменная `y = 5`.
|
||||
Variable `z = 1-2j`, here `j` - imaginary unit, but variable `y = 5`.
|
||||
***************************************************************************** */
|
||||
|
||||
|
||||
|
@ -63,26 +63,26 @@
|
|||
/*! ****************************************************************************
|
||||
\ingroup TYPES_GROUP
|
||||
\def IM(x)
|
||||
\brief Макрос определяющий мнимую часть комплексного числа.
|
||||
\brief Macro sets imaginary part of the complex number.
|
||||
|
||||
Например:
|
||||
Example:
|
||||
\code{.cpp}
|
||||
complex_t z;
|
||||
RE(z) = 1.0;
|
||||
IM(z) = -2.0;
|
||||
\endcode
|
||||
|
||||
Переменная `z = 1-2j`, где `j` - мнимая единица.
|
||||
Variable `z = 1-2j`, here `j` - imaginary unit.
|
||||
|
||||
Аналогично, макрос можно использовать для получения
|
||||
мнимой части комплексного числа:
|
||||
This macro can be used to return
|
||||
imaginary part of the complex number:
|
||||
\code{.cpp}
|
||||
complex_t z = {3.0, -4.0};
|
||||
double r;
|
||||
r = IM(z);
|
||||
\endcode
|
||||
В данном примере переменная `z = 3-4i`,
|
||||
а в переменой `r` будет храниться число -4.
|
||||
In this example `z = 3-4i`,
|
||||
but variable `r` will keep -4.
|
||||
***************************************************************************** */
|
||||
|
||||
|
||||
|
@ -97,27 +97,27 @@
|
|||
/*! ****************************************************************************
|
||||
\ingroup TYPES_GROUP
|
||||
\def RE(x)
|
||||
\brief Макрос определяющий реальную часть комплексного числа.
|
||||
\brief Macro sets real part of the complex number.
|
||||
|
||||
Например:
|
||||
Example:
|
||||
\code{.cpp}
|
||||
complex_t z;
|
||||
RE(z) = 1.0;
|
||||
IM(z) = -2.0;
|
||||
\endcode
|
||||
|
||||
Переменная `z = 1-2j`, где `j` - мнимая единица.
|
||||
Variable `z = 1-2j`, here `j` - imaginary unit.
|
||||
|
||||
Аналогично, макрос можно использовать для получения
|
||||
реальной части комплексного числа:
|
||||
This macro can be used to return
|
||||
real part of the complex number:
|
||||
|
||||
\code{.cpp}
|
||||
complex_t z = {3.0, -4.0};
|
||||
double r;
|
||||
r = RE(z);
|
||||
\endcode
|
||||
В данном примере переменная `z = 3-4i`, а в переменой `r`
|
||||
будет храниться число 3.
|
||||
In this example `z = 3-4i`,
|
||||
but variable `r` will keep 3.
|
||||
***************************************************************************** */
|
||||
|
||||
|
||||
|
@ -133,19 +133,23 @@ Function fills `re` and `im` vectors corresponds to real and image
|
|||
parts of the input complex array `x`. \n
|
||||
|
||||
|
||||
\param[in] x Pointer to the real complex vector. \n
|
||||
Vector size is `[n x 1]`. \n \n
|
||||
\param[in] x
|
||||
Pointer to the real complex vector. \n
|
||||
Vector size is `[n x 1]`. \n \n
|
||||
|
||||
\param[in] n Size of the input complex vector `x` and real and image
|
||||
vectors `re` and `im`. \n \n
|
||||
\param[in] n
|
||||
Size of the input complex vector `x` and real and image
|
||||
vectors `re` and `im`. \n \n
|
||||
|
||||
\param[out] re Pointer to the real part vector. \n
|
||||
Vector size is `[n x 1]`. \n
|
||||
Memory must be allocated. \n \n
|
||||
\param[out] re
|
||||
Pointer to the real part vector. \n
|
||||
Vector size is `[n x 1]`. \n
|
||||
Memory must be allocated. \n \n
|
||||
|
||||
\param[out] im Pointer to the image part vector. \n
|
||||
Vector size is `[n x 1]`. \n
|
||||
Memory must be allocated. \n \n
|
||||
\param[out] im
|
||||
Pointer to the image part vector. \n
|
||||
Vector size is `[n x 1]`. \n
|
||||
Memory must be allocated. \n \n
|
||||
|
||||
\return
|
||||
`RES_OK` if function converts complex vector successfully. \n
|
||||
|
@ -188,14 +192,17 @@ So complex vector contains data: \n
|
|||
`y[i] = x[i] + j0, here i = 0,1,2 ... n-1`
|
||||
|
||||
|
||||
\param[in] x Pointer to the real vector `x`. \n
|
||||
Vector size is `[n x 1]`. \n \n
|
||||
\param[in] x
|
||||
Pointer to the real vector `x`. \n
|
||||
Vector size is `[n x 1]`. \n \n
|
||||
|
||||
\param[in] n Size of the real vector `x` and complex vector `y`. \n \n
|
||||
\param[in] n
|
||||
Size of the real vector `x` and complex vector `y`. \n \n
|
||||
|
||||
\param[out] y Pointer to the complex vector `y`. \n
|
||||
Vector size is `[n x 1]`. \n
|
||||
Memory must be allocated. \n \n
|
||||
\param[out] y
|
||||
Pointer to the complex vector `y`. \n
|
||||
Vector size is `[n x 1]`. \n
|
||||
Memory must be allocated. \n \n
|
||||
|
||||
|
||||
\return
|
||||
|
@ -204,7 +211,7 @@ Else \ref ERROR_CODE_GROUP "code error": \n
|
|||
|
||||
|
||||
|
||||
Например при выполнении следующего кода
|
||||
Example:
|
||||
\code{.cpp}
|
||||
double x[3] = {1.0, 2.0, 3.0};
|
||||
complex_t y[3];
|
||||
|
|
|
@ -1,69 +1,82 @@
|
|||
/*! ****************************************************************************
|
||||
\mainpage DSPL-2.0 - библиотека алгоритмов цифровой обработки сигналов.
|
||||
\mainpage DSPL-2.0 - Digital Signal Processing Algorithm Library
|
||||
.
|
||||
|
||||
\section sec_main_page DSPL-2.0 --- свободная библиотека алгоритмов ЦОС
|
||||
|
||||
DSPL-2.0 --- свободная библиотека алгоритмов цифровой обработки сигналов,
|
||||
с открытым исходным кодом, написанная на языке Си. \n
|
||||
\section sec_main_page DSPL-2.0 --- free DSP algorithm library
|
||||
|
||||
|
||||
Распространяется под лицензией
|
||||
<a href = "http://www.gnu.org/licenses/lgpl.html">LGPL v3.</a>
|
||||
Это позволяет использовать данную библиотеку в закрытых приложения при
|
||||
условии динамической линковки.
|
||||
DSPL-2.0 --- opensource cross-platform digital
|
||||
signal processing algorithm library, written in C language. \n
|
||||
|
||||
Distributed under
|
||||
<a href = "http://www.gnu.org/licenses/lgpl.html"> LGPL v3 </a> license.
|
||||
This allows to use this library in all applications with dynamic linking.
|
||||
|
||||
|
||||
Исходные коды библиотеки доступны на
|
||||
Source codes are available on
|
||||
<a href = "https://github.com/Dsplib/libdspl-2.0">GitHub</a>. \n
|
||||
|
||||
Вы также можете внести свой вклад в развитие данной библиотеки.
|
||||
\b Присоединяйтесь!
|
||||
DSPL-2.0 includes follow algorithms sets: \n
|
||||
- Digital spectral analysis, discrete and fast Fourier transform algorithms. \n
|
||||
- Analog and digital IIR filters design and analysis. \n
|
||||
- Digital FIR filters design and analysis. \n
|
||||
- Windows function collection includes 15 different parametric
|
||||
and nonparametric window functions. \n
|
||||
- Digital Hilbert transform algorithms. \n
|
||||
- Mathematical sections includes trigonometric, hyperbolic, elliptic functions of real and complex variables. \n
|
||||
- Pseudorandom numbers generation algorithms. \n
|
||||
- Statistic functions. \n
|
||||
- Linar algebra algorithms (BLAS and LAPACK packages are used under the hood of the DSPL-2.0 library). \n
|
||||
- Digital resampling algorithms. \n
|
||||
|
||||
|
||||
\subsection sec_doc_start Компиляция и запуск программ DSPL-2.0
|
||||
|
||||
Для сборки библиотеки DSPL-2.0 в системе Windows подготовлен специальный
|
||||
набор программ \ref getting_started_toolchain "dsplib toolchain",
|
||||
в состав которого входит компилятор GCC, пакет построения графиков GNUPLOT,
|
||||
среда разработки и отладки CodeBlocks, а также файловый менеджер Far и
|
||||
коллекция портированных Unix утилит.
|
||||
\subsection sec_doc_start Build and run DSPL-2.0
|
||||
|
||||
To build the DSPL-2.0 library on Windows, a special
|
||||
set of programs \ref getting_started_toolchain "dsplib toolchain" is provided.
|
||||
Dsplib toolchain includes GCC, GNUPLOT, CodeBlocks IDE, Far file manager and also Unix utilities for Windows OS.
|
||||
|
||||
\ref getting_started_toolchain \n
|
||||
\ref getting_started_make \n
|
||||
\ref getting_started_codeblocks \n
|
||||
\ref SYS_LOADING_GROUP \n
|
||||
|
||||
\subsection sec_doc_content Разделы документации
|
||||
<b>Математические функции:</b> \n
|
||||
\ref SPEC_MATH_COMMON_GROUP \n
|
||||
\ref SPEC_MATH_TRIG_GROUP \n
|
||||
\ref SPEC_MATH_TRANSCEND \n
|
||||
\ref SPEC_MATH_ELLIP_GROUP \n
|
||||
\ref SPEC_MATH_RAND_GEN_GROUP \n
|
||||
\ref SPEC_MATH_STAT_GROUP \n
|
||||
\ref SPEC_MATH_LINALG_GROUP \n
|
||||
\subsection sec_doc_content Documentation content
|
||||
<b>Mathematical sections:</b> \n
|
||||
- \ref SPEC_MATH_COMMON_GROUP \n
|
||||
- \ref SPEC_MATH_TRIG_GROUP \n
|
||||
- \ref SPEC_MATH_TRANSCEND \n
|
||||
- \ref SPEC_MATH_ELLIP_GROUP \n
|
||||
- \ref SPEC_MATH_RAND_GEN_GROUP \n
|
||||
- \ref SPEC_MATH_STAT_GROUP \n
|
||||
- \ref SPEC_MATH_LINALG_GROUP \n
|
||||
\n
|
||||
|
||||
<b>Алгоритмы спектрального анализа: </b> \n
|
||||
\ref DFT_GROUP \n
|
||||
\ref WIN_GROUP \n
|
||||
\ref HILBERT_GROUP \n
|
||||
|
||||
<b>Digital spectral analysis: </b> \n
|
||||
- \ref DFT_GROUP \n
|
||||
- \ref WIN_GROUP \n
|
||||
- \ref HILBERT_GROUP \n
|
||||
\n
|
||||
|
||||
<b>Расчет и анализ аналоговых и цифровых фильтров:</b>\n
|
||||
\ref FILTER_CONV_GROUP \n
|
||||
\ref IIR_FILTER_DESIGN_GROUP \n
|
||||
\ref FIR_FILTER_DESIGN_GROUP \n
|
||||
\ref FILTER_ANALYSIS_GROUP \n
|
||||
|
||||
<b>Analog and digital filters design and analysis:</b>\n
|
||||
- \ref FILTER_CONV_GROUP \n
|
||||
- \ref IIR_FILTER_DESIGN_GROUP \n
|
||||
- \ref FIR_FILTER_DESIGN_GROUP \n
|
||||
- \ref FILTER_ANALYSIS_GROUP \n
|
||||
\n
|
||||
|
||||
<b>Прочие алгоритмы:</b> \n
|
||||
\ref RESAMPLING_GROUP \n
|
||||
\ref IN_OUT_GROUP \n
|
||||
\ref PLOT_GROUP \n
|
||||
|
||||
<b>Other algortithms:</b> \n
|
||||
- \ref RESAMPLING_GROUP \n
|
||||
- \ref IN_OUT_GROUP \n
|
||||
- \ref PLOT_GROUP \n
|
||||
\n
|
||||
|
||||
<b>Приложения</b>\n
|
||||
\ref TYPES_GROUP \n
|
||||
\ref ERROR_CODE_GROUP \n
|
||||
|
||||
<b>Appendix</b>\n
|
||||
- \ref TYPES_GROUP \n
|
||||
- \ref ERROR_CODE_GROUP \n
|
||||
***************************************************************************** */
|
||||
|
|
|
@ -19,6 +19,20 @@ $generatedby  <a href="http://www.doxygen.org/index.html">
|
|||
<!--END !GENERATE_TREEVIEW-->
|
||||
|
||||
</div>
|
||||
<div class = "bottom-nav-dsplib">
|
||||
<ul>
|
||||
<li><a href="http://en.dsplib.org">Content</a></li>
|
||||
<li><a href="http://en.dsplib.org/dspl">DSPL–2.0</a></li>
|
||||
<li style = "border-right-style: solid; border-right-color: 1px; border-right-width: 1px;">
|
||||
<a href="http://en.dsplib.org/forum">Forum</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -36,9 +36,6 @@ $extrastylesheet
|
|||
<body>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--LiveInternet counter--><script>
|
||||
new Image().src = "//counter.yadro.ru/hit?r"+
|
||||
escape(document.referrer)+((typeof(screen)=="undefined")?"":
|
||||
|
@ -87,14 +84,15 @@ screen.colorDepth:screen.pixelDepth))+";u"+escape(document.URL)+
|
|||
<div class = "menu-panel-dsplib">
|
||||
<div class = "dsplib-logo"><img src="http://dsplib.org/logo.png" /> </div>
|
||||
|
||||
<div class="search-bar-dsplib">
|
||||
|
||||
<div class="search-bar-dsplib">
|
||||
<div class="ya-site-form ya-site-form_inited_no" data-bem="{"action":"http://en.dsplib.org/search_results.html","arrow":false,"bg":"transparent","fontsize":12,"fg":"#000000","language":"en","logo":"rb","publicname":"dsplib.org search","suggest":true,"target":"_self","tld":"com","type":2,"usebigdictionary":true,"searchid":2411842,"input_fg":"#000000","input_bg":"#ffffff","input_fontStyle":"normal","input_fontWeight":"normal","input_placeholder":"","input_placeholderColor":"#000000","input_borderColor":"#7f9db9"}"><form action="https://yandex.com/search/site/" method="get" target="_self" accept-charset="utf-8"><input type="hidden" name="searchid" value="2411842"/><input type="hidden" name="l10n" value="en"/><input type="hidden" name="reqenc" value=""/><input type="search" name="text" value="" style = "height: 24px; font-family: verdana,arial; font-size: 12px"/><input type="submit" value="Search" style = "height: 24px;"/></form></div><style type="text/css">.ya-page_js_yes .ya-site-form_inited_no { display: none; }</style><script type="text/javascript">(function(w,d,c){var s=d.createElement('script'),h=d.getElementsByTagName('script')[0],e=d.documentElement;if((' '+e.className+' ').indexOf(' ya-page_js_yes ')===-1){e.className+=' ya-page_js_yes';}s.type='text/javascript';s.async=true;s.charset='utf-8';s.src=(d.location.protocol==='https:'?'https:':'http:')+'//site.yandex.net/v2.0/js/all.js';h.parentNode.insertBefore(s,h);(w[c]||(w[c]=[])).push(function(){Ya.Site.Form.init()})})(window,document,'yandex_site_callbacks');</script>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class = "menu-bar-dsplib">
|
||||
<div class = "menu-panel-dsplib">
|
||||
|
@ -103,16 +101,23 @@ screen.colorDepth:screen.pixelDepth))+";u"+escape(document.URL)+
|
|||
<li><a href="http://en.dsplib.org">Content</a></li>
|
||||
<li><a href="http://en.dsplib.org/dspl">DSPL–2.0</a></li>
|
||||
<li><a href="http://en.dsplib.org/forum">Forum</a></li>
|
||||
|
||||
<li class = "en-link"><a href="http://en.dsplib.org/dspl">En</a> </li>
|
||||
<li class = "ru-link"><a href="http://ru.dsplib.org/dspl">Ru</a> </li>
|
||||
<!-- <li style = "float: right;"><a href="http://ru.dsplib.org/forum">Об авторе</a></li> -->
|
||||
<li class = "lang-link">
|
||||
<table cellpadding ="0px", style = "margin-bottom:2px; margin-right:2px;">
|
||||
<tr>
|
||||
<td style = "border: solid; border-color:white; border-width:1px;">
|
||||
<a href="http://en.dsplib.org/dspl">En</a>
|
||||
</td>
|
||||
<td style = "border: solid; border-color:var(--menu-bar-color); border-width:1px;">
|
||||
<a href="http://ru.dsplib.org/dspl">Ru</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="main-dsplib">
|
||||
|
||||
|
@ -124,6 +129,7 @@ screen.colorDepth:screen.pixelDepth))+";u"+escape(document.URL)+
|
|||
|
||||
|
||||
|
||||
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
|
||||
<!--BEGIN TITLEAREA-->
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
/******************************************************************************
|
||||
Vector linear transformation
|
||||
--------------------------------------------------------------------------------
|
||||
Documented:
|
||||
Documented: RU, EN
|
||||
*******************************************************************************/
|
||||
int array_scale_lin(double* x, int n,
|
||||
double xmin, double xmax, double dx,
|
||||
|
@ -206,7 +206,7 @@ int DSPL_API flipip_cmplx(complex_t* x, int n)
|
|||
/*******************************************************************************
|
||||
Linspace array filling
|
||||
--------------------------------------------------------------------------------
|
||||
Documented: RU
|
||||
Documented: RU, EN
|
||||
*******************************************************************************/
|
||||
int DSPL_API linspace(double x0, double x1, int n, int type, double* x)
|
||||
{
|
||||
|
@ -245,7 +245,7 @@ int DSPL_API linspace(double x0, double x1, int n, int type, double* x)
|
|||
/*******************************************************************************
|
||||
Logspace array filling
|
||||
--------------------------------------------------------------------------------
|
||||
Documented: RU
|
||||
Documented: RU, EN
|
||||
*******************************************************************************/
|
||||
int DSPL_API logspace(double x0, double x1, int n, int type, double* x)
|
||||
{
|
||||
|
@ -284,7 +284,7 @@ int DSPL_API logspace(double x0, double x1, int n, int type, double* x)
|
|||
/*******************************************************************************
|
||||
Ones double array
|
||||
--------------------------------------------------------------------------------
|
||||
Documented: RU
|
||||
Documented: RU, EN
|
||||
*******************************************************************************/
|
||||
int DSPL_API ones(double* x, int n)
|
||||
{
|
||||
|
|
104
dspl/src/cheby.c
104
dspl/src/cheby.c
|
@ -25,55 +25,9 @@
|
|||
|
||||
|
||||
/******************************************************************************
|
||||
\ingroup SPEC_MATH_TRANSCEND
|
||||
\fn int cheby_poly1(double* x, int n, int ord, double* y)
|
||||
\brief Chebyshev polynomial of the first kind order `ord`
|
||||
|
||||
Function calculates Chebyshev polynomial \f$ C_ord(x)\f$ of the first kind
|
||||
order `ord` for the real vector `x` (length `n`) by recurrent equation:
|
||||
\f[
|
||||
C_ord(x) = 2 x C_{ord-1}(x) - C_{ord-2}(x),
|
||||
\f]
|
||||
where \f$ C_0(x) = 1 \f$, \f$ C_1(x) = x\f$
|
||||
|
||||
\param[in] x Pointer to the real argument vector `x`. \n
|
||||
Vector size is `[n x 1]`. \n \n
|
||||
|
||||
\param[in] n Size of vectors `x` and `y`. \n \n
|
||||
|
||||
\param[in] ord Chebyshev polynomial order. \n \n
|
||||
|
||||
\param[out] y Pointer to the Chebyshev polynomial values,
|
||||
corresponds to the argument `x`. \n
|
||||
Vector size is `[n x 1]`. \n
|
||||
Memory must be allocated. \n \n
|
||||
|
||||
\return
|
||||
`RES_OK` if Chebyshev polynomial is calculated successfully. \n
|
||||
Else \ref ERROR_CODE_GROUP "code error". \n
|
||||
|
||||
Example:
|
||||
|
||||
\include cheby_poly1_test.c
|
||||
|
||||
\n \n
|
||||
Text files will be created in `dat` directory: \n
|
||||
|
||||
<pre>
|
||||
cheby_poly1_ord1.txt
|
||||
cheby_poly1_ord2.txt
|
||||
cheby_poly1_ord3.txt
|
||||
cheby_poly1_ord4.txt
|
||||
</pre>
|
||||
|
||||
GNUPLOT package will create Chebyshev polynomials plot from saved text-files:
|
||||
|
||||
\image html cheby_poly1.png
|
||||
|
||||
GNUPLOT script is follow:
|
||||
\include cheby_poly1.plt
|
||||
|
||||
\author Sergey Bakhurin www.dsplib.org
|
||||
Chebyshev polynomial of the first kind order `ord`
|
||||
--------------------------------------------------------------------------------
|
||||
Documented: RU, EN
|
||||
*******************************************************************************/
|
||||
int DSPL_API cheby_poly1(double* x, int n, int ord, double* y)
|
||||
{
|
||||
|
@ -121,55 +75,9 @@ int DSPL_API cheby_poly1(double* x, int n, int ord, double* y)
|
|||
|
||||
|
||||
/******************************************************************************
|
||||
\ingroup SPEC_MATH_TRANSCEND
|
||||
\fn int cheby_poly2(double* x, int n, int ord, double* y)
|
||||
\brief Chebyshev polynomial of the second kind order `ord`
|
||||
|
||||
Function calculates Chebyshev polynomial \f$ U_ord(x)\f$ of the first kind
|
||||
order `ord` for the real vector `x` (length `n`) by recurrent equation:
|
||||
\f[
|
||||
U_ord(x) = 2 x U_{ord-1}(x) - U_{ord-2}(x),
|
||||
\f]
|
||||
where \f$ U_0(x) = 1 \f$, \f$ U_1(x) = 2x\f$
|
||||
|
||||
\param[in] x Pointer to the real argument vector `x`. \n
|
||||
Vector size is `[n x 1]`. \n \n
|
||||
|
||||
\param[in] n Size of vectors `x` and `y`. \n \n
|
||||
|
||||
\param[in] ord Chebyshev polynomial order. \n \n
|
||||
|
||||
\param[out] y Pointer to the Chebyshev polynomial values,
|
||||
corresponds to the argument `x`. \n
|
||||
Vector size is `[n x 1]`. \n
|
||||
Memory must be allocated. \n \n
|
||||
|
||||
\return
|
||||
`RES_OK` if Chebyshev polynomial is calculated successfully. \n
|
||||
Else \ref ERROR_CODE_GROUP "code error". \n
|
||||
|
||||
Example:
|
||||
|
||||
\include cheby_poly2_test.c
|
||||
|
||||
\n \n
|
||||
Text files will be created in `dat` directory: \n
|
||||
|
||||
<pre>
|
||||
cheby_poly2_ord1.txt
|
||||
cheby_poly2_ord2.txt
|
||||
cheby_poly2_ord3.txt
|
||||
cheby_poly2_ord4.txt
|
||||
</pre>
|
||||
|
||||
GNUPLOT package will create Chebyshev polynomials plot from saved text-files:
|
||||
|
||||
\image html cheby_poly2.png
|
||||
|
||||
GNUPLOT script is follow:
|
||||
\include cheby_poly2.plt
|
||||
|
||||
\author Sergey Bakhurin www.dsplib.org
|
||||
Chebyshev polynomial of the second kind order `ord`
|
||||
--------------------------------------------------------------------------------
|
||||
Documented: RU, EN
|
||||
*******************************************************************************/
|
||||
int DSPL_API cheby_poly2(double* x, int n, int ord, double* y)
|
||||
{
|
||||
|
|
|
@ -27,49 +27,9 @@
|
|||
|
||||
|
||||
/******************************************************************************
|
||||
\ingroup TYPES_GROUP
|
||||
\fn int cmplx2re(complex_t* x, int n, double* re, double* im)
|
||||
\brief Separate complex vector to the real and image vectors
|
||||
|
||||
Function fills `re` and `im` vectors corresponds to real and image
|
||||
parts of the input complex array `x`. \n
|
||||
|
||||
|
||||
\param[in] x Pointer to the real complex vector. \n
|
||||
Vector size is `[n x 1]`. \n \n
|
||||
|
||||
\param[in] n Size of the input complex vector `x` and real and image
|
||||
vectors `re` and `im`. \n \n
|
||||
|
||||
\param[out] re Pointer to the real part vector. \n
|
||||
Vector size is `[n x 1]`. \n
|
||||
Memory must be allocated. \n \n
|
||||
|
||||
\param[out] im Pointer to the image part vector. \n
|
||||
Vector size is `[n x 1]`. \n
|
||||
Memory must be allocated. \n \n
|
||||
|
||||
\return
|
||||
`RES_OK` if function converts complex vector successfully. \n
|
||||
Else \ref ERROR_CODE_GROUP "code error". \n
|
||||
|
||||
Example: \n
|
||||
\code{.cpp}
|
||||
complex_t x[3] = {{1.0, 2.0}, {3.0, 4.0}, {5.0, 6.0}};
|
||||
double re[3], im[3];
|
||||
|
||||
cmplx2re(x, 3, re, im);
|
||||
\endcode
|
||||
|
||||
Vectors `re` and `im` will contains:
|
||||
|
||||
\verbatim
|
||||
re[0] = 1.0; im[0] = 2.0;
|
||||
re[1] = 3.0; im[1] = 4.0;
|
||||
re[2] = 5.0; im[2] = 6.0;
|
||||
\endverbatim
|
||||
|
||||
\author Sergey Bakhurin. www.dsplib.org
|
||||
Separate complex vector to the real and image vectors
|
||||
--------------------------------------------------------------------------------
|
||||
Documented: RU, EN
|
||||
*******************************************************************************/
|
||||
int DSPL_API cmplx2re(complex_t* x, int n, double* re, double* im)
|
||||
{
|
||||
|
@ -97,49 +57,9 @@ int DSPL_API cmplx2re(complex_t* x, int n, double* re, double* im)
|
|||
|
||||
|
||||
/******************************************************************************
|
||||
\ingroup TYPES_GROUP
|
||||
\fn int re2cmplx(double* x, int n, complex_t *y)
|
||||
\brief Convert real array to the complex array.
|
||||
|
||||
Function copies the vector `x` to the real part of vector `y`.
|
||||
Image part of the vector `y` sets as zero. \n
|
||||
So complex vector contains data: \n
|
||||
`y[i] = x[i] + j0, here i = 0,1,2 ... n-1`
|
||||
|
||||
|
||||
\param[in] x Pointer to the real vector `x`. \n
|
||||
Vector size is `[n x 1]`. \n \n
|
||||
|
||||
\param[in] n Size of the real vector `x` and complex vector `y`. \n \n
|
||||
|
||||
\param[out] y Pointer to the complex vector `y`. \n
|
||||
Vector size is `[n x 1]`. \n
|
||||
Memory must be allocated. \n \n
|
||||
|
||||
|
||||
\return
|
||||
`RES_OK` if function returns successfully. \n
|
||||
Else \ref ERROR_CODE_GROUP "code error": \n
|
||||
|
||||
|
||||
|
||||
Например при выполнении следующего кода
|
||||
\code{.cpp}
|
||||
double x[3] = {1.0, 2.0, 3.0};
|
||||
complex_t y[3];
|
||||
|
||||
re2cmplx(x, 3, y);
|
||||
\endcode
|
||||
|
||||
Vector `y` will keep:
|
||||
|
||||
\verbatim
|
||||
y[0] = 1+0j;
|
||||
y[1] = 2+0j;
|
||||
y[2] = 3+0j.
|
||||
\endverbatim
|
||||
|
||||
\author Sergey Bakhurin. www.dsplib.org
|
||||
Convert real array to the complex array.
|
||||
--------------------------------------------------------------------------------
|
||||
Documented: RU, EN
|
||||
*******************************************************************************/
|
||||
int DSPL_API re2cmplx(double* x, int n, complex_t* y)
|
||||
{
|
||||
|
|
Ładowanie…
Reference in New Issue