Skip to content

Commit

Permalink
Merge pull request #31 from wtq2255/master
Browse files Browse the repository at this point in the history
update 0.1.7
  • Loading branch information
wtq2255 authored Dec 16, 2023
2 parents 2290dd4 + 44f670c commit 2f04f26
Show file tree
Hide file tree
Showing 26 changed files with 1,700 additions and 114 deletions.
2 changes: 1 addition & 1 deletion conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% set version = "0.1.6" %}
{% set version = "0.1.7" %}

package:
name: audioflux
Expand Down
10 changes: 10 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
ChangeLog
=========
v0.1.7
------
* New features:
* Add Cepstrogram algorithm.
* Add PitchCEP/PitchHPS/PitchLHS/PitchNCF/PitchPEF/PitchSTFT/PitchYIN algorithm.
* Modified API:
* `audioflux.display.fill_wave` add `times` params.
* Fix bug:
* Fix `flux` param: `is_no_exp` to `is_exp`.

v0.1.6
------
* Fix bug:
Expand Down
5 changes: 5 additions & 0 deletions docs/feature/cepstrogram.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Cepstrogram
===========

.. autoclass:: audioflux.Cepstrogram
:members:
1 change: 1 addition & 0 deletions docs/feature/feature.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The feature module contains the following algorithms:
spectral
xxcc
deconv
cepstrogram
temporal
featureExtractor

Expand Down
20 changes: 19 additions & 1 deletion docs/mir/pitch.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
Pitch
=====

.. autoclass:: audioflux.Pitch
.. autoclass:: audioflux.PitchCEP
:members:

.. autoclass:: audioflux.PitchHPS
:members:

.. autoclass:: audioflux.PitchLHS
:members:

.. autoclass:: audioflux.PitchNCF
:members:

.. autoclass:: audioflux.PitchPEF
:members:

.. autoclass:: audioflux.PitchSTFT
:members:

.. autoclass:: audioflux.PitchYIN
:members:
45 changes: 45 additions & 0 deletions include/cepstrogram_algorithm.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@


#ifndef CEPSTROGRAM_ALGORITHM_H
#define CEPSTROGRAM_ALGORITHM_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdio.h>
#include <stdlib.h>
#include "flux_base.h"

typedef struct OpaqueCepstrogram *CepstrogramObj;

/***
radix2Exp 12
WindowType "rect"
slideLength 1024
****/
int cepstrogramObj_new(CepstrogramObj *cepstrogramObj,int radix2Exp,WindowType *windowType,int *slideLength);

int cepstrogramObj_calTimeLength(CepstrogramObj cepstrogramObj,int dataLength);

/***
cepNum 4~128 ,formant estimate number
mDataArr1 cepstrums ,timeLength*(fftLength/2+1)
mDataArr2 envelope(formant) ,timeLength*(fftLength/2+1)
mDataArr3 details(tone) ,timeLength*(fftLength/2+1)
****/
void cepstrogramObj_cepstrogram(CepstrogramObj cepstrogramObj,int cepNum,float *dataArr,int dataLength,
float *mDataArr1,float *mDataArr2,float *mDataArr3);

void cepstrogramObj_cepstrogram2(CepstrogramObj cepstrogramObj,int cepNum,float *mRealArr,float *mImageArr,int nLength,
float *mDataArr1,float *mDataArr2,float *mDataArr3);

void cepstrogramObj_enableDebug(CepstrogramObj cepstrogramObj,int flag);

void cepstrogramObj_free(CepstrogramObj cepstrogramObj);

#ifdef __cplusplus
}
#endif

#endif
43 changes: 43 additions & 0 deletions include/mir/_pitch_cep.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@


#ifndef _PITCH_CEP_H
#define _PITCH_CEP_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdio.h>
#include <stdlib.h>

#include "../flux_base.h"

typedef struct OpaquePitchCEP *PitchCEPObj;

/***
samplate 32000
lowFre 32,
highFre 2000
radix2Exp 12
WindowType Hamm
slideLength (1<<radix2Exp)/4
isContinue 0
****/
int pitchCEPObj_new(PitchCEPObj *pitchCEPObj,
int *samplate,float *lowFre,float *highFre,
int *radix2Exp,int *slideLength,WindowType *windowType,
int *isContinue);

int pitchCEPObj_calTimeLength(PitchCEPObj pitchCEPObj,int dataLength);

void pitchCEPObj_pitch(PitchCEPObj pitchCEPObj,float *dataArr,int dataLength,
float *freArr);

void pitchCEPObj_enableDebug(PitchCEPObj pitchCEPObj,int isDebug);
void pitchCEPObj_free(PitchCEPObj pitchCEPObj);

#ifdef __cplusplus
}
#endif

#endif
46 changes: 46 additions & 0 deletions include/mir/_pitch_hps.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@


#ifndef _PITCH_HPS_H
#define _PITCH_HPS_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdio.h>
#include <stdlib.h>

#include "../flux_base.h"

typedef struct OpaquePitchHPS *PitchHPSObj;

/***
samplate 32000
lowFre 32,
highFre 2000
radix2Exp 12
WindowType Hamm
slideLength (1<<radix2Exp)/4
harmonicCount 5 >0
isContinue 0
****/
int pitchHPSObj_new(PitchHPSObj *pitchHPSObj,
int *samplate,float *lowFre,float *highFre,
int *radix2Exp,int *slideLength,WindowType *windowType,
int *harmonicCount,
int *isContinue);

int pitchHPSObj_calTimeLength(PitchHPSObj pitchHPSObj,int dataLength);

void pitchHPSObj_pitch(PitchHPSObj pitchHPSObj,float *dataArr,int dataLength,
float *freArr);

void pitchHPSObj_enableDebug(PitchHPSObj pitchHPSObj,int isDebug);
void pitchHPSObj_free(PitchHPSObj pitchHPSObj);

#ifdef __cplusplus
}
#endif

#endif
47 changes: 47 additions & 0 deletions include/mir/_pitch_lhs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@


#ifndef _PITCH_LHS_H
#define _PITCH_LHS_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdio.h>
#include <stdlib.h>

#include "../flux_base.h"

typedef struct OpaquePitchLHS *PitchLHSObj;

/***
samplate 32000
lowFre 32,
highFre 2000
radix2Exp 12
WindowType hamm
slideLength (1<<radix2Exp)/4
harmonicCount 5 >0
isContinue 0
****/
int pitchLHSObj_new(PitchLHSObj *pitchLHSObj,
int *samplate,float *lowFre,float *highFre,
int *radix2Exp,int *slideLength,WindowType *windowType,
int *harmonicCount,
int *isContinue);

int pitchLHSObj_calTimeLength(PitchLHSObj pitchLHSObj,int dataLength);

void pitchLHSObj_pitch(PitchLHSObj pitchLHSObj,float *dataArr,int dataLength,
float *freArr);

void pitchLHSObj_enableDebug(PitchLHSObj pitchLHSObj,int isDebug);
void pitchLHSObj_free(PitchLHSObj pitchLHSObj);

#ifdef __cplusplus
}
#endif

#endif
43 changes: 43 additions & 0 deletions include/mir/_pitch_ncf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@


#ifndef _PITCH_NCF_H
#define _PITCH_NCF_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdio.h>
#include <stdlib.h>

#include "../flux_base.h"

typedef struct OpaquePitchNCF *PitchNCFObj;

/***
samplate 32000
lowFre 32,
highFre 2000
radix2Exp 12
WindowType rect
slideLength (1<<radix2Exp)/4
isContinue 0
****/
int pitchNCFObj_new(PitchNCFObj *pitchNCFObj,
int *samplate,float *lowFre,float *highFre,
int *radix2Exp,int *slideLength,WindowType *windowType,
int *isContinue);

int pitchNCFObj_calTimeLength(PitchNCFObj pitchNCFObj,int dataLength);

void pitchNCFObj_pitch(PitchNCFObj pitchNCFObj,float *dataArr,int dataLength,
float *freArr);

void pitchNCFObj_enableDebug(PitchNCFObj pitchNCFObj,int isDebug);
void pitchNCFObj_free(PitchNCFObj pitchNCFObj);

#ifdef __cplusplus
}
#endif

#endif
49 changes: 49 additions & 0 deletions include/mir/_pitch_pef.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@


#ifndef _PITCH_PEF_H
#define _PITCH_PEF_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdio.h>
#include <stdlib.h>

#include "../flux_base.h"

typedef struct OpaquePitchPEF *PitchPEFObj;

/***
samplate 32000
lowFre 32,
highFre 2000
cutFre 4000, >highFre
radix2Exp 12
WindowType hamm
slideLength (1<<radix2Exp)/4
alpha 10 >0, beta 0.5 0~1, gamma 1.8 >1
isContinue 0
****/
int pitchPEFObj_new(PitchPEFObj *pitchPEFObj,
int *samplate,float *lowFre,float *highFre,float *cutFre,
int *radix2Exp,int *slideLength,WindowType *windowType,
float *alpha,float *beta,float *gamma,
int *isContinue);

int pitchPEFObj_calTimeLength(PitchPEFObj pitchPEFObj,int dataLength);
void pitchPEFObj_setFilterParams(PitchPEFObj pitchPEFObj,float alpha,float beta,float gamma);

void pitchPEFObj_pitch(PitchPEFObj pitchPEFObj,float *dataArr,int dataLength,
float *freArr);

void pitchPEFObj_enableDebug(PitchPEFObj pitchPEFObj,int isDebug);
void pitchPEFObj_free(PitchPEFObj pitchPEFObj);

#ifdef __cplusplus
}
#endif

#endif
Loading

0 comments on commit 2f04f26

Please sign in to comment.