BSAPI
Public Member Functions
SMelBanksI Class Reference

Calculation of Mel-bank energies. More...

#include <bsapi.h>

Inheritance diagram for SMelBanksI:
SFeatureExtractionI SParametersCallbackI SUnknownI SWaveformSourceCallbackI

List of all members.

Public Member Functions

virtual void BSAPI_METHOD SetSampleFreq (int sampleFreq=8000)=0
 Set sampling frequency.
virtual void BSAPI_METHOD SetVectorSize (int vectorSize=200)=0
 Set vector size.
virtual void BSAPI_METHOD SetStep (int step=80)=0
 Set frame step.
virtual void BSAPI_METHOD SetPreemCoef (float preemCoef=0.0f)=0
 Set pre-emphasis coefficient.
virtual void BSAPI_METHOD SetNBanks (int nBanks=15)=0
 Set number of Mel-banks.
virtual void BSAPI_METHOD SetLowFreq (float loFreq=0.0f)=0
 Set low cut-off frequency.
virtual void BSAPI_METHOD SetHighFreq (float hiFreq=4000.0f)=0
 Set high cut-off frequency.
virtual void BSAPI_METHOD SetLowWarpFreq (float loFreq=3000.0f)=0
 Set low warp frequency for VTLN.
virtual void BSAPI_METHOD SetHighWarpFreq (float hiFreq=3000.0f)=0
 Set high warp frequency for VTLN.
virtual bool BSAPI_METHOD SetWarpAlpha (float alpha=1.0f)=0
 Set warping factor for WTLN.
virtual void BSAPI_METHOD SetWaitForWarpingFactor (bool waitForWarpingFactor=false)=0
 Wait for warping factor.
virtual void BSAPI_METHOD SetZMeanSource (bool zMeanSource=false)=0
 Remove mean value from each frame.
virtual void BSAPI_METHOD SetTakeLog (bool takeLog=true)=0
 Take logarithm of energies at the output from Mel-banks.
virtual void BSAPI_METHOD SetUsePower (bool usePower=true)=0
 Use power spectra instead of magnitude spectra.
virtual void BSAPI_METHOD SetAddEnergy (bool addEnergy=false)=0
 Add logarithm of frame energy as an additional coefficient.
virtual void BSAPI_METHOD SetUseRawEnergy (bool useRawEnergy=false)=0
 Calculate energy after mean removal instead of after Hamming windowing.
virtual void BSAPI_METHOD SetNormalizeEnergy (bool normalizeEnergy=false)=0
 Enable normalization of temporal evolution of the log energy coefficient.
virtual void BSAPI_METHOD SetEnergyScale (float energyScale=0.1f)=0
 Set scale factor for energy normalization.
virtual void BSAPI_METHOD SetEnergyFloor (float energyFloor=50.0f)=0
 Set energy floor for energy normalization.
virtual void BSAPI_METHOD SetDebug (bool debug=false)=0
 Dump Mel-banks configuration parameters and numerical values of data after each processing step.
virtual void BSAPI_METHOD SetStartFrameRepetition (int startFrameRepetition=0)=0
 Repeate the first frame.
virtual void BSAPI_METHOD SetEndFrameRepetition (int endFrameRepetition=0)=0
 Repeate the last frame.
virtual void BSAPI_METHOD SetSpectralShiftHz (float spectralShiftHz=0.0f)=0
 Set the spectral shift.
virtual int BSAPI_METHOD GetSampleFreq ()=0
virtual int BSAPI_METHOD GetVectorSize ()=0
virtual int BSAPI_METHOD GetStep ()=0
virtual float BSAPI_METHOD GetPreemCoef ()=0
virtual int BSAPI_METHOD GetNBanks ()=0
virtual float BSAPI_METHOD GetLowFreq ()=0
virtual float BSAPI_METHOD GetHighFreq ()=0
virtual float BSAPI_METHOD GetWarpAlpha ()=0
virtual float BSAPI_METHOD GetLowWarpFreq ()=0
virtual float BSAPI_METHOD GetHighWarpFreq ()=0
virtual bool BSAPI_METHOD GetZMeanSource ()=0
virtual bool BSAPI_METHOD GetTakeLog ()=0
virtual float *BSAPI_METHOD GetCenters ()=0
virtual int BSAPI_METHOD GetStartFrameRepetition ()=0
virtual int BSAPI_METHOD GetEndFrameRepetition ()=0
virtual void BSAPI_METHOD SetOutBatchSize (int outBatchSize=0)=0
 Number of frames sent to output in one batch.
virtual void BSAPI_METHOD Reset ()=0

Detailed Description

Calculation of Mel-bank energies.

The per frame signal processing steps are: remove mean from waveform, pre-emphasis, Hamming window, FFT power, power to amplitude, Mel-bank application, logarithm.


Member Function Documentation

virtual void BSAPI_METHOD SMelBanksI::SetAddEnergy ( bool  addEnergy = false) [pure virtual]

Add logarithm of frame energy as an additional coefficient.

Parameters:
addEnergytrue to add the energy coefficient
virtual void BSAPI_METHOD SMelBanksI::SetDebug ( bool  debug = false) [pure virtual]

Dump Mel-banks configuration parameters and numerical values of data after each processing step.

Parameters:
debugtrue to enable debug mode
virtual void BSAPI_METHOD SMelBanksI::SetEndFrameRepetition ( int  endFrameRepetition = 0) [pure virtual]

Repeate the last frame.

This helps to fill up buffers of some subsequent algorithms for synchronization.

Parameters:
endFrameRepetitionnumber of times the last frame should be repeated
virtual void BSAPI_METHOD SMelBanksI::SetEnergyFloor ( float  energyFloor = 50.0f) [pure virtual]

