Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HDL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RTSD
HDL
Commits
ceff82d7
Commit
ceff82d7
authored
10 years ago
by
Daniel van der Schuur
Browse files
Options
Downloads
Patches
Plain Diff
-Added plot_rec_file.py.
parent
383df67a
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/dsp/correlator/tb/python/plot_rec_file.py
+81
-0
81 additions, 0 deletions
libraries/dsp/correlator/tb/python/plot_rec_file.py
with
81 additions
and
0 deletions
libraries/dsp/correlator/tb/python/plot_rec_file.py
0 → 100644
+
81
−
0
View file @
ceff82d7
# 0 1 2 3 4 5 6 7 8 9 10
# [sync] [bsn] [data] [re] [im] [valid] [sop] [eop] [empty] [channel] [err]
from
common
import
*
from
common_dsp
import
*
import
os
import
numpy
NOF_VISIBILITIES
=
300
REC_FILE
=
os
.
environ
[
'
RADIOHDL
'
]
+
'
/libraries/dsp/correlator/correlator_src_out_arr0.rec2
'
################################################################################
# Read the lines from the file and turn them into a list
################################################################################
with
open
(
REC_FILE
,
"
r
"
)
as
recfile
:
lines
=
recfile
.
read
().
splitlines
()
################################################################################
# Extract the complex fields; create new complex list
################################################################################
complex_list
=
[]
raw_data_int
=
[]
raw_data_str
=
[]
for
line
in
lines
:
line
=
line
.
replace
(
'
X
'
,
'
0
'
)
# Get rid of the 'X' on bit 24 (we only use 0..23)
split_line
=
line
.
split
(
'
'
)
# print split_line
str_re
=
split_line
[
3
]
str_im
=
split_line
[
4
]
raw_data_str
.
append
(
[
str_re
,
str_im
]
)
# print str_re,str_im
re
=
int
(
str_re
,
16
)
im
=
int
(
str_im
,
16
)
raw_data_int
.
append
(
[
re
,
im
]
)
# print re,im
complex_word
=
complex
(
re
,
im
)
complex_list
.
append
(
complex_word
)
#print 'COMPLEX LIST'
#print complex_list
################################################################################
# Extract the phases
################################################################################
phases
=
[]
for
word
in
complex_list
:
phases
.
append
(
complex_binomial_to_phasor
(
word
)[
1
])
################################################################################
# Split the list into chunks of NOF_VISIBILITIES, plot them channel after channel
################################################################################
phases_per_channel
=
split_list
(
phases
,
NOF_VISIBILITIES
)
#print 'Nof channels in file:', len(phases_per_channel)
#
#print 'CHANNEL 40 - PHASES'
#print phases_per_channel[40]
#print 'CHANNEL 40 - COMPLEX'
#print split_list(complex_list, NOF_VISIBILITIES)[40]
#print 'CHANNEL 40 - RAW DATA, INTEGER'
#print split_list(raw_data_int, NOF_VISIBILITIES)[40]
#print 'CHANNEL 40 - RAW DATA, HEX'
#print split_list(raw_data_str, NOF_VISIBILITIES)[40]
#
#print 'CHANNEL 41 - PHASES'
#print phases_per_channel[41]
#print 'CHANNEL 41 - COMPLEX'
#print split_list(complex_list, NOF_VISIBILITIES)[41]
#print 'CHANNEL 41 - RAW DATA, INTEGER'
#print split_list(raw_data_int, NOF_VISIBILITIES)[41]
#print 'CHANNEL 41 - RAW DATA, HEX'
#print split_list(raw_data_str, NOF_VISIBILITIES)[41]
for
channel_phases
in
phases_per_channel
[
40
:]:
phases_mat
=
numpy
.
array
(
channel_phases
)
mat
=
unique_vis_to_full_matrix
(
phases_mat
)
plot_matrix_color
([[
mat
]])
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment