*/
#include "aubio_priv.h"
-#include "sample.h"
+#include "fvec.h"
+#include "cvec.h"
#include "fft.h"
#include "mathutils.h"
#include "phasevoc.h"
uint_t win_s; /** grain length */
uint_t hop_s; /** overlap step */
uint_t channels; /** number of channels */
- aubio_mfft_t * fft; /** spectral data */
- fvec_t * synth; /**cur output grain [win_s] */
- fvec_t * synthold; /**last input frame [win_s-hop_s] */
- fvec_t * data; /**current input grain [win_s] */
- fvec_t * dataold; /**last input frame [win_s-hop_s] */
- smpl_t * w; /** grain window [win_s] */
+ aubio_fft_t * fft; /** fft object */
+ fvec_t * synth; /** cur output grain [win_s] */
+ fvec_t * synthold; /** last input frame [win_s-hop_s] */
+ fvec_t * data; /** current input grain [win_s] */
+ fvec_t * dataold; /** last input frame [win_s-hop_s] */
+ smpl_t * w; /** grain window [win_s] */
};
/* shift */
vec_shift(pv->data);
/* calculate fft */
- aubio_mfft_do (pv->fft,pv->data,fftgrain);
+ aubio_fft_do (pv->fft,pv->data,fftgrain);
}
void aubio_pvoc_rdo(aubio_pvoc_t *pv,cvec_t * fftgrain, fvec_t * synthnew) {
uint_t i;
/* calculate rfft */
- aubio_mfft_rdo(pv->fft,fftgrain,pv->synth);
+ aubio_fft_rdo(pv->fft,fftgrain,pv->synth);
/* unshift */
vec_shift(pv->synth);
for (i=0; i<pv->channels; i++) {
hop_s = win_s / 2;
}
- pv->fft = new_aubio_mfft(win_s,channels);
+ pv->fft = new_aubio_fft(win_s,channels);
/* remember old */
pv->data = new_fvec (win_s, channels);
del_fvec(pv->synth);
del_fvec(pv->dataold);
del_fvec(pv->synthold);
- del_aubio_mfft(pv->fft);
+ del_aubio_fft(pv->fft);
AUBIO_FREE(pv->w);
AUBIO_FREE(pv);
}
fvec_t * win;
cvec_t * fftOut;
fvec_t * fftLastPhase;
- aubio_mfft_t * fft;
+ aubio_fft_t * fft;
//aubio_pvoc_t * pvoc;
};
p->winput = new_fvec(bufsize,1);
p->fftOut = new_cvec(bufsize,1);
p->fftLastPhase = new_fvec(bufsize,1);
- p->fft = new_aubio_mfft(bufsize, 1);
+ p->fft = new_aubio_fft(bufsize, 1);
p->win = new_fvec(bufsize,1);
aubio_window(p->win->data[0], bufsize, aubio_win_hanning);
return p;
for (k=0; k < input->length; k++){
p->winput->data[0][k] = p->win->data[0][k] * input->data[0][k];
}
- aubio_mfft_do(p->fft,p->winput,p->fftOut);
+ aubio_fft_do(p->fft,p->winput,p->fftOut);
for (k=0; k<=p->fftSize/2; k++) {
smpl_t
del_fvec(p->fftLastPhase);
del_fvec(p->win);
del_fvec(p->winput);
- del_aubio_mfft(p->fft);
+ del_aubio_fft(p->fft);
AUBIO_FREE(p);
}
fvec_t * sqrmag; /**< square difference function */
fvec_t * weight; /**< spectral weighting window (psychoacoustic model) */
cvec_t * fftout; /**< Fourier transform output */
- aubio_mfft_t * fft; /**< fft object to compute square difference function */
+ aubio_fft_t * fft; /**< fft object to compute square difference function */
fvec_t * yinfft; /**< Yin function */
};
{
aubio_pitchyinfft_t * p = AUBIO_NEW(aubio_pitchyinfft_t);
p->winput = new_fvec(bufsize,1);
- p->fft = new_aubio_mfft(bufsize, 1);
+ p->fft = new_aubio_fft(bufsize, 1);
p->fftout = new_cvec(bufsize,1);
p->sqrmag = new_fvec(bufsize,1);
p->res = new_cvec(bufsize,1);
for (l=0; l < input->length; l++){
p->winput->data[0][l] = p->win->data[0][l] * input->data[0][l];
}
- aubio_mfft_do(p->fft,p->winput,p->fftout);
+ aubio_fft_do(p->fft,p->winput,p->fftout);
for (l=0; l < p->fftout->length; l++){
p->sqrmag->data[0][l] = SQR(p->fftout->norm[0][l]);
p->sqrmag->data[0][l] *= p->weight->data[0][l];
sum += p->sqrmag->data[0][l];
}
sum *= 2.;
- aubio_mfft_do(p->fft,p->sqrmag,res);
+ aubio_fft_do(p->fft,p->sqrmag,res);
yin->data[0][0] = 1.;
for (tau=1; tau < yin->length; tau++) {
yin->data[0][tau] = sum -
void del_aubio_pitchyinfft(aubio_pitchyinfft_t *p){
del_fvec(p->win);
- del_aubio_mfft(p->fft);
+ del_aubio_fft(p->fft);
del_fvec(p->yinfft);
del_fvec(p->sqrmag);
del_cvec(p->res);