Created
June 2, 2022 23:23
-
-
Save jinschoi/8396f25a4cb7ac7986a7d881026ae950 to your computer and use it in GitHub Desktop.
Plot a histogram of Flipper raw .sub files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import sys | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
filename = sys.argv[1] | |
segs = [] | |
with open(filename, 'r') as f: | |
for line in f: | |
m = re.match(r'RAW_Data:\s*([-0-9 ]+)\s*$', line) | |
if m: | |
segs.extend(abs(int(seg)) for seg in m[1].split(r' ')) | |
series = pd.Series(segs) | |
# Get rid of outliers | |
series = series[series < 5000] | |
series.plot.hist(bins=100) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@jinschoi checkout https://github.com/evilpete/flipper_toolbox/blob/main/subghz_histogram.py
it's an updated version that plots positive / negative timings separately
(I've noticed discrepancies with flipper raw FSK sampling where negative segments are shorter then they should be )