| 266 | } |
| 267 | |
| 268 | void |
| 269 | fvec_shift (fvec_t * s) |
| 270 | { |
| 271 | uint_t half = s->length / 2, start = half, j; |
| 272 | // if length is odd, middle element is moved to the end |
| 273 | if (2 * half < s->length) start ++; |
| 274 | #ifndef HAVE_BLAS |
| 275 | for (j = 0; j < half; j++) { |
| 276 | ELEM_SWAP (s->data[j], s->data[j + start]); |
| 277 | } |
| 278 | #else |
| 279 | aubio_cblas_swap(half, s->data, 1, s->data + start, 1); |
| 280 | #endif |
| 281 | if (start != half) { |
| 282 | for (j = 0; j < half; j++) { |
| 283 | ELEM_SWAP (s->data[j + start - 1], s->data[j + start]); |
| 284 | } |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | void |
| 289 | fvec_ishift (fvec_t * s) |