From 64fe59382f54770a95562c4f21a6d8da7880c5ab Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Tue, 9 Jun 2020 14:57:06 +0100 Subject: [PATCH] Start on the actual AX.25 demodulator. --- AX25Demodulator.cpp | 31 +++++++++++++++++++++++++++++++ AX25Demodulator.h | 35 +++++++++++++++++++++++++++++++++++ AX25RX.cpp | 9 ++++++++- AX25RX.h | 5 +++++ 4 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 AX25Demodulator.cpp create mode 100644 AX25Demodulator.h diff --git a/AX25Demodulator.cpp b/AX25Demodulator.cpp new file mode 100644 index 0000000..b1a9d84 --- /dev/null +++ b/AX25Demodulator.cpp @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2020 by Jonathan Naylor G4KLX + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "Config.h" +#include "Globals.h" +#include "AX25Demodulator.h" + +CAX25Demodulator::CAX25Demodulator(uint16_t n) : +m_n(n) +{ +} + +void CAX25Demodulator::process(q15_t sample) +{ +} + diff --git a/AX25Demodulator.h b/AX25Demodulator.h new file mode 100644 index 0000000..d26aa32 --- /dev/null +++ b/AX25Demodulator.h @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2020 by Jonathan Naylor G4KLX + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#if !defined(AX25Demodulator_H) +#define AX25Demodulator_H + +#include "Config.h" + +class CAX25Demodulator { +public: + CAX25Demodulator(uint16_t n); + + void process(q15_t sample); + +private: + uint16_t m_n; +}; + +#endif + diff --git a/AX25RX.cpp b/AX25RX.cpp index 8305407..260d549 100644 --- a/AX25RX.cpp +++ b/AX25RX.cpp @@ -20,7 +20,10 @@ #include "Globals.h" #include "AX25RX.h" -CAX25RX::CAX25RX() +CAX25RX::CAX25RX() : +m_demod1(1U), +m_demod2(2U), +m_demod3(3U) { } @@ -28,6 +31,10 @@ void CAX25RX::samples(const q15_t* samples, uint8_t length) { for (uint8_t i = 0U; i < length; i++) { q15_t sample = samples[i]; + + m_demod1.process(sample); + m_demod2.process(sample); + m_demod3.process(sample); } } diff --git a/AX25RX.h b/AX25RX.h index bbb2779..feab90a 100644 --- a/AX25RX.h +++ b/AX25RX.h @@ -21,6 +21,8 @@ #include "Config.h" +#include "AX25Demodulator.h" + class CAX25RX { public: CAX25RX(); @@ -28,6 +30,9 @@ public: void samples(const q15_t* samples, uint8_t length); private: + CAX25Demodulator m_demod1; + CAX25Demodulator m_demod2; + CAX25Demodulator m_demod3; }; #endif