24k: application law EXACT — cutA=1.8345*cutV+0.1615dB (rms 0.0025dB, 8 drive levels); x1.805 = exponent product 0.984x1.8345; single instance confirmed; R-slots static; probe-multitone method
This commit is contained in:
+17
-4
@@ -18,7 +18,7 @@ import time
|
||||
|
||||
import numpy as np
|
||||
|
||||
SLOTS = [0x540668]
|
||||
SLOTS = [0x540668, 0x540678, 0x540688, 0x540788, 0x5407f8]
|
||||
NARR = 8194
|
||||
SCAL_OFF = 0x540860
|
||||
SCAL_N = 24 # floats -> 0x540860..0x5408c0
|
||||
@@ -42,6 +42,8 @@ def find_host():
|
||||
def main():
|
||||
rpp = sys.argv[1] if len(sys.argv) > 1 else '/home/m/soothe-bt/dual_b1q_0.5.rpp'
|
||||
cap = int(sys.argv[2]) if len(sys.argv) > 2 else 200
|
||||
global OUT
|
||||
OUT = sys.argv[3] if len(sys.argv) > 3 else OUT
|
||||
os.makedirs(OUT, exist_ok=True)
|
||||
subprocess.run("pkill -9 -x reaper; pkill -9 -f '[y]abridge'; "
|
||||
"rm -rf /run/user/1000/yabridge-soothe2_x64-*; sleep 1", shell=True)
|
||||
@@ -148,9 +150,20 @@ def main():
|
||||
arr = np.frombuffer(fb[:2049 * 8], dtype='<f4')
|
||||
mag = np.hypot(arr[0::2], arr[1::2])
|
||||
sv = np.frombuffer(scal, dtype='<f4')
|
||||
np.savez_compressed(f'{OUT}/ph{saved:03d}.npz',
|
||||
fir_re=arr[0::2].copy(), fir_im=arr[1::2].copy(),
|
||||
scal=sv.copy())
|
||||
store = {'fir_re': arr[0::2].copy(), 'fir_im': arr[1::2].copy(),
|
||||
'scal': sv.copy()}
|
||||
for off in SLOTS[1:]:
|
||||
q = rd(ctx + off, 8)
|
||||
if not q:
|
||||
continue
|
||||
ptr = struct.unpack('<Q', q)[0]
|
||||
if ptr < 0x10000:
|
||||
continue
|
||||
ab = rd(ptr, NARR * 4)
|
||||
if ab:
|
||||
store[hex(off)] = np.frombuffer(ab, dtype='<f4').astype(np.float32)
|
||||
np.savez_compressed(f'{OUT}/ph{saved:03d}.npz', t_snap=time.time() - t0,
|
||||
**store)
|
||||
print('PH%03d t=%.2f fir43=%.4f fir171=%.4f | s888=%.6f s88c=%.6f s874=%.6f s87c=%.6f s870=%.3f' %
|
||||
(saved, time.time() - t0, mag[43], mag[171],
|
||||
sv[10], sv[11], sv[5], sv[7], sv[4]), flush=True)
|
||||
|
||||
Reference in New Issue
Block a user