Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Calibration
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Calibration
Commits
8a2e288e
Commit
8a2e288e
authored
Nov 13, 2023
by
Peter Jansweijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apply normalize to rad/sqrt(Hz)
parent
2050efff
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
RohdeSchwarz_FSWP.py
sw/phase_noise_plot/RohdeSchwarz_FSWP.py
+17
-6
No files found.
sw/phase_noise_plot/RohdeSchwarz_FSWP.py
View file @
8a2e288e
...
@@ -301,14 +301,25 @@ if __name__ == "__main__":
...
@@ -301,14 +301,25 @@ if __name__ == "__main__":
norm_pn
=
normalize
norm_pn
=
normalize
if
only_trace1
:
if
only_trace1
:
# x, y in [dBc/Hz]
x
=
fswp_data
[
"trace"
][
1
][
0
]
x
=
fswp_data
[
"trace"
][
1
][
0
]
y
=
fswp_data
[
"trace"
][
1
][
1
]
y
=
fswp_data
[
"trace"
][
1
][
1
]
# x_rad, y_rad in [rad/sqrt(Hz)]
x_rad
=
fswp_data
[
"trace_rad"
][
1
][
0
]
x_rad
=
fswp_data
[
"trace_rad"
][
1
][
0
]
y_rad
=
fswp_data
[
"trace_rad"
][
1
][
1
]
y_rad
=
fswp_data
[
"trace_rad"
][
1
][
1
]
# Normalize logarithmic [dBc/Hz] by add/subtract dB's
y_norm
=
fswp_data
[
"trace"
][
1
][
1
]
+
norm_pn
y_norm
=
fswp_data
[
"trace"
][
1
][
1
]
+
norm_pn
# Normalize lineair [rad/sqrt(Hz)] by multpilying dbc2rad(dB's)
y_norm_rad
=
fswp_data
[
"trace_rad"
][
1
][
1
]
*
dbc2rad
(
norm_pn
)
#pdb.set_trace()
if
fswp_data
[
"window"
]
==
"Noise Spectrum"
:
if
fswp_data
[
"window"
]
==
"Noise Spectrum"
:
if
rad
:
if
rad
:
trace
=
ax
.
loglog
(
x_rad
,
y_rad
,
color
=
cycle_colors
[
color
],
label
=
filename
+
str
(
" [1]"
))
trace
=
ax
.
loglog
(
x_rad
,
y_rad
,
color
=
cycle_colors
[
color
],
label
=
filename
+
str
(
" [1]"
))
lns
=
lns
+
trace
# plot dashed normalized trace in same color
if
norm_pn
!=
0
:
trace
=
ax
.
loglog
(
x_rad
,
y_norm_rad
,
color
=
cycle_colors
[
color
],
linestyle
=
"dashed"
,
label
=
filename
+
str
(
" [1] Normalized"
))
lns
=
lns
+
trace
else
:
else
:
trace
=
ax
.
semilogx
(
x
,
y
,
color
=
cycle_colors
[
color
],
label
=
filename
+
str
(
" [1]"
))
trace
=
ax
.
semilogx
(
x
,
y
,
color
=
cycle_colors
[
color
],
label
=
filename
+
str
(
" [1]"
))
lns
=
lns
+
trace
lns
=
lns
+
trace
...
@@ -324,8 +335,8 @@ if __name__ == "__main__":
...
@@ -324,8 +335,8 @@ if __name__ == "__main__":
for
trace_nr
in
fswp_data
[
"trace"
]
.
keys
():
for
trace_nr
in
fswp_data
[
"trace"
]
.
keys
():
x
=
fswp_data
[
"trace"
][
trace_nr
][
0
]
x
=
fswp_data
[
"trace"
][
trace_nr
][
0
]
y
=
fswp_data
[
"trace"
][
trace_nr
][
1
]
y
=
fswp_data
[
"trace"
][
trace_nr
][
1
]
x_rad
=
fswp_data
[
"trace_rad"
][
1
][
0
]
x_rad
=
fswp_data
[
"trace_rad"
][
trace_nr
][
1
][
0
]
y_rad
=
fswp_data
[
"trace_rad"
][
1
][
1
]
y_rad
=
fswp_data
[
"trace_rad"
][
trace_nr
][
1
][
1
]
if
fswp_data
[
"window"
]
==
"Noise Spectrum"
:
if
fswp_data
[
"window"
]
==
"Noise Spectrum"
:
if
rad
:
if
rad
:
trace
=
ax
.
loglog
(
x_rad
,
y_rad
,
label
=
filename
+
str
(
" ["
)
+
str
(
trace_nr
)
+
(
"]"
))
trace
=
ax
.
loglog
(
x_rad
,
y_rad
,
label
=
filename
+
str
(
" ["
)
+
str
(
trace_nr
)
+
(
"]"
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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