]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
combine autocorr, dirth functions
authormarshmellow42 <marshmellowrf@gmail.com>
Thu, 13 Apr 2017 14:33:18 +0000 (10:33 -0400)
committermarshmellow42 <marshmellowrf@gmail.com>
Thu, 13 Apr 2017 14:33:18 +0000 (10:33 -0400)
fix lfdemod bug
add askedge to overlays (remove askdemod)

client/cmddata.c
client/cmddata.h
client/cmdlf.c
client/graph.c
client/graph.h
client/proxgui.h
client/proxguiqt.cpp
client/proxguiqt.h
client/ui/overlays.ui
client/ui/ui_overlays.h
common/lfdemod.c

index a59236e6d64e915b62ec3ac87962fc949c5f601b..5dcd87b6e3d129025e644950672b46c0c5f0e8f1 100644 (file)
@@ -507,45 +507,44 @@ int Cmdaskrawdemod(const char *Cmd)
        return ASKDemod(Cmd, true, false, 0);
 }
 
        return ASKDemod(Cmd, true, false, 0);
 }
 
-int AutoCorrelate(int window, bool SaveGrph, bool verbose)
+int AutoCorrelate(const int *in, int *out, size_t len, int window, bool SaveGrph, bool verbose)
 {
        static int CorrelBuffer[MAX_GRAPH_TRACE_LEN];
        size_t Correlation = 0;
        int maxSum = 0;
        int lastMax = 0;
        if (verbose) PrintAndLog("performing %d correlations", GraphTraceLen - window);
 {
        static int CorrelBuffer[MAX_GRAPH_TRACE_LEN];
        size_t Correlation = 0;
        int maxSum = 0;
        int lastMax = 0;
        if (verbose) PrintAndLog("performing %d correlations", GraphTraceLen - window);
-       for (int i = 0; i < GraphTraceLen - window; ++i) {
+       for (int i = 0; i < len - window; ++i) {
                int sum = 0;
                for (int j = 0; j < window; ++j) {
                int sum = 0;
                for (int j = 0; j < window; ++j) {
-                       sum += (GraphBuffer[j]*GraphBuffer[i + j]) / 256;
+                       sum += (in[j]*in[i + j]) / 256;
                }
                CorrelBuffer[i] = sum;
                }
                CorrelBuffer[i] = sum;
-               if (sum >= maxSum-100 && sum <= maxSum+100){
+               if (sum >= maxSum-100 && sum <= maxSum+100) {
                        //another max
                        Correlation = i-lastMax;
                        lastMax = i;
                        if (sum > maxSum) maxSum = sum;
                        //another max
                        Correlation = i-lastMax;
                        lastMax = i;
                        if (sum > maxSum) maxSum = sum;
-               } else if (sum > maxSum){
+               } else if (sum > maxSum) {
                        maxSum=sum;
                        lastMax = i;
                }
        }
                        maxSum=sum;
                        lastMax = i;
                }
        }
-       if (Correlation==0){
+       if (Correlation==0) {
                //try again with wider margin
                //try again with wider margin
-               for (int i = 0; i < GraphTraceLen - window; i++){
-                       if (CorrelBuffer[i] >= maxSum-(maxSum*0.05) && CorrelBuffer[i] <= maxSum+(maxSum*0.05)){
+               for (int i = 0; i < len - window; i++) {
+                       if (CorrelBuffer[i] >= maxSum-(maxSum*0.05) && CorrelBuffer[i] <= maxSum+(maxSum*0.05)) {
                                //another max
                                Correlation = i-lastMax;
                                lastMax = i;
                                //another max
                                Correlation = i-lastMax;
                                lastMax = i;
-                               //if (CorrelBuffer[i] > maxSum) maxSum = sum;
                        }
                }
        }
        if (verbose && Correlation > 0) PrintAndLog("Possible Correlation: %d samples",Correlation);
 
                        }
                }
        }
        if (verbose && Correlation > 0) PrintAndLog("Possible Correlation: %d samples",Correlation);
 
-       if (SaveGrph){
-               GraphTraceLen = GraphTraceLen - window;
-               memcpy(GraphBuffer, CorrelBuffer, GraphTraceLen * sizeof (int));
+       if (SaveGrph) {
+               //GraphTraceLen = GraphTraceLen - window;
+               memcpy(out, CorrelBuffer, len * sizeof(int));
                RepaintGraphWindow();  
        }
        return Correlation;
                RepaintGraphWindow();  
        }
        return Correlation;
@@ -578,7 +577,7 @@ int CmdAutoCorr(const char *Cmd)
                return 0;
        }
        if (grph == 'g') updateGrph=true;
                return 0;
        }
        if (grph == 'g') updateGrph=true;
-       return AutoCorrelate(window, updateGrph, true);
+       return AutoCorrelate(GraphBuffer, GraphBuffer, GraphTraceLen, window, updateGrph, true);
 }
 
 int CmdBitsamples(const char *Cmd)
 }
 
 int CmdBitsamples(const char *Cmd)
@@ -681,6 +680,18 @@ int CmdGraphShiftZero(const char *Cmd)
        return 0;
 }
 
        return 0;
 }
 
+int AskEdgeDetect(const int *in, int *out, int len, int threshold) {
+       int Last = 0;
+       for(int i = 1; i<len; i++) {
+               if (in[i]-in[i-1] >= threshold) //large jump up
+                       Last = 127;
+               else if(in[i]-in[i-1] <= -1 * threshold) //large jump down
+                       Last = -127;
+               out[i-1] = Last;
+       }
+       return 0;
+}
+
 //by marshmellow
 //use large jumps in read samples to identify edges of waves and then amplify that wave to max
 //similar to dirtheshold, threshold commands 
 //by marshmellow
 //use large jumps in read samples to identify edges of waves and then amplify that wave to max
 //similar to dirtheshold, threshold commands 
