/* convolfft_c subroutine * FFT convolution computation * * Copyright (C) 2007-2009 Alan Layec * * This file is part of modnumlib. * * modnumlib 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; either version 2 of the License, or * (at your option) any later version. * * modnumlib 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 modnumlib; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ /* REVISION HISTORY : * $Log$ */ #include "modnum_lib.h" /* convolfft_c routine de calcul de filtre à réponse impulsionnelle finie * par la méthode de convolution par fft * * m1 : taille des vecteurs * z1_r : adresse de départ de la partie réelle du vecteur temporel 1 d'entrée * z1_i : adresse de départ de la partie imaginaire du vecteur temporel 1 d'entrée * z2_r : adresse de départ de la partie réelle du vecteur temporel 2 d'entrée * z2_i : adresse de départ de la partie imaginaire du vecteur temporel 2 d'entrée * y_r : adresse de départ de la partie réelle du vecteur temporel résultat * y_i : adresse de départ de la partie imaginaire du vecteur temporel résultat * * utilise : calc_fft * complx_c * * rmq m1 doit-être de taille en puissance de 2 */ void convolfft_c(int *m1, \ double *z1_r,double *z1_i, \ double *z2_r,double *z2_i, \ double *y_r,double *y_i, \ fft_pr_struct *fft_pr) { /*déclaration*/ /*int k,ierr;*/ /*def d'une structure pour calcul de fft*/ /* fft_pr_struct fft_pr; * * fft_pr.lfft = *m1; * fft_pr.ffttyp = 0; * fft_pr.isn = 0; */ /*appel fft*/ fft_pr->isn = 0; calc_fft_c(fft_pr,z1_r,z1_i); /*appel fft*/ calc_fft_c(fft_pr,z2_r,z2_i); /*Réalise la multiplication vectorielle complexe*/ cmplxmult_c(m1,&z1_r[0],&z1_i[0],&z2_r[0],&z2_i[0],&y_r[0],&y_i[0]); /*appel fft-1*/ fft_pr->isn = 1; calc_fft_c(fft_pr,y_r,y_i); }