Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parameters of auto interpretation for better PSK detection #649

Merged
merged 5 commits into from
May 5, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
catch error and improve value
jopohl committed May 5, 2019
commit 77af8101429e5f1624c724d4b629ed1d1af7c762
4 changes: 2 additions & 2 deletions src/urh/ainterpretation/AutoInterpretation.py
Original file line number Diff line number Diff line change
@@ -148,7 +148,7 @@ def detect_modulation(data: np.ndarray, wavelet_scale=4, median_filter_order=11)
var_filtered_mag = np.var(c_auto_interpretation.median_filter(mag_wavlt, k=median_filter_order))
var_filtered_norm_mag = np.var(c_auto_interpretation.median_filter(norm_mag_wavlt, k=median_filter_order))

if all(v < 0.15 for v in (var_mag, var_norm_mag, var_filtered_mag, var_filtered_norm_mag)):
if all(v < 0.175 for v in (var_mag, var_norm_mag, var_filtered_mag, var_filtered_norm_mag)):
return "OOK"

if var_mag > 1.5 * var_norm_mag:
@@ -206,7 +206,7 @@ def detect_center(rectangular_signal: np.ndarray, max_size=None):

try:
y, x = np.histogram(rect, bins=np.arange(hist_min, hist_max + hist_step, hist_step))
except ZeroDivisionError:
except (ZeroDivisionError, ValueError):
# For a segment with zero variance (constant line) it is not possible to find a center
return None