Skip to content
Snippets Groups Projects
Verified Commit f7673194 authored by Tobias Hangleiter's avatar Tobias Hangleiter
Browse files

Use f_max for bandwidth

parent 766a7ffd
No related branches found
No related tags found
1 merge request!66Extend simulator module
...@@ -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():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment