mirror of
https://github.com/romanz/amodem.git
synced 2026-02-24 16:18:12 +08:00
recv: split training verification
This commit is contained in:
@@ -87,7 +87,10 @@ class Receiver(object):
|
||||
equalization_filter = dsp.FIR(h=coeffs)
|
||||
equalized = list(equalization_filter(signal))
|
||||
equalized = equalized[prefix+lookahead:-postfix+lookahead]
|
||||
self._verify_training(equalized, train_symbols)
|
||||
return equalization_filter
|
||||
|
||||
def _verify_training(self, equalized, train_symbols):
|
||||
symbols = self.equalizer.demodulator(equalized, train.equalizer_length)
|
||||
sliced = np.array(symbols).round()
|
||||
errors = np.array(sliced - train_symbols, dtype=np.bool)
|
||||
@@ -107,8 +110,6 @@ class Receiver(object):
|
||||
'$F_c = {0} Hz$'.format(freq), index=i)
|
||||
assert error_rate == 0, error_rate
|
||||
|
||||
return equalization_filter
|
||||
|
||||
def _demodulate(self, sampler, symbols):
|
||||
streams = []
|
||||
symbol_list = []
|
||||
|
||||
Reference in New Issue
Block a user