From f8c6579b910d2752f40850fbf17f045fa5de0366 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 12 Dec 2014 12:01:59 +0100 Subject: Update copyright headers --- include/astra/Fourier.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include/astra/Fourier.h') diff --git a/include/astra/Fourier.h b/include/astra/Fourier.h index 290c094..2060b51 100644 --- a/include/astra/Fourier.h +++ b/include/astra/Fourier.h @@ -1,13 +1,13 @@ /* ----------------------------------------------------------------------- -Copyright 2012 iMinds-Vision Lab, University of Antwerp +Copyright: 2010-2014, iMinds-Vision Lab, University of Antwerp + 2014, CWI, Amsterdam -Contact: astra@ua.ac.be -Website: http://astra.ua.ac.be +Contact: astra@uantwerpen.be +Website: http://sf.net/projects/astra-toolbox +This file is part of the ASTRA Toolbox. -This file is part of the -All Scale Tomographic Reconstruction Antwerp Toolbox ("ASTRA Toolbox"). The ASTRA Toolbox is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -- cgit v1.2.3 From 37fde19dfe60bb8e0b0d96119cc005f756172a3e Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 26 Jan 2015 11:36:11 +0100 Subject: Update copyright to -2015 --- include/astra/Fourier.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/astra/Fourier.h') diff --git a/include/astra/Fourier.h b/include/astra/Fourier.h index 2060b51..b515dc6 100644 --- a/include/astra/Fourier.h +++ b/include/astra/Fourier.h @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------- -Copyright: 2010-2014, iMinds-Vision Lab, University of Antwerp - 2014, CWI, Amsterdam +Copyright: 2010-2015, iMinds-Vision Lab, University of Antwerp + 2014-2015, CWI, Amsterdam Contact: astra@uantwerpen.be Website: http://sf.net/projects/astra-toolbox -- cgit v1.2.3 From 6ccde536191676f9b504055b16c68786858b693d Mon Sep 17 00:00:00 2001 From: "Daniel M. Pelt" Date: Fri, 22 Apr 2016 14:22:53 +0200 Subject: Change CPU FFT implementation --- include/astra/Fourier.h | 132 ++++++++++++++++-------------------------------- 1 file changed, 44 insertions(+), 88 deletions(-) (limited to 'include/astra/Fourier.h') diff --git a/include/astra/Fourier.h b/include/astra/Fourier.h index b515dc6..ff26f82 100644 --- a/include/astra/Fourier.h +++ b/include/astra/Fourier.h @@ -33,94 +33,50 @@ $Id$ namespace astra { - -/** - * Perform a 1D DFT or inverse DFT. - * - * @param iLength number of elements - * @param pfRealIn real part of input - * @param pfImaginaryIn imaginary part of input - * @param pfRealOut real part of output - * @param pfImaginaryOut imaginary part of output - * @param iStrideIn distance between elements in pf*In - * @param iStrideOut distance between elements in pf*Out - * @param bInverse if true, perform an inverse DFT - */ - -void _AstraExport discreteFourierTransform1D(unsigned int iLength, - const float32* pfRealIn, - const float32* pfImaginaryIn, - float32* pfRealOut, - float32* pfImaginaryOut, - unsigned int iStrideIn, - unsigned int iStrideOut, - bool bInverse); - -/** - * Perform a 2D DFT or inverse DFT. - * - * @param iHeight number of rows - * @param iWidth number of columns - * @param pfRealIn real part of input - * @param pfImaginaryIn imaginary part of input - * @param pfRealOut real part of output - * @param pfImaginaryOut imaginary part of output - * @param bInverse if true, perform an inverse DFT - */ - -void _AstraExport discreteFourierTransform2D(unsigned int iHeight, unsigned int iWidth, - const float32* pfRealIn, - const float32* pfImaginaryIn, - float32* pfRealOut, - float32* pfImaginaryOut, - bool bInverse); - -/** - * Perform a 1D FFT or inverse FFT. The size must be a power of two. - * This transform can be done in-place, so the input and output pointers - * may point to the same data. - * - * @param iLength number of elements, must be a power of two - * @param pfRealIn real part of input - * @param pfImaginaryIn imaginary part of input - * @param pfRealOut real part of output - * @param pfImaginaryOut imaginary part of output - * @param iStrideIn distance between elements in pf*In - * @param iStrideOut distance between elements in pf*Out - * @param bInverse if true, perform an inverse DFT - */ - -void _AstraExport fastTwoPowerFourierTransform1D(unsigned int iLength, - const float32* pfRealIn, - const float32* pfImaginaryIn, - float32* pfRealOut, - float32* pfImaginaryOut, - unsigned int iStrideIn, - unsigned int iStrideOut, - bool bInverse); - -/** - * Perform a 2D FFT or inverse FFT. The size must be a power of two. - * This transform can be done in-place, so the input and output pointers - * may point to the same data. - * - * @param iHeight number of rows, must be a power of two - * @param iWidth number of columns, must be a power of two - * @param pfRealIn real part of input - * @param pfImaginaryIn imaginary part of input - * @param pfRealOut real part of output - * @param pfImaginaryOut imaginary part of output - * @param bInverse if true, perform an inverse DFT - */ - -void _AstraExport fastTwoPowerFourierTransform2D(unsigned int iHeight, - unsigned int iWidth, - const float32* pfRealIn, - const float32* pfImaginaryIn, - float32* pfRealOut, - float32* pfImaginaryOut, - bool bInverse); - +/* +-------- Complex DFT (Discrete Fourier Transform) -------- + [definition] + + X[k] = sum_j=0^n-1 x[j]*exp(2*pi*i*j*k/n), 0<=k + X[k] = sum_j=0^n-1 x[j]*exp(-2*pi*i*j*k/n), 0<=k + ip[0] = 0; // first time only + cdft(2*n, 1, a, ip, w); + + ip[0] = 0; // first time only + cdft(2*n, -1, a, ip, w); + [parameters] + 2*n :data length (int) + n >= 1, n = power of 2 + a[0...2*n-1] :input/output data (float32 *) + input data + a[2*j] = Re(x[j]), + a[2*j+1] = Im(x[j]), 0<=j= 2+sqrt(n) + strictly, + length of ip >= + 2+(1<<(int)(log(n+0.5)/log(2))/2). + ip[0],ip[1] are pointers of the cos/sin table. + w[0...n/2-1] :cos/sin table (float32 *) + w[],ip[] are initialized if ip[0] == 0. + [remark] + Inverse of + cdft(2*n, -1, a, ip, w); + is + cdft(2*n, 1, a, ip, w); + for (j = 0; j <= 2 * n - 1; j++) { + a[j] *= 1.0 / n; + } + . +*/ +void cdft(int n, int isgn, float32 *a, int *ip, float32 *w); } -- cgit v1.2.3 From 7f8b7b37121e06cec76b2b1cab1b56920c2c4ef4 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Fri, 22 Apr 2016 17:15:03 +0200 Subject: Fix build --- include/astra/Fourier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/astra/Fourier.h') diff --git a/include/astra/Fourier.h b/include/astra/Fourier.h index ff26f82..68f9f38 100644 --- a/include/astra/Fourier.h +++ b/include/astra/Fourier.h @@ -76,7 +76,7 @@ namespace astra { } . */ -void cdft(int n, int isgn, float32 *a, int *ip, float32 *w); +_AstraExport void cdft(int n, int isgn, float32 *a, int *ip, float32 *w); } -- cgit v1.2.3