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

implements subsample delay in spectral domain. More...

Public Member Functions

 subsample_delay_t (const std::vector< float > &subsample_delay, unsigned fftlen)
 Constructor computes complex phase factors to apply to achieve subsample delay. More...
 
void process (mha_spec_t *s)
 Apply the phase_gains to s to achieve the subsample delay. More...
 
void process (mha_spec_t *s, unsigned idx)
 Apply the pase gains to channel idx in s to achieve the subsample delay in channel idx. More...
 

Public Attributes

spectrum_t phase_gains
 The complex factors to apply to achieve the necessary phase shift. More...
 

Private Attributes

unsigned last_complex_bin
 index of the last complex fft bin for the used fft length. More...
 

Detailed Description

implements subsample delay in spectral domain.

When transformed back to the time domain, the signal is delayed by the configured fraction of a sample. This operation must not be used in a smoothgains bracket.

Constructor & Destructor Documentation

◆ subsample_delay_t()

MHASignal::subsample_delay_t::subsample_delay_t ( const std::vector< float > &  subsample_delay,
unsigned  fftlen 
)

Constructor computes complex phase factors to apply to achieve subsample delay.

Parameters
subsample_delayThe subsample delay to apply. -0.5 <= subsample_delay <= 0.5
fftlenFFT length
Exceptions
MHA_Errorif the parameters are out of range

Member Function Documentation

◆ process() [1/2]

void MHASignal::subsample_delay_t::process ( mha_spec_t s)

Apply the phase_gains to s to achieve the subsample delay.

◆ process() [2/2]

void MHASignal::subsample_delay_t::process ( mha_spec_t s,
unsigned  idx 
)

Apply the pase gains to channel idx in s to achieve the subsample delay in channel idx.

Parameters
ssignal
idxchannel index, 0-based
Exceptions
MHA_Errorif idx >= s->num_channels

Member Data Documentation

◆ phase_gains

spectrum_t MHASignal::subsample_delay_t::phase_gains

The complex factors to apply to achieve the necessary phase shift.

◆ last_complex_bin

unsigned MHASignal::subsample_delay_t::last_complex_bin
private

index of the last complex fft bin for the used fft length.


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