mirror of
https://github.com/romanz/amodem.git
synced 2026-04-20 13:16:42 +08:00
40kbps demo
This commit is contained in:
@@ -7,8 +7,8 @@ log = logging.getLogger(__name__)
|
|||||||
Fs = 32e3
|
Fs = 32e3
|
||||||
Ts = 1.0 / Fs
|
Ts = 1.0 / Fs
|
||||||
|
|
||||||
frequencies = (np.arange(4) + 8) * 1e3
|
frequencies = (np.arange(10) + 1) * 1e3
|
||||||
carrier_index = len(frequencies)/2
|
carrier_index = 0
|
||||||
Fc = frequencies[carrier_index]
|
Fc = frequencies[carrier_index]
|
||||||
Tc = 1.0 / Fc
|
Tc = 1.0 / Fc
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class QAM(object):
|
|||||||
index = np.argmin(np.abs(s - self.points))
|
index = np.argmin(np.abs(s - self.points))
|
||||||
yield self._dec[ self.points[index] ]
|
yield self._dec[ self.points[index] ]
|
||||||
|
|
||||||
modulator = QAM(bits_per_symbol=2, radii=[1.0])
|
modulator = QAM(bits_per_symbol=4, radii=[1.0, 0.6])
|
||||||
|
|
||||||
def clip(x, lims):
|
def clip(x, lims):
|
||||||
return min(max(x, lims[0]), lims[1])
|
return min(max(x, lims[0]), lims[1])
|
||||||
|
|||||||
2
test.sh
2
test.sh
@@ -3,7 +3,7 @@ set -u
|
|||||||
set -x
|
set -x
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
dd if=/dev/urandom of=data.send bs=1024 count=8
|
dd if=/dev/urandom of=data.send bs=1024 count=64
|
||||||
python send.py
|
python send.py
|
||||||
python recv.py
|
python recv.py
|
||||||
python errors.py data.* #python show.py tx.int16 rx.int16
|
python errors.py data.* #python show.py tx.int16 rx.int16
|
||||||
Reference in New Issue
Block a user