hamnet70-gnuradio-legacy/utils/filter_preamble.py
Thomas Kolb 69a497ccf8 Further optimize preamble
Maximum off-center autocorrelation value is now 11 (center peak is 128).
2019-09-13 23:07:48 +02:00

22 lines
754 B
Python
Executable file

#!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as pp
import rrc
pre = [ -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]
pre_up = np.zeros(2 * len(pre) + 1)
pre_up[1::2] = pre
rrc_coef = rrc.rrc_design(150, 2)
pre_flt = np.convolve(pre_up, rrc_coef, mode='same')
print(list(pre_flt))
pp.plot(pre_up)
pp.plot(pre_flt)
pp.show()