mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
small fft fix which caused problems with waterfall view
This commit is contained in:
parent
8913f81b79
commit
85d2f36e36
1 changed files with 2 additions and 5 deletions
|
@ -874,7 +874,7 @@ class RF:
|
||||||
# Have to do this when we are not transmitting so our
|
# Have to do this when we are not transmitting so our
|
||||||
# own sending data will not affect this too much
|
# own sending data will not affect this too much
|
||||||
if not static.TRANSMITTING:
|
if not static.TRANSMITTING:
|
||||||
dfft[dfft > avg + 10] = 100
|
dfft[dfft > avg + 15] = 100
|
||||||
|
|
||||||
# Calculate audio dbfs
|
# Calculate audio dbfs
|
||||||
# https://stackoverflow.com/a/9763652
|
# https://stackoverflow.com/a/9763652
|
||||||
|
@ -917,15 +917,12 @@ class RF:
|
||||||
# Check for signals higher than average by checking for "100"
|
# Check for signals higher than average by checking for "100"
|
||||||
# If we have a signal, increment our channel_busy delay counter
|
# If we have a signal, increment our channel_busy delay counter
|
||||||
# so we have a smoother state toggle
|
# so we have a smoother state toggle
|
||||||
if np.sum(dfft[dfft > avg + 10]) >= 400 and not static.TRANSMITTING:
|
if np.sum(dfft[dfft > avg + 15]) >= 400 and not static.TRANSMITTING:
|
||||||
static.CHANNEL_BUSY = True
|
static.CHANNEL_BUSY = True
|
||||||
# Limit delay counter to a maximum of 250. The higher this value,
|
# Limit delay counter to a maximum of 250. The higher this value,
|
||||||
# the longer we will wait until releasing state
|
# the longer we will wait until releasing state
|
||||||
channel_busy_delay = min(channel_busy_delay + 10, 250)
|
channel_busy_delay = min(channel_busy_delay + 10, 250)
|
||||||
else:
|
else:
|
||||||
# if transmitting set busy delay to 0 for avoiding too much false positives
|
|
||||||
if static.TRANSMITTING:
|
|
||||||
channel_busy_delay = 0
|
|
||||||
# Decrement channel busy counter if no signal has been detected.
|
# Decrement channel busy counter if no signal has been detected.
|
||||||
channel_busy_delay = max(channel_busy_delay - 1, 0)
|
channel_busy_delay = max(channel_busy_delay - 1, 0)
|
||||||
# When our channel busy counter reaches 0, toggle state to False
|
# When our channel busy counter reaches 0, toggle state to False
|
||||||
|
|
Loading…
Reference in a new issue