outbuf[coef_cnt]=0.f;
//compute mfccs
- aubio_mffc_do(fftgrain->norm, nframes, filterbank, outbuf);
+ aubio_mffc_do(fftgrain->norm, nframes, mf, outbuf);
for (coef_cnt=0; coef_cnt<n_filters ; coef_cnt++)
outmsg("%f ",outbuf[coef_cnt]);
uint_t banksize = (uint) ( sizeof(aubio_mel_filter));
aubio_mel_filter * mf = (aubio_mel_filter *)getbytes(banksize);
- mfilterbank->n_filters = 20;
- mfilterbank->filters = (smpl_t **)getbytes(mf->n_filters * sizeof(smpl_t *));
+ mf->n_filters = 20;
+ mf->filters = (smpl_t **)getbytes(mf->n_filters * sizeof(smpl_t *));
for(n = 0; n < mf->n_filters; n++)
mf->filters[n] = (smpl_t *)getbytes((buffer_size/2+1) * sizeof(smpl_t));
result[filter] = log(result[filter] < XTRACT_LOG_LIMIT ? XTRACT_LOG_LIMIT : result[filter]);
}
+ //TODO: check that zero padding
for(n = filter + 1; n < N; n++) result[n] = 0;
aubio_dct_do(result, f->n_filters, NULL, result);
int aubio_dct_do(const float *data, const int N, const void *argv, float *result){
+
+ //call aubio p_voc in dct setting
+
+ //TODO: fvec as input? Remove data length, N?
+
+ //compute mag spectrum
+ aubio_pvoc_do (pv,data, fftgrain);
+
+ int i;
+ //extract real part of fft grain
+ for(i=0; i<N ;i++){
+ result[i]= fftgrain->norm[i]*cos(fftgrain->phase[i]);
+ }
+
+ /*
fftwf_plan plan;
plan =
fftwf_plan_r2r_1d(N, (float *) data, result, FFTW_REDFT00, FFTW_ESTIMATE);
fftwf_execute(plan);
- fftwf_destroy_plan(plan);
+ fftwf_destroy_plan(plan);*/
return XTRACT_SUCCESS;
}