A fast implementation of Schmitt Trigger in GNU Octave and MATLAB
Daria-Andreea Vasile, Teodor Petriţa · 2023
This paper deals with a notable absence of in the signal processing libraries of MATLAB/GNU Octave computer algebra systems (CAS): the Schmitt Trigger. As far as we are aware, MATLAB lacks an implementation of a Schmitt Trigger function. GNU Octave has a function built in signal package that implements a multi signal Schmitt trigger with levels, with inconstant results in our trials. We have implemented a compiled function in both suites, which solves the problem of the implementation and likewise the processing speed. Also, we are proposing a compiled implementation of this functionality compatible with both software suites. Compared to a script for loop implementation our function performs in average 10x faster in MATLAB and up to 2000x faster in GNU Octave, processing a 10^9 random vector in about less then 10s on a reference computer configuration.