Commit 6ae7f5c4 authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

fftw3 array engine is fully implemented; remains to be tested

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/branches/libfourier
SVN Revision: 3953
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent d51f8bdf
......@@ -27,7 +27,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* ----
*
*
* REVISIONS and CHANGES
* - 13/05/2011 V1.0 Thomas Forbriger
*
......@@ -49,7 +48,7 @@ namespace fourier {
DRFFTWAFFArrayEngine::DRFFTWAFFArrayEngine(const int& nseis,
const int& nsamp)
: Mseriesarray(TAseries(nsamp,nseis)),
Mspectrumarray(TAspectrum(DRFFTWAFFArrayEngine::ncoeff(nsamp)),nseis),
Mspectrumarray(TAspectrum(DRFFTWAFFArrayEngine::ncoeff(nsamp),nseis)),
Mplanr2c(0), Mplanc2r(0)
{
this->checkconsistency();
......@@ -84,14 +83,26 @@ namespace fourier {
/*----------------------------------------------------------------------*/
//! execute c2r plan
void DRFFTWAFFArrayEngine::c2r()
{
if (Mplanc2r == 0)
{
this->createplanc2r();
}
fftw_execute(Mplanc2r);
} // DRFFTWAFFArrayEngine::c2r()
/*----------------------------------------------------------------------*/
//! execute r2c plan
void DRFFTWAFFArrayEngine::r2c()
{
if (Mplanr2c == 0)
{
this->createplanr2c();
}
fftw_execute(Mplanr2c);
} // DRFFTWAFFArrayEngine::r2c()
/*----------------------------------------------------------------------*/
......@@ -209,6 +220,31 @@ namespace fourier {
}
} // void DRFFTWAFFArrayEngine::createplanc2r()
/*----------------------------------------------------------------------*/
//! Return appropriate scaling factor for sampling interval dt.
DRFFTWAFFArrayEngine::Tsample
DRFFTWAFFArrayEngine::scale_series(const Tsample& dt) const
{
return(1./(Mseriesarray.size(0)*dt));
} // Tsample DRFFTWAFFArrayEngine::scale_series(const Tsample& dt) const
/*----------------------------------------------------------------------*/
//! Return appropriate scaling factor for sampling interval dt.
DRFFTWAFFArrayEngine::Tsample
DRFFTWAFFArrayEngine::scale_spectrum(const Tsample& dt) const
{
return(dt);
} // Tsample DRFFTWAFFArrayEngine::scale_spectrum(const Tsample& dt) const
/*----------------------------------------------------------------------*/
unsigned int DRFFTWAFFArrayEngine::nseries() const
{
return Mseriesarray.size(1);
} // unsigned int DRFFTWAFFArrayEngine::nseries() const
} // namespace fft
} // namespace fourier
......
......@@ -99,11 +99,11 @@ namespace fourier {
//! \brief return a reference to the Fourier coefficient arrays
TAspectrum spectrum() const { return Mspectrumarray; }
//! \brief return the number of series in the arrays
int nseries() const;
unsigned int nseries() const;
//! \brief return a reference to the time series i
Tseries series(const int& i) const;
TAseries series(const int& i) const;
//! \brief return a reference to the Fourier coefficients of series i
Tspectrum specturm(const int& i) const;
TAspectrum specturm(const int& i) const;
private:
void checkconsistency();
void createplanr2c();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment