Chris@0
|
1 /*
|
Chris@0
|
2 copyright (C) 2012 I. Irigaray, M. Rocamora
|
Chris@0
|
3
|
Chris@0
|
4 This program is free software: you can redistribute it and/or modify
|
Chris@0
|
5 it under the terms of the GNU General Public License as published by
|
Chris@0
|
6 the Free Software Foundation, either version 3 of the License, or
|
Chris@0
|
7 (at your option) any later version.
|
Chris@0
|
8
|
Chris@0
|
9 This program is distributed in the hope that it will be useful,
|
Chris@0
|
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
|
Chris@0
|
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
Chris@0
|
12 GNU General Public License for more details.
|
Chris@0
|
13
|
Chris@0
|
14 You should have received a copy of the GNU General Public License
|
Chris@0
|
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
|
Chris@0
|
16 */
|
Chris@0
|
17
|
Chris@14
|
18 #ifndef FCHTRANSFORMUTILS_H
|
Chris@14
|
19 #define FCHTRANSFORMUTILS_H
|
Chris@14
|
20
|
Chris@0
|
21 #include <string.h>
|
Chris@0
|
22
|
Chris@14
|
23 class Utils
|
Chris@14
|
24 {
|
Chris@14
|
25 public:
|
Chris@14
|
26 static void interp1(const double *x1,const double *y1, int N1, const double *x2, double *y2, int N2);
|
Chris@0
|
27
|
Chris@14
|
28 static void interp1q(const double *y1, const int *x2_int, const double *x2_frac, double *y2, int N2){
|
Chris@14
|
29 for(int i=0;i<N2;i++){
|
Chris@14
|
30 y2[i] = y1[x2_int[i]]*(1.0-x2_frac[i])+y1[x2_int[i]+1]*x2_frac[i];
|
Chris@14
|
31 } // for
|
Chris@14
|
32 }
|
Chris@0
|
33
|
Chris@14
|
34 static void cumtrapz(const double *x, const double *y, int N, double *accum);
|
Chris@0
|
35
|
Chris@14
|
36 static void hanning_window(double *p_window, int n, bool normalize);
|
Chris@14
|
37 };
|
Chris@14
|
38
|
Chris@14
|
39 #endif
|
Chris@14
|
40
|