SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
DComplexFFTServer Class Reference

Performs double precision complex fast Fourier transforms (FFTs) of an RWMathVec vector. More...

#include <rw/cfft.h>

Inheritance diagram for DComplexFFTServer:
DoubleFFTServer DoubleCosineServer

Public Member Functions

 DComplexFFTServer ()
 
 DComplexFFTServer (const DComplexFFTServer &)
 
 DComplexFFTServer (size_t order)
 
RWMathVec< DComplexfourier (const RWMathVec< DComplex > &v)
 
RWMathVec< DComplexifourier (const RWMathVec< DComplex > &v)
 
DComplexFFTServeroperator= (const DComplexFFTServer &v)
 
size_t order () const
 
void setOrder (size_t N)
 

Detailed Description

Class DComplexFFTServer performs double precision complex fast Fourier transforms (FFTs) of an RWMathVec vector. The transform of a complex vector is a complex vector; therefore, the server returns a complex vector for either a forward or backward (inverse) transform.

At any given moment, the server is configured to transform a vector of a specified length. This length can be set three ways:

  • At construction time.
  • With the function setOrder().
  • By the server from a supplied vector length.

The last method means that if the vector length changes, the server automatically reconfigures to the new length. Since this is an expensive calculation, it is most efficient to call a server repeatedly for series of the same length. Different FFT servers may be constructed to handle different lengths.

There are no restrictions on the number of points; that is, the number need not be a power of 2.

The Fourier transform calculated is:

\[ A(n) = \displaystyle\sum_{j=0}^{N-1}X(j)exp\left(\frac{-2i \pi nj}{N}\right); \quad n=0, \quad .., \quad N-1 \]

The inverse Fourier transform (IDFT) calculated is:

\[ X(j) = \displaystyle\sum_{n=0}^{N-1}A(n)exp\left(\frac{2i \pi nj}{N}\right); \quad j=0, \quad .., \quad N-1 \]

where A and X are complex. Note that the sum is not normalized; a call to fourier() followed by a call to ifourier() results in the original series multiplied by N.

Synopsis
#include <rw/cfft.h>
Performs double precision complex fast Fourier transforms (FFTs) of an RWMathVec vector.
Definition cfft.h:103

Constructor & Destructor Documentation

◆ DComplexFFTServer() [1/3]

DComplexFFTServer::DComplexFFTServer ( )

Constructs a complex FFT server to transform a vector of unspecified length. This length is initialized when the server is used.

◆ DComplexFFTServer() [2/3]

DComplexFFTServer::DComplexFFTServer ( size_t order)

Constructs a complex FFT server designed to transform a vector of length order.

◆ DComplexFFTServer() [3/3]

DComplexFFTServer::DComplexFFTServer ( const DComplexFFTServer & )

Copy constructor. The new server references the old server's data.

Member Function Documentation

◆ fourier()

RWMathVec< DComplex > DComplexFFTServer::fourier ( const RWMathVec< DComplex > & v)

Returns the forward FFT, as defined above, of a complex vector v. The expression:

std::cout << f.fourier(v);
RWMathVec< DComplex > fourier(const RWMathVec< DComplex > &v)
A templatized vector class.
Definition mathvec.h:667

outputs the Fourier transform of v as a complex vector with N points. If the server is not currently configured to the length of v, it reconfigures.

◆ ifourier()

RWMathVec< DComplex > DComplexFFTServer::ifourier ( const RWMathVec< DComplex > & v)

Returns the inverse FFT, as defined above, of a complex vector v. The expression:

outputs the inverse Fourier transform of v as a complex vector with N points.

◆ operator=()

DComplexFFTServer & DComplexFFTServer::operator= ( const DComplexFFTServer & v)

Sets self to the same order as v.

◆ order()

size_t DComplexFFTServer::order ( ) const
inline

Returns the order of an FFT server, that is, the vector length it is currently configured to transform.

◆ setOrder()

void DComplexFFTServer::setOrder ( size_t N)

Resets the order of an FFT server to N.

Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.