The present code is a Matlab function that provides measurement of the threshold crossing rate i.e., the rate of changes along a given signal level, termed threshold. This feature is used in frequency measurement, pitch detection, speech recognition, music information retrieval, etc.
An example is given in order to clarify the usage of the function. For convenience, the input and output arguments are given in the beginning of the function.
The code is based on the theory described in:
 L. Rabiner, R. Schafer. Introduction to Digital Speech Processing. Boston, Now Publishers, 2007.
Hristo Zhivomirov (2019). Crossing Rate Measurement with Matlab (https://www.mathworks.com/matlabcentral/fileexchange/70246-crossing-rate-measurement-with-matlab), MATLAB Central File Exchange. Retrieved .