1
/* ------------------------------------------------------------------
3
libofa -- the Open Fingerprint Architecture library
5
Copyright (C) 2006 MusicIP Corporation
8
-------------------------------------------------------------------*/
10
// MODULE: Class header for Signal_op
12
// DATE CREATED: 1/12/06
15
#define __SIGNAL_OP_H 1
18
const int MaxSample = 32767;
19
const int MinSample = -32768;
25
void Load(short* samples, long size, int sRate, bool stereo);
26
void CutSignal(double start, double dur);
27
void PrepareStereo(long rate, double silTh);
28
void PrepareMono(long rate, double silTh);
31
void RemoveSilence(double startTh, double endTh);
32
void RemoveDCOffset();
34
void ConvertSampleRate(long targetSR);
35
double GetCrossCorrelation();
36
double GetDuration() { return (double) NumBlocks * 1000.0 / (double) Rate; } // In msec
37
short* GetBuffer() { return Data; }
38
long GetLength() { return NumBlocks; }
39
long GetRate() { return Rate; }
42
short* Data; // buffer
44
long BufSize; // Total size of Data in terms of # of data items (short or float)
45
long NumBlocks; // number of data blocks (= number of sample points)
46
long Rate; // Sample rate
47
int NumChannels; // number of channels