Commit Graph

94 Commits

Author SHA1 Message Date
Silvano Seva a6561ef59b M17: Demodulator: split FSM states into functions
Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
2025-11-03 18:59:00 +01:00
Ryan Turner 00a4dbb063 style: resolve ambiguous paths on include macros
Update meson and cmake config to only include openrtx and platform paths.
Update files to use <..> for system and external libraries, ".." for
project files and new relative paths as necessary.

Did not attempt to fix areas where includes that should be <..> were
previously ".."

Inspired by #96, closes #359.

Acked-by: Silvano Seva <silseva@fastwebnet.it>
2025-09-28 17:27:45 +02:00
Silvano Seva 6db558e89c core: dsp: refactor DC block filter implementation
New DC block filter implementation using fixed-point math and guaranteeing
zero DC component on the output signal.

Signed-off-by: Silvano Seva <silseva@fastwebnet.it>
2025-09-28 14:12:20 +02:00
Silvano Seva 03d1ae5546 Updated year in copyright headers 2025-04-04 21:15:39 +02:00
Jim Ancona b16c3c0fd1 M17: replaced std::experimental::array with std:array 2025-03-01 20:01:08 +01:00
Morgan Diepart dd8d6be5a9 M17: Synchronizer: fixed uninitialized variable and out-of-bounds array access. 2024-11-10 14:37:40 +01:00
Silvano Seva a6f01c3e55 Small refactoring of M17 modulator.
- made start() function return a boolean indicating the actual modulator status
- moved sending of preamble to a dedicated function
- renamed send() function to sendFrame()
2024-07-12 11:11:44 +02:00
Silvano Seva 598f1c4523 M17: deeply restructured the demodulator code
Restructured the M17Demodulator class and rewritten the
demodulator logic to have a more solid lock on the
baseband stream. This fixes the long standing bug of the
demodulator causing random losses of lock even when
receiving a solid baseband stream.
2024-01-27 15:15:37 +01:00
Silvano Seva ddf889177c Frame synchronizer class 2024-01-27 15:15:37 +01:00
Silvano Seva 3375d0b5d1 Correlator class 2024-01-27 12:17:07 +01:00
Silvano Seva 91c0965007 Module17: made M17 baseband output have correct DC bias and amplitude
Removed an old workaround for an hardware bug of Module17 rev 0.1b limiting
the output swing of baseband signal in newer hardware revisions.

Contribution by Mathis Schmieder DB9MAT.
2023-11-21 18:46:03 +01:00
Silvano Seva 1011dd1081 Moved audio_stream.h from interfaces to core headers 2023-08-30 18:04:24 +02:00
marco 278d7850c7 M17: add data structures for GNSS and extended callsign metadata. 2023-08-28 10:25:46 +02:00
Silvano Seva e93b461beb Added phase inversion setting to M17 modulator 2023-05-29 22:12:40 +02:00
Silvano Seva 4a3bc93fa4 Always send an M17 EOT frame as the last frame before terminating baseband output 2023-03-12 16:27:31 +01:00
Silvano Seva a89a7523cb Updated year in copyright headers 2023-02-08 16:33:02 +01:00
Silvano Seva 49c6cbd7c0 Added implementation of soft-decision Viterbi decoder for M17 protocol, updated version number in meson.build 2022-11-11 22:04:34 +01:00
Silvano Seva 21481072e7 Moved audio management in M17 opmode handler to audio path system 2022-10-28 09:47:47 +02:00
Silvano Seva b5fc9b252d Moved code of compensating filter for MDx PWM-based DAC to a dedicated class. 2022-08-28 12:17:04 +02:00
Silvano Seva d11bb903b1 Made public the M17Modulator.stop() function, added macro to enable the transmission of an M17 EOT frame (disabled by default). 2022-08-28 12:00:36 +02:00
Jacob McSwain fa33f15417 Implemented M17 EOT marker 2022-08-28 11:59:31 +02:00
Silvano Seva a22aceb576 Reorganized code for M17 transmission: removed M17Transmitter class, use M17FrameEncoder to assemble LSF and data frames, modified API of M17Modulator class. 2022-08-28 11:59:31 +02:00
Silvano Seva 9c2091c060 Changed M17 RX behaviour so that received stream data is forwarded to codec2 decode only when a full valid LSF is received. 2022-07-21 22:14:55 +02:00
Silvano Seva 54af6bf429 Made decode functions in M17Viterbi class return the final decode cost 2022-07-21 22:03:48 +02:00
Silvano Seva 54aa794bf8 Changed file extension of all C++ only header files from .h to .hpp 2022-07-09 18:22:36 +02:00
Silvano Seva 34c90c2485 Moved FIR filter class to a dedicated header file 2022-07-09 18:07:42 +02:00
Silvano Seva d2e0b7d940 Improved heap memory management in M17 modulator class 2022-06-05 12:27:25 +02:00
Silvano Seva a1888ae19e Improved heap memory management in M17 demodulator class 2022-06-05 12:24:43 +02:00
Silvano Seva 4d4ebae2f3 Added configurable phase inversion to M17 demodulator. Forced enabling of phase inversion for MD3x0 VHF radios. 2022-05-30 19:19:01 +02:00
Silvano Seva bfa3494777 Fixed bug in M17 demodulator causing the M17Demodulator::getFrame() function to return the frame currently being processed instead of the fully demodulated one. 2022-05-27 21:49:33 +02:00
Silvano Seva 63f4c787c0 Moved helper functions for M17 Golay to a dedicated source file 2022-05-27 21:49:33 +02:00
Niccolò Izzo 6322cb49a4 Cleanup demodulator, improved quantization log
Unified offset and phase variable to reduce the chance of off-by-ones
between buffers. Improved logging on linux and module17 adding
quantization indices.

