Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
python-spectrometer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
qutech
python-spectrometer
Commits
f7673194
Verified
Commit
f7673194
authored
2 months ago
by
Tobias Hangleiter
Browse files
Options
Downloads
Patches
Plain Diff
Use f_max for bandwidth
parent
766a7ffd
No related branches found
No related tags found
1 merge request
!66
Extend simulator module
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/python_spectrometer/daq/zurich_instruments.py
+26
-22
26 additions, 22 deletions
src/python_spectrometer/daq/zurich_instruments.py
with
26 additions
and
22 deletions
src/python_spectrometer/daq/zurich_instruments.py
+
26
−
22
View file @
f7673194
...
@@ -171,28 +171,14 @@ class ZurichInstrumentsMFLIDAQ(_ZurichInstrumentsDevice):
...
@@ -171,28 +171,14 @@ class ZurichInstrumentsMFLIDAQ(_ZurichInstrumentsDevice):
return
MFLIDAQSettings
return
MFLIDAQSettings
def
setup
(
self
,
bandwidth
:
Union
[
str
,
float
]
=
'
auto
'
,
filter_order
:
Optional
[
int
]
=
None
,
def
setup
(
self
,
filter_order
:
Optional
[
int
]
=
None
,
freq
:
float
=
50
,
freq
:
float
=
50
,
**
settings
:
Mapping
)
->
Dict
[
str
,
Any
]:
**
settings
:
Mapping
)
->
Dict
[
str
,
Any
]:
r
"""
Sets up the daq module to acquire time series data.
r
"""
Sets up the daq module to acquire time series data.
See [1]_ for information on lock-in measurements.
See [1]_ for information on lock-in measurements.
Parameters
Parameters
----------
----------
bandwidth : Union[str, float], optional
The demodulator noise-equivalent power (NEP) bandwidth.
The default is
'
auto
'
, in which case it is set to f_max/2.
The bandwidth is related to the time constant of the RC
filter by
.. math::
\tau = \frac{\Gamma\left(n - \frac{1}{2}\right)}
{4\sqrt{\pi}f_\mathrm{NEP}\Gamma(n)},
where :math:`n` is the filter order
filter_order : int, optional
filter_order : int, optional
The filter order. Not changed if not given.
The filter order. Not changed if not given.
freq : float, optional
freq : float, optional
...
@@ -211,9 +197,23 @@ class ZurichInstrumentsMFLIDAQ(_ZurichInstrumentsDevice):
...
@@ -211,9 +197,23 @@ class ZurichInstrumentsMFLIDAQ(_ZurichInstrumentsDevice):
**settings : Mapping
**settings : Mapping
Additional settings for data acqusition.
Additional settings for data acqusition.
Notes
-----
The demodulator 3 dB bandwidth is chosen as $f_\text{max}$. The
noise-equivalent power (NEP) bandwidth is related to the time
constant of the RC filter by
.. math::
\tau = \frac{\Gamma\left(n - \frac{1}{2}\right)}
{4\sqrt{\pi}f_\mathrm{NEP}\Gamma(n)},
where :math:`n` is the filter order. By default, it is set to
``fs/4``.
Raises
Raises
------
------
RuntimeError
RuntimeError
:
If settings are incompatible with the hardware.
If settings are incompatible with the hardware.
Returns
Returns
...
@@ -226,18 +226,22 @@ class ZurichInstrumentsMFLIDAQ(_ZurichInstrumentsDevice):
...
@@ -226,18 +226,22 @@ class ZurichInstrumentsMFLIDAQ(_ZurichInstrumentsDevice):
.. [1] https://www.zhinst.com/europe/en/resources/principles-of-lock-in-detection
.. [1] https://www.zhinst.com/europe/en/resources/principles-of-lock-in-detection
"""
"""
settings
=
self
.
DAQSettings
(
freq
=
freq
,
**
settings
).
to_consistent_dict
()
settings
=
self
.
DAQSettings
(
freq
=
freq
,
**
settings
)
if
'
bandwidth
'
in
settings
:
warnings
.
warn
(
'
The bandwidth parameter has been replaced by f_max
'
,
DeprecationWarning
)
if
bandwidth
==
'
auto
'
:
if
'
f_max
'
not
in
settings
:
bandwidth
=
settings
[
'
f_max
'
]
/
2
settings
.
f_max
=
settings
.
fs
/
4
if
filter_order
:
if
filter_order
is
not
None
:
self
.
device
.
demods
[
self
.
demod
].
order
(
int
(
filter_order
))
self
.
device
.
demods
[
self
.
demod
].
order
(
int
(
filter_order
))
# BW 3dB = √(2^(1/n) - 1) / 2πτ
# BW 3dB = √(2^(1/n) - 1) / 2πτ
# BW NEP = Γ(n - 1/2) / 4τ √(π)Γ(n)
# BW NEP = Γ(n - 1/2) / 4τ √(π)Γ(n)
n
=
self
.
device
.
demods
[
self
.
demod
].
order
()
n
=
self
.
device
.
demods
[
self
.
demod
].
order
()
tc
=
gamma
(
n
-
0.5
)
/
(
4
*
bandwidth
*
np
.
sqrt
(
np
.
pi
)
*
gamma
(
n
))
tc
=
gamma
(
n
-
0.5
)
/
(
4
*
settings
[
'
f_max
'
]
*
np
.
sqrt
(
np
.
pi
)
*
gamma
(
n
))
# Do not use context manager here because somehow settings can get lost
# Do not use context manager here because somehow settings can get lost
# with device.set_transaction():
# with device.set_transaction():
...
...
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