Wykres commitów

586 Commity (da22d6ff64d640d5ba2e627b749a66f521709683)

Autor SHA1 Wiadomość Data
Silvano Seva da22d6ff64 Separated interface for CPS loading from the non volatile memory one 2022-06-01 14:56:33 +02:00
Silvano Seva c3cfaba4b2 Renamed zones into banks to align to M17 codeplug naming convention. 2022-06-01 14:56:22 +02:00
Silvano Seva 7ed4a64027 On MD-3x0 added a fixed gain of four to codec2 demodulated audio to compensate for the low output volume 2022-05-31 21:28:09 +02:00
Silvano Seva 4367db53d0 Added configuration of AT1846S registers for digital modes in MD-UV3x0 driver. In M17 mode handler forced signal phase inversion at demodulator side also for MD-UV3x0 devices 2022-05-31 18:19:57 +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
Silvano Seva 1620889640 Reorganised main FSM inside M17 operating mode handler 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
Silvano Seva 46c988bdc2 Restoring priority level of output streams to PRIO_BEEP when the stream terminates, made M17Modulator::emitBaseband() wait for effective stream termination before returning when transmission stop is requested. Fixes #76 2022-05-27 21:49:33 +02:00
Silvano Seva 76be50db61 Improved debug log in M17 demodulator, changed trigger condition for log dump, re-enabled audio reproduction when logging. 2022-05-27 21:49:33 +02:00
Silvano Seva 4304013d62 Updated M17 demodulator debug logger: now log data is continously updated and dumped only in case of a missed sync after lock has been acquired. 2022-05-27 21:49:33 +02:00
Silvano Seva ff7a28ff59 RingBuffer class: implemented eraseElement() function, rewritten the pop() function in a cleaner way, fixed a bug in the pop() function causing the not_full condition variable to be never rised. 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 5b27e6b692 Ensure proper termination of baseband sampling when M17Demodulator::terminate() is called.
Solves #74.
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 115982d279 Add demod log script
Add script to receive the demodulated data from Module17/radio, to use
it you need to add in meson.build:12 the ENABLE_DEMOD_LOG define.
Build and flash into the platform, build and run scripts/get_demod_log,
turn on the radio, remember to turn of radio before you terminate
get_demod_log, print the output with
`scripts/plot_m17_demod_csv.py serial_demod_log.csv`.

TG-81
2022-05-27 21:49:32 +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
Silvano Seva 6be567a781 Implementation of a statically allocated ring buffer with blocking and non-blocking push and pop 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 b998d3b78f Modified time constant of DC removal high-pass filter to avoid a too high cut-off frequency when run with at fast sample rates 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 b1f2cb109f 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
Silvano Seva e68b05d859 Fixed double free errors in M17 code, see #73 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 2e7ed7a8f0 M17 demodulator further improvements
- Fix phase propagation across buffers
- Fix initial syncword offset detection
- Improve quantization algorithm

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
Silvano Seva beca0d2acc Reorganised constants inside M17 demodulator class 2022-05-27 21:48:47 +02:00
Silvano Seva 77dfeef9e7 Implemented audio decoding functions in CODEC2 module 2022-05-27 21:48:47 +02:00
Silvano Seva fda0fed5e7 Moved constant specifying sample rate for M17 baseband decoding from hwconfig.h files to M17Demodulator class 2022-05-27 21:48:47 +02:00
Silvano Seva e5b5daba85 Moved state variables of PWM compensator and DC removal filter outside the function bodies to allow keeping their consistency among function calls 2022-05-27 21:48:47 +02:00
Mathis Schmieder 89c05a7332 Adjusted Module17 mic processing gain; interim-fix for DC offset removal 2022-05-27 21:48:47 +02:00
Silvano Seva 49e5486ea6 Parametric mic gain inside codec2 module 2022-05-27 21:48:47 +02:00
Silvano Seva b144657257 Moved CODEC2 management to a dedicated module 2022-05-27 21:48:47 +02:00
Silvano Seva 4b8685b853 Changed gain and added an offset at tx RRC stage only for Module 17 to compensate for an hardware bug 2022-05-27 21:48:47 +02:00
Silvano Seva 4a3e31cd03 Fixed bug in M17 demodulator caused by the precedent code refactoring 2022-05-27 21:48:47 +02:00
Silvano Seva d1b4973cc9 Fixed reset of DC bias on stream stop in Module 17 output stream driver, made parametric the gain of the RRC at modulator side 2022-05-27 21:48:47 +02:00
Silvano Seva 83020d4fa3 Increased priority of CODEC2 thread, this fixes glitches when generating M17 baseband signal 2022-05-27 21:48:47 +02:00
Silvano Seva 3d169484e9 Improved management of CODEC2 thread in M17 mode handler, now activated only when transmitting. Fixes a confict with RTX and MIC input streams causing the rtx thread to hang when PTT was pressed 2022-05-27 21:48:47 +02:00