23g: amplitude sweep attempt inconclusive (phase-stability control needed); scripts committed

This commit is contained in:
2026-08-23 22:30:39 +03:00
parent 70cafc1700
commit c3656975dd
2 changed files with 52 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
#!/usr/bin/env python3
"""amseries.py — amplitude sweep via rendersnap: scratch vs input level.
Gives ka = d(scr)/d(ln am) of the log-domain law."""
import glob
import subprocess
import sys
import numpy as np
CASES = [('t_-24', -24.0), ('t_-12', -12.0), ('t_0', 0.0), ('t_24', 24.0)]
def steady(tag):
fs = sorted(glob.glob('/tmp/opencode/rendersnap/phase*.npz'))
for f in fs[::-1]:
z = np.load(f)
sc = z['0x540628']
if sc[85] < -1e-4:
return float(sc[85]), float(sc[85])
return None
def main():
out = []
for tag, db in CASES:
rpp = f'/tmp/opencode/{tag}.rpp'
subprocess.run(['timeout', '100', 'python3',
'/home/m/re-tools/scripts/rendersnap.py', rpp],
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
st = steady(tag)
if st:
out.append((db, st))
print(tag, db, 'scr43=%.4f scr171=%.4f' % st, flush=True)
else:
print(tag, 'NO STEADY', flush=True)
if len(out) >= 2:
(d1, s1), (d2, s2) = out[0], out[-1]
ka = (s2[0] - s1[0]) / ((d2 - d1) * np.log(10) / 20)
ka171 = (s2[1] - s1[1]) / ((d2 - d1) * np.log(10) / 20)
print('ka(d scr/d ln am) @85: %.4f' % ka)
pass
if __name__ == '__main__':
main()