@@ -688,18 +699,12 @@ int CmdGraphShiftZero(const char *Cmd)
 int CmdAskEdgeDetect(const char *Cmd)
 {
        int thresLen = 25;
 int CmdAskEdgeDetect(const char *Cmd)
 {
        int thresLen = 25;
-       int Last = 0;
+       int ans = 0;
        sscanf(Cmd, "%i", &thresLen); 
 
        sscanf(Cmd, "%i", &thresLen); 
 
-       for(int i = 1; i<GraphTraceLen; i++){
-               if (GraphBuffer[i]-GraphBuffer[i-1]>=thresLen) //large jump up
-                       Last = 127;
-               else if(GraphBuffer[i]-GraphBuffer[i-1]<=-1*thresLen) //large jump down
-                       Last = -127;
-               GraphBuffer[i-1] = Last;
-       }
+       ans = AskEdgeDetect(GraphBuffer, GraphBuffer, GraphTraceLen, thresLen);
        RepaintGraphWindow();
        RepaintGraphWindow();
-       return 0;
+       return ans;
 }
 
 /* Print our clock rate */
 }
 
 /* Print our clock rate */
@@ -1433,37 +1438,42 @@ int CmdScale(const char *Cmd)
        return 0;
 }
 
        return 0;
 }
 
-int CmdDirectionalThreshold(const char *Cmd)
+int directionalThreshold(const int* in, int *out, size_t len, int8_t up, int8_t down)
 {
 {
-       int8_t upThres = param_get8(Cmd, 0);
-       int8_t downThres = param_get8(Cmd, 1);
-
-       printf("Applying Up Threshold: %d, Down Threshold: %d\n", upThres, downThres);
-
-       int lastValue = GraphBuffer[0];
-       GraphBuffer[0] = 0; // Will be changed at the end, but init 0 as we adjust to last samples value if no threshold kicks in.
+       int lastValue = in[0];
+       out[0] = 0; // Will be changed at the end, but init 0 as we adjust to last samples value if no threshold kicks in.
 
 
-       for (int i = 1; i < GraphTraceLen; ++i) {
+       for (int i = 1; i < len; ++i) {
                // Apply first threshold to samples heading up
                // Apply first threshold to samples heading up
-               if (GraphBuffer[i] >= upThres && GraphBuffer[i] > lastValue)
+               if (in[i] >= up && in[i] > lastValue)
                {
                {
-                       lastValue = GraphBuffer[i]; // Buffer last value as we overwrite it.
-                       GraphBuffer[i] = 127;
+                       lastValue = out[i]; // Buffer last value as we overwrite it.
+                       out[i] = 1;
                }
                // Apply second threshold to samples heading down
                }
                // Apply second threshold to samples heading down
-               else if (GraphBuffer[i] <= downThres && GraphBuffer[i] < lastValue)
+               else if (in[i] <= down && in[i] < lastValue)
                {
                {
-                       lastValue = GraphBuffer[i]; // Buffer last value as we overwrite it.
-                       GraphBuffer[i] = -127;
+                       lastValue = out[i]; // Buffer last value as we overwrite it.
+                       out[i] = -1;
                }
                else
                {
                }
                else
                {
-                       lastValue = GraphBuffer[i]; // Buffer last value as we overwrite it.
-                       GraphBuffer[i] = GraphBuffer[i-1];
-
+                       lastValue = out[i]; // Buffer last value as we overwrite it.
+                       out[i] = out[i-1];
                }
        }
                }
        }
-       GraphBuffer[0] = GraphBuffer[1]; // Aline with first edited sample.
+       out[0] = out[1]; // Align with first edited sample.
+       return 0;
+}
+
+int CmdDirectionalThreshold(const char *Cmd)
+{
+       int8_t upThres = param_get8(Cmd, 0);
+       int8_t downThres = param_get8(Cmd, 1);
+
+       printf("Applying Up Threshold: %d, Down Threshold: %d\n", upThres, downThres);
+
+       directionalThreshold(GraphBuffer, GraphBuffer,GraphTraceLen, upThres, downThres);
        RepaintGraphWindow();
        return 0;
 }
        RepaintGraphWindow();
        return 0;
 }
index 4a3287a719eabc2ee293321e59d5e80fa0a1ced3..0484acdbe44ed58346e3d1598b47812bef1dc294 100644 (file)
@@ -27,7 +27,7 @@ void save_restoreDB(uint8_t saveOpt);// option '1' to save DemodBuffer any other
 int CmdPrintDemodBuff(const char *Cmd);
 int Cmdaskrawdemod(const char *Cmd);
 int Cmdaskmandemod(const char *Cmd);
 int CmdPrintDemodBuff(const char *Cmd);
 int Cmdaskrawdemod(const char *Cmd);
 int Cmdaskmandemod(const char *Cmd);
-int AutoCorrelate(int window, bool SaveGrph, bool verbose);
+int AutoCorrelate(const int *in, int *out, size_t len, int window, bool SaveGrph, bool verbose);
 int CmdAutoCorr(const char *Cmd);
 int CmdBiphaseDecodeRaw(const char *Cmd);
 int CmdBitsamples(const char *Cmd);
 int CmdAutoCorr(const char *Cmd);
 int CmdBiphaseDecodeRaw(const char *Cmd);
 int CmdBitsamples(const char *Cmd);
@@ -65,6 +65,9 @@ int PSKDemod(const char *Cmd, bool verbose);
 int NRZrawDemod(const char *Cmd, bool verbose);
 int getSamples(int n, bool silent);
 void setClockGrid(int clk, int offset);
 int NRZrawDemod(const char *Cmd, bool verbose);
 int getSamples(int n, bool silent);
 void setClockGrid(int clk, int offset);
