hamnet70-gnuradio-legacy/utils/filter_preamble.py
Thomas Kolb c805bee1fb New preamble and header modulation to assist phase tracking
Also, the new symbols give more power to the sync parts, which should
make the sync more robust.
2019-09-25 23:53:36 +02:00

26 lines
875 B
Python
Executable file

#!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as pp
import rrc
pre = np.array([ -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, -1, 1, 1, 1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, -1, -1, 1, 1, -1, 1, 1, -1, -1, -1, 1, -1, -1, 1, -1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, -1, 1, 1, -1, -1, -1, 1, -1, 1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, 1, 1, -1, -1, -1]) * (1+1j)
pre_up = np.zeros(2 * len(pre) + 1, dtype=complex)
pre_up[1::2] = pre
rrc_coef = rrc.rrc_design(150, 2)
pre_flt = np.convolve(pre_up, rrc_coef, mode='same')
print("===== Preamble =====")
print(list(pre))
print("===== Filtered Preamble =====")
print(list(pre_flt))
pp.plot(pre_up)
pp.plot(pre_flt)
pp.show()