MCPcopy Create free account
hub / github.com/PyTTaMaster/PyTTa / arr2dB

Function arr2dB

pytta/utils/maths.py:68–83  ·  view source on GitHub ↗

Calculate the decibel level of an array of data. Arguments --------- arr (np.array): Array of data. power (bool, optional): If it's power data. Defaults to False. ref (float, optional): Decibel reference. Defaults to 1.. Returns ------- float: D

(arr: np.array, power: bool = False, ref: float = 1.)

Source from the content-addressed store, hash-verified

66
67@nb.njit
68def arr2dB(arr: np.array, power: bool = False, ref: float = 1.) -> float:
69 """
70 Calculate the decibel level of an array of data.
71
72 Arguments
73 ---------
74 arr (np.array): Array of data.
75 power (bool, optional): If it's power data. Defaults to False.
76 ref (float, optional): Decibel reference. Defaults to 1..
77
78 Returns
79 -------
80 float: Decibel scaled value.
81
82 """
83 return rms2dB(arr2rms(arr), power, ref)
84
85
86def fft_degree(timeLength: float = 0, samplingRate: int = 1) -> float:

Callers

nothing calls this directly

Calls 2

rms2dBFunction · 0.85
arr2rmsFunction · 0.85

Tested by

no test coverage detected