Advertisement
Guest User

Untitled

a guest
Oct 15th, 2016
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. def split_code_book(initial, k, e):
  2. temp_code_book = np.vstack((initial - e, initial + e))
  3. temp_code_book = np.vsplit(temp_code_book, 2)
  4. for i in range(k-2):
  5. for j in range(len(temp_code_book)):
  6. if j == 0:
  7. new_code_book = np.vstack((temp_code_book[j] - e, temp_code_book[j] + e))
  8. else:
  9. new_code_book = np.vstack((new_code_book, temp_code_book[j] - e, temp_code_book[j] + e))
  10. temp_code_book = np.vsplit(new_code_book, 2**(i+2))
  11. return(temp_code_book)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement