/* ================================================================================ RPL/2 (R) version 4.0.21 Copyright (C) 1989-2011 Dr. BERTRAND Joël This file is part of RPL/2. RPL/2 is free software; you can redistribute it and/or modify it under the terms of the CeCILL V2 License as published by the french CEA, CNRS and INRIA. RPL/2 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 CeCILL V2 License for more details. You should have received a copy of the CeCILL License along with RPL/2. If not, write to info@cecill.info. ================================================================================ */ #include "rpl-conv.h" /* ================================================================================ Fonction de calcul d'une transformée de Fourier discrète ================================================================================ Entrées : pointeur sur une structure struct_processus -------------------------------------------------------------------------------- Sorties : -------------------------------------------------------------------------------- Effets de bord : néant ================================================================================ */ void dft(complex16 *dft, integer4 *nombre_lignes, integer4 *nombre_colonnes, integer4 *inverse, integer4 *erreur) { integer4 i; gsl_fft_complex_wavetable *wavetable; gsl_fft_complex_workspace *workspace; wavetable = gsl_fft_complex_wavetable_alloc((size_t) (*nombre_colonnes)); workspace = gsl_fft_complex_workspace_alloc((size_t) (*nombre_colonnes)); (*erreur) = 0; if ((*inverse) == 0) { for(i = 0; (i < (*nombre_lignes)) && ((*erreur) == 0); i++) { (*erreur) = gsl_fft_complex_forward((gsl_complex_packed_array) &(dft[i * (*nombre_colonnes)]), (size_t) 1, (size_t) (*nombre_colonnes), wavetable, workspace); } } else { for(i = 0; (i < (*nombre_lignes)) && ((*erreur) == 0); i++) { (*erreur) = gsl_fft_complex_inverse((gsl_complex_packed_array) &(dft[i * (*nombre_colonnes)]), (size_t) 1, (size_t) (*nombre_colonnes), wavetable, workspace); } } gsl_fft_complex_wavetable_free(wavetable); gsl_fft_complex_workspace_free(workspace); return; } // vim: ts=4