Changeset 1da7e08 for tests/src/test-fft.c
- Timestamp:
- Nov 2, 2007, 12:25:42 PM (17 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:
- c721874
- Parents:
- 97525e4 (diff), 100f950 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
tests/src/test-fft.c
r97525e4 r1da7e08 9 9 int main(){ 10 10 uint_t i,j; 11 /* allocate some memory */ 12 uint_t win_s = 1024; /* window size */ 13 uint_t channels = 1; /* number of channel */ 14 fvec_t * in = new_fvec (win_s, channels); /* input buffer */ 15 cvec_t * fftgrain = new_cvec (win_s, channels); /* fft norm and phase */ 16 fvec_t * out = new_fvec (win_s, channels); /* output buffer */ 11 uint_t win_s = 1024; // window size 12 uint_t channels = 1; // number of channel 13 fvec_t * in = new_fvec (win_s, channels); // input buffer 14 cvec_t * fftgrain = new_cvec (win_s, channels); // fft norm and phase 15 fvec_t * out = new_fvec (win_s, channels); // output buffer 17 16 18 / * allocate fft and other memory space */19 aubio_fft_t * fft = new_aubio_fft(win_s); /* fft interface */20 smpl_t * w = NEW_ARRAY(smpl_t,win_s); / * window */21 / * complex spectral data */17 // allocate fft and other memory space 18 aubio_fft_t * fft = new_aubio_fft(win_s); // fft interface 19 smpl_t * w = NEW_ARRAY(smpl_t,win_s); // window 20 // complex spectral data 22 21 fft_data_t ** spec = NEW_ARRAY(fft_data_t*,channels); 23 22 for (i=0; i < channels; i++) 24 23 spec[i] = NEW_ARRAY(fft_data_t,win_s); 25 / * initialize the window (see mathutils.c) */24 // initialize the window (see mathutils.c) 26 25 aubio_window(w,win_s,aubio_win_hanningz); 27 26 28 / * fill input with some data */27 // fill input with some data 29 28 in->data[0][win_s/2] = 1; 30 29 31 / * execute stft */30 // execute stft 32 31 for (i=0; i < channels; i++) { 33 32 aubio_fft_do (fft,in->data[i],spec[i],win_s); 34 / * put norm and phase into fftgrain */33 // put norm and phase into fftgrain 35 34 aubio_fft_getnorm(fftgrain->norm[i], spec[i], win_s/2+1); 36 35 aubio_fft_getphas(fftgrain->phas[i], spec[i], win_s/2+1); 37 36 } 38 37 39 / * execute inverse fourier transform */38 // execute inverse fourier transform 40 39 for (i=0; i < channels; i++) { 41 40 for (j=0; j<win_s/2+1; j++) {
Note: See TracChangeset
for help on using the changeset viewer.