/ concept-collection / ephys_compression_tests
concept-collection / ephys_compression_tests
update lpc param
Jeremy Magland <jmagland@flatironinstitute.org> committed commit 426128a1d95d parent 703723c Browse files
1 changed file+4−4
python/ephys_compression_tests/algorithms/ans/__init__.pymodified+4−4View file
@@ -7,7 +7,7 @@ from ...types import Algorithm
77 # Adapter functions
88 def encode_lpc(data: np.ndarray, order: int):
99 """Encode using LPC model - adapter for lpc_numba."""
10- coeffs, initial_points = lpc_numba.fit_lpc_model(data, k=order)
10+ coeffs, initial_points = lpc_numba.fit_lpc_model(data, k=order, subsample_factor=100, min_samples=2000)
1111 residuals_full = lpc_numba.compute_residuals(data, coeffs, initial_points)
1212 # Extract residuals excluding the initial points (first 'order' rows)
1313 residuals = residuals_full[order:, :]
@@ -19,7 +19,7 @@ def encode_lpc(data: np.ndarray, order: int):
1919 def encode_lpc_lossy(data: np.ndarray, order: int, step: int):
2020 """Encode using LPC model with lossy quantization - adapter for lpc_numba."""
2121 # Fit the LPC model
22- coeffs, initial_points = lpc_numba.fit_lpc_model(data, k=order)
22+ coeffs, initial_points = lpc_numba.fit_lpc_model(data, k=order, subsample_factor=100, min_samples=2000)
2323
2424 # Compute residuals with quantization
2525 residuals_full = lpc_numba.compute_residuals_lossy(data, coeffs, initial_points, step=step)
@@ -318,7 +318,7 @@ for a in algorithm_dicts_base:
318318 return reconstructed
319319 algorithm_dicts.append({
320320 "name": a["name"] + f"-lpc{order}",
321- "version": a["version"] + f".3",
321+ "version": a["version"] + f".4",
322322 "encode": encode0_lpc,
323323 "decode": decode0_lpc,
324324 "description": a["description"] + f" with auto-regressive prediction encoding of order {order}",
@@ -361,7 +361,7 @@ for lpc_order in [2, 8]:
361361 return decode0_lpc_lossy
362362 algorithm_dicts.append({
363363 "name": f"ans-lpc{lpc_order}-lossy-tol{tolerance}",
364- "version": "12",
364+ "version": "13",
365365 "encode": make_encode_lpc_lossy(),
366366 "decode": make_decode_lpc_lossy(),
367367 "description": f"ANS with lossy linear predictive coding of order {lpc_order} and tolerance {tolerance}",