hamnet70-gnuradio-legacy/utils/make_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
387 B
Python
Executable file

#!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as pp
min_err = 100
pre = np.array([1]*64 + [-1]*64)
while min_err > 10:
pre = np.random.permutation( pre )
c = np.correlate(pre, pre, mode='full')
err = np.max(np.absolute(c[:127]))
if err < min_err:
min_err = err
print(err)
print(pre)
pp.plot(c)
pp.show()