From 91ba0b3ab40ace83aea8cf63ced71cc18d721350 Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Tue, 8 Dec 2020 18:30:58 +0200 Subject: [PATCH] ggwave-gui : update version to 1.0.0 --- examples/ggwave-gui/common.h | 2 +- src/ggwave.cpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/ggwave-gui/common.h b/examples/ggwave-gui/common.h index b5df2b3..ea9734c 100644 --- a/examples/ggwave-gui/common.h +++ b/examples/ggwave-gui/common.h @@ -289,7 +289,7 @@ void renderMain() { ImGui::BeginChild("Settings:main", ImGui::GetContentRegionAvail(), true); ImGui::Text("%s", ""); ImGui::Text("%s", ""); - ImGui::Text("Waver v0.1"); + ImGui::Text("Waver v1.0.0"); ImGui::Separator(); ImGui::Text("%s", ""); diff --git a/src/ggwave.cpp b/src/ggwave.cpp index b10a1eb..00e29bc 100644 --- a/src/ggwave.cpp +++ b/src/ggwave.cpp @@ -572,20 +572,20 @@ void GGWave::receive(const CBDequeueAudio & CBDequeueAudio) { bool isReceiving = false; for (const auto & rxProtocol : kTxProtocols) { - bool isReceivingCur = true; + int nDetectedMarkerBits = m_nBitsInMarker; for (int i = 0; i < m_nBitsInMarker; ++i) { double freq = bitFreq(rxProtocol, i); int bin = std::round(freq*m_ihzPerSample); if (i%2 == 0) { - if (m_sampleSpectrum[bin] <= 3.0f*m_sampleSpectrum[bin + m_freqDelta_bin]) isReceivingCur = false; + if (m_sampleSpectrum[bin] <= 3.0f*m_sampleSpectrum[bin + m_freqDelta_bin]) --nDetectedMarkerBits; } else { - if (m_sampleSpectrum[bin] >= 3.0f*m_sampleSpectrum[bin + m_freqDelta_bin]) isReceivingCur = false; + if (m_sampleSpectrum[bin] >= 3.0f*m_sampleSpectrum[bin + m_freqDelta_bin]) --nDetectedMarkerBits; } } - if (isReceivingCur) { + if (nDetectedMarkerBits == m_nBitsInMarker) { m_markerFreqStart = rxProtocol.freqStart; isReceiving = true; break; @@ -611,20 +611,20 @@ void GGWave::receive(const CBDequeueAudio & CBDequeueAudio) { bool isEnded = false; for (const auto & rxProtocol : kTxProtocols) { - bool isEndedCur = true; + int nDetectedMarkerBits = m_nBitsInMarker; for (int i = 0; i < m_nBitsInMarker; ++i) { double freq = bitFreq(rxProtocol, i); int bin = std::round(freq*m_ihzPerSample); if (i%2 == 0) { - if (m_sampleSpectrum[bin] >= 3.0f*m_sampleSpectrum[bin + m_freqDelta_bin]) isEndedCur = false; + if (m_sampleSpectrum[bin] >= 3.0f*m_sampleSpectrum[bin + m_freqDelta_bin]) nDetectedMarkerBits--; } else { - if (m_sampleSpectrum[bin] <= 3.0f*m_sampleSpectrum[bin + m_freqDelta_bin]) isEndedCur = false; + if (m_sampleSpectrum[bin] <= 3.0f*m_sampleSpectrum[bin + m_freqDelta_bin]) nDetectedMarkerBits--; } } - if (isEndedCur) { + if (nDetectedMarkerBits == m_nBitsInMarker) { isEnded = true; break; }