Measurement Operators
〰️ Phase Feature
Section titled “〰️ Phase Feature”sim_add_phase_feature_operator(ctx, src, dst, opts)
Extract phase-aligned magnitude features.
threshold(≥0, default 0): magnitude gate.exponent(≥0, default 0): power applied before normalization.accumulate(bool, default false): add instead of overwrite.scale_by_dt(bool, default true): scale when accumulating.
Examples:
sim.sim_add_phase_feature_operator(ctx, signal, feature, { threshold = 0.1})
sim.sim_add_phase_feature_operator(ctx, signal, feature, { exponent = 2.0, accumulate = true})🧩 Minimal Convolution
Section titled “🧩 Minimal Convolution”sim_add_minimal_convolution_operator(ctx, src, dst, opts)
Odd-length 1D convolution.
kernel_taps(enum 3|5|7|9, default 3).kernel(float array/string): coefficients matching tap count.stride(1..16, default 1).wrap(bool, default true) orboundary(enumperiodic|neumann|dirichlet|reflective).accumulate(bool): add instead of overwrite.scale_by_dt(bool): scale when accumulating.
Examples:
sim.sim_add_minimal_convolution_operator(ctx, u, v, { kernel_taps = 5, kernel = "-1,0,0,0,1"})
sim.sim_add_minimal_convolution_operator(ctx, u, v, { kernel = {0.25, 0.5, 0.25}, boundary = "neumann"})Inspect/update minimal convolution at runtime
Section titled “Inspect/update minimal convolution at runtime”sim_minimal_convolution_config(ctx, op_index) -> tablereturns{ kernel_taps, stride, accumulate, wrap, boundary, kernel }.sim_minimal_convolution_update(ctx, op_index, opts) -> trueupdates any subset. Providekernel_taps(3/5/7/9) with a matchingkernelarray/string;boundaryaccepts the same enum assim_add_minimal_convolution_operator.
local cfg = sim.sim_minimal_convolution_config(ctx, op_index)sim.log("conv taps=%d stride=%d boundary=%s", cfg.kernel_taps, cfg.stride, cfg.boundary)
-- Swap in a 5-tap smoothing kernel and stride 2sim.sim_minimal_convolution_update(ctx, op_index, { kernel_taps = 5, kernel = {1, 4, 6, 4, 1}, stride = 2, wrap = false, boundary = "reflective",})🧹 Sieve
Section titled “🧹 Sieve”sim_add_sieve_operator(ctx, src, dst, opts)
Gaussian low/high-pass filter.
mode(enum):low_passorhigh_pass.sigma(>0): Gaussian standard deviation (samples).taps(int): kernel length (odd).accumulate(bool) andscale_by_dt(bool).
Examples:
sim.sim_add_sieve_operator(ctx, src, dst, { mode = "low_pass", sigma = 1.2, taps = 7})
sim.sim_add_sieve_operator(ctx, src, dst, { mode = "high_pass", sigma = 2.0, accumulate = true})