- Timestamp:
- Oct 11, 2009, 12:38:43 PM (15 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:
- 4f4299d
- Parents:
- 2fde783
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/spectral/fft.c
r2fde783 r8979752 184 184 uint_t i, j; 185 185 for (i = 0; i < spectrum->channels; i++) { 186 spectrum->phas[i][0] = 0.; 186 if (compspec->data[i][0] < 0) { 187 spectrum->phas[i][0] = PI; 188 } else { 189 spectrum->phas[i][0] = 0.; 190 } 187 191 for (j=1; j < spectrum->length - 1; j++) { 188 192 spectrum->phas[i][j] = ATAN2(compspec->data[i][compspec->length-j], 189 193 compspec->data[i][j]); 190 194 } 191 spectrum->phas[i][spectrum->length-1] = 0.; 195 if (compspec->data[i][compspec->length/2] < 0) { 196 spectrum->phas[i][spectrum->length - 1] = PI; 197 } else { 198 spectrum->phas[i][spectrum->length - 1] = 0.; 199 } 192 200 } 193 201 }
Note: See TracChangeset
for help on using the changeset viewer.