AudioDataLib
A C++ library of classes supporting a variety of audio-data tasks.
Loading...
Searching...
No Matches
AudioDataLib::ComplexVector Class Reference

These can be imagined as row (or column) vectors having complex-valued elements. More...

#include <ComplexVector.h>

Public Member Functions

 ComplexVector ()
 
 ComplexVector (const ComplexVector &complexVector)
 
virtual ~ComplexVector ()
 
void Clear ()
 
void Add (const ComplexNumber &complexNumber)
 
uint32_t Size () const
 
void operator= (const ComplexVector &complexVector)
 
const ComplexNumberoperator[] (uint32_t i) const
 
ComplexNumberoperator[] (uint32_t i)
 
bool FFT (const ComplexVector &complexVector, bool inverse, Error &error)
 

Protected Attributes

std::vector< ComplexNumber > * complexNumberArray
 

Detailed Description

These can be imagined as row (or column) vectors having complex-valued elements.

A typical use-case is to populate the vector with audio samples, then to perform an FFT.

Constructor & Destructor Documentation

◆ ComplexVector() [1/2]

ComplexVector::ComplexVector ( )

Construct a new empty vector.

◆ ComplexVector() [2/2]

ComplexVector::ComplexVector ( const ComplexVector & complexVector)

Construct a new vector as a copy of the given vector.

◆ ~ComplexVector()

ComplexVector::~ComplexVector ( )
virtual

Member Function Documentation

◆ Add()

void ComplexVector::Add ( const ComplexNumber & complexNumber)

Append a new complex number to the vector.

◆ Clear()

void ComplexVector::Clear ( )

Remove all complex numbers from this vector, making it empty.

◆ FFT()

bool ComplexVector::FFT ( const ComplexVector & complexVector,
bool inverse,
Error & error )

Perform a Fast Fourier Transform on the given complex vector, placing the result in this complex vector.

Parameters
[in]complexVectorThis is the complex vector to be transformed.
[in]inverseIf true, an inverse-FFT is performed; a regular FFT otherwise.
[out]errorThis will contain error information if false is returned.
Returns
True is returned on success; otherwise, false is returned.

◆ operator=()

void ComplexVector::operator= ( const ComplexVector & complexVector)

Assign the given complex vector to this one, making a copy.

◆ operator[]() [1/2]

ComplexNumber & ComplexVector::operator[] ( uint32_t i)

Return the complex number at the given offset in this vector.

Parameters
[in]iThis is the offset of the desired vector. If it is out of range, your program will crash.

◆ operator[]() [2/2]

const ComplexNumber & ComplexVector::operator[] ( uint32_t i) const

Return the (read-only) complex number at the given offset in this vector.

Parameters
[in]iThis is the offset of the desired vector. If it is out of range, your program will crash.

◆ Size()

uint32_t ComplexVector::Size ( ) const

Return the number of elements (complex numbers) in the vector.

Member Data Documentation

◆ complexNumberArray

std::vector<ComplexNumber>* AudioDataLib::ComplexVector::complexNumberArray
protected

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