Open MakisChristou opened 2 years ago
Python support is still experimental I think use binaries in c
You'll need to edit amodem/config.py and setup an arbritrary BITRATE answer (see below) that uses frequencies 1e3 and/or 2e3. Out of the box, the program assumes you have 0-15 kHz to play with, which is appropriate if you are using a wideband broadcast remote transmitter like a Marti RPT-25. Using 1e3 will use up 0-2 kHz, 2e3 will use 2-4 kHz, and combining the two will give you the best possible throughput for a 0-4 kHz audio path.
export BITRATE=99
pip install .
amodem/config.py:
# MODEM configurations for various bitrates [kbps]
bitrates = {
1: Configuration(Fs=8e3, Npoints=2, frequencies=[2e3]),
2: Configuration(Fs=8e3, Npoints=4, frequencies=[2e3]),
4: Configuration(Fs=8e3, Npoints=16, frequencies=[2e3]),
8: Configuration(Fs=8e3, Npoints=16, frequencies=[1e3, 2e3]),
12: Configuration(Fs=16e3, Npoints=16, frequencies=[3e3, 5e3]),
16: Configuration(Fs=16e3, Npoints=16, frequencies=[2e3, 5e3]),
20: Configuration(Fs=16e3, Npoints=16, frequencies=[2e3, 6e3]),
24: Configuration(Fs=16e3, Npoints=16, frequencies=[1e3, 6e3]),
28: Configuration(Fs=32e3, Npoints=16, frequencies=[3e3, 9e3]),
32: Configuration(Fs=32e3, Npoints=16, frequencies=[2e3, 9e3]),
36: Configuration(Fs=32e3, Npoints=64, frequencies=[4e3, 9e3]),
42: Configuration(Fs=32e3, Npoints=64, frequencies=[4e3, 10e3]),
48: Configuration(Fs=32e3, Npoints=64, frequencies=[3e3, 10e3]),
54: Configuration(Fs=32e3, Npoints=64, frequencies=[2e3, 10e3]),
60: Configuration(Fs=32e3, Npoints=64, frequencies=[2e3, 11e3]),
64: Configuration(Fs=32e3, Npoints=256, frequencies=[3e3, 10e3]),
72: Configuration(Fs=32e3, Npoints=256, frequencies=[2e3, 10e3]),
80: Configuration(Fs=32e3, Npoints=256, frequencies=[2e3, 11e3]),
97: Configuration(Fs=32e3, Npoints=256, frequencies=[1e3]),
98: Configuration(Fs=32e3, Npoints=256, frequencies=[2e3]),
99: Configuration(Fs=32e3, Npoints=256, frequencies=[1e3,2e3]),
}
The audio out needs to be low-pass filtered to below 4100 Hz with a brick-wall or FIR filter. There is a notch in the output audio around that frequency. Otherwise the spectrum looks like sin (x^2/x), and harmonics all the way up. However, you need flat audio (discriminator/modulator access in the radio, no pre-emphasis or de-emphasis) to take advantage of the QAM between 0-2 kHz.
You'll need to edit amodem/config.py and setup an arbritrary BITRATE answer (see below) that uses frequencies 1e3 and/or 2e3. Out of the box, the program assumes you have 0-15 kHz to play with, which is appropriate if you are using a wideband broadcast remote transmitter like a Marti RPT-25. Using 1e3 will use up 0-2 kHz, 2e3 will use 2-4 kHz, and combining the two will give you the best possible throughput for a 0-4 kHz audio path.
export BITRATE=99 pip install . amodem/config.py: # MODEM configurations for various bitrates [kbps] bitrates = { 1: Configuration(Fs=8e3, Npoints=2, frequencies=[2e3]), 2: Configuration(Fs=8e3, Npoints=4, frequencies=[2e3]), 4: Configuration(Fs=8e3, Npoints=16, frequencies=[2e3]), 8: Configuration(Fs=8e3, Npoints=16, frequencies=[1e3, 2e3]), 12: Configuration(Fs=16e3, Npoints=16, frequencies=[3e3, 5e3]), 16: Configuration(Fs=16e3, Npoints=16, frequencies=[2e3, 5e3]), 20: Configuration(Fs=16e3, Npoints=16, frequencies=[2e3, 6e3]), 24: Configuration(Fs=16e3, Npoints=16, frequencies=[1e3, 6e3]), 28: Configuration(Fs=32e3, Npoints=16, frequencies=[3e3, 9e3]), 32: Configuration(Fs=32e3, Npoints=16, frequencies=[2e3, 9e3]), 36: Configuration(Fs=32e3, Npoints=64, frequencies=[4e3, 9e3]), 42: Configuration(Fs=32e3, Npoints=64, frequencies=[4e3, 10e3]), 48: Configuration(Fs=32e3, Npoints=64, frequencies=[3e3, 10e3]), 54: Configuration(Fs=32e3, Npoints=64, frequencies=[2e3, 10e3]), 60: Configuration(Fs=32e3, Npoints=64, frequencies=[2e3, 11e3]), 64: Configuration(Fs=32e3, Npoints=256, frequencies=[3e3, 10e3]), 72: Configuration(Fs=32e3, Npoints=256, frequencies=[2e3, 10e3]), 80: Configuration(Fs=32e3, Npoints=256, frequencies=[2e3, 11e3]), 97: Configuration(Fs=32e3, Npoints=256, frequencies=[1e3]), 98: Configuration(Fs=32e3, Npoints=256, frequencies=[2e3]), 99: Configuration(Fs=32e3, Npoints=256, frequencies=[1e3,2e3]), }
The audio out needs to be low-pass filtered to below 4100 Hz with a brick-wall or FIR filter. There is a notch in the output audio around that frequency. Otherwise the spectrum looks like sin (x^2/x), and harmonics all the way up. However, you need flat audio (discriminator/modulator access in the radio, no pre-emphasis or de-emphasis) to take advantage of the QAM between 0-2 kHz.
@ke4ahr this still doesn't solve the issue. I'm getting the following error after including your code and installing it again:
Traceback (most recent call last): File "/home/karan/voice_modem/amodem/amodem/main.py", line 64, in recv receiver.run(sampler, gain=1.0/amplitude, output=dst) File "/home/karan/voice_modem/amodem/amodem/recv.py", line 165, in run filt = self._train(sampler, order=10, lookahead=10) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/karan/voice_modem/amodem/amodem/recv.py", line 77, in _train self._verify_training(equalized, train_symbols) File "/home/karan/voice_modem/amodem/amodem/recv.py", line 98, in _verify_training assert error_rate == 0, error_rate AssertionError: 0.003
As the title suggests I am trying to use amodem to transfer files using a pair of uv-5rs. I have two APRS cables and two TRRS USB sound cards that I bought off Amazon. I am testing this on a single Linux machine. During the calibration process I managed to get a
good signal
indication with the following settings:On the sender's side:
and on the receiver's side:
But when I actually attempt to send files with the same exact settings I always get invalid check-sums.
On the receiver's side:
Can anyone point me into the right direction? Any other logs you want me to provide? I have little to no experience with signal processing so any help would be appreciated!