+int directionalThreshold(const int* in, int *out, size_t len, int8_t up, int8_t down);
+extern int AskEdgeDetect(const int *in, int *out, int len, int threshold);
+//int autoCorr(const int* in, int *out, size_t len, int window);
 
 #define MAX_DEMOD_BUF_LEN (1024*128)
 extern uint8_t DemodBuffer[MAX_DEMOD_BUF_LEN];
 
 #define MAX_DEMOD_BUF_LEN (1024*128)
 extern uint8_t DemodBuffer[MAX_DEMOD_BUF_LEN];
index 5825b339d3239979c10094e9f156e158f98340e0..3c4319c778ce458bb28b547a5bcdccf1363bb5ee 100644 (file)
@@ -1059,7 +1059,7 @@ int CmdLFfind(const char *Cmd)
                ans=CheckChipType(cmdp);
                //test unknown tag formats (raw mode)0
                PrintAndLog("\nChecking for Unknown tags:\n");
                ans=CheckChipType(cmdp);
                //test unknown tag formats (raw mode)0
                PrintAndLog("\nChecking for Unknown tags:\n");
-               ans=AutoCorrelate(4000, false, false);
+               ans=AutoCorrelate(GraphBuffer, GraphBuffer, GraphTraceLen, 4000, false, false);
                if (ans > 0) PrintAndLog("Possible Auto Correlation of %d repeating samples",ans);
                ans=GetFskClock("",false,false); 
                if (ans != 0) { //fsk
                if (ans > 0) PrintAndLog("Possible Auto Correlation of %d repeating samples",ans);
                ans=GetFskClock("",false,false); 
                if (ans != 0) { //fsk
index 547e9b30d8e26672ef54dc48332dfd1cc6053a13..cc0ec6fb20a95dc9c3d7d8693ec2651bc071d77b 100644 (file)
@@ -293,57 +293,3 @@ bool graphJustNoise(int *BitStream, int size)
        }
        return justNoise1;
 }
        }
        return justNoise1;
 }
-int autoCorr(const int* in, int *out, size_t len, int window)
-{
-       static int CorrelBuffer[MAX_GRAPH_TRACE_LEN];
-
-       if (window == 0) {
-               PrintAndLog("needs a window");
-               return 0;
-       }
-       if (window >= len) {
-               PrintAndLog("window must be smaller than trace (%d samples)",
-               len);
-               return 0;
-       }
-
-       PrintAndLog("performing %d correlations", len - window);
-
-       for (int i = 0; i < len - window; ++i) {
-               int sum = 0;
-               for (int j = 0; j < window; ++j) {
-                       sum += (in[j]*in[i + j]) / 256;
-               }
-               CorrelBuffer[i] = sum;
-       }
-       //GraphTraceLen = GraphTraceLen - window;
-       memcpy(out, CorrelBuffer, len * sizeof (int));
-       return 0;
-}
-int directionalThreshold(const int* in, int *out, size_t len, int8_t up, int8_t down)
-{
-       int lastValue = in[0];
-       out[0] = 0; // Will be changed at the end, but init 0 as we adjust to last samples value if no threshold kicks in.
-
-       for (int i = 1; i < len; ++i) {
-               // Apply first threshold to samples heading up
-               if (in[i] >= up && in[i] > lastValue)
-               {
-                       lastValue = out[i]; // Buffer last value as we overwrite it.
-                       out[i] = 1;
-               }
-               // Apply second threshold to samples heading down
-               else if (in[i] <= down && in[i] < lastValue)
-               {
-                       lastValue = out[i]; // Buffer last value as we overwrite it.
-                       out[i] = -1;
-               }
-               else
-               {
-                       lastValue = out[i]; // Buffer last value as we overwrite it.
-                       out[i] = out[i-1];
-               }
-       }
-       out[0] = out[1]; // Align with first edited sample.
-       return 0;
-}
index e70efe4625ebb83c3ade0434ade56e586a12ef1b..d77db301c8f5dbf88b091a4619ba03d2a8d09213 100644 (file)
@@ -37,7 +37,4 @@ extern int GraphBuffer[MAX_GRAPH_TRACE_LEN];
 extern int GraphTraceLen;
 extern int s_Buff[MAX_GRAPH_TRACE_LEN];
 
 extern int GraphTraceLen;
 extern int s_Buff[MAX_GRAPH_TRACE_LEN];
 
-int autoCorr(const int* in, int *out, size_t len, int window);
-int directionalThreshold(const int* in, int *out, size_t len, int8_t up, int8_t down);
-
 #endif
 #endif
index a6d8f24a1287fab8608b469abb00ab3bea39d190..de6dd6c2386879180264f7e6fd00d77448965588 100644 (file)
@@ -34,7 +34,9 @@ extern int offline;
 extern bool GridLocked;
 
 //Operations defined in data_operations
 extern bool GridLocked;
 
 //Operations defined in data_operations
-extern int autoCorr(const int* in, int *out, size_t len, int window);
+//extern int autoCorr(const int* in, int *out, size_t len, int window);
+extern int AskEdgeDetect(const int *in, int *out, int len, int threshold);
+extern int AutoCorrelate(const int *in, int *out, size_t len, int window, bool SaveGrph, bool verbose);
 extern int directionalThreshold(const int* in, int *out, size_t len, int8_t up, int8_t down);
 extern void save_restoreGB(uint8_t saveOpt);
 
 extern int directionalThreshold(const int* in, int *out, size_t len, int8_t up, int8_t down);
 extern void save_restoreGB(uint8_t saveOpt);
 
