The Open Master Hearing Aid (openMHA)  openMHA
Open community platform for hearing aid algorithm research
MHASignal::fft_t Class Reference

Public Member Functions

 fft_t (const unsigned int &)
 
 ~fft_t ()
 
void wave2spec (const mha_wave_t *, mha_spec_t *, bool swap)
 fast fourier transform. More...
 
void spec2wave (const mha_spec_t *, mha_wave_t *)
 
void spec2wave (const mha_spec_t *, mha_wave_t *, unsigned int offset)
 wave may have fewer number of frames than needed for a complete iFFT. More...
 
void forward (mha_spec_t *sIn, mha_spec_t *sOut)
 
void backward (mha_spec_t *sIn, mha_spec_t *sOut)
 
void wave2spec_scale (const mha_wave_t *, mha_spec_t *, bool swap)
 
void spec2wave_scale (const mha_spec_t *, mha_wave_t *)
 
void forward_scale (mha_spec_t *sIn, mha_spec_t *sOut)
 
void backward_scale (mha_spec_t *sIn, mha_spec_t *sOut)
 

Private Member Functions

void sort_fftw2spec (fftw_real *s_fftw, mha_spec_t *s_spec, unsigned int ch)
 Arrange the order of an fftw spectrum to the internal order. More...
 
void sort_spec2fftw (fftw_real *s_fftw, const mha_spec_t *s_spec, unsigned int ch)
 Arrange the order of an internal spectrum to the fftw order. More...
 

Private Attributes

unsigned int nfft
 
unsigned int n_re
 
unsigned int n_im
 
mha_real_t scale
 
mha_real_tbuf_in
 
mha_real_tbuf_out
 
rfftw_plan fftw_plan_wave2spec
 
rfftw_plan fftw_plan_spec2wave
 
fftw_plan fftw_plan_fft
 
fftw_plan fftw_plan_ifft
 

Constructor & Destructor Documentation

◆ fft_t()

MHASignal::fft_t::fft_t ( const unsigned int &  n)

◆ ~fft_t()

MHASignal::fft_t::~fft_t ( )

Member Function Documentation

◆ wave2spec()

void MHASignal::fft_t::wave2spec ( const mha_wave_t wave,
mha_spec_t spec,
bool  swap 
)

fast fourier transform.

if swap is set, the buffer halfes of the wave signal are exchanged before computing the fft.

◆ spec2wave() [1/2]

void MHASignal::fft_t::spec2wave ( const mha_spec_t spec,
mha_wave_t wave 
)

◆ spec2wave() [2/2]

void MHASignal::fft_t::spec2wave ( const mha_spec_t spec,
mha_wave_t wave,
unsigned int  offset 
)

wave may have fewer number of frames than needed for a complete iFFT.

Only as many frames are written into wave as fit, starting with offset offset of the complete iFFT.

◆ forward()

void MHASignal::fft_t::forward ( mha_spec_t sIn,
mha_spec_t sOut 
)

◆ backward()

void MHASignal::fft_t::backward ( mha_spec_t sIn,
mha_spec_t sOut 
)

◆ wave2spec_scale()

void MHASignal::fft_t::wave2spec_scale ( const mha_wave_t wave,
mha_spec_t spec,
bool  swap 
)

◆ spec2wave_scale()

void MHASignal::fft_t::spec2wave_scale ( const mha_spec_t spec,
mha_wave_t wave 
)

◆ forward_scale()

void MHASignal::fft_t::forward_scale ( mha_spec_t sIn,
mha_spec_t sOut 
)

◆ backward_scale()

void MHASignal::fft_t::backward_scale ( mha_spec_t sIn,
mha_spec_t sOut 
)

◆ sort_fftw2spec()

void MHASignal::fft_t::sort_fftw2spec ( fftw_real *  s_fftw,
mha_spec_t s_spec,
unsigned int  ch 
)
private

Arrange the order of an fftw spectrum to the internal order.

The fftw spectrum is arranged [r0 r1 r2 ... rn-1 in in-1 ... i1], while the interal order is [r0 – r1 i1 r2 i2 ... rn-1 in-1 rn –].

◆ sort_spec2fftw()

void MHASignal::fft_t::sort_spec2fftw ( fftw_real *  s_fftw,
const mha_spec_t s_spec,
unsigned int  ch 
)
private

Arrange the order of an internal spectrum to the fftw order.

Member Data Documentation

◆ nfft

unsigned int MHASignal::fft_t::nfft
private

◆ n_re

unsigned int MHASignal::fft_t::n_re
private

◆ n_im

unsigned int MHASignal::fft_t::n_im
private

◆ scale

mha_real_t MHASignal::fft_t::scale
private

◆ buf_in

mha_real_t* MHASignal::fft_t::buf_in
private

◆ buf_out

mha_real_t* MHASignal::fft_t::buf_out
private

◆ fftw_plan_wave2spec

rfftw_plan MHASignal::fft_t::fftw_plan_wave2spec
private

◆ fftw_plan_spec2wave

rfftw_plan MHASignal::fft_t::fftw_plan_spec2wave
private

◆ fftw_plan_fft

fftw_plan MHASignal::fft_t::fftw_plan_fft
private

◆ fftw_plan_ifft

fftw_plan MHASignal::fft_t::fftw_plan_ifft
private

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