Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nam
ProxPython
Commits
96008a82
Commit
96008a82
authored
Nov 05, 2019
by
alexander.dornheim
Browse files
Fixed bug / Simplified code in CDP_processor
parent
34a9882d
Changes
1
Hide whitespace changes
Inline
Side-by-side
proxtoolbox/Problems/Phase/CDP_processor.py
View file @
96008a82
...
...
@@ -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
'
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment