Commit Graph

47 Commits

Author SHA1 Message Date
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 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
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 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 54a89abcd0 Removed a printf left behind after debugging from M17 demodulator class and slightly cleaned up the code 2022-05-27 21:48:47 +02:00
Silvano Seva c9a4bfb199 Cleanup and refactoring of M17 modulator class, now using output streams for baseband signal output 2022-05-27 21:48:47 +02:00
Silvano Seva 427c5f50b3 Made M17Demodulator::update() return a boolean indicating when a new decoded frame is ready 2022-05-27 21:48:47 +02:00
Niccolò Izzo 77aead675a Improve runtime performance of M17 Demodulator
Tweaked the exponential moving average alpha factors to improve the
reactivity of the M17 demodulator.

TG-81
2022-05-27 21:48:47 +02:00
Niccolò Izzo 5ef145cd39 Add fuzzy syncword validation
Now syncword match is not exact but can tolerate up to two erroneous
bits.

TG-81
2022-05-27 21:48:47 +02:00
Niccolò Izzo ca49b306b9 Update constants for M17 demodulation
Constants were updated to increase performance based on baseband sample
collected with Module17.

TG-81
2022-05-27 21:48:47 +02:00
Niccolò Izzo 2d8c696a09 Complete M17 demodulator implementation
Make quantization work also on DC offset signal
Add samples plot code
Fix bug in buffer wrap around
Fix oob memory access in M17 modulator
Update tests with DC offset signal
Switch to 48KHz sample rate for Module17 and MD380
Add DC biasing script

TG-81
2022-05-27 21:48:46 +02:00
Niccolò Izzo ae26cca46f Remove SPS
Now M17_SAPLES_PER_SYMBOL is computed dinamically from sample rate.

TG-81
2022-05-27 21:48:46 +02:00
Niccolò Izzo a091bca35f M17 Demodulator bugfixes
Fixed several bugs in the M17 Demodulator code.

TG-81
2022-05-27 21:48:46 +02:00
Silvano Seva 35c1f062c6 Implementation of M17 frame encoder 2022-05-27 21:48:46 +02:00
Silvano Seva 82dd0a63f1 Clarification of naming: renamed DATA_SYNC_WORD to STREAM_SYNC_WORD and Audio_puncture to DATA_PUNCTURE 2022-05-27 21:48:46 +02:00
Silvano Seva 5fbd39959c Implementation of M17 frame decoder 2022-05-27 21:48:46 +02:00
Silvano Seva 49bd8ee2f4 Reorganised internal structure of M17LinkSetupFrame class, renamed M17Frame to M17StreamFrame and reorganised its structure 2022-05-27 21:48:46 +02:00
Silvano Seva c73aa92305 Reorganised M17LinkSetupframe and M17Frame classes, encapsulating structs defining their internal data structure 2022-05-27 21:48:46 +02:00
Niccolò Izzo 7a9bbfcaf2 Demodulator bugfix
Fix several bugs in the demodulator code, tipycally sign errors.
2022-05-27 21:48:46 +02:00
Niccolò Izzo 1a9b3c4168 Implement M17 demodulator logic
Implemented frame wrapping logic and demodulator loop.
2022-05-27 21:48:46 +02:00
Silvano Seva 963fbdc141 M17 mode handler: calling demodulator update function when in RX mode 2022-05-27 21:48:46 +02:00
Niccolò Izzo 5bf4df75ba Fine tune demodulator to OpenRTX M17 baseband
Fine tuned M17 demodulator with code generated from OpenRTX itself.

TG-81
2022-05-27 21:48:46 +02:00
Niccolò Izzo 4b498689f5 Replace RRC filter taps, update M17 testsuite
RRC filter taps have been replaced with the ones generated by Wojciech,
a new baseband for the M17 demodulation testsuite has been generated,
using OpenRTX itself and some further minor changes.

TG-81
2022-05-27 21:48:46 +02:00
Niccolò Izzo 3163dd49d7 Add M17 demodulator code and tests
Added implementation of the M17 4FSK demodulator, including clock
recovery, phase detection, and quantization algorithms.
A testsuite is also included to do regression testing against a
reference baseband pre-generated and the corresponding reference
bitstream.

A 1% BER is still present due to a fault likely in the RRC filtering,
since the eye diagram of the filtered stream is bad.

TG-81
2022-05-27 21:48:46 +02:00
Silvano Seva 396f66a1f3 Implementation of M17 Viterbi decoder and associated unit test 2022-05-27 21:48:46 +02:00
Niccolò Izzo 3aeade6c1f Clarify M17 modulator constant naming
Further clarify modulator constant naming for sample rate and frame
lengths, to distinguish between demodulator values.
2022-05-27 21:48:46 +02:00
Niccolò Izzo 6588a6718e Add M17 namespace in M17 related source files
Now M17 source files reside in the M17 namespace, the OPMODE_ prefix
was added to all opmode enums to avoid a name clash.
2022-05-27 21:48:46 +02:00
Niccolò Izzo 876cb87d57 Move rrc filter into separate compilation unit
By moving the rrc filter into a separate compilation unit with its own
header file, we can use it both in the modulator and in the demodulator.
2022-05-27 21:48:46 +02:00
Niccolò Izzo c648ffe377 Add draft of M17Demodulator class 2022-05-27 21:48:46 +02:00
Silvano Seva 8a3643ad3a Implementation of Golay(24,12) decoder, reimplemented Golay(24,12) encoder using generator matrix, unit test for Golay(24,12) encoding and decoding routines 2022-05-27 21:48:46 +02:00
Silvano Seva a3b7b490d4 Fixed jitter in M17 baseband signal generation 2022-05-27 21:48:46 +02:00
Silvano Seva a9e1e68709 Implemented function for inverse code puncturing in M17 protocol 2021-10-03 12:09:00 +02:00
Silvano Seva d018dbb4a0 Implementation of M17 polynomial deinterleaver 2021-09-20 21:34:59 +02:00
Silvano Seva bad5a50d7d Updated code puncturing pattern for M17 link setup frame to follow new specifications 2021-09-03 16:44:57 +02:00
Silvano Seva 2f3db118fc Changed streamType_t from bitfield struct to union of anonymous bitfield struct and uint16_t to facilitate endianness conversion. Change also fixed a bug in endianness conversion inside M17LinkSetupFrame class due to unaligned memory access. 2021-09-03 16:44:57 +02:00
Silvano Seva 92ea1535ff Moved definition of 'PLATFORM_LINUX' macro from hwconfig to meson.build, added '-std=c++14' compilation flag to compile arguments for linux platform, added missing includes to M17Utils.h 2021-09-03 16:44:57 +02:00
Silvano Seva 98e4164f54 M17 transmitter class 2021-09-03 16:44:57 +02:00
Silvano Seva 39e41ee470 M17 4FSK modulator class 2021-09-03 16:44:57 +02:00
Silvano Seva 7b5e98bbca Implemented generation of Golay(24,12) LICH blocks inside M17LinkSetupFrame class 2021-09-03 16:39:06 +02:00
Silvano Seva 93af26ef13 Implementation of M17 decorrelator, polynomial interleaver and Golay(24,12) encoder 2021-09-03 16:39:06 +02:00
Silvano Seva ee1b111fb7 Implementation of M17 code puncturing scheme 2021-09-03 16:39:06 +02:00
Silvano Seva d545071df6 Implementation of M17 convolutional encoder 2021-09-03 16:39:06 +02:00
Silvano Seva 9e5c689bf3 M17 protocol data structures 2021-09-03 16:39:06 +02:00