labplot  2.8.2
About: LabPlot is an application for plotting and analysis of 2D and 3D functions and data. It is a complete rewrite of LabPlot1 and lacks in the first release a lot of features available in the predecessor. On the other hand, the GUI and the usability is more superior.
  Fossies Dox: labplot-2.8.2.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

nsl_corr.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : nsl_corr.h
3  Project : LabPlot
4  Description : NSL discrete correlation functions
5  --------------------------------------------------------------------
6  Copyright : (C) 2018 by Stefan Gerlach (stefan.gerlach@uni.kn)
7 
8  ***************************************************************************/
9 
10 /***************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  * This program is distributed in the hope that it will be useful, *
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
20  * GNU General Public License for more details. *
21  * *
22  * You should have received a copy of the GNU General Public License *
23  * along with this program; if not, write to the Free Software *
24  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
25  * Boston, MA 02110-1301 USA *
26  * *
27  ***************************************************************************/
28 
29 #ifndef NSL_CORR_H
30 #define NSL_CORR_H
31 
32 #include <stdlib.h>
33 
34 #define NSL_CORR_TYPE_COUNT 2
35 /* linear (zero-padded), circular */
37 extern const char* nsl_corr_type_name[];
38 
39 #define NSL_CORR_NORM_COUNT 4
40 /* how to normalize (see octave)
41  * biased - 1/N
42  * unbiased - 1/(N-|m|)
43  * coeff - 1/sqrt(R_xx(0) R_yy(0)) = 1/sqrt(sum x_i^2 sum y_i^2) [used in Origin]
44  * */
46 extern const char* nsl_corr_norm_name[];
47 
48 
49 int nsl_corr_correlation(double s[], size_t n, double r[], size_t m, nsl_corr_type_type, nsl_corr_norm_type normalize, double out[]);
50 
51 /* linear/circular correlation using FFT method
52  * s and r are untouched
53  */
54 int nsl_corr_fft_type(double s[], size_t n, double r[], size_t m, nsl_corr_type_type, nsl_corr_norm_type normalize, double out[]);
55 /* actual FFT method calculation using zero-padded arrays
56  * uses FFTW if available and GSL otherwise
57  * s and r are overwritten
58  */
59 #ifdef HAVE_FFTW3
60 int nsl_corr_fft_FFTW(double s[], double r[], size_t n, double out[]);
61 #endif
62 int nsl_corr_fft_GSL(double s[], double r[], size_t n, double out[]);
63 
64 #endif /* NSL_CORR_H */
int nsl_corr_fft_GSL(double s[], double r[], size_t n, double out[])
Definition: nsl_corr.c:177
nsl_corr_type_type
Definition: nsl_corr.h:36
@ nsl_corr_type_circular
Definition: nsl_corr.h:36
@ nsl_corr_type_linear
Definition: nsl_corr.h:36
const char * nsl_corr_type_name[]
Definition: nsl_corr.c:37
int nsl_corr_correlation(double s[], size_t n, double r[], size_t m, nsl_corr_type_type, nsl_corr_norm_type normalize, double out[])
Definition: nsl_corr.c:40
int nsl_corr_fft_type(double s[], size_t n, double r[], size_t m, nsl_corr_type_type, nsl_corr_norm_type normalize, double out[])
Definition: nsl_corr.c:44
const char * nsl_corr_norm_name[]
Definition: nsl_corr.c:38
nsl_corr_norm_type
Definition: nsl_corr.h:45
@ nsl_corr_norm_coeff
Definition: nsl_corr.h:45
@ nsl_corr_norm_biased
Definition: nsl_corr.h:45
@ nsl_corr_norm_none
Definition: nsl_corr.h:45
@ nsl_corr_norm_unbiased
Definition: nsl_corr.h:45