mirror of
https://github.com/romanz/amodem.git
synced 2026-04-21 13:46:30 +08:00
refactor sigproc
This commit is contained in:
@@ -47,10 +47,9 @@ class QAM(object):
|
|||||||
yield s
|
yield s
|
||||||
|
|
||||||
def decode(self, symbols):
|
def decode(self, symbols):
|
||||||
keys = np.array(self._dec.keys())
|
|
||||||
for s in symbols:
|
for s in symbols:
|
||||||
index = np.argmin(np.abs(s - keys))
|
index = np.argmin(np.abs(s - self.points))
|
||||||
yield self._dec[ keys[index] ]
|
yield self._dec[ self.points[index] ]
|
||||||
|
|
||||||
modulator = QAM(bits_per_symbol=2, radii=[1.0])
|
modulator = QAM(bits_per_symbol=2, radii=[1.0])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user