index 05a048d828df9b3b3d52be9f5e4c444aee90044c..c1fc7e12fcd77c7ecb04106c5ddb3765fa6ed950 100644 (file)
@@ -109,7 +109,7 @@ void ProxWidget::applyOperation()
 {
        printf("ApplyOperation()");
        save_restoreGB(1);
 {
        printf("ApplyOperation()");
        save_restoreGB(1);
-       memcpy(GraphBuffer,s_Buff, sizeof(int) * GraphTraceLen);
+       memcpy(GraphBuffer, s_Buff, sizeof(int) * GraphTraceLen);
        RepaintGraphWindow();
 
 }
        RepaintGraphWindow();
 
 }
@@ -120,14 +120,23 @@ void ProxWidget::stickOperation()
 }
 void ProxWidget::vchange_autocorr(int v)
 {
 }
 void ProxWidget::vchange_autocorr(int v)
 {
-       autoCorr(GraphBuffer,s_Buff, GraphTraceLen, v);
-       printf("vchange_autocorr(%d)\n", v);
+       int ans;
+       ans = AutoCorrelate(GraphBuffer, s_Buff, GraphTraceLen, v, true, false);
+       printf("vchange_autocorr(w:%d): %d\n", v, ans);
+       RepaintGraphWindow();
+}
+void ProxWidget::vchange_askedge(int v)
+{
+       int ans;
+       //extern int AskEdgeDetect(const int *in, int *out, int len, int threshold);
+       ans = AskEdgeDetect(GraphBuffer, s_Buff, GraphTraceLen, v);
+       printf("vchange_askedge(w:%d)\n", v);
        RepaintGraphWindow();
 }
 void ProxWidget::vchange_dthr_up(int v)
 {
        int down = opsController->horizontalSlider_dirthr_down->value();
        RepaintGraphWindow();
 }
 void ProxWidget::vchange_dthr_up(int v)
 {
        int down = opsController->horizontalSlider_dirthr_down->value();
-       directionalThreshold(GraphBuffer,s_Buff, GraphTraceLen, v, down);
+       directionalThreshold(GraphBuffer, s_Buff, GraphTraceLen, v, down);
        printf("vchange_dthr_up(%d)", v);
        RepaintGraphWindow();
 
        printf("vchange_dthr_up(%d)", v);
        RepaintGraphWindow();
 
@@ -161,6 +170,7 @@ ProxWidget::ProxWidget(QWidget *parent, ProxGuiQT *master) : QWidget(parent)
        QObject::connect(opsController->horizontalSlider_window, SIGNAL(valueChanged(int)), this, SLOT(vchange_autocorr(int)));
        QObject::connect(opsController->horizontalSlider_dirthr_up, SIGNAL(valueChanged(int)), this, SLOT(vchange_dthr_up(int)));
        QObject::connect(opsController->horizontalSlider_dirthr_down, SIGNAL(valueChanged(int)), this, SLOT(vchange_dthr_down(int)));
        QObject::connect(opsController->horizontalSlider_window, SIGNAL(valueChanged(int)), this, SLOT(vchange_autocorr(int)));
        QObject::connect(opsController->horizontalSlider_dirthr_up, SIGNAL(valueChanged(int)), this, SLOT(vchange_dthr_up(int)));
        QObject::connect(opsController->horizontalSlider_dirthr_down, SIGNAL(valueChanged(int)), this, SLOT(vchange_dthr_down(int)));
+       QObject::connect(opsController->horizontalSlider_askedge, SIGNAL(valueChanged(int)), this, SLOT(vchange_askedge(int)));
 
        controlWidget->show();
 
 
        controlWidget->show();
 
@@ -178,7 +188,7 @@ ProxWidget::ProxWidget(QWidget *parent, ProxGuiQT *master) : QWidget(parent)
        //layout->addWidget(slider);
        layout->addWidget(plot);
        setLayout(layout);
        //layout->addWidget(slider);
        layout->addWidget(plot);
        setLayout(layout);
-       //printf("Proxwidget Constructor just set layout\r\n");
+       printf("Proxwidget Constructor just set layout\r\n");
 }
 
 
 }
 
 
index 794db2d7a673b0ce6f5107514660c07bdbf0d730..fa1ba018d756874da56182ce6658e8c53e3798bb 100644 (file)
@@ -71,6 +71,7 @@ class ProxWidget : public QWidget
                void applyOperation();
                void stickOperation();
                void vchange_autocorr(int v);
                void applyOperation();
                void stickOperation();
                void vchange_autocorr(int v);
+               void vchange_askedge(int v);
                void vchange_dthr_up(int v);
                void vchange_dthr_down(int v);
 };
                void vchange_dthr_up(int v);
                void vchange_dthr_down(int v);
 };
index 8b7f85e550a5cfbf3fa8facb051e27e46903a744..7cc9043e775a1b8856e253de592ebbb02031c87d 100644 (file)
@@ -17,7 +17,7 @@
    <item>
     <widget class="QTabWidget" name="tabWidget_overlays">
      <property name="currentIndex">
    <item>
     <widget class="QTabWidget" name="tabWidget_overlays">
      <property name="currentIndex">
-      <number>0</number>
+      <number>1</number>
      </property>
      <widget class="QWidget" name="tab">
       <property name="focusPolicy">
      </property>
      <widget class="QWidget" name="tab">
       <property name="focusPolicy">
       <layout class="QVBoxLayout" name="verticalLayout_2">
        <item>
         <layout class="QFormLayout" name="formLayout">
       <layout class="QVBoxLayout" name="verticalLayout_2">
        <item>
         <layout class="QFormLayout" name="formLayout">
-         <item row="0" column="0">
-          <widget class="QLabel" name="label">
+         <item row="0" column="1">
+          <widget class="QLabel" name="label_5">
            <property name="text">
            <property name="text">
-            <string>Window size</string>
+            <string/>
            </property>
           </widget>
          </item>
            </property>
           </widget>
          </item>
