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

Runtime config class for plugin spec2wave, the counterpart of wave2spec. More...

Public Member Functions

 spec2wave_t (unsigned nfft_, unsigned nwnd_, unsigned nwndshift_, unsigned nch, mha_real_t ramplen, const MHAWindow::base_t &postwin)
 Constructor. More...
 
 ~spec2wave_t ()
 
mha_wave_tprocess (mha_spec_t *)
 

Private Attributes

mha_fft_t ft
 FFT class. More...
 
unsigned int npad1
 length of zero padding before window More...
 
unsigned int npad2
 length of zero padding after window More...
 
hanning_ramps_t ramps
 
MHASignal::waveform_t calc_out
 
MHASignal::waveform_t out_buf
 
MHASignal::waveform_t write_buf
 
mha_real_t sc
 
unsigned int nfft
 
unsigned int nwndshift
 
MHAWindow::base_t postwindow
 

Detailed Description

Runtime config class for plugin spec2wave, the counterpart of wave2spec.

Constructor & Destructor Documentation

◆ spec2wave_t()

spec2wave_t::spec2wave_t ( unsigned  nfft_,
unsigned  nwnd_,
unsigned  nwndshift_,
unsigned  nch,
mha_real_t  ramplen,
const MHAWindow::base_t postwin 
)

Constructor.

Parameters
nfft_FFT length.
nwnd_Overlap-add analysis window length.
nwndshift_Overlap-add hop size. Needed to compute scaling.
nchNumber of audio channels.
ramplenA user-configurable factor which is applied to the length of the zero paddings in samples before and after the analysis window. Rising and falling hanning ramps are computed for the resulting ramp lengths in member ramps.
postwinPost windowing function. This window is applied in addition to the hanning ramps. It is applied to the whole output waveform computed by the inverse FFT before the signal is overlap-added to the previous output.

◆ ~spec2wave_t()

spec2wave_t::~spec2wave_t ( )

Member Function Documentation

◆ process()

mha_wave_t * spec2wave_t::process ( mha_spec_t spec_in)

Member Data Documentation

◆ ft

mha_fft_t spec2wave_t::ft
private

FFT class.

◆ npad1

unsigned int spec2wave_t::npad1
private

length of zero padding before window

◆ npad2

unsigned int spec2wave_t::npad2
private

length of zero padding after window

◆ ramps

hanning_ramps_t spec2wave_t::ramps
private

◆ calc_out

MHASignal::waveform_t spec2wave_t::calc_out
private

◆ out_buf

MHASignal::waveform_t spec2wave_t::out_buf
private

◆ write_buf

MHASignal::waveform_t spec2wave_t::write_buf
private

◆ sc

mha_real_t spec2wave_t::sc
private

◆ nfft

unsigned int spec2wave_t::nfft
private

◆ nwndshift

unsigned int spec2wave_t::nwndshift
private

◆ postwindow

MHAWindow::base_t spec2wave_t::postwindow
private

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