Loris::FourierTransform Class Reference

#include <FourierTransform.h>

List of all members.

Public Types

typedef std::vector
< std::complex< double >
>::size_type 
size_type
typedef std::vector
< std::complex< double >
>::iterator 
iterator
 The type of a non-const iterator of (complex) transform samples.
typedef std::vector
< std::complex< double >
>::const_iterator 
const_iterator
 The type of a const iterator of (complex) transform samples.

Public Member Functions

 FourierTransform (size_type len)
 FourierTransform (const FourierTransform &rhs)
 ~FourierTransform (void)
 Free the resources associated with this FourierTransform.
FourierTransformoperator= (const FourierTransform &rhs)
std::complex< double > & operator[] (size_type index)
const std::complex< double > & operator[] (size_type index) const
iterator begin (void)
iterator end (void)
const_iterator begin (void) const
const_iterator end (void) const
void transform (void)
size_type size (void) const

Detailed Description

FourierTransform provides a simplified interface to the FFTW library (www.fftw.org). Loris uses the FFTW library to perform efficient Fourier transforms of arbitrary length. Clients store and access the in-place transform data as a sequence of std::complex< double >. Samples are stored in the FourierTransform instance using subscript or iterator access, the transform is computed by the transform member, and the transformed samples replace the input samples, and are accessed by subscript or iterator. FourierTransform computes a complex transform, so it can be used to invert a transform of real samples as well. Uses the standard library complex class, which implements arithmetic operations.

Supports FFTW versions 2 and 3. Does not make use of FFTW "wisdom" to speed up transform computation.

If FFTW is unavailable, uses instead the General Purpose FFT package by Takuya OOURA, http://momonga.t.u-tokyo.ac.jp/~ooura/fft.html defined in fftsg.c for power-of-two transforms, and a very slow direct DFT implementation for non-PO2 transforms.


Member Typedef Documentation

typedef std::vector< std::complex< double > >::size_type Loris::FourierTransform::size_type

An unsigned integral type large enough to represent the length of any transform.


Constructor & Destructor Documentation

Loris::FourierTransform::FourierTransform ( size_type  len  ) 

Initialize a new FourierTransform of the specified size.

Parameters:
len is the length of the transform in samples (the number of samples in the transform)
Exceptions:
RuntimeError if the necessary buffers cannot be allocated, or there is an error configuring FFTW.
Loris::FourierTransform::FourierTransform ( const FourierTransform rhs  ) 

Initialize a new FourierTransform that is a copy of another, having the same size and the same buffer contents.

Parameters:
rhs is the instance to copy
Exceptions:
RuntimeError if the necessary buffers cannot be allocated, or there is an error configuring FFTW.

Member Function Documentation

const_iterator Loris::FourierTransform::begin ( void   )  const [inline]

Return a const iterator refering to the beginning of the sequence of complex samples in the transform buffer.

Returns:
a const iterator refering to the first position in the transform buffer.
iterator Loris::FourierTransform::begin ( void   )  [inline]

Return an iterator refering to the beginning of the sequence of complex samples in the transform buffer.

Returns:
a non-const iterator refering to the first position in the transform buffer.
const_iterator Loris::FourierTransform::end ( void   )  const [inline]

Return a const iterator refering to the end of the sequence of complex samples in the transform buffer.

Returns:
a const iterator refering to one past the last position in the transform buffer.
iterator Loris::FourierTransform::end ( void   )  [inline]

Return an iterator refering to the end of the sequence of complex samples in the transform buffer.

Returns:
a non-const iterator refering to one past the last position in the transform buffer.
FourierTransform& Loris::FourierTransform::operator= ( const FourierTransform rhs  ) 

Make this FourierTransform a copy of another, having the same size and buffer contents.

Parameters:
rhs is the instance to copy
Returns:
a refernce to this instance
Exceptions:
RuntimeError if the necessary buffers cannot be allocated, or there is an error configuring FFTW.
const std::complex< double >& Loris::FourierTransform::operator[] ( size_type  index  )  const [inline]

Access (read-only) a transform sample by index. Use this member to fill the transform buffer before computing the transform, and to access the samples after computing the transform. (inlined for speed)

Parameters:
index is the index or rank of the complex transform sample to access. Zero is the first position in the buffer.
Returns:
const reference to the std::complex< double > at the specified position in the buffer.
std::complex< double >& Loris::FourierTransform::operator[] ( size_type  index  )  [inline]

Access (read/write) a transform sample by index. Use this member to fill the transform buffer before computing the transform, and to access the samples after computing the transform. (inlined for speed)

Parameters:
index is the index or rank of the complex transform sample to access. Zero is the first position in the buffer.
Returns:
non-const reference to the std::complex< double > at the specified position in the buffer.
size_type Loris::FourierTransform::size ( void   )  const

Return the length of the transform (in samples).

Returns:
the length of the transform in samples.
void Loris::FourierTransform::transform ( void   ) 

Compute the Fourier transform of the samples stored in the transform buffer. The samples stored in the transform buffer (accessed by index or by iterator) are replaced by the transformed samples, in-place.


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2