|
ReMAS
1.5
Real-time Musical Accompaniment System
|
File with code of ReMAS functions for CPU, both x86_64 and ARM. More...
Go to the source code of this file.
Functions | |
| 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. More... | |
| void | ComputeNorms (MyType *norms, MyType *ts_fk, const MyType *s_fk, const int nmidi, const int nbases, const MyType beta) |
| ComputeNorms fills norms vector. More... | |
| int | AllocAuxiCPU (MyType **norms, short **frame, MyType **v_cfreq, MyType **v_dxState, const int nbases, const int tamframe, const int nmidi) |
| AllocAuxiCPU Memory reservation for norms, frame, v_cfreq and v_dxState vectors. More... | |
| int | AllocFFTCPU (MyFFTCPUType *plan, MyType **X_fft, MyType **Out_fft, MyType **Mod_fft, int *kmin_fft, int *kmax_fft, const int nfft, DTWfiles NameFiles) |
| AllocFFTCPU Allocates memory for FFT vector and reads some fft information from files. More... | |
| int | AllocS_fkCPU (MyType **s_fk, MyType **tauxi, MyType **ts_fk, const MyType BETA, const int nmidi, const int nbases, DTWfiles NameFiles) |
| AllocS_fkCPU Allocates memory for S_fk vector, read its data from file and initializes other auxiliar vectors. More... | |
| int | AllocDTWCPU (MyType **pV, MyType **v_SxD, const int DTWSize, const int DTWSizePlusPad, const int startin) |
| AllocDTWCPU Allocates memory for DTW vectors and initializes them. More... | |
| int | AllocDataCPU (MyType **v_hanning, int **states_time_i, int **states_time_e, int **states_seq, int **states_corr, int **I_SxD, int *DTWSize, const int tamframe, const int nstates, DTWfiles NameFiles) |
| AllocDataCPU creates and initializes some structures reading info from files. More... | |
| void | FFT (MyType *v_cfreq, const int *kmin, const int *kmax, MyType *X_fft, MyType *Mod_fft, MyType *Out_fft, MyFFTCPUType plan, const int nfft, const int nmidi) |
| FFT computes FFT and updates v_cfreq vector. More... | |
| int | SeqIdamin (const int N, const MyType *v) |
| SeqIdamin returns the pos of the minimum in a vector. More... | |
| 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. More... | |
| void | ApplyDist (const MyType *v_dxState, MyType *v_SxD, const int *I_SxD, const int size, const MyType ALPHA) |
| ApplyDist applies distortion. More... | |
| 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. More... | |
| int | ReadWavCPU1st (short *frame, FILE *fp) |
| ReadWavCPU1st reads first audio (frame) from WAV file when ARM is used. More... | |
| int | ReadWavCPU (short *frame, FILE *fp) |
| ReadWavCPU reads current audio (frame) from WAV file when ARM is used. More... | |
| void | BetaNorm (MyType *v_cfreq, const int nmidi, MyType BETA) |
| BetaNorm normalizes v_cfreq vector to have beta-norm 1. More... | |
File with code of ReMAS functions for CPU, both x86_64 and ARM.
Definition in file CPUFunctions.c.
| int AllocAuxiCPU | ( | MyType ** | norms, |
| short ** | frame, | ||
| MyType ** | v_cfreq, | ||
| MyType ** | v_dxState, | ||
| const int | nbases, | ||
| const int | tamframe, | ||
| const int | nmidi | ||
| ) |
AllocAuxiCPU Memory reservation for norms, frame, v_cfreq and v_dxState vectors.
| norms | (out) Norms vector |
| frame | (out) Vector for frames |
| v_cfreq | (out) v_cfreq vector |
| v_dxState | (out) v_dxState vector |
| nbases | (in) Number of bases/combinations, sizeof norms and v_dxState |
| tamframe | (in) Size of frames in samples |
| nmidi | (in) Number of midi notes, sizeof v_cfreq |
Definition at line 152 of file CPUFunctions.c.
| int AllocDataCPU | ( | MyType ** | v_hanning, |
| int ** | states_time_i, | ||
| int ** | states_time_e, | ||
| int ** | states_seq, | ||
| int ** | states_corr, | ||
| int ** | I_SxD, | ||
| int * | DTWSize, | ||
| const int | tamframe, | ||
| const int | nstates, | ||
| DTWfiles | NameFiles | ||
| ) |
AllocDataCPU creates and initializes some structures reading info from files.
| v_hanning | (out) v_hanning vector |
| states_time_i | (out) states_time_i vector, contains the start-time of each state in frames |
| states_time_e | (out) states_time_e vector, contains the end-time of each state in frames |
| states_seq | (out) states_seq vector, contains the base/combination that is performed in each state |
| states_corr | (out) states_corr vector |
| I_SxD | (out) I_SxD vector |
| DTWSize | (in) Size of DTW vectors |
| tamframe | (in) Size of frames in samples |
| nstates | (in) Number of states |
| NameFiles | (in) Struct with the file names |
Definition at line 310 of file CPUFunctions.c.
| int AllocDTWCPU | ( | MyType ** | pV, |
| MyType ** | v_SxD, | ||
| const int | DTWSize, | ||
| const int | DTWSizePlusPad, | ||
| const int | startin | ||
| ) |
AllocDTWCPU Allocates memory for DTW vectors and initializes them.
| pV | (out) DTW pV vector |
| v_SxD | (out) v_SxD vector |
| DTWSize | (in) Size of DTW vectors |
| DTWSizePlusPad | (in) Size of DTW vectors plus padding |
| startin | (in) Where we start to store data within circular-buffer |
Definition at line 270 of file CPUFunctions.c.
| int AllocFFTCPU | ( | MyFFTCPUType * | plan, |
| MyType ** | X_fft, | ||
| MyType ** | Out_fft, | ||
| MyType ** | Mod_fft, | ||
| int * | kmin_fft, | ||
| int * | kmax_fft, | ||
| const int | nfft, | ||
| DTWfiles | NameFiles | ||
| ) |
AllocFFTCPU Allocates memory for FFT vector and reads some fft information from files.
| plan | (out) FFT scheduler |
| X_fft | (out) X_fft vector |
| Out_fft | (out) Out_fft vector |
| Mod_fft | (out) Mod_fft vector |
| kmin_fft | (out) Where kmin_fft is stored |
| kmax_fft | (out) Where kmax_fft is stored |
| nfft | (in) As is to be, Mod_fft and Out_fft size |
| NameFiles | (in) Struct with the file names |
Definition at line 177 of file CPUFunctions.c.
| int AllocS_fkCPU | ( | MyType ** | s_fk, |
| MyType ** | tauxi, | ||
| MyType ** | ts_fk, | ||
| const MyType | BETA, | ||
| const int | nmidi, | ||
| const int | nbases, | ||
| DTWfiles | NameFiles | ||
| ) |
AllocS_fkCPU Allocates memory for S_fk vector, read its data from file and initializes other auxiliar vectors.
| s_fk | (out) s_fk vector |
| tauxi | (out) Auxiliar vector tauxi |
| ts_fk | (out) Auxiliar vector ts_fk |
| BETA | (in) BETA value |
| nmidi | (in) Number of midi notes |
| nbases | (in) Number of bases/combinations |
| NameFiles | (in) Struct with the file names |
Definition at line 231 of file CPUFunctions.c.
| void ApplyDist | ( | const MyType * | v_dxState, |
| MyType * | v_SxD, | ||
| const int * | I_SxD, | ||
| const int | size, | ||
| const MyType | ALPHA | ||
| ) |
ApplyDist applies distortion.
| v_dxState | (in) v_dxState vector |
| v_SxD | (out) v_SxD vector |
| I_SxD | (in) I_SxD vector |
| size | (in) Size of the vectors |
| ALPHA | (in) ALPHA value |
Definition at line 550 of file CPUFunctions.c.
| 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.
| X_fft | (out) Vector X_fft to update |
| frame | (in) Vector with current frame |
| v_hanning | (in) Hanning vector |
| framesize | (in) Size of the frame |
| xfftsize | (in) Size of the vector X_fft |
Definition at line 48 of file CPUFunctions.c.
| void BetaNorm | ( | MyType * | v_cfreq, |
| const int | nmidi, | ||
| MyType | BETA | ||
| ) |
BetaNorm normalizes v_cfreq vector to have beta-norm 1.
| v_cfreq | (inout) v_cfreq vector |
| BETA | (in) BETA value |
| nmidi | (in) Number of midi notes |
Definition at line 817 of file CPUFunctions.c.
| 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.
| v_cfreq | (in) v_cfreq vector |
| v_dxStates | (out) v_dxStates vector |
| tauxi | (out) tauxi vector |
| norms | (in) norms vector |
| s_fk | (in) s_fk vector |
| ts_fk | (in) ts_fk vector |
| BETA | (in) BETA value |
| nbases | (in) Number of bases/combinations |
| nmidi | (in) Number of midi notes |
Definition at line 600 of file CPUFunctions.c.
| void ComputeNorms | ( | MyType * | norms, |
| MyType * | ts_fk, | ||
| const MyType * | s_fk, | ||
| const int | nmidi, | ||
| const int | nbases, | ||
| const MyType | beta | ||
| ) |
ComputeNorms fills norms vector.
| norms | (out) Vector with the norms |
| ts_fk | (in) Auxiliar vector |
| s_fk | (in) Vector s_fk |
| nmidi | (in) Number of midi notes |
| nbases | (in) Number of bases/combinations |
| beta | (in) BETA value |
Definition at line 73 of file CPUFunctions.c.
| 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.
| Sequence | (in) Currente frame |
| Costs | (in) Vector with DTW path-costs |
| pD | (out) DTW pD vector |
| NSeq | (in) One referenced position within DTW vectors |
| Where | (in) Position within DTW vectors |
| NST | (in) Number of states |
Definition at line 485 of file CPUFunctions.c.
| void FFT | ( | MyType * | v_cfreq, |
| const int * | kmin, | ||
| const int * | kmax, | ||
| MyType * | X_fft, | ||
| MyType * | Mod_fft, | ||
| MyType * | Out_fft, | ||
| MyFFTCPUType | plan, | ||
| const int | nfft, | ||
| const int | nmidi | ||
| ) |
FFT computes FFT and updates v_cfreq vector.
| v_cfreq | (out) v_cfreq vector |
| kmin | (input) kmin vector |
| kmax | (input) kmax vector |
| X_fft | (inout) X_fft vector |
| Mod_fft | (inout) Mod_fft vector |
| Out_fft | (inout) Out_fft vector |
| plan | (out) FFT scheduler |
| nfft | (in) As is to be, Mod_fft and Out_fft size |
| nmidi | (in) Number of midi notes |
Definition at line 356 of file CPUFunctions.c.
| ReadWavCPU | ( | short * | frame, |
| FILE * | fp | ||
| ) |
ReadWavCPU reads current audio (frame) from WAV file when ARM is used.
| frame | (out) Vector to store the current frame |
| fp | (in) ID of file with data |
Definition at line 756 of file CPUFunctions.c.
| ReadWavCPU1st | ( | short * | frame, |
| FILE * | fp | ||
| ) |
ReadWavCPU1st reads first audio (frame) from WAV file when ARM is used.
| frame | (out) Vector to store the first frame |
| fp | (in) ID of file with the information |
Definition at line 742 of file CPUFunctions.c.
| int SeqIdamin | ( | const int | N, |
| const MyType * | v | ||
| ) |
SeqIdamin returns the pos of the minimum in a vector.
When minimum's number of occurrences > 1 => returns the position of the 1st occurrence
| N | (in) Vector size |
| v | (in) The vector |
Definition at line 462 of file CPUFunctions.c.
1.8.13