-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/wtq2255/audioFlux
- Loading branch information
Showing
26 changed files
with
945 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
|
||
#ifndef NMF_H | ||
#define NMF_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
/*** | ||
V=W*H | ||
k k<n&&k<m,k*(n+m)<n*m | ||
maxIter 300 | ||
type 0 0 KL 1 IS 2 Euc | ||
thresh 1e-3 | ||
norm 0 max 1 sum/p-1 2 p-2 | ||
****/ | ||
void nmf(float *mDataArr,int nLength,int mLength,int k, | ||
float *wArr,float *hArr, | ||
int *maxIter,int *type,float *thresh, | ||
int *norm); | ||
|
||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
|
||
#ifndef VITERBI_H | ||
#define VITERBI_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
/*** | ||
λ=(π,A,B) sLength*1,sLength*sLength,sLength*nLength | ||
oArr B nLength index | ||
mProbArr tLength*sLength | ||
sArr A sLength index | ||
****/ | ||
float viterbi(float *piArr,float *mAArr,float *mBArr, | ||
int sLength,int nLength, | ||
int *oArr,int tLength,int *isLog, | ||
int *sArr,float *mProbArr,int *mIndexArr); | ||
|
||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
|
||
#ifndef CONV_ALGORITHM_H | ||
#define CONV_ALGORITHM_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include "../flux_base.h" | ||
|
||
// convolution 相关 | ||
typedef enum{ | ||
ConvMode_Full=0, | ||
ConvMode_Same, | ||
ConvMode_Valid, | ||
|
||
} ConvModeType; | ||
|
||
typedef enum{ | ||
ConvMethod_Auto=0, | ||
ConvMethod_Direct, | ||
ConvMethod_FFT, | ||
|
||
} ConvMethodType; | ||
|
||
typedef struct OpaqueConv *ConvObj; | ||
|
||
int convObj_new(ConvObj *convObj); | ||
|
||
int convObj_conv(ConvObj convObj,float *vArr1,int length1,float *vArr2,int length2, | ||
ConvModeType *mode,ConvMethodType *method, | ||
float *vArr3); | ||
|
||
void convObj_free(ConvObj convObj); | ||
|
||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
|
||
#ifndef HILBERT_ALGORITHM_H | ||
#define HILBERT_ALGORITHM_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include "../flux_base.h" | ||
|
||
typedef struct OpaqueHilbert *HilbertObj; | ||
|
||
int hilbertObj_new(HilbertObj *hilbertObj,int radix2Exp); | ||
|
||
void hilbertObj_hilbert(HilbertObj hilbertObj,float *dataArr, | ||
float *realArr3,float *imageArr3); | ||
|
||
void hilbertObj_free(HilbertObj hilbertObj); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
|
||
#ifndef PHASE_VOCODER_H | ||
#define PHASE_VOCODER_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
/*** | ||
mDataArr1 stft time*fftLength | ||
rate 0.5~2 | ||
slideLength fftLength/4 | ||
****/ | ||
void phase_vocoder(float *mRealArr1,float *mImageArr1,int timeLength,int fftLength,int slideLength,float rate, | ||
float *mRealArr2,float *mImageArr2); | ||
|
||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
|
||
#ifndef HARMONI_ALGORITHM_H | ||
#define HARMONI_ALGORITHM_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include "flux_base.h" | ||
|
||
typedef struct OpaqueHarmonic *HarmonicObj; | ||
|
||
/*** | ||
samplate 32000 | ||
radix2Exp 12 | ||
windowType hamm | ||
****/ | ||
int harmonicObj_new(HarmonicObj *harmonicObj, | ||
int *samplate, | ||
int *radix2Exp,WindowType *windowType,int *slideLength); | ||
|
||
int harmonicObj_calTimeLength(HarmonicObj harmonicObj,int dataLength); | ||
|
||
void harmonicObj_exec(HarmonicObj harmonicObj,float *dataArr,int dataLength); | ||
|
||
void harmonicObj_harmonicCount(HarmonicObj harmonicObj,float low,float high,int *countArr); | ||
|
||
void harmonicObj_free(HarmonicObj harmonicObj); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
|
||
#ifndef PITCHSHIFT_ALGORITHM_H | ||
#define PITCHSHIFT_ALGORITHM_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
#include "../flux_base.h" | ||
|
||
typedef struct OpaquePitchShift *PitchShiftObj; | ||
|
||
/*** | ||
radix2Exp 12 | ||
WindowType hann | ||
slideLength (1<<radix2Exp)/4 | ||
****/ | ||
int pitchShiftObj_new(PitchShiftObj *pitchShiftObj,int *radix2Exp,int *slideLength,WindowType *windowType); | ||
|
||
// nSemitone -12~12 | ||
void pitchShiftObj_pitchShift(PitchShiftObj pitchShiftObj,int samplate,int nSemitone,float *dataArr1,int dataLength1,float *dataArr2); | ||
|
||
void pitchShiftObj__free(PitchShiftObj pitchShiftObj); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
|
||
#ifndef TIMESTRETCH_ALGORITHM_H | ||
#define TIMESTRETCH_ALGORITHM_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
#include "../flux_base.h" | ||
|
||
typedef struct OpaqueTimeStretch *TimeStretchObj; | ||
|
||
/*** | ||
radix2Exp 12 | ||
WindowType hann | ||
slideLength (1<<radix2Exp)/4 | ||
****/ | ||
int timeStretchObj_new(TimeStretchObj *timeStretchObj,int *radix2Exp,int *slideLength,WindowType *windowType); | ||
|
||
int timeStretchObj_calDataCapacity(TimeStretchObj timeStretchObj,float rate,int dataLength); | ||
int timeStretchObj_timeStretch(TimeStretchObj timeStretchObj,float rate,float *dataArr1,int dataLength1,float *dataArr2); | ||
|
||
void timeStretchObj_free(TimeStretchObj timeStretchObj); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
Oops, something went wrong.