64 #include <asoundlib.h> 67 #include "../common/defines.h" 69 int AllocDataCPU(MyType **,
int **,
int **,
int **,
int **,
int **,
int *,
const int,
const int,
DTWfiles);
71 int AllocDTWCPU(MyType **, MyType **,
const int,
const int,
const int);
75 int AllocFFTCPU(MyFFTCPUType *, MyType **, MyType **, MyType **,
int*,
int*,
const int,
DTWfiles);
77 int AllocAuxiCPU(MyType **,
short **, MyType **, MyType **,
const int,
const int,
const int);
79 void ApplyWindow(MyType * __restrict,
const short *,
const MyType *,
const int,
const int);
81 void ComputeNorms(MyType *, MyType *,
const MyType *,
const int,
const int,
const MyType);
83 void FFT(MyType *,
const int *,
const int *, MyType *, MyType *, MyType *, MyFFTCPUType,
const int,
const int);
85 int DTWProc(
const MyType *,
const MyType *, MyType * __restrict,
const int,
const int,
const int);
87 void ApplyDist(
const MyType *, MyType *,
const int *,
const int,
const MyType);
89 void ComputeDist(
const MyType *, MyType * __restrict, MyType *,
const MyType *,
const MyType *,
const MyType *,
90 const MyType,
const int,
const int);
96 int ReadAlsaCPU1st(
short *, snd_pcm_t *, FILE *);
97 int ReadAlsaCPU (
short *, snd_pcm_t *, FILE *);
100 int SeqIdamin(
const int,
const MyType *);
103 int ParIdamin(
const int,
const MyType *);
108 void BetaNorm(MyType *,
const int, MyType);
Struct for store the name of input/verificaton files. Each composition needs a file with values for ...
int AllocAuxiCPU(MyType **, short **, MyType **, MyType **, const int, const int, const int)
AllocAuxiCPU Memory reservation for norms, frame, v_cfreq and v_dxState vectors.
int AllocS_fkCPU(MyType **, MyType **, MyType **, const MyType, const int, const int, DTWfiles)
AllocS_fkCPU Allocates memory for S_fk vector, read its data from file and initializes other auxiliar...
int AllocDataCPU(MyType **, int **, int **, int **, int **, int **, int *, const int, const int, DTWfiles)
AllocDataCPU creates and initializes some structures reading info from files.
int DTWProc(const MyType *Sequence, const MyType *Costs, MyType *__restrict pD, const int NSeq, const int Where, const int NST)
DTWProc performs the Online-DTW process for the current frame.
void ApplyDist(const MyType *, MyType *, const int *, const int, const MyType)
ApplyDist applies distortion.
void BetaNorm(MyType *, const int, MyType)
BetaNorm normalizes v_cfreq vector to have beta-norm 1.
int SeqIdamin(const int, const MyType *)
SeqIdamin returns the pos of the minimum in a vector.
int ReadWavCPU(short *, FILE *)
ReadWavCPU reads current audio (frame) from WAV file when ARM is used.
void ComputeNorms(MyType *, MyType *, const MyType *, const int, const int, const MyType)
ComputeNorms fills norms vector.
void ApplyWindow(MyType *__restrict X_fft, const short *frame, const MyType *v_hanning, const int framesize, const int xfftsize)
ApplyWindow applies hanning window to the current frame and store the result en vector X_fft...
int AllocDTWCPU(MyType **, MyType **, const int, const int, const int)
AllocDTWCPU Allocates memory for DTW vectors and initializes them.
void FFT(MyType *, const int *, const int *, MyType *, MyType *, MyType *, MyFFTCPUType, const int, const int)
FFT computes FFT and updates v_cfreq vector.
int ReadWavCPU1st(short *, FILE *)
ReadWavCPU1st reads first audio (frame) from WAV file when ARM is used.
void ComputeDist(const MyType *v_cfreq, MyType *__restrict v_dxStates, MyType *tauxi, const MyType *norms, const MyType *s_fk, const MyType *ts_fk, const MyType BETA, const int nbases, const int nmidi)
ComputeDist computes distortion.
int AllocFFTCPU(MyFFTCPUType *, MyType **, MyType **, MyType **, int *, int *, const int, DTWfiles)
AllocFFTCPU Allocates memory for FFT vector and reads some fft information from files.