fix STT bug for strong waves (or cleaned ones)

This commit is contained in:
marshmellow42 2017-02-28 11:53:55 -05:00
parent 40c6a02bc9
commit dda5a928f0

View file

@ -1759,6 +1759,10 @@ bool DetectST(uint8_t buffer[], size_t *size, int *foundclock) {
for(i=0; i < clk/2-tol; ++i) {
buffer[dataloc+i] = high+5;
}
} //test for single sample outlier (high between two lows) in the case of very strong waves
if (buffer[dataloc] >= high && buffer[dataloc+2] <= low) {
buffer[dataloc] = buffer[dataloc+2];
buffer[dataloc+1] = buffer[dataloc+2];
}
for (i=0; i<datalen; ++i) {
if (i+newloc < bufsize) {