Shunyaya Symbolic Mathematics — Convolution & correlation (scalar kernels) (2.48)

Abstract
We lift discrete/continuous convolution and correlation to symbolic numerals (m, a) by computing the classical operation on magnitudes and attaching an alignment tag via a rapidity-weighted mean of contributors. This preserves linearity and the convolution/correlation theorems on the magnitude channel while keeping stability metadata audit-ready. Under collapse phi(m,a) = m, all results reduce exactly to the classical formulas.


Definitions (magnitude first, alignment summary)

Discrete-time convolution

For x[n] = (m_x[n], a_x[n]) and a scalar kernel k[n] (classical; tagged (k[n], +1)),

y[n] = (m_y[n], a_y[n])

m_y[n] = Σ_r  k[r] * m_x[n - r]

u_x[n] = atanh( clamp(a_x[n], -1+eps, +1-eps) ),   eps = 1e-6
w_r(n) = | k[r] | * | m_x[n - r] |^gamma          # gamma >= 0 (default 1)

u_y[n] = ( Σ_r  w_r(n) * u_x[n - r] ) / ( Σ_r  w_r(n) )      if Σ w_r(n) > 0
a_y[n] = tanh( u_y[n] )

Continuous-time convolution

For x(t) = (m_x(t), a_x(t)) and scalar kernel k(t),

m_y(t) = ∫ k(τ) * m_x(t - τ) dτ
w(τ; t) = | k(τ) | * | m_x(t - τ) |^gamma
u_y(t)  =  ( ∫ w(τ; t) * u_x(t - τ) dτ ) / ( ∫ w(τ; t) dτ )
a_y(t)  = tanh( u_y(t) )

Why absolute-weights? Using |k| prevents cancellation from oscillatory kernels from corrupting the stability tag; it mirrors physical “load” on the output.

Options (manifest):

align.weights     = "|k|*|m|^gamma"   # default
align.gamma       = 1                 # 0 for kernel-only weighting
align.fallback    = "mean_u" | "+1"   # when Σ weights = 0


Correlation (cross and auto)

Discrete cross-correlation

For x[n], y[n],

R_xy[ℓ] = ( M_xy[ℓ] , a_xy[ℓ] )

M_xy[ℓ] = Σ_n  m_x[n] * m_y[n + ℓ]

u_pair[n,ℓ] = u_x[n] + u_y[n + ℓ]         # product term (M2 on per-term product)
w_n(ℓ)      = | m_x[n] * m_y[n + ℓ] |

u_xy[ℓ] = ( Σ_n w_n(ℓ) * u_pair[n,ℓ] ) / ( Σ_n w_n(ℓ) )
a_xy[ℓ] = tanh( u_xy[ℓ] )

Autocorrelation R_xx[ℓ] follows by setting y = x. Continuous-time forms use integrals.

Link to spectra (magnitude channel): by Wiener–Khinchin, the PSD is the Fourier transform of the autocorrelation of m. Alignment diagnostics can use the rapidity spectrum from 2.25.


Properties (magnitude channel) and collapse

  • Linearity: convolution/correlation are linear in m.
  • Shift/scale: standard theorems hold for m.
  • Convolution theorem: F{m_x * k} = F{m_x} · F{k}.
  • Collapse: if all a = +1, then a_y = +1 and the outputs are exactly classical.

Alignment tags are summaries; they do not alter any magnitude identities.


Filter stability and guards

  • BIBO stability (magnitude): discrete Σ_r |k[r]| < ∞ or continuous ∫ |k(τ)| dτ < ∞.
  • Normalization: moving-average/low-pass kernels often satisfy Σ k[r] = 1 (or ∫ k = 1).
  • Signs/oscillation: kernels with negative lobes are allowed; weights use |k| by default to ensure nonnegative averaging.
  • Boundary handling (discrete): conv.mode = "full" | "same" | "valid" conv.pad = "zero" (default, pad magnitude 0 with (0,+1) tag) | "reflect" | "wrap"
  • Causality: for real-time filtering use k[r]=0 for r<0; otherwise declare noncausal.

