added matlab file (high-level implementation of this software)
added interval control code. Proper work of thresholding and interval control not yet verified