33 #define testnn(x) {try{if (x<0) throw("testnn");}catch(...){x=0;}} 40 #define AllocateGMM(_MIXS, _DIM, _P, _M, _DEV) \ 41 double* _P=new double[_MIXS]; double** _M=new double*[_MIXS]; double ** _DEV=new double*[_MIXS]; \ 42 _M[0]=new double[(_MIXS)*(_DIM)]; _DEV[0]=new double[(_MIXS)*(_DIM)]; \ 43 for (int _MIX=1; _MIX<_MIXS; _MIX++) _M[_MIX]=&_M[0][_MIX*(_DIM)], _DEV[_MIX]=&_DEV[0][_MIX*(_DIM)]; 44 #define ReleaseGMM(_P, _M, _DEV) \ 45 delete[] _P; if (_M) {delete[] _M[0]; delete[] _M;} if (_DEV) {delete[] _DEV[0]; delete[] _DEV;} 63 #define ResetClock(AClock) {AClock.t=0;} 64 #define StartClock(AClock) {AClock.Ticks=GetTickCount();} 65 #define StopClock(AClock) {AClock.Ticks2=GetTickCount(); AClock.t+=0.001*(AClock.Ticks2-AClock.Ticks);} 130 void InsertPeak(
TSpecPeak& APeak,
int index);
150 int Delete(
int Index);
153 double ACPower(
double* data,
int Count,
void*);
154 void Add(
double* dest,
double* source,
int Count);
155 void Add(
double* out,
double* addend,
double* adder,
int count);
156 void ApplyWindow(
double* OutBuffer,
double* Buffer,
double* Weights,
int Size);
157 double Avg(
double*,
int,
void*);
158 void AvgFilter(
double* dataout,
double* data,
int Count,
int HWid);
159 int BitInv(
int value,
int order);
160 void CalculateSpectrogram(
double* data,
int Count,
int start,
int end,
int Wid,
int Offst,
double*
Window=0,
double** Spec=0,
double** Ph=0,
double amp=1,
bool half=
true);
161 void Conv(
double* out,
int N1,
double* in1,
int N2,
double* in2);
162 void DCT(
double* output,
double* input,
int N);
163 void IDCT(
double* output,
double* input,
int N);
165 double DCPower(
double*,
int,
void*);
166 double ddIPHann(
double,
void*);
167 void DeDC(
double* data,
int Count,
int HWid);
169 void DoubleToInt(
void* out,
int BytesPerSample,
double* in,
int Count);
170 void DoubleToIntAdd(
void* out,
int BytesPerSample,
double* in,
int Count);
171 double DPower(
double* data,
int Count,
void*);
172 double Energy(
double* data,
int Count);
173 double ExpOnsetFilter(
double* dataout,
double* data,
int Count,
double Tr,
double Ta);
176 void FFTConv(
double* dest,
double* source1,
int size1,
double* source2,
int size2,
int zero=0,
double* pre_buffer=NULL,
double* post_buffer=NULL);
177 void FFTConv(
unsigned char* dest,
unsigned char* source1,
int bps,
int size1,
double* source2,
int size2,
int zero=0,
unsigned char* pre_buffer=NULL,
unsigned char* post_buffer=NULL);
178 void FFTConv(
double* dest,
double* source1,
int size1,
double* source2,
int size2,
double* pre_buffer=NULL);
179 void FFTFilter(
double* dataout,
double* data,
int Count,
int Wid,
int On,
int Off);
180 void FFTFilterOLA(
double* dataout,
double* data,
int Count,
int Wid,
int On,
int Off,
double* pre_buffer=NULL);
181 void FFTFilterOLA(
unsigned char* dataout,
unsigned char* data,
int BytesPerSample,
int Count,
int Wid,
int On,
int Off,
unsigned char* pre_buffer=NULL);
182 void FFTFilterOLA(
double* dataout,
double* data,
int Count,
double* amp,
double* ph,
int Wid,
double* pre_buffer=NULL);
183 double FFTMask(
double* dataout,
double* data,
int Count,
int Wid,
double DigiOn,
double DigiOff,
double maskcoef=1);
184 int FindInc(
double value,
double* data,
int Count);
185 double Gaussian(
int Dim,
double* Vector,
double* Mean,
double* Dev,
bool StartFrom1);
186 void HalfDCT(
double* data,
int Count,
double* CC,
int order);
187 double Hamming(
double f,
double T);
188 double Hann(
double x,
double N);
189 double HannSq(
double x,
double N);
190 int HxPeak2(
double*& hps,
double*& vhps,
double (*F)(
double,
void*),
double (*dF)(
double,
void*),
double(*ddF)(
double,
void*),
void* params,
double st,
double en,
double epf=1e-6);
192 int InsertDec(
double value,
double* data,
int Count);
193 int InsertDec(
int value,
int* data,
int Count);
194 int InsertDec(
double value,
int index,
double* data,
int* indices,
int Count);
195 int InsertInc(
void* value,
void** data,
int Count,
int (*Compare)(
void*,
void*));
196 int InsertInc(
double value,
double* data,
int Count,
bool doinsert=
true);
197 int InsertInc(
double value,
int index,
double* data,
int* indices,
int Count);
198 int InsertInc(
double value,
double index,
double* data,
double* indices,
int Count);
199 int InsertInc(
double value,
int* data,
int Count,
bool doinsert=
true);
200 int InsertIncApp(
double value,
double* data,
int Count);
203 void IntToDouble(
double* out,
void* in,
int BytesPerSample,
int Count);
205 double IPHannC(
double f,
void* params);
206 double IPHannCP(
double f,
void* params);
207 void lse(
double* x,
double* y,
int Count,
double& a,
double& b);
208 void memdoubleadd(
double* dest,
double* source,
int count);
209 void MFCC(
int FrameWidth,
int NumBands,
int Ceps_Order,
double* Data,
double* Bands,
double* C,
double* Amps,
cdouble* W,
cdouble* X);
210 double*
MFCCPrepareBands(
int NumberOfBands,
int SamplesPerSec,
int NumberOfBins);
211 void Multi(
double* data,
int count,
double mul);
212 void Multi(
double* out,
double* in,
int count,
double mul);
213 void MultiAdd(
double* out,
double* in,
double* adder,
int count,
double mul);
214 int NearestPeak(
double* data,
int count,
int anindex);
215 double NegativeExp(
double* x,
double* y,
int Count,
double& lmd,
int sample=1,
double step=0.05,
double eps=1e-6,
int maxiter=50);
216 double NL(
double* data,
int Count,
int Wid);
217 double Normalize(
double* data,
int Count,
double Maxi=1);
218 double Normalize2(
double* data,
int Count,
double Norm=1);
219 double nextdouble(
double x,
double dir);
220 double PhaseSpan(
double* data,
int Count,
void*);
221 void PolyFit(
int P,
double* a,
int N,
double* x,
double* y);
222 void Pow(
double* data,
int Count,
double ex);
224 int Rectify(
double* data,
int Count,
double th=0);
225 double Res(
double in,
double mod);
226 double Romberg(
int n,
double(*f)(
double,
void*),
double a,
double b,
void* params=0);
227 double Romberg(
double(*f)(
double,
void*),
double a,
double b,
void* params=0,
int maxiter=50,
double ep=1e-6);
228 double sinca(
double x);
230 double SmoothPhase(
double* Arg,
int Count,
int mpi=2);
232 double StiffB(
double f0,
double fm,
int m);
233 double StiffFm(
double f0,
int m,
double B);
234 double StiffF0(
double fm,
int m,
double B);
235 double StiffM(
double f0,
double fm,
double B);
236 void TFFilter(
double* data,
double* dataout,
int Count,
int Wid,
TTFSpans* Spans,
bool Pass, WindowType wt,
double windp,
int Sps,
int TOffst=0);
237 void TFFilter(
void* data,
void* dataout,
int BytesPerSample,
int Count,
int Wid,
TTFSpans* Spans,
bool Pass, WindowType wt,
double windp,
int Sps,
int TOffst);
238 void TFMask(
double* data,
double* dataout,
int Count,
int Wid,
TTFSpans* Spans,
double masklevel, WindowType wt,
double windp,
int Sps,
int TOffst);
239 void TFMask(
void* data,
void* dataout,
int BytesPerSec,
int Count,
int Wid,
TTFSpans* Spans,
double masklevel, WindowType wt,
double windp,
int Sps,
int TOffst);
void DeDC(double *data, int Count, int HWid)
Definition: procedures.cpp:485
void FFTFilter(double *dataout, double *data, int Count, int Wid, int On, int Off)
Definition: procedures.cpp:1051
void memdoubleadd(double *dest, double *source, int count)
Definition: procedures.cpp:2003
void IDCT(double *output, double *input, int N)
Definition: procedures.cpp:464
int HxPeak2(double *&hps, double *&vhps, double(*F)(double, void *), double(*dF)(double, void *), double(*ddF)(double, void *), void *params, double st, double en, double epf=1e-6)
Definition: procedures.cpp:1439
double ExtractLinearComponent(double *dataout, double *data, int Count)
Definition: procedures.cpp:637
void Multi(double *data, int count, double mul)
Definition: procedures.cpp:2120
double * MFCCPrepareBands(int NumberOfBands, int SamplesPerSec, int NumberOfBins)
Definition: procedures.cpp:2090
double PhaseSpan(double *data, int Count, void *)
Definition: procedures.cpp:2312
int FindInc(double value, double *data, int Count)
Definition: procedures.cpp:1272
cdouble * Window(cdouble *x, double f, int N, int M, double *c, int K1, int K2)
Definition: sinest.cpp:102
double Normalize(double *data, int Count, double Maxi=1)
Definition: procedures.cpp:2266
int BitInv(int value, int order)
Definition: fft.cpp:50
Definition: procedures.h:91
Definition: procedures.h:139
double StiffFm(double f0, int m, double B)
Definition: procedures.cpp:2577
double NL(double *data, int Count, int Wid)
Definition: procedures.cpp:2239
void TFFilter(double *data, double *dataout, int Count, int Wid, TTFSpans *Spans, bool Pass, WindowType wt, double windp, int Sps, int TOffst=0)
Definition: procedures.cpp:2633
void IntToDouble(double *out, void *in, int BytesPerSample, int Count)
Definition: quickspec.cpp:116
int InsertIncApp(double value, double *data, int Count)
Definition: procedures.cpp:1848
int Rectify(double *data, int Count, double th=0)
Definition: procedures.cpp:2386
void AvgFilter(double *dataout, double *data, int Count, int HWid)
Definition: procedures.cpp:285
double Hamming(double f, double T)
Definition: procedures.cpp:1318
double sinca(double x)
Definition: procedures.cpp:2505
void DeDC_static(double *data, int Count)
Definition: procedures.cpp:502
void MFCC(int FrameWidth, int NumBands, int Ceps_Order, double *Data, double *Bands, double *C, double *Amps, cdouble *W, cdouble *X)
Definition: procedures.cpp:2048
double Normalize2(double *data, int Count, double Norm=1)
Definition: procedures.cpp:2293
double Avg(double *, int, void *)
Definition: procedures.cpp:266
double sincd_unn(double x, int N)
Definition: procedures.cpp:2519
void ApplyWindow(double *OutBuffer, double *Buffer, double *Weights, int Size)
Definition: procedures.cpp:253
double IPHannC(double f, cdouble *x, int N, int K1, int K2)
Definition: procedures.cpp:1963
void Pow(double *data, int Count, double ex)
Definition: procedures.cpp:2370
void FFTFilterOLA(double *dataout, double *data, int Count, int Wid, int On, int Off, double *pre_buffer=NULL)
Definition: procedures.cpp:1120
Definition: procedures.h:99
double Hann(double x, double N)
Definition: procedures.cpp:1396
double ACPower(double *data, int Count, void *)
Definition: procedures.cpp:201
void DCT(double *output, double *input, int N)
Definition: procedures.cpp:441
double DCAmplitude(double *, int, void *)
Definition: procedures.cpp:399
Definition: procedures.h:77
double InstantFreq(int k, int hwid, cdouble *x, int mode=1)
Definition: procedures.cpp:1888
double StiffB(double f0, double fm, int m)
Definition: procedures.cpp:2560
double ExpOnsetFilter(double *dataout, double *data, int Count, double Tr, double Ta)
Definition: procedures.cpp:589
Definition: procedures.h:57
void MultiAdd(double *out, double *in, double *adder, int count, double mul)
Definition: procedures.cpp:2148
void CalculateSpectrogram(double *data, int Count, int start, int end, int Wid, int Offst, double *Window=0, double **Spec=0, double **Ph=0, double amp=1, bool half=true)
Definition: procedures.cpp:325
double DCPower(double *, int, void *)
Definition: procedures.cpp:419
void PolyFit(int P, double *a, int N, double *x, double *y)
Definition: procedures.cpp:2340
double StiffM(double f0, double fm, double B)
Definition: procedures.cpp:2608
double Res(double in, double mod)
Definition: procedures.cpp:2406
double FFTMask(double *dataout, double *data, int Count, int Wid, double DigiOn, double DigiOff, double maskcoef=1)
Definition: procedures.cpp:1180
double DPower(double *data, int Count, void *)
Definition: procedures.cpp:556
void FFTConv(double *dest, double *source1, int size1, double *source2, int size2, int zero=0, double *pre_buffer=NULL, double *post_buffer=NULL)
Definition: procedures.cpp:671
void DoubleToIntAdd(void *out, int BytesPerSample, double *in, int Count)
Definition: procedures.cpp:534
double Romberg(int n, double(*f)(double, void *), double a, double b, void *params=0)
Definition: procedures.cpp:2426
double HannSq(double x, double N)
Definition: procedures.cpp:1358
Definition: xcomplex.h:26
int NearestPeak(double *data, int count, int anindex)
Definition: procedures.cpp:2163
int InsertDec(int value, int *data, int Count)
Definition: procedures.cpp:1541
Definition: procedures.h:69
void lse(double *x, double *y, int Count, double &a, double &b)
Definition: procedures.cpp:1980
double NegativeExp(double *x, double *y, int Count, double &lmd, int sample=1, double step=0.05, double eps=1e-6, int maxiter=50)
Definition: procedures.cpp:2194
double SmoothPhase(double *Arg, int Count, int mpi=2)
Definition: procedures.cpp:2535
double Energy(double *data, int Count)
Definition: procedures.cpp:571
Definition: procedures.h:114
double ExpOnsetFilter_balanced(double *dataout, double *data, int Count, double Tr, double Ta, int bal=5)
Definition: procedures.cpp:616
int InsertInc(double value, double *data, int Count, bool doinsert=true)
Definition: procedures.cpp:1704
double StiffF0(double fm, int m, double B)
Definition: procedures.cpp:2592
void DoubleToInt(void *out, int BytesPerSample, double *in, int Count)
Definition: procedures.cpp:518
void Add(double *dest, double *source, int Count)
Definition: procedures.cpp:224
void Conv(double *out, int N1, double *in1, int N2, double *in2)
Definition: procedures.cpp:362
double I0(double x)
Definition: windowfunctions.cpp:25