Brief description of class still missing. More...
#include <DFFTPack.h>
Public Member Functions | |
virtual void | backward (int nSamples, double *samples) |
virtual void | backward (int nSamples, Complex *samples) |
virtual void | forward (int nSamples, double *samples) |
virtual void | forward (int nSamples, Complex *samples) |
virtual void | manyBackward (int howmany, int nSamples, Complex *samples) |
virtual void | manyForward (int howmany, int nSamples, Complex *samples) |
Brief description of class still missing.
Full description of class still missing
void GeopsyCore::DFFTPack::backward | ( | int | nSamples, |
double * | samples | ||
) | [virtual] |
Implements GeopsyCore::FastFourierTransform.
References GeopsyCore::DFFTPackCache::begin(), QGpCoreTools::AbstractNumericalCache::end(), GeopsyCore::DFFTPackKey::Real, GeopsyCore::rfftb1_(), and GeopsyCore::DFFTPackCache::wsave().
{ long n=nSamples; double * buf=new double[n]; // Re-order complex vector memcpy(buf, samples, n*sizeof(double)); // samples[0] is already at the good place int i2; int n2=n >> 1; if(n & 0x00000001) { for(int i=n2; i>0; i-- ) { i2=i << 1; samples[i2-1]=buf[i]; samples[i2]=buf[n-i]; } } else { for(int i=n2-1; i>0; i-- ) { i2=i << 1; samples[i2-1]=buf[i]; samples[i2]=buf[n-i]; } samples[n-1]=buf[n2]; } const DFFTPackCache * cache=DFFTPackCache::begin(nSamples, DFFTPackKey::Real); rfftb1_(&n, samples, buf, cache->wsave(), cache->wsave()+n); DFFTPackCache::end(cache); delete [] buf; }
void GeopsyCore::DFFTPack::backward | ( | int | nSamples, |
Complex * | samples | ||
) | [virtual] |
Implements GeopsyCore::FastFourierTransform.
References GeopsyCore::DFFTPackCache::begin(), GeopsyCore::cfftb1_(), GeopsyCore::DFFTPackKey::Complex, QGpCoreTools::AbstractNumericalCache::end(), and GeopsyCore::DFFTPackCache::wsave().
{ long n=nSamples; long n2=n << 1; double * buf=new double[n2]; const DFFTPackCache * cache=DFFTPackCache::begin(nSamples, DFFTPackKey::Complex); cfftb1_(&n, samples, buf, cache->wsave(), cache->wsave()+n2); DFFTPackCache::end(cache); delete [] buf; }
void GeopsyCore::DFFTPack::forward | ( | int | nSamples, |
double * | samples | ||
) | [virtual] |
Output format: r0, r1, r2, ..., r(n+1)/2-1, [, rn/2], i(n+1)/2-1, ..., i2, i1 ([] only for even n)
Uses dfftpack which have a slighly different output format: r0, r1, i1, r2, i2,..., r(n+1)/2-1, i(n+1)/2-1, [rn/2]
Implements GeopsyCore::FastFourierTransform.
References GeopsyCore::DFFTPackCache::begin(), QGpCoreTools::AbstractNumericalCache::end(), GeopsyCore::DFFTPackKey::Real, GeopsyCore::rfftf1_(), and GeopsyCore::DFFTPackCache::wsave().
{ long n=nSamples; double * buf=new double[n]; const DFFTPackCache * cache=DFFTPackCache::begin(nSamples, DFFTPackKey::Real); rfftf1_(&n, samples, buf, cache->wsave(), cache->wsave()+n); DFFTPackCache::end(cache); // Re-order complex vector memcpy(buf, samples, n*sizeof(double)); // samples[0] is already at the good place int i2; int n2=n >> 1; if(n & 0x00000001) { for(int i=n2; i>0; i-- ) { i2=i << 1; samples[i]=buf[i2-1]; samples[n-i]=buf[i2]; } } else { for(int i=n2-1; i>0; i-- ) { i2=i << 1; samples[i]=buf[i2-1]; samples[n-i]=buf[i2]; } samples[n2]=buf[n-1]; } delete [] buf; }
void GeopsyCore::DFFTPack::forward | ( | int | nSamples, |
Complex * | samples | ||
) | [virtual] |
Implements GeopsyCore::FastFourierTransform.
References GeopsyCore::DFFTPackCache::begin(), GeopsyCore::cfftf1_(), GeopsyCore::DFFTPackKey::Complex, QGpCoreTools::AbstractNumericalCache::end(), and GeopsyCore::DFFTPackCache::wsave().
{ long n=nSamples; long n2=n << 1; double * buf=new double[n2]; const DFFTPackCache * cache=DFFTPackCache::begin(nSamples, DFFTPackKey::Complex); cfftf1_(&n, samples, buf, cache->wsave(), cache->wsave()+n2); DFFTPackCache::end(cache); delete [] buf; }
void GeopsyCore::DFFTPack::manyBackward | ( | int | howmany, |
int | nSamples, | ||
Complex * | samples | ||
) | [virtual] |
Implements GeopsyCore::FastFourierTransform.
References GeopsyCore::DFFTPackCache::begin(), GeopsyCore::cfftb1_(), GeopsyCore::DFFTPackKey::Complex, QGpCoreTools::AbstractNumericalCache::end(), and GeopsyCore::DFFTPackCache::wsave().
{ long n=nSamples; long n2=n << 1; double * buf=new double[n2]; const DFFTPackCache * cache=DFFTPackCache::begin(nSamples, DFFTPackKey::Complex); for(int i=0; i<howmany; i++) { cfftb1_(&n, samples, buf, cache->wsave(), cache->wsave()+n2); samples+=nSamples; } DFFTPackCache::end(cache); delete [] buf; }
void GeopsyCore::DFFTPack::manyForward | ( | int | howmany, |
int | nSamples, | ||
Complex * | samples | ||
) | [virtual] |
Implements GeopsyCore::FastFourierTransform.
References GeopsyCore::DFFTPackCache::begin(), GeopsyCore::cfftf1_(), GeopsyCore::DFFTPackKey::Complex, QGpCoreTools::AbstractNumericalCache::end(), and GeopsyCore::DFFTPackCache::wsave().
{ long n=nSamples; long n2=n << 1; double * buf=new double[n2]; const DFFTPackCache * cache=DFFTPackCache::begin(nSamples, DFFTPackKey::Complex); for(int i=0; i<howmany; i++) { cfftf1_(&n, samples, buf, cache->wsave(), cache->wsave()+n2); samples+=nSamples; } DFFTPackCache::end(cache); delete [] buf; }