Changeset d95ff38 for src/spectral/phasevoc.c
- Timestamp:
- Dec 4, 2009, 1:38:30 AM (14 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- 741bdda
- Parents:
- 0b9a02a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/spectral/phasevoc.c
r0b9a02a rd95ff38 30 30 uint_t win_s; /** grain length */ 31 31 uint_t hop_s; /** overlap step */ 32 uint_t channels; /** number of channels */33 32 aubio_fft_t * fft; /** fft object */ 34 33 fvec_t * synth; /** cur output grain [win_s] */ … … 49 48 50 49 void aubio_pvoc_do(aubio_pvoc_t *pv, fvec_t * datanew, cvec_t *fftgrain) { 51 uint_t i; 52 for (i=0; i<pv->channels; i++) { 53 /* slide */ 54 aubio_pvoc_swapbuffers(pv->data->data[i],pv->dataold->data[i], 55 datanew->data[i],pv->win_s,pv->hop_s); 56 } 50 /* slide */ 51 aubio_pvoc_swapbuffers(pv->data->data,pv->dataold->data, 52 datanew->data,pv->win_s,pv->hop_s); 57 53 /* windowing */ 58 54 fvec_weight(pv->data, pv->w); … … 64 60 65 61 void aubio_pvoc_rdo(aubio_pvoc_t *pv,cvec_t * fftgrain, fvec_t * synthnew) { 66 uint_t i;67 62 /* calculate rfft */ 68 63 aubio_fft_rdo(pv->fft,fftgrain,pv->synth); 69 64 /* unshift */ 70 65 fvec_shift(pv->synth); 71 for (i=0; i<pv->channels; i++) { 72 aubio_pvoc_addsynth(pv->synth->data[i],pv->synthold->data[i], 73 synthnew->data[i],pv->win_s,pv->hop_s); 74 } 66 aubio_pvoc_addsynth(pv->synth->data,pv->synthold->data, 67 synthnew->data,pv->win_s,pv->hop_s); 75 68 } 76 69 77 aubio_pvoc_t * new_aubio_pvoc (uint_t win_s, uint_t hop_s , uint_t channels) {70 aubio_pvoc_t * new_aubio_pvoc (uint_t win_s, uint_t hop_s) { 78 71 aubio_pvoc_t * pv = AUBIO_NEW(aubio_pvoc_t); 79 72 … … 88 81 } 89 82 90 pv->fft = new_aubio_fft (win_s,channels);83 pv->fft = new_aubio_fft (win_s); 91 84 92 85 /* remember old */ 93 pv->data = new_fvec (win_s , channels);94 pv->synth = new_fvec (win_s , channels);86 pv->data = new_fvec (win_s); 87 pv->synth = new_fvec (win_s); 95 88 96 89 /* new input output */ 97 pv->dataold = new_fvec (win_s-hop_s , channels);98 pv->synthold = new_fvec (win_s-hop_s , channels);90 pv->dataold = new_fvec (win_s-hop_s); 91 pv->synthold = new_fvec (win_s-hop_s); 99 92 pv->w = new_aubio_window ("hanningz", win_s); 100 93 101 pv->channels = channels;102 94 pv->hop_s = hop_s; 103 95 pv->win_s = win_s;
Note: See TracChangeset
for help on using the changeset viewer.