Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

Loris::FourierTransform Class Reference

FourierTransform provides a simplified interface to the FFTW library (www.fftw.org). More...

#include <FourierTransform.h>

List of all members.

Public Types

typedef std::vector< std::complex<
double > >::size_type 
size_type
 An unsigned integral type large enough to represent the length of any transform.

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)
 
Exceptions:
RuntimeError if the necessary buffers cannot be allocated, or there is an error configuring FFTW.


 FourierTransform (const FourierTransform &rhs)
 Initialize a new FourierTransform that is a copy of another, having the same size and the same buffer contents.

 ~FourierTransform (void)
 Free the resources associated with this FourierTransform.

FourierTransformoperator= (const FourierTransform &rhs)
 Make this FourierTransform a copy of another, having the same size and buffer contents.

std::complex< double > & operator[] (size_type index)
 Access (read/write) a transform sample by index.

const std::complex< double > & operator[] (size_type index) const
 Access (read-only) a transform sample by index.

iterator begin (void)
 Return an iterator refering to the beginning of the sequence of complex samples in the transform buffer.

iterator end (void)
 complex samples in the transform buffer.

const_iterator begin (void) const
 Return a const iterator refering to the beginning of the sequence of complex samples in the transform buffer.

const_iterator end (void) const
 complex samples in the transform buffer.

void transform (void)
 Compute the Fourier transform of the samples stored in the transform buffer.

size_type size (void) const
 Return the length of the transform (in samples).


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. Does not use FFTW "wisdom" to speed up transform computation.


Constructor & Destructor Documentation

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
 

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   ) 
 

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
 

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   ) 
 

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
 

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  ) 
 

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.


Generated on Thu Apr 14 22:01:56 2005 for Loris by doxygen 1.3.4