fixed bug for input shorter than 1000 samples.
Authored by: kellgeor 2015-10-08
Parent: [r89]
Child: [r91]