The signal extraction on the spectrogram relies on a linear search.
|
# loop down until threshold is undershot |
|
start = ti |
|
start_min = 0 if self._spectrogram_last is None else -len(self._spectrogram_last[0]) |
|
while start > start_min: |
|
if start < 0: |
|
power = self._spectrogram_last[fi, start] |
|
else: |
|
power = fft[start] |
|
|
|
if power < self.signal_threshold: |
|
break |
|
|
|
start -= 1 |
|
|
|
# loop up until threshold is undershot |
|
end = ti |
|
while end < len(fft): |
|
if fft[end] < self.signal_threshold: |
|
ti_skip = end |
|
break |
|
|
|
end += 1 |
When using binary search, a significant performance gain in low signal thresholds can be expected.
The signal extraction on the spectrogram relies on a linear search.
pyradiotracking/radiotracking/analyze.py
Lines 175 to 196 in a6e953d
When using binary search, a significant performance gain in low signal thresholds can be expected.