Convenience functions and classes¶
A few simple functions and classes are defined in the DataLogger package to streamline the implementation of some functionality.
-
cued_datalogger.api.numpy_extensions.to_dB(x)¶ A simple function that converts x to dB:
20*np.log10(x)
-
cued_datalogger.api.numpy_extensions.from_dB(x)¶ A simple function that converts x in dB to a ratio over 1:
10**(x/20)
-
class
cued_datalogger.api.numpy_extensions.MatlabList¶ Bases:
listA list that allows slicing like Matlab.
eg:
l[1, 2, slice(3, 5), slice(10, 20, 2)]Methods
-
cued_datalogger.api.numpy_extensions.sdof_modal_peak(w, wr, zr, cr, phi)¶ Return a modal peak generated from the given parameters.
Parameters: w : ndarray
An array of omega (angular frequency) values.
- wr : float
The resonant angular frequency.
- zr : float
The damping factor.
- cr : float
The magnitude of the modal constant.
- phi : float
The phase of the modal constant.
Returns: ndarray
The modal peak.
rac{C_r e^(iphi)}{omega_r^2 + 2izeta_romega_r^2 - omega^2}