diff options
author | Thomas Habets <thomas@habets.se> | 2021-02-28 22:57:23 +0000 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2021-03-01 07:52:44 -0500 |
commit | 2f0e690baeda709e0e76be93ebb60edc1d3e1695 (patch) | |
tree | a21d1768cab24ad4bf93aceda0d9fae199cfdeed /gr-digital/lib/simple_correlator_impl.h | |
parent | 0231d9746b41c3980f30390557b7a08e538f25c6 (diff) |
digital/simple_correlator: Remove manual memory management
Signed-off-by: Thomas Habets <thomas@habets.se>
Diffstat (limited to 'gr-digital/lib/simple_correlator_impl.h')
-rw-r--r-- | gr-digital/lib/simple_correlator_impl.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/gr-digital/lib/simple_correlator_impl.h b/gr-digital/lib/simple_correlator_impl.h index 59188363c8..3a5514dcc9 100644 --- a/gr-digital/lib/simple_correlator_impl.h +++ b/gr-digital/lib/simple_correlator_impl.h @@ -26,21 +26,21 @@ private: enum state_t { ST_LOOKING, ST_UNDER_THRESHOLD, ST_LOCKED }; int d_payload_bytesize; - state_t d_state; - unsigned int d_osi; // over sample index [0,OVERSAMPLE-1] - unsigned int d_transition_osi; // first index where Hamming dist < thresh - unsigned int d_center_osi; // center of bit + state_t d_state = ST_LOOKING; + unsigned int d_osi = 0; // over sample index [0,OVERSAMPLE-1] + unsigned int d_transition_osi = 0; // first index where Hamming dist < thresh + unsigned int d_center_osi = 0; // center of bit unsigned long long int d_shift_reg[OVERSAMPLE]; - int d_bblen; // length of bitbuf - unsigned char* d_bitbuf; // demodulated bits - unsigned char* d_pktbuf; // temp packet buf - int d_bbi; // bitbuf index + int d_bblen; // length of bitbuf + std::vector<unsigned char> d_bitbuf; // demodulated bits + std::vector<unsigned char> d_pktbuf; // temp packet buf + int d_bbi = 0; // bitbuf index static const int AVG_PERIOD = 512; // must be power of 2 (for freq offset correction) - int d_avbi; + int d_avbi = 0; float d_avgbuf[AVG_PERIOD]; - float d_avg; - float d_accum; + float d_avg = 0.0; + float d_accum = 0.0; inline int slice(float x) { return x >= d_avg ? 1 : 0; } |