mirror of
https://github.com/romanz/amodem.git
synced 2026-04-21 05:36:42 +08:00
detect: fix detection logging
This commit is contained in:
@@ -92,7 +92,7 @@ class Detector(object):
|
|||||||
coeffs.append(c)
|
coeffs.append(c)
|
||||||
|
|
||||||
index = np.argmax(coeffs)
|
index = np.argmax(coeffs)
|
||||||
log.debug('Starting coherence: %.3f%%', coeffs[index] * 100)
|
log.info('Carrier coherence: %.3f%%', coeffs[index] * 100)
|
||||||
offset = index + len(zeroes)
|
offset = index + len(zeroes)
|
||||||
return offset
|
return offset
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ class Detector(object):
|
|||||||
symbols = np.array(symbols[skip:-skip])
|
symbols = np.array(symbols[skip:-skip])
|
||||||
|
|
||||||
amplitude = np.mean(np.abs(symbols))
|
amplitude = np.mean(np.abs(symbols))
|
||||||
log.debug('Carrier symbols amplitude : %.3f', amplitude)
|
log.info('Carrier symbols amplitude : %.3f', amplitude)
|
||||||
|
|
||||||
phase = np.unwrap(np.angle(symbols)) / (2 * np.pi)
|
phase = np.unwrap(np.angle(symbols)) / (2 * np.pi)
|
||||||
indices = np.arange(len(phase))
|
indices = np.arange(len(phase))
|
||||||
@@ -113,6 +113,6 @@ class Detector(object):
|
|||||||
self.plt.plot(indices, a * indices + b)
|
self.plt.plot(indices, a * indices + b)
|
||||||
|
|
||||||
freq_err = a / (self.Tsym * self.freq)
|
freq_err = a / (self.Tsym * self.freq)
|
||||||
log.debug('Frequency error: %.3f ppm', freq_err * 1e6)
|
log.info('Frequency error: %.3f ppm', freq_err * 1e6)
|
||||||
self.plt.title('Frequency drift: {0:.3f} ppm'.format(freq_err * 1e6))
|
self.plt.title('Frequency drift: {0:.3f} ppm'.format(freq_err * 1e6))
|
||||||
return amplitude, freq_err
|
return amplitude, freq_err
|
||||||
|
|||||||
Reference in New Issue
Block a user