Hello Encoders,
if your sign values are in an array, you can make a copy of that array shifted by one position. Then you multiply the array with the copy: when there is a sign change, you get a -1, if there is no sign change you get a +1. Then you do a comparison "Is smaller than 0" followed by a "convert binary to 0/1" followed by "sum up array". Then you got your number of sign changes.
Simple math...
The attached vi illustrates the algorithm.
Best regards
Gerd
Best regards,
GerdW

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019