-         <item row="0" column="1">
-          <widget class="QLabel" name="label_5">
+         <item row="0" column="0">
+          <widget class="QLabel" name="label">
            <property name="text">
            <property name="text">
-            <string/>
+            <string>Window size</string>
            </property>
           </widget>
          </item>
            </property>
           </widget>
          </item>
      </widget>
      <widget class="QWidget" name="tab_3">
       <attribute name="title">
      </widget>
      <widget class="QWidget" name="tab_3">
       <attribute name="title">
-       <string>Askdemod</string>
+       <string>AskEdge</string>
       </attribute>
       </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout_4">
+       <item>
+        <layout class="QFormLayout" name="formLayout_4">
+         <property name="bottomMargin">
+          <number>0</number>
+         </property>
+         <item row="0" column="0">
+          <widget class="QLabel" name="label_8">
+           <property name="text">
+            <string>Edge Jump Threshold</string>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="QLabel" name="label_9">
+           <property name="text">
+            <string/>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <widget class="QSlider" name="horizontalSlider_askedge">
+         <property name="minimum">
+          <number>5</number>
+         </property>
+         <property name="maximum">
+          <number>80</number>
+         </property>
+         <property name="value">
+          <number>20</number>
+         </property>
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="verticalSpacer_3">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>40</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
      </widget>
      <widget class="QWidget" name="tab_2">
       <attribute name="title">
      </widget>
      <widget class="QWidget" name="tab_2">
       <attribute name="title">
      <item>
       <widget class="QPushButton" name="pushButton_sticky">
        <property name="text">
      <item>
       <widget class="QPushButton" name="pushButton_sticky">
        <property name="text">
-        <string>Sticky</string>
+        <string>Restore</string>
        </property>
       </widget>
      </item>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QLabel" name="label_4">
        <property name="text">
      <item>
       <widget class="QLabel" name="label_4">
        <property name="text">
-        <string>TextLabel</string>
+        <string/>
        </property>
       </widget>
      </item>
        </property>
       </widget>
      </item>
    <slot>setNum(int)</slot>
    <hints>
     <hint type="sourcelabel">
    <slot>setNum(int)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>29</x>
-     <y>90</y>
+     <x>46</x>
+     <y>118</y>
     </hint>
     <hint type="destinationlabel">
      <x>597</x>
     </hint>
     <hint type="destinationlabel">
      <x>597</x>
    <slot>setNum(int)</slot>
    <hints>
     <hint type="sourcelabel">
    <slot>setNum(int)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>153</x>
-     <y>84</y>
+     <x>170</x>
+     <y>118</y>
     </hint>
     <hint type="destinationlabel">
      <x>161</x>
     </hint>
     <hint type="destinationlabel">
      <x>161</x>
    <slot>setNum(int)</slot>
    <hints>
     <hint type="sourcelabel">
    <slot>setNum(int)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>53</x>
-     <y>92</y>
+     <x>70</x>
+     <y>118</y>
     </hint>
     <hint type="destinationlabel">
      <x>68</x>
     </hint>
     <hint type="destinationlabel">
      <x>68</x>
    <slot>setNum(int)</slot>
    <hints>
     <hint type="sourcelabel">
    <slot>setNum(int)</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>184</x>
-     <y>161</y>
+     <x>201</x>
+     <y>185</y>
     </hint>
     <hint type="destinationlabel">
      <x>149</x>
     </hint>
     <hint type="destinationlabel">
      <x>149</x>
     </hint>
    </hints>
   </connection>
     </hint>
    </hints>
   </connection>
+  <connection>
+   <sender>horizontalSlider_askedge</sender>
+   <signal>valueChanged(int)</signal>
+   <receiver>label_9</receiver>
+   <slot>setNum(int)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>149</x>
+     <y>102</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>250</x>
+     <y>70</y>
+    </hint>
+   </hints>
+  </connection>
  </connections>
 </ui>
  </connections>
 </ui>
index 83aa3e6cea617037574d0d00fa3ceedb42d383bf..daa6192bbab24348bd45fc2331f939180a5b02e0 100644 (file)
@@ -1,13 +1,13 @@
 /********************************************************************************
 /********************************************************************************
-** Form generated from reading UI file 'overlaystQ7020.ui'
+** Form generated from reading UI file 'overlays.ui'
 **
 **
-** Created by: Qt User Interface Compiler version 4.8.6
+** Created by: Qt User Interface Compiler version 5.6.1
 **
 ** WARNING! All changes made in this file will be lost when recompiling UI file!
 ********************************************************************************/
 
 **
 ** WARNING! All changes made in this file will be lost when recompiling UI file!
 ********************************************************************************/
 
-#ifndef OVERLAYSTQ7020_H
-#define OVERLAYSTQ7020_H
+#ifndef UI_OVERLAYS_H
+#define UI_OVERLAYS_H
 
 #include <QtCore/QVariant>
 #include <QAction>
 
 #include <QtCore/QVariant>
 #include <QAction>
@@ -34,11 +34,17 @@ public:
     QWidget *tab;
     QVBoxLayout *verticalLayout_2;
     QFormLayout *formLayout;
     QWidget *tab;
     QVBoxLayout *verticalLayout_2;
     QFormLayout *formLayout;
-    QLabel *label;
     QLabel *label_5;
     QLabel *label_5;
+    QLabel *label;
     QSlider *horizontalSlider_window;
     QSpacerItem *verticalSpacer;
     QWidget *tab_3;
     QSlider *horizontalSlider_window;
     QSpacerItem *verticalSpacer;
     QWidget *tab_3;
