Stage 0 complete: walking human detected via RSSI (spread 3->12dB, ~3dB body shadow); windowed analyzer
This commit is contained in:
parent
47a32ad369
commit
67503f2606
2 changed files with 1631 additions and 0 deletions
1605
dataset/stage0_walk1.csv
Normal file
1605
dataset/stage0_walk1.csv
Normal file
File diff suppressed because it is too large
Load diff
26
tools/stage0/analyze.py
Executable file
26
tools/stage0/analyze.py
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Windowed stats over an RSSI capture CSV (stage 0)."""
|
||||
import csv
|
||||
import sys
|
||||
|
||||
path = sys.argv[1] if len(sys.argv) > 1 else 'dataset/stage0_walk1.csv'
|
||||
win = int(sys.argv[2]) if len(sys.argv) > 2 else 10
|
||||
|
||||
rows = []
|
||||
for r in csv.reader(open(path)):
|
||||
if len(r) == 3 and r[2] != 'dbm':
|
||||
rows.append((float(r[1]), int(r[2])))
|
||||
|
||||
if not rows:
|
||||
sys.exit('no data rows')
|
||||
print(f'{path}: {len(rows)} samples, span {rows[-1][0]:.0f}s')
|
||||
print(' window mean spread std')
|
||||
for w in range(0, int(rows[-1][0]) + 1, win):
|
||||
v = [d for t, d in rows if w <= t < w + win]
|
||||
if not v:
|
||||
continue
|
||||
m = sum(v) / len(v)
|
||||
sd = (sum((x - m) ** 2 for x in v) / len(v)) ** 0.5
|
||||
sp = max(v) - min(v)
|
||||
print(f'{w:3d}-{w + win:3d}s {m:6.1f} {sp:5d} {sd:5.2f} '
|
||||
+ '#' * int(max(1, sp)))
|
||||
Loading…
Reference in a new issue