/*----------------------------------------------------------------------------------------- * Copyright (C) 2016 For the list of authors, see file AUTHORS. * * This file is part of IFOS. * * IFOS is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2.0 of the License only. * * IFOS is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with IFOS. See file COPYING and/or . -----------------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------ * Function for convolving * ----------------------------------------------------------------------*/ #include "fd.h" #include "segy.h" #include void conv_FD(float * temp_TS, float * temp_TS1, float * temp_conv, int ns){ /* declaration of local variables */ int i,j, h, nfreq, npad; float xr, yr, x, y, dump, a; double npadd; /* declaration of variables for FFTW3*/ fftw_complex *in1, *in2, *out1, *out2, *out3; fftw_plan p1, p2, p3; npad = (int)(pow(2.0, ceil(log((double)(ns))/log(2.0))+2.0) ); /* ns -> npad for usage in FFT*/ npadd = (double)npad; in1 = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * npad); out1 = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * npad); in2 = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * npad); out2 = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * npad); out3 = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * npad); for (j=0;j