From ed0643e4e10da607653b58f2d7f120b7ec95c64e Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Sat, 1 Feb 2014 18:31:54 +0100 Subject: [PATCH] utils: calc sync words --- utils/sync_words.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 utils/sync_words.py diff --git a/utils/sync_words.py b/utils/sync_words.py new file mode 100644 index 0000000..7a9412f --- /dev/null +++ b/utils/sync_words.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python + + +short = tuple([(52**.5/24**.5) * x for x in [0, 0, 0, 0, 0, 0, 0, 0, 1+1j, 0, 0, 0, -1-1j, 0, 0, 0, 1+1j, 0, 0, 0, -1-1j, 0, 0, 0, -1-1j, 0, 0, 0, 1+1j, 0, 0, 0, 0, 0, 0, 0, -1-1j, 0, 0, 0, -1-1j, 0, 0, 0, 1+1j, 0, 0, 0, 1+1j, 0, 0, 0, 1+1j, 0, 0, 0, 1+1j, 0, 0, 0, 0, 0, 0, 0]]) + +long_norm = tuple([0, 0, 0, 0, 0, 0, 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, 0, 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, 0, 0, 0, 0, 0]) + + +mul = tuple([1, -1j, -1, 1j] * 16) +long_rot = tuple([x * y for x, y in zip(long_norm, mul)]) + + +sync = tuple([short, short, long_rot, long_norm]) + + +assert(len(short) == 64) +assert(len(long_norm) == 64) +assert(len(long_rot) == 64) +assert(len(sync) == 4) + +print "power short: " + str(sum([abs(x)**2 for x in short])) +print "power long: " + str(sum([abs(x)**2 for x in long_norm])) + +print "sync sequence" +print sync +print "len sync: " + str(len(sync)) + + + + + + +