For a thorough explanation of the algorithm, see the Wikipedia article.
I wrote this code as part of a lager ongoing project (gammatone filtering) that I will release eventually.
|The model interface hardware with the FPGA in-circuit emulator.|
|Lukas Gerlach (L) and Christopher Seifert (R) demoing their ASIC model setup, running realtime on a FPGA.|
but that is a bit ugly, and has the problem that if I'm doing an IPython Notebook (as I often do), this append function gets reevaluated if I reexecute the cell in which I do all my imports (since as I'm edition the notebook and adding stuff, I would do a lot). Besides I now have sys in my namespace.
import sys sys.path.append('/path/to/my/dir')
I can now do
import sys myPythonDir = '/home/jthiem/Documents/Python' if myPythonDir not in sys.path: sys.path.append(myPythonDir);
and have instant no-fuss access to my homebrew packages. Now isn't that nice.