Audacity  2.2.0
VoiceKey Class Reference

This implements a voice key, detecting either the next "ON" or "OFF" point. More...

#include <VoiceKey.h>

Public Member Functions

 VoiceKey ()
 
 ~VoiceKey ()
 
sampleCount OnForward (const WaveTrack &t, sampleCount start, sampleCount len)
 
sampleCount OnBackward (const WaveTrack &t, sampleCount start, sampleCount len)
 
sampleCount OffForward (const WaveTrack &t, sampleCount start, sampleCount len)
 
sampleCount OffBackward (const WaveTrack &t, sampleCount start, sampleCount len)
 
void CalibrateNoise (const WaveTrack &t, sampleCount start, sampleCount len)
 
void AdjustThreshold (double t)
 
bool AboveThreshold (const WaveTrack &t, sampleCount start, sampleCount len)
 
void SetKeyType (bool erg, bool scLow, bool scHigh, bool dcLow, bool dcHigh)
 

Private Member Functions

double TestEnergy (const WaveTrack &t, sampleCount start, sampleCount len)
 
double TestSignChanges (const WaveTrack &t, sampleCount start, sampleCount len)
 
double TestDirectionChanges (const WaveTrack &t, sampleCount start, sampleCount len)
 
void TestEnergyUpdate (double &prevErg, int length, const float &drop, const float &add)
 
void TestSignChangesUpdate (double &currentsignchanges, int length, const float &a1, const float &a2, const float &z1, const float &z2)
 
void TestDirectionChangesUpdate (double &currentdirectionchanges, int length, int &atrend, const float &a1, const float &a2, int &ztrend, const float &z1, const float &z2)
 

Private Attributes

double mWindowSize
 
double mThresholdAdjustment
 
double mEnergyMean
 
double mEnergySD
 
double mSignChangesMean
 
double mSignChangesSD
 
double mDirectionChangesMean
 
double mDirectionChangesSD
 
double mThresholdEnergy
 
double mThresholdSignChangesLower
 
double mThresholdSignChangesUpper
 
double mThresholdDirectionChangesLower
 
double mThresholdDirectionChangesUpper
 
bool mUseEnergy
 
bool mUseSignChangesLow
 
bool mUseSignChangesHigh
 
bool mUseDirectionChangesLow
 
bool mUseDirectionChangesHigh
 
double mSilentWindowSize
 
double mSignalWindowSize
 

Detailed Description

This implements a voice key, detecting either the next "ON" or "OFF" point.

Constructor & Destructor Documentation

VoiceKey::~VoiceKey ( )

Member Function Documentation

void VoiceKey::SetKeyType ( bool  erg,
bool  scLow,
bool  scHigh,
bool  dcLow,
bool  dcHigh 
)
double VoiceKey::TestDirectionChanges ( const WaveTrack t,
sampleCount  start,
sampleCount  len 
)
private
void VoiceKey::TestDirectionChangesUpdate ( double &  currentdirectionchanges,
int  length,
int &  atrend,
const float &  a1,
const float &  a2,
int &  ztrend,
const float &  z1,
const float &  z2 
)
private

References sgn().

Referenced by OffBackward(), OffForward(), OnBackward(), and OnForward().

double VoiceKey::TestEnergy ( const WaveTrack t,
sampleCount  start,
sampleCount  len 
)
private
void VoiceKey::TestEnergyUpdate ( double &  prevErg,
int  length,
const float &  drop,
const float &  add 
)
private
double VoiceKey::TestSignChanges ( const WaveTrack t,
sampleCount  start,
sampleCount  len 
)
private
void VoiceKey::TestSignChangesUpdate ( double &  currentsignchanges,
int  length,
const float &  a1,
const float &  a2,
const float &  z1,
const float &  z2 
)
private

References sgn().

Referenced by OffBackward(), OffForward(), OnBackward(), and OnForward().

Member Data Documentation

double VoiceKey::mDirectionChangesMean
private
double VoiceKey::mDirectionChangesSD
private
double VoiceKey::mEnergyMean
private
double VoiceKey::mEnergySD
private
double VoiceKey::mSignalWindowSize
private

Referenced by OnForward(), and VoiceKey().

double VoiceKey::mSignChangesMean
private
double VoiceKey::mSignChangesSD
private
double VoiceKey::mSilentWindowSize
private
double VoiceKey::mThresholdAdjustment
private

Referenced by AdjustThreshold(), and CalibrateNoise().

double VoiceKey::mThresholdDirectionChangesLower
private
double VoiceKey::mThresholdDirectionChangesUpper
private
double VoiceKey::mThresholdEnergy
private
double VoiceKey::mThresholdSignChangesLower
private
double VoiceKey::mThresholdSignChangesUpper
private
bool VoiceKey::mUseDirectionChangesHigh
private
bool VoiceKey::mUseDirectionChangesLow
private
bool VoiceKey::mUseEnergy
private
bool VoiceKey::mUseSignChangesHigh
private
bool VoiceKey::mUseSignChangesLow
private
double VoiceKey::mWindowSize
private

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