TG-81
2022-05-27 21:49:33 +02:00
Niccolò Izzo 29ad0830f0 M17 demodulation improvement
Add logging in syncword sweep, fix unsigned underflow bug,
fixed symbol average computation for quantization.
Do syncword sweep whenever available.

TG-81
2022-05-27 21:49:33 +02:00
Silvano Seva d17d683b2d M17 code cleanup pass: reorganised data type definitions and constants 2022-05-27 21:49:33 +02:00
Silvano Seva 7aff678069 Improved robustness of frame type detection, now based on minimum hamming distance between syncwords 2022-05-27 21:49:33 +02:00
Niccolò Izzo c987848382 Add syncword hot re-sync fix DC removal
DC removal filter had a bug that created weird positive spikes on
Module17, add a syncword hot re-sync to be able to correct small phase
errors that appear every five seconds more or less.

TG-81
2022-05-27 21:48:47 +02:00
Silvano Seva 1f77c2af6c Reorganised logging inside M17 demodulator, logging is disabled by default.
On non-linux devices log data is printed on the serial port in raw binary format.
2022-05-27 21:48:47 +02:00
Niccolò Izzo ef61c532a3 Cleaned up quantization average
Now average is computed over all the syncword symbols, for each syncword
as a simple average.

TG-81
2022-05-27 21:48:47 +02:00
Niccolò Izzo 5fe5b0e578 Refactor M17 logging
Refactored logging functions to enable in-system logging on Module17 and
MDx radios.

TG-81
2022-05-27 21:48:47 +02:00
Silvano Seva 361308be16 Generator of pseudorandom binary sequence compliant with M17 specification 2022-05-27 21:48:47 +02:00
Silvano Seva 3988540b6c Changed coefficients for the 41-tap, 24kHz RRC filter to have unitary input-output gain 2022-05-27 21:48:47 +02:00
Niccolò Izzo c3c984d504 Add syncword fuzzy detection
Frame decoder now tolerates bit error in syncword, removed syncword type
detection in demodulator code.

TG-81
2022-05-27 21:48:47 +02:00
Silvano Seva 6b31a73f42 Corrected RRC gain and changed HR_C5000 modulation factor and input gain to have the correct 2.4kHz deviation when transmitting M17 with an MD3x0 radio 2022-05-27 21:48:47 +02:00
Niccolò Izzo 2d59658d60 Switch M17 Rx sample rate to 5SPS
Due to the RRC computation sometimes violating the timing constraints,
we switched the M17 demodulator to 5 samples per symbol (24KHz), thus
dividing the processing time by four ar the number of samples halves as
well as the number of taps of the RRC.
Minor adaptation on the code followed.

TG-81
2022-05-27 21:48:47 +02:00
Niccolò Izzo 63bd864674 Fix M17 Rx LED
Now LED turns on when a syncword is successfully detected, not just when
the correlation is sufficiently high.

TG-81
2022-05-27 21:48:47 +02:00
Niccolò Izzo c4483edff0 Improve quantization strategy
Now quantization is performed by averaging syncword samples and dividing
the resulting threshold by a constant.

TG-81
2022-05-27 21:48:47 +02:00
Niccolò Izzo 7d1b89550e Rewrite quantization algorithm
Quantization algorithm is now based on separate rolling averages for
positive and negative samples.
Merged csv outputs from syncword search and quantization on Linux.

TG-81
2022-05-27 21:48:47 +02:00
Niccolò Izzo aa9fcc26b7 Remove useless DC bias in quantization
TG-81
2022-05-27 21:48:47 +02:00
Niccolò Izzo d1651a702c Add proper DC-bias removal, tuned EMAs 2022-05-27 21:48:47 +02:00
Silvano Seva da5c453852 Implemented unpacking and decoding of M17 audio stream frames 2022-05-27 21:48:47 +02:00