lwvmobile / dsd-fme

Digital Speech Decoder - Florida Man Edition
Other
155 stars 30 forks source link

WIP: M17 Decoding #152

Closed lwvmobile closed 1 year ago

lwvmobile commented 1 year ago

Much like YSF, I was able to recycle the heavy lifting convolutional decoder from NXDN code and de-puncturing techniques to quickly rollout M17 support. However, with M17, there are new tools required, mainly, Codec2, and it is a system I am still learning how to implement properly. While I do have voice being decoded, it sounds a bit choppy, or too fast, like not enough samples are being decoded by it before its being played. This portion is a work in progress, but the audio samples do sound extremely clean. To playback Codec2 in DSD-FME, you will need to build or install the appropriate packages from repo. For Debian/Ubuntu/Mint/Pi, this is libcodec2-dev and Fedora, is codec2-devel. Cygwin may require a manual build (I honestly haven't even tested it yet over there). M17 will still decode without Codec2 installed, and will just display the bytes of the voice frame. Note: Codec2 is a free and open source vocoder. They're main Github presence can be found here.

Currently, we have just enough for embedded LSF (link control, basically) and voice output. The rest will hopefully be fixed up and filled in here and there until its all working soundly.

Working: LICH Decode Embedded LSF Chunk Assembly, CRC16, and Decode Codec2 3200 Voice (working now) LSF SRC/DST Callsigns Ncurses Support for M17 Wav file saving for Calls

Not Working: LSF Sync Frame Decoding (issues with initial frame demod, or P1 puncture) Packet/Data Frame Decoding Codec2 Raw Signal Files Call History

Untested Codec2 1600 Voice (implemented via guesswork, but no samples)

To test my implementation, I used resources from the M17-Project's Github, mainly m17-tools to mod and demod test files and input/output and also the .rrc files found in the M17-education repo.

If anybody wants to test out the current performance of M17 on DSD-FME, you will need to use the v2.1b branch and get the .rrc files found here and play them back with

dsd-fme -fz -i 2.rrc or dsd-fme -fz -Z -i 2.rrc making sure the .rrc files are in the same directory as dsd-fme, or that you point to the correct directory as well.

If anybody can provide any recorded wav files from SDR++, that would be great for testing on real world samples.

lwvmobile commented 1 year ago

Update: Codec2 3200bps voice is now playing back appropriately. I swear, the way I fixed it was doing what I had originally done the first time, but when that didn't work, I tried other things. One of those days, I guess.

kb9mwr commented 1 year ago

Thank you. If you need other recordings or have questions the folks on their discord channel are always helpful. https://discord.gg/G8zGphypf6 Keep up the good work

lwvmobile commented 1 year ago

I've done some more work, and now I have the CRC16 working correctly this time, have handling for Codec2 1600 half rate voice (still untested, and coded based purely on guesswork since its not currently in any M17 code I found nor in the M17 spec or manual). Also, have ncurses support for M17 now. Proper LSF DST/SRC Callsigns working now. Saving decoded calls to a single wav file now working (no per call) and I have a setup for the LSF Sync Frame, but decoding it is not working, either due to bad demodulation on the initial frame, or bad implementation of the P1 depuncture or there is too many punctures for the decoder to handle causing the convolutional decoder to fail. LSF frame is coded, but not working.