+    QVBoxLayout *verticalLayout_4;
+    QFormLayout *formLayout_4;
+    QLabel *label_8;
+    QLabel *label_9;
+    QSlider *horizontalSlider_askedge;
+    QSpacerItem *verticalSpacer_3;
     QWidget *tab_2;
     QVBoxLayout *verticalLayout;
     QFormLayout *formLayout_2;
     QWidget *tab_2;
     QVBoxLayout *verticalLayout;
     QFormLayout *formLayout_2;
@@ -59,34 +65,34 @@ public:
     void setupUi(QWidget *Form)
     {
         if (Form->objectName().isEmpty())
     void setupUi(QWidget *Form)
     {
         if (Form->objectName().isEmpty())
-            Form->setObjectName(QString::fromUtf8("Form"));
+            Form->setObjectName(QStringLiteral("Form"));
         Form->resize(614, 286);
         verticalLayout_3 = new QVBoxLayout(Form);
         Form->resize(614, 286);
         verticalLayout_3 = new QVBoxLayout(Form);
-        verticalLayout_3->setObjectName(QString::fromUtf8("verticalLayout_3"));
+        verticalLayout_3->setObjectName(QStringLiteral("verticalLayout_3"));
         tabWidget_overlays = new QTabWidget(Form);
         tabWidget_overlays = new QTabWidget(Form);
-        tabWidget_overlays->setObjectName(QString::fromUtf8("tabWidget_overlays"));
+        tabWidget_overlays->setObjectName(QStringLiteral("tabWidget_overlays"));
         tab = new QWidget();
         tab = new QWidget();
-        tab->setObjectName(QString::fromUtf8("tab"));
+        tab->setObjectName(QStringLiteral("tab"));
         tab->setFocusPolicy(Qt::StrongFocus);
         verticalLayout_2 = new QVBoxLayout(tab);
         tab->setFocusPolicy(Qt::StrongFocus);
         verticalLayout_2 = new QVBoxLayout(tab);
-        verticalLayout_2->setObjectName(QString::fromUtf8("verticalLayout_2"));
+        verticalLayout_2->setObjectName(QStringLiteral("verticalLayout_2"));
         formLayout = new QFormLayout();
         formLayout = new QFormLayout();
-        formLayout->setObjectName(QString::fromUtf8("formLayout"));
-        label = new QLabel(tab);
-        label->setObjectName(QString::fromUtf8("label"));
-
-        formLayout->setWidget(0, QFormLayout::LabelRole, label);
-
+        formLayout->setObjectName(QStringLiteral("formLayout"));
         label_5 = new QLabel(tab);
         label_5 = new QLabel(tab);
-        label_5->setObjectName(QString::fromUtf8("label_5"));
+        label_5->setObjectName(QStringLiteral("label_5"));
 
         formLayout->setWidget(0, QFormLayout::FieldRole, label_5);
 
 
         formLayout->setWidget(0, QFormLayout::FieldRole, label_5);
 
+        label = new QLabel(tab);
+        label->setObjectName(QStringLiteral("label"));
+
+        formLayout->setWidget(0, QFormLayout::LabelRole, label);
+
 
         verticalLayout_2->addLayout(formLayout);
 
         horizontalSlider_window = new QSlider(tab);
 
         verticalLayout_2->addLayout(formLayout);
 
         horizontalSlider_window = new QSlider(tab);
-        horizontalSlider_window->setObjectName(QString::fromUtf8("horizontalSlider_window"));
+        horizontalSlider_window->setObjectName(QStringLiteral("horizontalSlider_window"));
         horizontalSlider_window->setMinimum(10);
         horizontalSlider_window->setMaximum(10000);
         horizontalSlider_window->setValue(2000);
         horizontalSlider_window->setMinimum(10);
         horizontalSlider_window->setMaximum(10000);
         horizontalSlider_window->setValue(2000);
@@ -100,21 +106,52 @@ public:
 
         tabWidget_overlays->addTab(tab, QString());
         tab_3 = new QWidget();
 
         tabWidget_overlays->addTab(tab, QString());
         tab_3 = new QWidget();
-        tab_3->setObjectName(QString::fromUtf8("tab_3"));
+        tab_3->setObjectName(QStringLiteral("tab_3"));
+        verticalLayout_4 = new QVBoxLayout(tab_3);
+        verticalLayout_4->setObjectName(QStringLiteral("verticalLayout_4"));
+        formLayout_4 = new QFormLayout();
+        formLayout_4->setObjectName(QStringLiteral("formLayout_4"));
+        formLayout_4->setContentsMargins(-1, -1, -1, 0);
+        label_8 = new QLabel(tab_3);
+        label_8->setObjectName(QStringLiteral("label_8"));
+
+        formLayout_4->setWidget(0, QFormLayout::LabelRole, label_8);
+
+        label_9 = new QLabel(tab_3);
+        label_9->setObjectName(QStringLiteral("label_9"));
+
+        formLayout_4->setWidget(0, QFormLayout::FieldRole, label_9);
+
+
+        verticalLayout_4->addLayout(formLayout_4);
+
+        horizontalSlider_askedge = new QSlider(tab_3);
+        horizontalSlider_askedge->setObjectName(QStringLiteral("horizontalSlider_askedge"));
+        horizontalSlider_askedge->setMinimum(5);
+        horizontalSlider_askedge->setMaximum(80);
+        horizontalSlider_askedge->setValue(20);
+        horizontalSlider_askedge->setOrientation(Qt::Horizontal);
+
+        verticalLayout_4->addWidget(horizontalSlider_askedge);
+
+        verticalSpacer_3 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
+
+        verticalLayout_4->addItem(verticalSpacer_3);
+
         tabWidget_overlays->addTab(tab_3, QString());
         tab_2 = new QWidget();
         tabWidget_overlays->addTab(tab_3, QString());
         tab_2 = new QWidget();
-        tab_2->setObjectName(QString::fromUtf8("tab_2"));
+        tab_2->setObjectName(QStringLiteral("tab_2"));
         verticalLayout = new QVBoxLayout(tab_2);
         verticalLayout = new QVBoxLayout(tab_2);
-        verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
+        verticalLayout->setObjectName(QStringLiteral("verticalLayout"));
         formLayout_2 = new QFormLayout();
         formLayout_2 = new QFormLayout();
-        formLayout_2->setObjectName(QString::fromUtf8("formLayout_2"));
+        formLayout_2->setObjectName(QStringLiteral("formLayout_2"));
         label_2 = new QLabel(tab_2);
         label_2 = new QLabel(tab_2);
-        label_2->setObjectName(QString::fromUtf8("label_2"));
+        label_2->setObjectName(QStringLiteral("label_2"));
 
         formLayout_2->setWidget(0, QFormLayout::LabelRole, label_2);
 
         label_6 = new QLabel(tab_2);
 
         formLayout_2->setWidget(0, QFormLayout::LabelRole, label_2);
 
         label_6 = new QLabel(tab_2);
-        label_6->setObjectName(QString::fromUtf8("label_6"));
+        label_6->setObjectName(QStringLiteral("label_6"));
 
         formLayout_2->setWidget(0, QFormLayout::FieldRole, label_6);
 
 
         formLayout_2->setWidget(0, QFormLayout::FieldRole, label_6);
 
@@ -122,7 +159,7 @@ public:
         verticalLayout->addLayout(formLayout_2);
 
         horizontalSlider_dirthr_up = new QSlider(tab_2);
         verticalLayout->addLayout(formLayout_2);
 
         horizontalSlider_dirthr_up = new QSlider(tab_2);
-        horizontalSlider_dirthr_up->setObjectName(QString::fromUtf8("horizontalSlider_dirthr_up"));
+        horizontalSlider_dirthr_up->setObjectName(QStringLiteral("horizontalSlider_dirthr_up"));
         horizontalSlider_dirthr_up->setMaximum(128);
         horizontalSlider_dirthr_up->setValue(20);
         horizontalSlider_dirthr_up->setOrientation(Qt::Horizontal);
         horizontalSlider_dirthr_up->setMaximum(128);
         horizontalSlider_dirthr_up->setValue(20);
         horizontalSlider_dirthr_up->setOrientation(Qt::Horizontal);
@@ -130,14 +167,14 @@ public:
         verticalLayout->addWidget(horizontalSlider_dirthr_up);
 
         formLayout_3 = new QFormLayout();
         verticalLayout->addWidget(horizontalSlider_dirthr_up);
 
         formLayout_3 = new QFormLayout();
-        formLayout_3->setObjectName(QString::fromUtf8("formLayout_3"));
+        formLayout_3->setObjectName(QStringLiteral("formLayout_3"));
         label_3 = new QLabel(tab_2);
         label_3 = new QLabel(tab_2);
-        label_3->setObjectName(QString::fromUtf8("label_3"));
+        label_3->setObjectName(QStringLiteral("label_3"));
 
         formLayout_3->setWidget(0, QFormLayout::LabelRole, label_3);
 
         label_7 = new QLabel(tab_2);
 
         formLayout_3->setWidget(0, QFormLayout::LabelRole, label_3);
 
         label_7 = new QLabel(tab_2);
-        label_7->setObjectName(QString::fromUtf8("label_7"));
+        label_7->setObjectName(QStringLiteral("label_7"));
 
         formLayout_3->setWidget(0, QFormLayout::FieldRole, label_7);
 
 
         formLayout_3->setWidget(0, QFormLayout::FieldRole, label_7);
 
@@ -145,7 +182,7 @@ public:
         verticalLayout->addLayout(formLayout_3);
 
         horizontalSlider_dirthr_down = new QSlider(tab_2);
         verticalLayout->addLayout(formLayout_3);
 
         horizontalSlider_dirthr_down = new QSlider(tab_2);
-        horizontalSlider_dirthr_down->setObjectName(QString::fromUtf8("horizontalSlider_dirthr_down"));
+        horizontalSlider_dirthr_down->setObjectName(QStringLiteral("horizontalSlider_dirthr_down"));
         horizontalSlider_dirthr_down->setMaximum(127);
         horizontalSlider_dirthr_down->setOrientation(Qt::Horizontal);
 
         horizontalSlider_dirthr_down->setMaximum(127);
         horizontalSlider_dirthr_down->setOrientation(Qt::Horizontal);
 
@@ -160,14 +197,14 @@ public:
         verticalLayout_3->addWidget(tabWidget_overlays);
 
         horizontalLayout = new QHBoxLayout();
         verticalLayout_3->addWidget(tabWidget_overlays);
 
         horizontalLayout = new QHBoxLayout();
-        horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
+        horizontalLayout->setObjectName(QStringLiteral("horizontalLayout"));
         pushButton_apply = new QPushButton(Form);
         pushButton_apply = new QPushButton(Form);
-        pushButton_apply->setObjectName(QString::fromUtf8("pushButton_apply"));
+        pushButton_apply->setObjectName(QStringLiteral("pushButton_apply"));
 
         horizontalLayout->addWidget(pushButton_apply);
 
         pushButton_sticky = new QPushButton(Form);
 
         horizontalLayout->addWidget(pushButton_apply);
 
         pushButton_sticky = new QPushButton(Form);
-        pushButton_sticky->setObjectName(QString::fromUtf8("pushButton_sticky"));
+        pushButton_sticky->setObjectName(QStringLiteral("pushButton_sticky"));
 
         horizontalLayout->addWidget(pushButton_sticky);
 
 
         horizontalLayout->addWidget(pushButton_sticky);
 
@@ -176,7 +213,7 @@ public:
         horizontalLayout->addItem(horizontalSpacer);
 
         label_4 = new QLabel(Form);
         horizontalLayout->addItem(horizontalSpacer);
 
         label_4 = new QLabel(Form);
-        label_4->setObjectName(QString::fromUtf8("label_4"));
+        label_4->setObjectName(QStringLiteral("label_4"));
 
         horizontalLayout->addWidget(label_4);
 
 
         horizontalLayout->addWidget(label_4);
 
@@ -189,8 +226,9 @@ public:
         QObject::connect(horizontalSlider_window, SIGNAL(valueChanged(int)), label_5, SLOT(setNum(int)));
         QObject::connect(horizontalSlider_dirthr_up, SIGNAL(valueChanged(int)), label_6, SLOT(setNum(int)));
         QObject::connect(horizontalSlider_dirthr_down, SIGNAL(valueChanged(int)), label_7, SLOT(setNum(int)));
         QObject::connect(horizontalSlider_window, SIGNAL(valueChanged(int)), label_5, SLOT(setNum(int)));
         QObject::connect(horizontalSlider_dirthr_up, SIGNAL(valueChanged(int)), label_6, SLOT(setNum(int)));
         QObject::connect(horizontalSlider_dirthr_down, SIGNAL(valueChanged(int)), label_7, SLOT(setNum(int)));
+        QObject::connect(horizontalSlider_askedge, SIGNAL(valueChanged(int)), label_9, SLOT(setNum(int)));
 
 
-        tabWidget_overlays->setCurrentIndex(0);
+        tabWidget_overlays->setCurrentIndex(1);
 
 
         QMetaObject::connectSlotsByName(Form);
 
 
         QMetaObject::connectSlotsByName(Form);
@@ -199,18 +237,20 @@ public:
     void retranslateUi(QWidget *Form)
     {
         Form->setWindowTitle(QApplication::translate("Form", "Overlays", 0));
     void retranslateUi(QWidget *Form)
     {
         Form->setWindowTitle(QApplication::translate("Form", "Overlays", 0));
-        label->setText(QApplication::translate("Form", "Window size", 0));
         label_5->setText(QString());
         label_5->setText(QString());
+        label->setText(QApplication::translate("Form", "Window size", 0));
         tabWidget_overlays->setTabText(tabWidget_overlays->indexOf(tab), QApplication::translate("Form", "Autocorrelate", 0));
         tabWidget_overlays->setTabText(tabWidget_overlays->indexOf(tab), QApplication::translate("Form", "Autocorrelate", 0));
-        tabWidget_overlays->setTabText(tabWidget_overlays->indexOf(tab_3), QApplication::translate("Form", "Askdemod", 0));
+        label_8->setText(QApplication::translate("Form", "Edge Jump Threshold", 0));
+        label_9->setText(QString());
+        tabWidget_overlays->setTabText(tabWidget_overlays->indexOf(tab_3), QApplication::translate("Form", "AskEdge", 0));
         label_2->setText(QApplication::translate("Form", "Up", 0));
         label_6->setText(QString());
         label_3->setText(QApplication::translate("Form", "Down", 0));
         label_7->setText(QString());
         tabWidget_overlays->setTabText(tabWidget_overlays->indexOf(tab_2), QApplication::translate("Form", "Dirthreshold", 0));
         pushButton_apply->setText(QApplication::translate("Form", "Apply", 0));
         label_2->setText(QApplication::translate("Form", "Up", 0));
         label_6->setText(QString());
         label_3->setText(QApplication::translate("Form", "Down", 0));
         label_7->setText(QString());
         tabWidget_overlays->setTabText(tabWidget_overlays->indexOf(tab_2), QApplication::translate("Form", "Dirthreshold", 0));
         pushButton_apply->setText(QApplication::translate("Form", "Apply", 0));
-        pushButton_sticky->setText(QApplication::translate("Form", "Sticky", 0));
-        label_4->setText(QApplication::translate("Form", "TextLabel", 0));
+        pushButton_sticky->setText(QApplication::translate("Form", "Restore", 0));
+        label_4->setText(QString());
     } // retranslateUi
 
 };
     } // retranslateUi
 
 };
