Index: python/ext/aubiomodule.c
===================================================================
--- python/ext/aubiomodule.c	(revision 3cb2a52afc6c3cd85b1fdcb9dddbd128edfb9f15)
+++ python/ext/aubiomodule.c	(revision c9ca26089538e7f8f94b2112b41bc51d4698da98)
@@ -243,4 +243,6 @@
   {"level_detection", Py_aubio_level_detection, METH_VARARGS, Py_aubio_level_detection_doc},
   {"window", Py_aubio_window, METH_VARARGS, Py_aubio_window_doc},
+  {"shift", Py_aubio_shift, METH_VARARGS, Py_aubio_shift_doc},
+  {"ishift", Py_aubio_ishift, METH_VARARGS, Py_aubio_ishift_doc},
   {NULL, NULL, 0, NULL} /* Sentinel */
 };
Index: python/ext/py-musicutils.c
===================================================================
--- python/ext/py-musicutils.c	(revision 3cb2a52afc6c3cd85b1fdcb9dddbd128edfb9f15)
+++ python/ext/py-musicutils.c	(revision c9ca26089538e7f8f94b2112b41bc51d4698da98)
@@ -134,2 +134,50 @@
   return level_detection;
 }
+
+PyObject *
+Py_aubio_shift(PyObject *self, PyObject *args)
+{
+  PyObject *input;
+  fvec_t vec;
+
+  if (!PyArg_ParseTuple (args, "O:shift", &input)) {
+    return NULL;
+  }
+
+  if (input == NULL) {
+    return NULL;
+  }
+
+  if (!PyAubio_ArrayToCFvec(input, &vec)) {
+    return NULL;
+  }
+
+  fvec_shift(&vec);
+
+  //Py_RETURN_NONE;
+  return (PyObject *) PyAubio_CFvecToArray(&vec);
+}
+
+PyObject *
+Py_aubio_ishift(PyObject *self, PyObject *args)
+{
+  PyObject *input;
+  fvec_t vec;
+
+  if (!PyArg_ParseTuple (args, "O:shift", &input)) {
+    return NULL;
+  }
+
+  if (input == NULL) {
+    return NULL;
+  }
+
+  if (!PyAubio_ArrayToCFvec(input, &vec)) {
+    return NULL;
+  }
+
+  fvec_ishift(&vec);
+
+  //Py_RETURN_NONE;
+  return (PyObject *) PyAubio_CFvecToArray(&vec);
+}
Index: python/ext/py-musicutils.h
===================================================================
--- python/ext/py-musicutils.h	(revision 3cb2a52afc6c3cd85b1fdcb9dddbd128edfb9f15)
+++ python/ext/py-musicutils.h	(revision c9ca26089538e7f8f94b2112b41bc51d4698da98)
@@ -72,3 +72,33 @@
 PyObject * Py_aubio_level_detection(PyObject *self, PyObject *args);
 
+static char Py_aubio_shift_doc[] = ""
+"Swap left and right partitions of a vector\n"
+"\n"
+"Returns the swapped vector. The input vector is also modified.\n"
+"\n"
+"For a vector of length N, the partition is split at index N - N//2.\n"
+"\n"
+"Example\n"
+"-------\n"
+"\n"
+">>> import numpy\n"
+">>> shift(numpy.arange(3, dtype=aubio.float_type))\n"
+"array([2., 0., 1.], dtype=" AUBIO_NPY_SMPL_STR ")";
+PyObject * Py_aubio_shift(PyObject *self, PyObject *args);
+
+static char Py_aubio_ishift_doc[] = ""
+"Swap right and left partitions of a vector\n"
+"\n"
+"Returns the swapped vector. The input vector is also modified.\n"
+"\n"
+"Unlike with shift(), the partition is split at index N//2.\n"
+"\n"
+"Example\n"
+"-------\n"
+"\n"
+">>> import numpy\n"
+">>> ishift(numpy.arange(3, dtype=aubio.float_type))\n"
+"array([1., 2., 0.], dtype=" AUBIO_NPY_SMPL_STR ")";
+PyObject * Py_aubio_ishift(PyObject *self, PyObject *args);
+
 #endif /* PY_AUBIO_MUSICUTILS_H */
Index: python/tests/test_fvec_shift.py
===================================================================
--- python/tests/test_fvec_shift.py	(revision c9ca26089538e7f8f94b2112b41bc51d4698da98)
+++ python/tests/test_fvec_shift.py	(revision c9ca26089538e7f8f94b2112b41bc51d4698da98)
@@ -0,0 +1,35 @@
+#! /usr/bin/env python
+
+import numpy as np
+from numpy.testing import TestCase, assert_equal
+import aubio
+
+class aubio_shift_test_case(TestCase):
+
+    def run_shift_ishift(self, n):
+        ramp = np.arange(n, dtype=aubio.float_type)
+        # construct expected output
+        # even length: [5. 6. 7. 8. 9. 0. 1. 2. 3. 4.]
+        # odd length: [4. 5. 6. 0. 1. 2. 3.]
+        half = n - n//2
+        expected = np.concatenate([np.arange(half, n), np.arange(half)])
+        # shift in place, returns modified copy
+        assert_equal(aubio.shift(ramp), expected)
+        # check input was changed as expected
+        assert_equal(ramp, expected)
+        # construct expected output
+        expected = np.arange(n)
+        # revert shift in place, returns modifed copy
+        assert_equal(aubio.ishift(ramp), expected)
+        # check input was shifted back
+        assert_equal(ramp, expected)
+
+    def test_can_shift_fvec(self):
+        self.run_shift_ishift(10)
+
+    def test_can_shift_fvec_odd(self):
+        self.run_shift_ishift(7)
+
+from unittest import main
+if __name__ == '__main__':
+    main()
