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.)
| 66 | |
| 67 | @nb.njit |
| 68 | def 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 | |
| 86 | def fft_degree(timeLength: float = 0, samplingRate: int = 1) -> float: |