LCR calculates Level Crossing Rate, that is a number of crossings (in the positive direction) of an input vector through a given threshold vector.
[x,t] = lcr( sig, thr );
The crossings are calculated for all the values of the input threshold vector. The input signal has to be a vector.
n = randn( 1, 1000 );
x = lcr( n, -5:0.1:5 );
plot( t, x );
Adrian Bohdanowicz (2022). Level Crossing Rate (https://www.mathworks.com/matlabcentral/fileexchange/2817-level-crossing-rate), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!