X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=libctsim%2Ffourier.cpp;fp=libctsim%2Ffourier.cpp;h=eb2c58d30310c49068320946f3a5bd34d6164173;hp=08940d43636881e2db2d632b09ccfba95fae1ac3;hb=2796ae86cd15663bcd6875a45d4b9d7c650321ce;hpb=c8fac8b2ba8998e384a3fd285c86e45ab494b235 diff --git a/libctsim/fourier.cpp b/libctsim/fourier.cpp index 08940d4..eb2c58d 100644 --- a/libctsim/fourier.cpp +++ b/libctsim/fourier.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2001 Kevin Rosenberg ** -** $Id: fourier.cpp,v 1.2 2001/01/02 16:02:13 kevin Exp $ +** $Id: fourier.cpp,v 1.3 2001/01/13 10:14:06 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -56,14 +56,14 @@ Fourier::shuffleFourierToNaturalOrder (ImageFile& im) if (im.isComplex()) { for (ix = 0; ix < nx; ix++) pRow[ix] = vImag[ix][iy]; - Fourier::shuffleFourierToNaturalOrder (pRow, nx);; + Fourier::shuffleFourierToNaturalOrder (pRow, nx); for (ix = 0; ix < nx; ix++) vImag[ix][iy] = pRow[ix]; } } delete pRow; } - + void Fourier::shuffleNaturalToFourierOrder (ImageFile& im) { @@ -99,7 +99,7 @@ Fourier::shuffleNaturalToFourierOrder (ImageFile& im) delete [] pRow; } - + // Odd Number of Points // Natural Frequency Order: -(n-1)/2...-1,0,1...(n-1)/2 // Fourier Frequency Order: 0, 1..(n-1)/2,-(n-1)/2...-1 @@ -114,7 +114,7 @@ Fourier::shuffleNaturalToFourierOrder (double* pdVector, const int n) int i; if (n % 2) { // Odd int iHalfN = (n - 1) / 2; - + pdTemp[0] = pdVector[iHalfN]; for (i = 0; i < iHalfN; i++) pdTemp[i + 1] = pdVector[i + 1 + iHalfN]; @@ -128,7 +128,7 @@ Fourier::shuffleNaturalToFourierOrder (double* pdVector, const int n) for (i = 0; i < iHalfN; i++) pdTemp[i + iHalfN] = pdVector[i]; } - + for (i = 0; i < n; i++) pdVector[i] = pdTemp[i]; delete pdTemp; @@ -141,7 +141,7 @@ Fourier::shuffleNaturalToFourierOrder (std::complex* pdVector, const int int i; if (n % 2) { // Odd int iHalfN = (n - 1) / 2; - + pdTemp[0] = pdVector[iHalfN]; for (i = 0; i < iHalfN; i++) pdTemp[i + 1] = pdVector[i + 1 + iHalfN]; @@ -155,7 +155,7 @@ Fourier::shuffleNaturalToFourierOrder (std::complex* pdVector, const int for (i = 0; i < iHalfN; i++) pdTemp[i + iHalfN] = pdVector[i]; } - + for (i = 0; i < n; i++) pdVector[i] = pdTemp[i]; delete [] pdTemp; @@ -169,7 +169,7 @@ Fourier::shuffleNaturalToFourierOrder (float* pdVector, const int n) int i; if (n % 2) { // Odd int iHalfN = (n - 1) / 2; - + pdTemp[0] = pdVector[iHalfN]; for (i = 0; i < iHalfN; i++) pdTemp[i + 1] = pdVector[i + 1 + iHalfN]; @@ -183,7 +183,7 @@ Fourier::shuffleNaturalToFourierOrder (float* pdVector, const int n) for (i = 0; i < iHalfN; i++) pdTemp[i + iHalfN] = pdVector[i]; } - + for (i = 0; i < n; i++) pdVector[i] = pdTemp[i]; delete pdTemp;