11#ifndef __AUDACITY_VOICEKEY__
12#define __AUDACITY_VOICEKEY__
16#define M_PI 3.14159265358979323846
49 void SetKeyType(
bool erg,
bool scLow,
bool scHigh,
50 bool dcLow,
bool dcHigh);
88 void TestEnergyUpdate (
double & prevErg,
int length,
const float & drop,
const float &
add);
90 const float & a2,
const float & z1,
const float & z2);
92 int & atrend,
const float & a1,
const float & a2,
93 int & ztrend,
const float & z1,
const float & z2);
98inline int sgn(
int number){
return (number<0) ? -1: 1;}
@ VKT_DIRECTION_CHANGES_LOW
@ VKT_DIRECTION_CHANGES_HIGH
This implements a voice key, detecting either the next "ON" or "OFF" point.
double TestDirectionChanges(const WaveChannel &t, sampleCount start, sampleCount len)
double mThresholdAdjustment
void TestDirectionChangesUpdate(double ¤tdirectionchanges, int length, int &atrend, const float &a1, const float &a2, int &ztrend, const float &z1, const float &z2)
sampleCount OffForward(const WaveChannel &t, sampleCount start, sampleCount len)
sampleCount OnBackward(const WaveChannel &t, sampleCount start, sampleCount len)
double mThresholdDirectionChangesUpper
void AdjustThreshold(double t)
sampleCount OnForward(const WaveChannel &t, sampleCount start, sampleCount len)
double mThresholdDirectionChangesLower
bool AboveThreshold(const WaveChannel &t, sampleCount start, sampleCount len)
bool mUseDirectionChangesLow
sampleCount OffBackward(const WaveChannel &t, sampleCount start, sampleCount len)
void TestEnergyUpdate(double &prevErg, int length, const float &drop, const float &add)
double mThresholdSignChangesLower
bool mUseDirectionChangesHigh
double TestEnergy(const WaveChannel &t, sampleCount start, sampleCount len)
double TestSignChanges(const WaveChannel &t, sampleCount start, sampleCount len)
void CalibrateNoise(const WaveChannel &t, sampleCount start, sampleCount len)
void SetKeyType(bool erg, bool scLow, bool scHigh, bool dcLow, bool dcHigh)
void TestSignChangesUpdate(double ¤tsignchanges, int length, const float &a1, const float &a2, const float &z1, const float &z2)
double mThresholdSignChangesUpper
double mDirectionChangesSD
double mDirectionChangesMean
Positions or offsets within audio files need a wide type.
void add(const T *src1, const T *src2, T *dst, int32_t n)