Worked examples

A) 3-point moving average (discrete).
k = [1/3, 1/3, 1/3]. Around index n0, suppose

x[n0-1] = (1,  0.3)   → u ≈  0.3095
x[n0]   = (4,  0.8)   → u ≈  1.0986
x[n0+1] = (7, -0.2)   → u ≈ -0.2027

Magnitude:

m_y[n0] = (1 + 4 + 7)/3 = 4

Weights (gamma=1): (1/3)*|1|, (1/3)*|4|, (1/3)*|7| = (0.333, 1.333, 2.333), sum = 4.0.
Alignment:

u_y = (0.333*0.3095 + 1.333*1.0986 + 2.333*(-0.2027)) / 4.0 ≈ 0.2739
a_y = tanh(0.2739) ≈ 0.267
Result: y[n0] ≈ ( 4.000 , 0.267 )

B) Exponential moving average (causal, discrete).
y[n] = α m_x[n] + (1-α) m_y[n-1], α = 0.2. Take

x[n]     = (5, 0.1)   → u_x ≈ 0.1003
y[n-1]   = (4, 0.7)   → u_prev ≈ 0.8673

Magnitude:

m_y[n] = 0.2*5 + 0.8*4 = 4.2

Weights: 1.0 and 3.2.
Alignment:

u_y = (1.0*0.1003 + 3.2*0.8673)/4.2 ≈ 0.684
a_y = tanh(0.684) ≈ 0.594
Result: y[n] ≈ ( 4.2 , 0.594 )

C) Cross-correlation at lag 0 (length-2).

x = [(1,0.9), (2,0.3)]     → u ≈ (1.4722, 0.3095)
y = [(2,0.2), (1,0.8)]     → u ≈ (0.2027, 1.0986)

Magnitude:

M_xy[0] = 1*2 + 2*1 = 4

Alignment (two terms, equal weights 2 and 2):

u_pair1 = 1.4722 + 0.2027 = 1.6749
u_pair2 = 0.3095 + 1.0986 = 1.4081
u_xy[0] = (2*1.6749 + 2*1.4081)/4 ≈ 1.5415
a_xy[0] = tanh(1.5415) ≈ 0.912
Result: R_xy[0] ≈ ( 4 , 0.912 )


Options and extensions (manifest)

conv.type            = "discrete" | "continuous"
align.weights        = "|k|*|m|^gamma"     # gamma = 1 default
align.gamma          = 1
align.parameter_dep  = false               # true to include kernel shape at each eval
conv.mode            = "full" | "same" | "valid"
conv.pad             = "zero" | "reflect" | "wrap"
causal               = true | false
kernel.normalize     = true | false        # Σ k = 1 (or ∫ k = 1)
stability.check      = "L1"                # BIBO: Σ|k| < ∞ or ∫|k| < ∞
diagnostics          = "rapidity_spectrum" # compute A_u(ω) as in 2.25 (optional)
zero_policy          = "canonical_zero"    # (0,+1) for exact zeros

Alternative weight modes (advanced):

  • "kernel_only": w = |k| — useful to expose the filter’s structural footprint independent of signal scale.
  • "signed_pairs" (correlation): weights = |m_x m_y| but form per-term rapidities as u_x + u_y; keep denominator positive (use absolute weights).

Takeaway

Convolution and correlation in SSM keep the classical magnitude math and add a principled, reproducible alignment summary via rapidity-weighted means. This preserves linear systems theory on magnitudes (linearity, BIBO, convolution/correlation theorems) while making stability drift traceable through filtering and pattern matching. Under collapse (a = +1), everything is classical.


Navigation
Previous → Vector/matrix-valued functions (2.47)
Next →


Disclaimer
Observation only. Results reproduce mathematically; domain claims require independent peer review. Defaults: mult_mode = M2, clamp_eps = 1e-6, |a| < 1; convolution/correlation alignments use rapidity-weighted means with declared weights. All formulas are presented in plain text. Collapse uses phi(m,a) = m.