Chebyshev Approximation Reference

This example demonstrates how to use ChebConvolve to approximate a standard band-pass filter. It serves as a reference to verify that the polynomial approximation converges to the same spatial result as the analytical solver.

Chebyshev Approximation vs. Analytical Solver
import sgwt
from sgwt import ChebyConvolve, DyConvolve, impulse
from sgwt import IMPEDANCE_TEXAS as L

SCALES =  [0.1, 1.0, 10.0]
ORDER = 300
XMIN = 1e-3

def f(x): 
    return np.stack([
        sgwt.functions.bandpass(x, scale=s, order=2) for s in SCALES], 
    axis=1)

kernel = sgwt.ChebyKernel.from_function_on_graph(L, f, ORDER, min_lambda=XMIN)

X = impulse(L, n=600) 

with ChebyConvolve(L) as conv_cheb:
    Y_cheb = conv_cheb.convolve(X, kernel)

with DyConvolve(L, [1.0/s for s in SCALES]) as conv: 
    Y_dy = conv.bandpass(X, order=2)

Chebyshev Convolution Comparison