/* fft/c_pass_n.c * * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Brian Gough * * This program 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 3 of the License, or (at * your option) any later version. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ static int FUNCTION(fft_complex,pass_n) (BASE in[], const size_t istride, BASE out[], const size_t ostride, const gsl_fft_direction sign, const size_t factor, const size_t product, const size_t n, const TYPE(gsl_complex) twiddle[]) { size_t i = 0, j = 0; size_t k, k1; const size_t m = n / factor; const size_t q = n / product; const size_t p_1 = product / factor; const size_t jump = (factor - 1) * p_1; size_t e, e1; for (i = 0; i < m; i++) { REAL(out,ostride,i) = REAL(in,istride,i); IMAG(out,ostride,i) = IMAG(in,istride,i); } for (e = 1; e < (factor - 1) / 2 + 1; e++) { for (i = 0; i < m; i++) { const size_t idx = i + e * m; const size_t idxc = i + (factor - e) * m; REAL(out,ostride,idx) = REAL(in,istride,idx) + REAL(in,istride,idxc); IMAG(out,ostride,idx) = IMAG(in,istride,idx) + IMAG(in,istride,idxc); REAL(out,ostride,idxc) = REAL(in,istride,idx) - REAL(in,istride,idxc); IMAG(out,ostride,idxc) = IMAG(in,istride,idx) - IMAG(in,istride,idxc); } } /* e = 0 */ for (i=0 ; i