]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - common/lfdemod.c
fix STT bug for strong waves (or cleaned ones)
[proxmark3-svn] / common / lfdemod.c
index e1fcbf736ed4ffd5d6ed73e916d04271eba06415..125112088e09fc57b44768e0743bcb2b67a0c356 100644 (file)
@@ -288,6 +288,7 @@ int cleanAskRawDemod(uint8_t *BinStream, size_t *size, int clk, int invert, int
 }
 
 //by marshmellow
+//amplify based on ask edge detection
 void askAmp(uint8_t *BitStream, size_t size)
 {
        uint8_t Last = 128;
@@ -1758,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) {
Impressum, Datenschutz