Implemented with Matlab. Input/Output is not quite friendly and there is some performance issue in it. Not a good Matlab programmer myself...