Converting matlab code to python November 25, 2013 Look at this SO question to convert matlab code into python/scipy/numpy: