kopia lustrzana https://github.com/Dsplib/libdspl-2.0
added _release folder
Changes to be committed: new file: _release/.gitignore modified: dspl/ide/codeblocks/dspl.layout modified: dspl/ide/codeblocks/dspl.workspace modified: dspl/ide/codeblocks/examples.cbp modified: dspl/ide/codeblocks/examples.layout modified: dspl/src/statistic.cpull/6/merge
rodzic
6aa80e6c48
commit
ac495581f5
|
@ -0,0 +1,5 @@
|
||||||
|
*.dll
|
||||||
|
*.c
|
||||||
|
*.h
|
||||||
|
|
||||||
|
|
|
@ -2,27 +2,32 @@
|
||||||
<CodeBlocks_layout_file>
|
<CodeBlocks_layout_file>
|
||||||
<FileVersion major="1" minor="0" />
|
<FileVersion major="1" minor="0" />
|
||||||
<ActiveTarget name="Debug" />
|
<ActiveTarget name="Debug" />
|
||||||
<File name="..\..\src\complex.c" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
<File name="..\..\src\cheby.c" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor>
|
||||||
|
<Cursor1 position="1457" topLine="21" />
|
||||||
|
</Cursor>
|
||||||
|
</File>
|
||||||
|
<File name="..\..\..\include\dspl.h" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor>
|
||||||
|
<Cursor1 position="78789" topLine="1404" />
|
||||||
|
</Cursor>
|
||||||
|
</File>
|
||||||
|
<File name="..\..\src\inout.c" open="1" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor>
|
||||||
|
<Cursor1 position="13583" topLine="503" />
|
||||||
|
</Cursor>
|
||||||
|
</File>
|
||||||
|
<File name="..\..\src\complex.c" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
<Cursor>
|
<Cursor>
|
||||||
<Cursor1 position="808" topLine="5" />
|
<Cursor1 position="808" topLine="5" />
|
||||||
</Cursor>
|
</Cursor>
|
||||||
</File>
|
</File>
|
||||||
<File name="..\..\src\cheby.c" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
<File name="..\..\src\statistic.c" open="1" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
<Cursor>
|
<Cursor>
|
||||||
<Cursor1 position="854" topLine="21" />
|
<Cursor1 position="769" topLine="0" />
|
||||||
</Cursor>
|
</Cursor>
|
||||||
</File>
|
</File>
|
||||||
<File name="..\..\..\include\dspl.h" open="1" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
<File name="..\..\src\dft.c" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="1" zoom_2="0">
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="0" topLine="0" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="..\..\src\array.c" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
|
||||||
<Cursor>
|
|
||||||
<Cursor1 position="857" topLine="6" />
|
|
||||||
</Cursor>
|
|
||||||
</File>
|
|
||||||
<File name="..\..\src\dft.c" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="1" zoom_2="0">
|
|
||||||
<Cursor>
|
<Cursor>
|
||||||
<Cursor1 position="204" topLine="0" />
|
<Cursor1 position="204" topLine="0" />
|
||||||
</Cursor>
|
</Cursor>
|
||||||
|
@ -37,4 +42,14 @@
|
||||||
<Collapse line="500" />
|
<Collapse line="500" />
|
||||||
</Folding>
|
</Folding>
|
||||||
</File>
|
</File>
|
||||||
|
<File name="..\..\src\filter_iir.c" open="1" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor>
|
||||||
|
<Cursor1 position="16896" topLine="358" />
|
||||||
|
</Cursor>
|
||||||
|
</File>
|
||||||
|
<File name="..\..\src\array.c" open="1" top="1" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
<Cursor>
|
||||||
|
<Cursor1 position="17981" topLine="549" />
|
||||||
|
</Cursor>
|
||||||
|
</File>
|
||||||
</CodeBlocks_layout_file>
|
</CodeBlocks_layout_file>
|
||||||
|
|
|
@ -15,9 +15,6 @@
|
||||||
</Project>
|
</Project>
|
||||||
<Project filename="examples.cbp">
|
<Project filename="examples.cbp">
|
||||||
<Depends filename="dspl.cbp" />
|
<Depends filename="dspl.cbp" />
|
||||||
<Depends filename="blas.cbp" />
|
|
||||||
<Depends filename="lapack_complex.cbp" />
|
|
||||||
<Depends filename="lapack_double.cbp" />
|
|
||||||
</Project>
|
</Project>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
</CodeBlocks_workspace_file>
|
</CodeBlocks_workspace_file>
|
||||||
|
|
|
@ -7,9 +7,9 @@
|
||||||
<Option compiler="gcc" />
|
<Option compiler="gcc" />
|
||||||
<Build>
|
<Build>
|
||||||
<Target title="Debug">
|
<Target title="Debug">
|
||||||
<Option output="../../../_release/test" prefix_auto="1" extension_auto="1" />
|
<Option output="../test/bin/test" prefix_auto="1" extension_auto="1" />
|
||||||
<Option working_dir="../../../_release/" />
|
<Option working_dir="../test/bin" />
|
||||||
<Option object_output="../test" />
|
<Option object_output="../test/obj" />
|
||||||
<Option type="1" />
|
<Option type="1" />
|
||||||
<Option compiler="gcc" />
|
<Option compiler="gcc" />
|
||||||
<Compiler>
|
<Compiler>
|
||||||
|
@ -17,9 +17,9 @@
|
||||||
</Compiler>
|
</Compiler>
|
||||||
</Target>
|
</Target>
|
||||||
<Target title="Release">
|
<Target title="Release">
|
||||||
<Option output="../../../_release/test" prefix_auto="1" extension_auto="1" />
|
<Option output="../test/bin/test" prefix_auto="1" extension_auto="1" />
|
||||||
<Option working_dir="../../../_release/" />
|
<Option working_dir="../test/bin" />
|
||||||
<Option object_output="../test" />
|
<Option object_output="../test/obj" />
|
||||||
<Option type="1" />
|
<Option type="1" />
|
||||||
<Option compiler="gcc" />
|
<Option compiler="gcc" />
|
||||||
<Compiler>
|
<Compiler>
|
||||||
|
@ -35,11 +35,14 @@
|
||||||
<Add option="-DWIN_OS" />
|
<Add option="-DWIN_OS" />
|
||||||
<Add directory="../../../include" />
|
<Add directory="../../../include" />
|
||||||
</Compiler>
|
</Compiler>
|
||||||
|
<ExtraCommands>
|
||||||
|
<Add before="cp ../../../_release/libdspl.dll ../test/bin/libdspl.dll" />
|
||||||
|
</ExtraCommands>
|
||||||
<Unit filename="../../../include/dspl.c">
|
<Unit filename="../../../include/dspl.c">
|
||||||
<Option compilerVar="CC" />
|
<Option compilerVar="CC" />
|
||||||
</Unit>
|
</Unit>
|
||||||
<Unit filename="../../../include/dspl.h" />
|
<Unit filename="../../../include/dspl.h" />
|
||||||
<Unit filename="../test/test.c">
|
<Unit filename="../test/src/test.c">
|
||||||
<Option compilerVar="CC" />
|
<Option compilerVar="CC" />
|
||||||
</Unit>
|
</Unit>
|
||||||
<Extensions />
|
<Extensions />
|
||||||
|
|
|
@ -2,14 +2,14 @@
|
||||||
<CodeBlocks_layout_file>
|
<CodeBlocks_layout_file>
|
||||||
<FileVersion major="1" minor="0" />
|
<FileVersion major="1" minor="0" />
|
||||||
<ActiveTarget name="Release" />
|
<ActiveTarget name="Release" />
|
||||||
<File name="..\..\..\include\dspl.c" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
<File name="..\test\src\test.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
<Cursor>
|
<Cursor>
|
||||||
<Cursor1 position="0" topLine="0" />
|
<Cursor1 position="579" topLine="0" />
|
||||||
</Cursor>
|
</Cursor>
|
||||||
</File>
|
</File>
|
||||||
<File name="..\test\test.c" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
<File name="..\..\..\include\dspl.c" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
<Cursor>
|
<Cursor>
|
||||||
<Cursor1 position="182" topLine="0" />
|
<Cursor1 position="10692" topLine="154" />
|
||||||
</Cursor>
|
</Cursor>
|
||||||
</File>
|
</File>
|
||||||
</CodeBlocks_layout_file>
|
</CodeBlocks_layout_file>
|
||||||
|
|
|
@ -238,7 +238,7 @@ exit_label:
|
||||||
|
|
||||||
Function calculates the mean value
|
Function calculates the mean value
|
||||||
\f[
|
\f[
|
||||||
m = \sum_{i = 0}^{n-1} x(i)
|
m = \frac{1}{n}\sum_{i = 0}^{n-1} x(i)
|
||||||
\f]
|
\f]
|
||||||
|
|
||||||
\param[in] x
|
\param[in] x
|
||||||
|
@ -275,7 +275,7 @@ As result the variable `m` will keep value `2`.
|
||||||
|
|
||||||
Функция рассчитывает оценку математического ожидания
|
Функция рассчитывает оценку математического ожидания
|
||||||
\f[
|
\f[
|
||||||
m = \sum_{i = 0}^{n-1} x(i)
|
m = \frac{1}{n} \sum_{i = 0}^{n-1} x(i)
|
||||||
\f]
|
\f]
|
||||||
|
|
||||||
\param[in] x
|
\param[in] x
|
||||||
|
@ -327,6 +327,7 @@ int DSPL_API mean(double* x, int n, double* m)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef DOXYGEN_ENGLISH
|
#ifdef DOXYGEN_ENGLISH
|
||||||
/*! ****************************************************************************
|
/*! ****************************************************************************
|
||||||
\ingroup SPEC_MATH_STAT_GROUP
|
\ingroup SPEC_MATH_STAT_GROUP
|
||||||
|
@ -335,7 +336,7 @@ int DSPL_API mean(double* x, int n, double* m)
|
||||||
|
|
||||||
Function calculates the mean value
|
Function calculates the mean value
|
||||||
\f[
|
\f[
|
||||||
m = \sum_{i = 0}^{n-1} x(i)
|
m = \frac{1}{n}\sum_{i = 0}^{n-1} x(i)
|
||||||
\f]
|
\f]
|
||||||
|
|
||||||
\param[in] x
|
\param[in] x
|
||||||
|
@ -372,7 +373,7 @@ As result the variable `m` will keep value `1 + 3j`.
|
||||||
|
|
||||||
Функция рассчитывает оценку математического ожидания
|
Функция рассчитывает оценку математического ожидания
|
||||||
\f[
|
\f[
|
||||||
m = \sum_{i = 0}^{n-1} x(i)
|
m = \frac{1}{n} \sum_{i = 0}^{n-1} x(i)
|
||||||
\f]
|
\f]
|
||||||
|
|
||||||
\param[in] x
|
\param[in] x
|
||||||
|
@ -429,6 +430,9 @@ int DSPL_API mean_cmplx(complex_t* x, int n, complex_t* m)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef DOXYGEN_ENGLISH
|
#ifdef DOXYGEN_ENGLISH
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -462,11 +466,92 @@ int DSPL_API minmax(double* x, int n, double* xmin, double* xmax)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef DOXYGEN_ENGLISH
|
#ifdef DOXYGEN_ENGLISH
|
||||||
|
/*! ****************************************************************************
|
||||||
|
\ingroup SPEC_MATH_STAT_GROUP
|
||||||
|
\fn int std(double* x, int n, double* s)
|
||||||
|
\brief Calculates the standard deviation of the input vector `x`
|
||||||
|
|
||||||
#endif
|
Function calculates the the standard deviation value
|
||||||
|
\f[
|
||||||
|
s = \sqrt{\frac{1}{n-1} \sum_{i = 0}^{n-1} \big(x(i) - \mu \big)^2},
|
||||||
|
\f]
|
||||||
|
here \f$\mu\f$ - mean value of the vector `x`:
|
||||||
|
\f[
|
||||||
|
\mu = \frac{1}{n} \sum_{i = 0}^{n-1} x(i).
|
||||||
|
\f]
|
||||||
|
|
||||||
|
\param[in] x
|
||||||
|
Pointer to the real input vector `x`. \n
|
||||||
|
Vector size is `[n x 1]`. \n \n
|
||||||
|
|
||||||
|
\param[in] n
|
||||||
|
Size of input vector `x`. \n \n
|
||||||
|
|
||||||
|
\param[out] s
|
||||||
|
Pointer to the variable which keeps vector `x` standard deviation value.\n
|
||||||
|
Memory must be allocated. \n \n
|
||||||
|
|
||||||
|
`RES_OK` if function calculates successfully,
|
||||||
|
else \ref ERROR_CODE_GROUP "code error".
|
||||||
|
|
||||||
|
Example:
|
||||||
|
\code{.cpp}
|
||||||
|
double a[5] = {0.0, 1.0, 2.0, 3.0, 4.0};
|
||||||
|
double s;
|
||||||
|
std(a, 5, &s);
|
||||||
|
printf("\n\n Standard deviation value: %8.1f\n", s);
|
||||||
|
\endcode
|
||||||
|
As result the variable `s` will keep value `1.5811`.
|
||||||
|
|
||||||
|
\author Sergey Bakhurin www.dsplib.org
|
||||||
|
***************************************************************************** */#endif
|
||||||
#ifdef DOXYGEN_RUSSIAN
|
#ifdef DOXYGEN_RUSSIAN
|
||||||
|
/*! ****************************************************************************
|
||||||
|
\ingroup SPEC_MATH_STAT_GROUP
|
||||||
|
\fn int std(double* x, int n, double* s)
|
||||||
|
\brief Выборочная оценка стандартного отклонения вещественного вектора `x`
|
||||||
|
|
||||||
|
Функция рассчитывает оценку стандартного отклонения
|
||||||
|
\f[
|
||||||
|
s = \sqrt{\frac{1}{n-1} \sum_{i = 0}^{n-1} \big(x(i) - \mu \big)^2},
|
||||||
|
\f]
|
||||||
|
где \f$\mu\f$ - выборочная оценка математического ожидания вектора `x`:
|
||||||
|
\f[
|
||||||
|
\mu = \frac{1}{n} \sum_{i = 0}^{n-1} x(i).
|
||||||
|
\f]
|
||||||
|
|
||||||
|
\param[in] x
|
||||||
|
Указатель на вещественный вектор `x`. \n
|
||||||
|
Размер вектора `[n x 1]`. \n \n
|
||||||
|
|
||||||
|
\param[in] n
|
||||||
|
Размер входного вектора `x`. \n \n
|
||||||
|
|
||||||
|
\param[out] s
|
||||||
|
Указатель на адрес памяти, в который сохранить
|
||||||
|
рассчитанное значение стандартного отклонения вектора `x`. \n
|
||||||
|
Память должна быть выделена. \n \n
|
||||||
|
|
||||||
|
\return
|
||||||
|
`RES_OK` если функция выполнена успешно. \n
|
||||||
|
В противном случае \ref ERROR_CODE_GROUP "код ошибки".
|
||||||
|
|
||||||
|
Пример:
|
||||||
|
\code{.cpp}
|
||||||
|
double a[5] = {0.0, 1.0, 2.0, 3.0, 4.0};
|
||||||
|
double s;
|
||||||
|
std(a, 5, &s);
|
||||||
|
printf("\n\n Standard deviation value: %8.1f\n", s);
|
||||||
|
\endcode
|
||||||
|
В результате в переменную `s` будет записано значение `1.5811`.
|
||||||
|
|
||||||
|
\author Бахурин Сергей. www.dsplib.org
|
||||||
|
***************************************************************************** */
|
||||||
#endif
|
#endif
|
||||||
int DSPL_API std(double* x, int n, double* s)
|
int DSPL_API std(double* x, int n, double* s)
|
||||||
{
|
{
|
||||||
|
@ -487,11 +572,92 @@ exit_label:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef DOXYGEN_ENGLISH
|
#ifdef DOXYGEN_ENGLISH
|
||||||
|
/*! ****************************************************************************
|
||||||
|
\ingroup SPEC_MATH_STAT_GROUP
|
||||||
|
\fn int std_cmplx(complex_t* x, int n, double* s)
|
||||||
|
\brief Calculates the standard deviation of the complex input vector `x`
|
||||||
|
|
||||||
#endif
|
Function calculates the the standard deviation value
|
||||||
|
\f[
|
||||||
|
s = \sqrt{\frac{1}{n-1} \sum_{i = 0}^{n-1} \big|x(i) - \mu \big|^2},
|
||||||
|
\f]
|
||||||
|
here \f$\mu\f$ - mean value of the vector `x`:
|
||||||
|
\f[
|
||||||
|
\mu = \frac{1}{n} \sum_{i = 0}^{n-1} x(i).
|
||||||
|
\f]
|
||||||
|
|
||||||
|
\param[in] x
|
||||||
|
Pointer to the complex input vector `x`. \n
|
||||||
|
Vector size is `[n x 1]`. \n \n
|
||||||
|
|
||||||
|
\param[in] n
|
||||||
|
Size of input vector `x`. \n \n
|
||||||
|
|
||||||
|
\param[out] s
|
||||||
|
Pointer to the variable which keeps vector `x` standard deviation value.\n
|
||||||
|
Memory must be allocated. \n \n
|
||||||
|
|
||||||
|
`RES_OK` if function calculates successfully,
|
||||||
|
else \ref ERROR_CODE_GROUP "code error".
|
||||||
|
|
||||||
|
Example:
|
||||||
|
\code{.cpp}
|
||||||
|
complex_t a[3] = {{0.0, -1.0}, {1.0, 2.0}, {3.0, 5.0}};
|
||||||
|
double s;
|
||||||
|
std_cmplx(a, 3, &s);
|
||||||
|
printf("\n\n Standard deviation value: %8.1f\n", s);
|
||||||
|
\endcode
|
||||||
|
As result the variable `s` will keep value `3.3665`.
|
||||||
|
|
||||||
|
\author Sergey Bakhurin www.dsplib.org
|
||||||
|
***************************************************************************** */#endif
|
||||||
#ifdef DOXYGEN_RUSSIAN
|
#ifdef DOXYGEN_RUSSIAN
|
||||||
|
/*! ****************************************************************************
|
||||||
|
\ingroup SPEC_MATH_STAT_GROUP
|
||||||
|
\fn int std_cmplx(complex_t* x, int n, double* s)
|
||||||
|
\brief Выборочная оценка стандартного отклонения комплексного вектора `x`
|
||||||
|
|
||||||
|
Функция рассчитывает оценку стандартного отклонения
|
||||||
|
\f[
|
||||||
|
s = \sqrt{\frac{1}{n-1} \sum_{i = 0}^{n-1} \big|x(i) - \mu \big|^2},
|
||||||
|
\f]
|
||||||
|
где \f$\mu\f$ - выборочная оценка математического ожидания вектора `x`:
|
||||||
|
\f[
|
||||||
|
\mu = \frac{1}{n} \sum_{i = 0}^{n-1} x(i).
|
||||||
|
\f]
|
||||||
|
\note Для комплексного вектора данных, величина стандартного отклонения
|
||||||
|
всегда вещественная и неотрицательная.
|
||||||
|
|
||||||
|
\param[in] x
|
||||||
|
Указатель на комплексный вектор `x`. \n
|
||||||
|
Размер вектора `[n x 1]`. \n \n
|
||||||
|
|
||||||
|
\param[in] n
|
||||||
|
Размер входного вектора `x`. \n \n
|
||||||
|
|
||||||
|
\param[out] s
|
||||||
|
Указатель на адрес памяти, в который сохранить
|
||||||
|
рассчитанное значение стандартного отклонения вектора `x`. \n
|
||||||
|
Память должна быть выделена. \n \n
|
||||||
|
|
||||||
|
\return
|
||||||
|
`RES_OK` если функция выполнена успешно. \n
|
||||||
|
В противном случае \ref ERROR_CODE_GROUP "код ошибки".
|
||||||
|
|
||||||
|
Пример:
|
||||||
|
\code{.cpp}
|
||||||
|
complex_t a[3] = {{0.0, -1.0}, {1.0, 2.0}, {3.0, 5.0}};
|
||||||
|
double s;
|
||||||
|
std_cmplx(a, 3, &s);
|
||||||
|
printf("\n\n Standard deviation value: %8.1f\n", s);
|
||||||
|
\endcode
|
||||||
|
В результате в переменную `s` будет записано значение `3.3665`.
|
||||||
|
|
||||||
|
\author Бахурин Сергей. www.dsplib.org
|
||||||
|
***************************************************************************** */
|
||||||
#endif
|
#endif
|
||||||
int DSPL_API std_cmplx(complex_t* x, int n, double* s)
|
int DSPL_API std_cmplx(complex_t* x, int n, double* s)
|
||||||
{
|
{
|
||||||
|
@ -501,11 +667,9 @@ int DSPL_API std_cmplx(complex_t* x, int n, double* s)
|
||||||
err = mean_cmplx(x, n, &m);
|
err = mean_cmplx(x, n, &m);
|
||||||
if(err != RES_OK)
|
if(err != RES_OK)
|
||||||
goto exit_label;
|
goto exit_label;
|
||||||
|
|
||||||
RE(tmp) = RE(x[0]) - RE(m);
|
sum = 0.0;
|
||||||
IM(tmp) = IM(x[0]) - IM(m);
|
for(k = 0; k < n; k++)
|
||||||
sum = ABSSQR(tmp);
|
|
||||||
for(k = 1; k < n; k++)
|
|
||||||
{
|
{
|
||||||
RE(tmp) = RE(x[k]) - RE(m);
|
RE(tmp) = RE(x[k]) - RE(m);
|
||||||
IM(tmp) = IM(x[k]) - IM(m);
|
IM(tmp) = IM(x[k]) - IM(m);
|
||||||
|
|
Ładowanie…
Reference in New Issue