mirror of
https://github.com/romanz/amodem.git
synced 2026-05-09 13:07:39 +08:00
move constellation symbols definition to common.py
This commit is contained in:
@@ -12,6 +12,10 @@ carrier_index = 0
|
|||||||
Fc = frequencies[carrier_index]
|
Fc = frequencies[carrier_index]
|
||||||
Tc = 1.0 / Fc
|
Tc = 1.0 / Fc
|
||||||
|
|
||||||
|
symbols = np.array([complex(x, y)
|
||||||
|
for x in np.linspace(-1, 1, 4)
|
||||||
|
for y in np.linspace(-1, 1, 4)]) / np.sqrt(2)
|
||||||
|
|
||||||
Tsym = 1e-3
|
Tsym = 1e-3
|
||||||
Nsym = int(Tsym / Ts)
|
Nsym = int(Tsym / Ts)
|
||||||
baud = int(1/Tsym)
|
baud = int(1/Tsym)
|
||||||
|
|||||||
@@ -56,9 +56,7 @@ class QAM(object):
|
|||||||
S = self.symbols[index]
|
S = self.symbols[index]
|
||||||
yield self._dec[S]
|
yield self._dec[S]
|
||||||
|
|
||||||
_xs, _ys = np.linspace(-1, 1, 4), np.linspace(-1, 1, 4) # QAM-16
|
modulator = QAM(common.symbols)
|
||||||
_symbols = np.array([complex(x, y) for x in _xs for y in _ys]) * np.sqrt(0.5)
|
|
||||||
modulator = QAM(_symbols)
|
|
||||||
|
|
||||||
modem_bps = common.baud * modulator.bits_per_symbol * len(common.frequencies)
|
modem_bps = common.baud * modulator.bits_per_symbol * len(common.frequencies)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user