Chris@0: /*
Chris@0: copyright (C) 2012 I. Irigaray, M. Rocamora
Chris@0:
Chris@0: This program is free software: you can redistribute it and/or modify
Chris@0: it under the terms of the GNU General Public License as published by
Chris@0: the Free Software Foundation, either version 3 of the License, or
Chris@0: (at your option) any later version.
Chris@0:
Chris@0: This program is distributed in the hope that it will be useful,
Chris@0: but WITHOUT ANY WARRANTY; without even the implied warranty of
Chris@0: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Chris@0: GNU General Public License for more details.
Chris@0:
Chris@0: You should have received a copy of the GNU General Public License
Chris@0: along with this program. If not, see .
Chris@0: */
Chris@0:
Chris@14: #ifndef FCHTRANSFORMUTILS_H
Chris@14: #define FCHTRANSFORMUTILS_H
Chris@14:
Chris@0: #include
Chris@0:
Chris@21: #include "bqvec/Restrict.h"
Chris@21:
Chris@14: class Utils
Chris@14: {
Chris@14: public:
Chris@14: static void interp1(const double *x1,const double *y1, int N1, const double *x2, double *y2, int N2);
Chris@0:
Chris@21: static void interp1q(const double *const BQ_R__ y1,
Chris@21: const int *const BQ_R__ x2_int,
Chris@21: const double *const BQ_R__ x2_frac,
Chris@21: double *const BQ_R__ y2,
Chris@21: int const n2)
Chris@21: {
Chris@21: for (int i = 0; i < n2; ++i) {
Chris@21: double f = x2_frac[i];
Chris@21: int j = x2_int[i];
Chris@21: y2[i] = y1[j] * (1.0-f) + y1[j+1] * f;
Chris@21: }
Chris@14: }
Chris@0:
Chris@14: static void cumtrapz(const double *x, const double *y, int N, double *accum);
Chris@0:
Chris@14: static void hanning_window(double *p_window, int n, bool normalize);
Chris@14: };
Chris@14:
Chris@14: #endif
Chris@14: