LASP 1.0
Library for Acoustic Signal Processing
Loading...
Searching...
No Matches

Perform forward FFT's on real time data. Computes single-sided spectra, equivalent to Numpy's rfft and irfft functions. But then faster as it can use a fast FFT backend, such as FFTW. More...

#include <lasp_fft.h>

Public Member Functions

 Fft (const us nfft)
 Initialize FFT.
 
 ~Fft ()
 
 Fft (const Fft &)=delete
 
Fftoperator= (const Fft &)=delete
 
us nfft () const
 Return nfft.
 
vc fft (const vd &timedata)
 
cmat fft (const dmat &timedata)
 
vd ifft (const vc &freqdata)
 
dmat ifft (const cmat &freqdata)
 

Static Public Member Functions

static void load_fft_wisdom (const std::string &wisdom)
 Load FFT wisdom from a wisdom string. Function does nothing if FFT backend is not FFTW.
 
static std::string store_fft_wisdom ()
 Return a string containing FFT wisdom storage. String is empty for backend != FFTW.
 

Detailed Description

Perform forward FFT's on real time data. Computes single-sided spectra, equivalent to Numpy's rfft and irfft functions. But then faster as it can use a fast FFT backend, such as FFTW.

Definition at line 24 of file lasp_fft.h.

Constructor & Destructor Documentation

◆ Fft() [1/2]

Fft::Fft ( const us  nfft)

Initialize FFT.

Parameters
nfftThe length of nfft

Definition at line 108 of file lasp_fft.cpp.

◆ ~Fft()

Fft::~Fft ( )

Definition at line 119 of file lasp_fft.cpp.

◆ Fft() [2/2]

Fft::Fft ( const Fft )
delete

Member Function Documentation

◆ fft() [1/2]

cmat Fft::fft ( const dmat timedata)

Compute the fft of the data matrix, first axis is assumed to be the time axis.

Parameters
[in]timedataInput time data, should have size nfft. First axis is time, second axis is channel
Returns
Result complex array
  • WARNING *. This was source of a serious bug. It is not possible to run FFT's and IFFT's on the same _impl, as it overwrites the same memory. Uncommenting the line below results in faulty results.

Definition at line 131 of file lasp_fft.cpp.

◆ fft() [2/2]

vc Fft::fft ( const vd timedata)

Compute the fft for a single channel of data.

Parameters
[in]timedataInput time data, should have size nfft
Returns
Result complex vector

Definition at line 126 of file lasp_fft.cpp.

◆ ifft() [1/2]

dmat Fft::ifft ( const cmat freqdata)

Perform inverse FFT

Parameters
freqdataFrequency domain data
Returns
timedata Time domain result
  • WARNING *. This was source of a serious bug. It is not possible to run FFT's and IFFT's on the same _impl, as it overwrites the same memory. Uncommenting the line below results in faulty results.

Definition at line 150 of file lasp_fft.cpp.

◆ ifft() [2/2]

vd Fft::ifft ( const vc freqdata)

Perform inverse fft on a single channel.

Parameters
[in]freqdataFrequency domain input data, to be iFft'th. Should have size nfft/2+1
Returns
timedata: iFft't data, size nfft.

Definition at line 145 of file lasp_fft.cpp.

◆ load_fft_wisdom()

void Fft::load_fft_wisdom ( const std::string &  wisdom)
static

Load FFT wisdom from a wisdom string. Function does nothing if FFT backend is not FFTW.

Parameters
wisdomWisdom string content.

Definition at line 163 of file lasp_fft.cpp.

◆ nfft()

us Fft::nfft ( ) const

Return nfft.

Returns
nfft NFFT (lenght of the DFT transform)

Definition at line 121 of file lasp_fft.cpp.

◆ operator=()

Fft & Fft::operator= ( const Fft )
delete

◆ store_fft_wisdom()

std::string Fft::store_fft_wisdom ( )
static

Return a string containing FFT wisdom storage. String is empty for backend != FFTW.

Returns
FFT wisdom string

Definition at line 175 of file lasp_fft.cpp.


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