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

Public Member Functions

 gsc_adaptive_stage (MHA_AC::algo_comm_t &ac, const mhaconfig_t, int lenOldSamps, bool doCircularComp, float mu, float alp, bool useVAD, const std::string &vadName_)
 Ctor of the rt processing class. More...
 
 ~gsc_adaptive_stage ()=default
 
mha_wave_tprocess (mha_wave_t *wavin)
 Processing callback. More...
 

Private Member Functions

void insert ()
 Re-insert all AC variables into the AC space. More...
 

Private Attributes

MHA_AC::algo_comm_tac
 Handle to AC space. More...
 
unsigned int lenOldSamps
 Number of old samples to buffer. More...
 
unsigned int lenNewSamps
 Number of new samples. More...
 
unsigned int bufSize
 Total buffer size. More...
 
float frac_old
 Fraction of new samples to total buffer size. More...
 
mha_fft_t mha_fft
 FFT handle. More...
 
unsigned int nfreq
 Number of frequency bins. More...
 
unsigned int nchan
 Number of channels in input signal. More...
 
unsigned int desired_chan
 Channel index containing the desired response. More...
 
bool doCircularComp
 Whether to compensate for circular convolution. More...
 
float mu
 Linear coefficient for gradient. More...
 
float alp
 Autoregressive coefficient for estimating PSD. More...
 
bool useVAD
 Wether to use VAD. More...
 
std::string vadName
 Name of VAD AC variable. More...
 
MHA_AC::waveform_t x
 Buffered input signal. More...
 
MHA_AC::spectrum_t X
 FFT of the buffered input signal. More...
 
MHA_AC::spectrum_t W
 Time-varying filter. More...
 
MHA_AC::spectrum_t Y
 Filter output, frequency domain. More...
 
MHA_AC::waveform_t y
 Filter output, time domain. More...
 
MHA_AC::waveform_t d
 Desired response. More...
 
MHA_AC::waveform_t e
 Error signal, time domain. More...
 
MHA_AC::spectrum_t E
 Error signal, frequency domain. More...
 
MHA_AC::spectrum_t E2
 Error spectrum multiplied by input spectrum: E2=X*E. More...
 
MHA_AC::waveform_t grad
 Gradient. More...
 
MHA_AC::spectrum_t Grad
 FT of the gradient. More...
 
MHA_AC::waveform_t e_out
 Error signal. More...
 
MHA_AC::waveform_t P
 Signal power estimate. More...
 
MHA_AC::waveform_t Psum
 Signal power estimate, summed over all channels. More...
 

Constructor & Destructor Documentation

◆ gsc_adaptive_stage()

gsc_adaptive_stage::gsc_adaptive_stage::gsc_adaptive_stage ( MHA_AC::algo_comm_t ac,
const mhaconfig_t  in_cfg,
int  lenOldSamps,
bool  doCircularComp,
float  mu,
float  alp,
bool  useVAD,
const std::string &  vadName_ 
)

Ctor of the rt processing class.

Parameters
acHandle to AC space
in_cfgInput signal configuration
lenOldSampsHow many old samples to buffer
doCircularCompCompensate for circular convolution?
muScalar coefficient for gradient
alpAutoregressive coefficient for estimating PSD
useVADUse voice activity detection?
vadName_Name of the VAD AC variable

◆ ~gsc_adaptive_stage()

gsc_adaptive_stage::gsc_adaptive_stage::~gsc_adaptive_stage ( )
default

Member Function Documentation

◆ process()

mha_wave_t * gsc_adaptive_stage::gsc_adaptive_stage::process ( mha_wave_t wavin)

Processing callback.

Parameters
wavininput signal
Returns
Returns a pointer to the output signal

◆ insert()

void gsc_adaptive_stage::gsc_adaptive_stage::insert ( )
private

Re-insert all AC variables into the AC space.

Member Data Documentation

◆ ac

MHA_AC::algo_comm_t& gsc_adaptive_stage::gsc_adaptive_stage::ac
private

