B.11: LUT-кривая уровень->маска извлечена (rmse 0.072 dB, 36 точек, 3 уровня): коллапс dual+t1kq+t1k на ОДНУ кривую x=log10(L0/res); степенной закон C~L0^p НЕ работает на 0dB (p_eff 0.19 vs 0.085) - LUT насыщающая gamma из FUN_180563440 (param_1+0x188); форма резонанса стабильна; model_lut.py канонический + roadmap B.11
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
#!/usr/bin/env python3
|
||||
"""verify_lut3.py — LUT-кривая с узлами в колене (x=0.574/0.61), форма B.10."""
|
||||
import numpy as np
|
||||
from scipy.interpolate import PchipInterpolator
|
||||
|
||||
FS = 44100.0
|
||||
DEPTH = 0.8639736175537109
|
||||
QS = [0.1, 0.2, 0.3, 0.5, 0.7, 1.0, 1.5, 2.0, 3.0, 5.0, 10.0]
|
||||
DUAL = np.array([(10.220, 15.224), (10.219, 13.963), (10.219, 12.947),
|
||||
(10.219, 11.725), (10.218, 11.119), (10.216, 10.689),
|
||||
(10.210, 10.412), (10.203, 10.305), (10.182, 10.225),
|
||||
(10.113, 10.183), (9.822, 10.165)])
|
||||
FCS = [800.0, 900.0, 950.0, 1000.0, 1050.0, 1100.0, 1200.0]
|
||||
T1KQ = np.array([7.868, 8.536, 8.726, 8.788, 8.729, 8.575, 8.115])
|
||||
T1K = np.array([14.548, 15.332, 15.553, 15.626, 15.557, 15.378, 14.840])
|
||||
L_DUAL = 10 ** (-7.142 / 20)
|
||||
L_T1KQ = 10 ** (-18.063 / 20)
|
||||
L_T1K = 1.0
|
||||
TILT = {500: 1.414, 1000: 1.454, 2000: 1.795}
|
||||
Q, G = 0.900, 4.132
|
||||
|
||||
# узлы: (-0.75,0.4453) (-0.5,0.4551) (-0.25,0.4784) (0,0.5041) (0.25,0.5331)
|
||||
# (0.308,0.540?) (0.5,0.5715) (0.574,0.566) (0.61,0.647) (0.75,0.657) (1.0,0.664)
|
||||
LUTX = np.array([-0.75, -0.50, -0.25, 0.00, 0.25, 0.50, 0.574, 0.61, 0.75, 1.00])
|
||||
LUTY = np.array([0.4453, 0.4551, 0.4784, 0.5041, 0.5331, 0.5715, 0.5660, 0.6470, 0.6574, 0.6636])
|
||||
lut = PchipInterpolator(LUTX, LUTY)
|
||||
|
||||
|
||||
def res_at(ft, fc, Q, g):
|
||||
w0 = fc * 2 * np.pi / FS
|
||||
c, s = np.cos(w0), np.sin(w0)
|
||||
p = (s * 0.5) / Q
|
||||
a, a2 = p * g, p / g
|
||||
A = [a + 1, -2 * c, 1 - a]
|
||||
B = [a2 + 1, -2 * c, 1 - a2]
|
||||
w = 2 * np.pi * ft / FS
|
||||
z = np.exp(-1j * w)
|
||||
return np.abs(2.0 * (B[0] + B[1] * z + B[2] * z * z) /
|
||||
(A[0] + A[1] * z + A[2] * z * z))
|
||||
|
||||
|
||||
def red(x, tilt):
|
||||
C = DEPTH * tilt * lut(x)
|
||||
return -20 * np.log10(max(1 - C, 1e-9))
|
||||
|
||||
|
||||
def run():
|
||||
preds, meas, tags = [], [], []
|
||||
for i, q in enumerate(QS):
|
||||
for f, m in ((500, DUAL[i, 0]), (2000, DUAL[i, 1])):
|
||||
p = red(np.log10(L_DUAL / res_at(f, 500, q, G)), TILT[f])
|
||||
preds.append(p); meas.append(m); tags.append(f'dual{q}@{f}')
|
||||
for i, fc in enumerate(FCS):
|
||||
r = res_at(1000, fc, 0.9999978, G)
|
||||
preds.append(red(np.log10(L_T1KQ / r), TILT[1000])); meas.append(T1KQ[i]); tags.append(f't1kq{fc}')
|
||||
preds.append(red(np.log10(L_T1K / r), TILT[1000])); meas.append(T1K[i]); tags.append(f't1k{fc}')
|
||||
preds = np.array(preds); meas = np.array(meas)
|
||||
rmse = np.sqrt(np.mean((preds - meas) ** 2))
|
||||
print(f'rmse={rmse:.4f} dB')
|
||||
for t, m, p in zip(tags, meas, preds):
|
||||
if abs(p - m) > 0.15:
|
||||
print(f' {t:12s} {m:7.3f}/{p:7.3f} ({p - m:+.3f})')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
run()
|
||||
Reference in New Issue
Block a user