Set energy floor for energy normalization.

Parameters:
energyFloorenergy floor in dBs
virtual void BSAPI_METHOD SMelBanksI::SetEnergyScale ( float  energyScale = 0.1f) [pure virtual]

Set scale factor for energy normalization.

Parameters:
energyScalescale factor
virtual void BSAPI_METHOD SMelBanksI::SetHighFreq ( float  hiFreq = 4000.0f) [pure virtual]

Set high cut-off frequency.

Parameters:
hiFreqhigh cut-off frequency in Hertzs
virtual void BSAPI_METHOD SMelBanksI::SetHighWarpFreq ( float  hiFreq = 3000.0f) [pure virtual]

Set high warp frequency for VTLN.

Parameters:
hiFreqhigh warp frequency in Hertzs
virtual void BSAPI_METHOD SMelBanksI::SetLowFreq ( float  loFreq = 0.0f) [pure virtual]

Set low cut-off frequency.

Parameters:
loFreqlow cut-off frequency in Hertzs
virtual void BSAPI_METHOD SMelBanksI::SetLowWarpFreq ( float  loFreq = 3000.0f) [pure virtual]

Set low warp frequency for VTLN.

Parameters:
loFreqlow warp frequency in Hertzs
virtual void BSAPI_METHOD SMelBanksI::SetNBanks ( int  nBanks = 15) [pure virtual]

Set number of Mel-banks.

Parameters:
nBanksnumber of Mel-banks
virtual void BSAPI_METHOD SMelBanksI::SetNormalizeEnergy ( bool  normalizeEnergy = false) [pure virtual]

Enable normalization of temporal evolution of the log energy coefficient.

This enables normalization of temporal evolution of the log energy coefficient. At first, the minimal value is limited using EnergyFloor. Then the the energy is converted using formula "new_energy = 1 - (max - log(energy)) * EnergyScale". The max value is the maximal energy found over all frames. The normalization can be applied in the offline mode only.

Parameters:
normalizeEnergytrue to enable normalization
virtual void BSAPI_METHOD SMelBanksI::SetOutBatchSize ( int  outBatchSize = 0) [pure virtual]

Number of frames sent to output in one batch.

This function is important for the online mode (controlled by the OnWaveform flags). In the offline mode, all the data are packed to one matrix.

Parameters:
outBatchSizenumber of frames or 0 to enforce offline mode and pack everything to one matrix
virtual void BSAPI_METHOD SMelBanksI::SetPreemCoef ( float  preemCoef = 0.0f) [pure virtual]

Set pre-emphasis coefficient.

Parameters:
preemCoefpre-emphasis coefficient, 0 means that pre-emphasis is not applied
virtual void BSAPI_METHOD SMelBanksI::SetSampleFreq ( int  sampleFreq = 8000) [pure virtual]

Set sampling frequency.

Parameters:
sampleFreqsampling frequency
virtual void BSAPI_METHOD SMelBanksI::SetSpectralShiftHz ( float  spectralShiftHz = 0.0f) [pure virtual]

Set the spectral shift.

Shift the spectrum and compensate for mistuning of the carrier frequency in HF transmission

Parameters:
spectralShiftHzspectral shift in Hertzs (- to left, + to right)
virtual void BSAPI_METHOD SMelBanksI::SetStartFrameRepetition ( int  startFrameRepetition = 0) [pure virtual]

Repeate the first frame.

This helps to fill up buffers of some subsequent algorithms for synchronization.

Parameters:
startFrameRepetitionnumber of times the first frame should be repeated
virtual void BSAPI_METHOD SMelBanksI::SetStep ( int  step = 80) [pure virtual]

Set frame step.

Parameters:
stepframe step in samples
virtual void BSAPI_METHOD SMelBanksI::SetTakeLog ( bool  takeLog = true) [pure virtual]

Take logarithm of energies at the output from Mel-banks.

Parameters:
takeLogtrue to enable logarithm at the output from Mel-banks
virtual void BSAPI_METHOD SMelBanksI::SetUsePower ( bool  usePower = true) [pure virtual]

Use power spectra instead of magnitude spectra.

Parameters:
usePowertrue to use power spectra instead of magnitude spectra
virtual void BSAPI_METHOD SMelBanksI::SetUseRawEnergy ( bool  useRawEnergy = false) [pure virtual]

Calculate energy after mean removal instead of after Hamming windowing.

This is for the additional energy parameter. See the SMelBanksI description for signal processing steps.

Parameters:
useRawEnergytrue to use raw energy
virtual void BSAPI_METHOD SMelBanksI::SetVectorSize ( int  vectorSize = 200) [pure virtual]

Set vector size.

Parameters:
vectorSizevector size or frame size in samples
virtual void BSAPI_METHOD SMelBanksI::SetWaitForWarpingFactor ( bool  waitForWarpingFactor = false) [pure virtual]

Wait for warping factor.

This is a synchronization mechanism. If the waiting for warping factor is enabled, the object only stores a pointer to waveform when it comes and the waveform is is processed after the warping facor have been received. This synchronization works in the offline processing mode only.

Parameters:
waitForWarpingFactortrue if waiting for warping factor is enabled.
virtual bool BSAPI_METHOD SMelBanksI::SetWarpAlpha ( float  alpha = 1.0f) [pure virtual]

Set warping factor for WTLN.

Parameters:
alphaVTLN warping factor
Returns:
true if the new Mel-bank was dessigned correctly
virtual void BSAPI_METHOD SMelBanksI::SetZMeanSource ( bool  zMeanSource = false) [pure virtual]

Remove mean value from each frame.

Parameters:
zMeanSourcetrue to enable the mean removal

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