Handle to AC space.

◆ lenOldSamps

unsigned int gsc_adaptive_stage::gsc_adaptive_stage::lenOldSamps
private

Number of old samples to buffer.

◆ lenNewSamps

unsigned int gsc_adaptive_stage::gsc_adaptive_stage::lenNewSamps
private

Number of new samples.

◆ bufSize

unsigned int gsc_adaptive_stage::gsc_adaptive_stage::bufSize
private

Total buffer size.

Must be lenOldSamps+lenNewSamps

◆ frac_old

float gsc_adaptive_stage::gsc_adaptive_stage::frac_old
private

Fraction of new samples to total buffer size.

◆ mha_fft

mha_fft_t gsc_adaptive_stage::gsc_adaptive_stage::mha_fft
private

FFT handle.

◆ nfreq

unsigned int gsc_adaptive_stage::gsc_adaptive_stage::nfreq
private

Number of frequency bins.

◆ nchan

unsigned int gsc_adaptive_stage::gsc_adaptive_stage::nchan
private

Number of channels in input signal.

◆ desired_chan

unsigned int gsc_adaptive_stage::gsc_adaptive_stage::desired_chan
private

Channel index containing the desired response.

Always last channel by convention

◆ doCircularComp

bool gsc_adaptive_stage::gsc_adaptive_stage::doCircularComp
private

Whether to compensate for circular convolution.

◆ mu

float gsc_adaptive_stage::gsc_adaptive_stage::mu
private

Linear coefficient for gradient.

◆ alp

float gsc_adaptive_stage::gsc_adaptive_stage::alp
private

Autoregressive coefficient for estimating PSD.

◆ useVAD

bool gsc_adaptive_stage::gsc_adaptive_stage::useVAD
private

Wether to use VAD.

◆ vadName

std::string gsc_adaptive_stage::gsc_adaptive_stage::vadName
private

Name of VAD AC variable.

◆ x

MHA_AC::waveform_t gsc_adaptive_stage::gsc_adaptive_stage::x
private

Buffered input signal.

◆ X

MHA_AC::spectrum_t gsc_adaptive_stage::gsc_adaptive_stage::X
private

FFT of the buffered input signal.

◆ W

MHA_AC::spectrum_t gsc_adaptive_stage::gsc_adaptive_stage::W
private

Time-varying filter.

◆ Y

MHA_AC::spectrum_t gsc_adaptive_stage::gsc_adaptive_stage::Y
private

Filter output, frequency domain.

◆ y

MHA_AC::waveform_t gsc_adaptive_stage::gsc_adaptive_stage::y
private

Filter output, time domain.

◆ d

MHA_AC::waveform_t gsc_adaptive_stage::gsc_adaptive_stage::d
private

Desired response.

◆ e

MHA_AC::waveform_t gsc_adaptive_stage::gsc_adaptive_stage::e
private

Error signal, time domain.

◆ E

MHA_AC::spectrum_t gsc_adaptive_stage::gsc_adaptive_stage::E
private

Error signal, frequency domain.

◆ E2

MHA_AC::spectrum_t gsc_adaptive_stage::gsc_adaptive_stage::E2
private

Error spectrum multiplied by input spectrum: E2=X*E.

◆ grad

MHA_AC::waveform_t gsc_adaptive_stage::gsc_adaptive_stage::grad
private

Gradient.

◆ Grad

MHA_AC::spectrum_t gsc_adaptive_stage::gsc_adaptive_stage::Grad
private

FT of the gradient.

◆ e_out

MHA_AC::waveform_t gsc_adaptive_stage::gsc_adaptive_stage::e_out
private

Error signal.

◆ P

MHA_AC::waveform_t gsc_adaptive_stage::gsc_adaptive_stage::P
private

Signal power estimate.

◆ Psum

MHA_AC::waveform_t gsc_adaptive_stage::gsc_adaptive_stage::Psum
private

Signal power estimate, summed over all channels.


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