mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
catch fft division by zero error
This commit is contained in:
parent
a3f9dd6f45
commit
5be2a88fd0
1 changed files with 2 additions and 0 deletions
|
@ -974,6 +974,8 @@ class RF:
|
||||||
# try except for avoiding runtime errors by division/0
|
# try except for avoiding runtime errors by division/0
|
||||||
try:
|
try:
|
||||||
rms = int(np.sqrt(np.max(d ** 2)))
|
rms = int(np.sqrt(np.max(d ** 2)))
|
||||||
|
if rms == 0:
|
||||||
|
raise ZeroDivisionError
|
||||||
static.AUDIO_DBFS = 20 * np.log10(rms / 32768)
|
static.AUDIO_DBFS = 20 * np.log10(rms / 32768)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.log.warning(
|
self.log.warning(
|
||||||
|
|
Loading…
Reference in a new issue