@@ -221,4 +261,4 @@ namespace Ui {
 
 QT_END_NAMESPACE
 
 
 QT_END_NAMESPACE
 
-#endif // OVERLAYSTQ7020_H
+#endif // UI_OVERLAYS_H
index 072bd120a7c315fc8aac100f05e1b55dff74ab0f..be9d361372cab66b8e9d98b402a39d37c86d6bb4 100644 (file)
@@ -1490,7 +1490,7 @@ size_t aggregate_bits(uint8_t *dest, size_t size, uint8_t rfLen, uint8_t invert,
 //by marshmellow  (from holiman's base)
 // full fsk demod from GraphBuffer wave to decoded 1s and 0s (no mandemod)
 int fskdemod_ext(uint8_t *dest, size_t size, uint8_t rfLen, uint8_t invert, uint8_t fchigh, uint8_t fclow, int *startIdx) {
 //by marshmellow  (from holiman's base)
 // full fsk demod from GraphBuffer wave to decoded 1s and 0s (no mandemod)
 int fskdemod_ext(uint8_t *dest, size_t size, uint8_t rfLen, uint8_t invert, uint8_t fchigh, uint8_t fclow, int *startIdx) {
-       if (justNoise(dest, *size)) return 0;
+       if (justNoise(dest, size)) return 0;
        // FSK demodulator
        size = fsk_wave_demod(dest, size, fchigh, fclow, startIdx);
        size = aggregate_bits(dest, size, rfLen, invert, fchigh, fclow, startIdx);
        // FSK demodulator
        size = fsk_wave_demod(dest, size, fchigh, fclow, startIdx);
        size = aggregate_bits(dest, size, rfLen, invert, fchigh, fclow, startIdx);
Impressum, Datenschutz