Commit 96008a82 authored by alexander.dornheim's avatar alexander.dornheim
Browse files

Fixed bug / Simplified code in CDP_processor

parent 34a9882d
......@@ -32,10 +32,7 @@ def CDP_processor(config):
elif n1==1:
Masks = np.random.choice(np.array([1j, -1j, 1, -1]),(L,n2))
else:
Masks = zeros((n1,n2,L)); # Storage for L masks, each of dim n1 x n2
# Sample phases: each symbol in alphabet {1, -1, i , -i} has equal prob.
for ll in range(L):
Masks[:,:,ll] = np.random.choice(np.array([1j, -1j, 1, -1]),(n1,n2))
np.random.choice(np.array([1j, -1j, 1, -1]),(n1,n2,L))
# Sample magnitudes and make masks
temp = random_sample(Masks.shape) #works like rand but accepts tuple as argument
......@@ -96,4 +93,4 @@ def CDP_processor(config):
print('Run time of initialization: %.2f seconds', toc-tic)
print('Relative error after initialization: %.2f', Relerrs)
print('\n')
\ No newline at end of file
print('\n')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment