Filters

The pygsp.filters module implements methods used for filtering and defines commonly used filters that can be applied to pygsp.graphs. A filter is associated to a graph and is defined with one or several functions. We define by filter bank a list of filters, usually centered around different frequencies, applied to a single graph.

Interface

The Filter base class implements a common interface to all filters:

Filter.evaluate(x)

Evaluate the kernels at given frequencies.

Filter.filter(s[, method, order])

Filter signals (analysis or synthesis).

Filter.analyze(s[, method, order])

Convenience alias to filter().

Filter.synthesize(s[, method, order])

Convenience wrapper around filter().

Filter.complement([frame_bound])

Return the filter that makes the frame tight.

Filter.inverse()

Return the pseudo-inverse filter bank.

Filter.compute_frame(**kwargs)

Compute the associated frame.

Filter.estimate_frame_bounds([x])

Estimate lower and upper frame bounds.

Filter.plot([n, eigenvalues, sum, labels, …])

Plot the spectral response of a filter bank.

Filter.localize(i, **kwargs)

Localize the kernels at a node (to visualize them).

Filters

Then, derived classes implement various common graph filters.

Filters that solve differential equations

The following filters solve partial differential equations (PDEs) on graphs, which model processes such as heat diffusion or wave propagation.

Heat(G[, scale, normalize])

Design a filter bank of heat kernels.

Wave(G[, time, speed])

Design a filter bank of wave kernels.

Low-pass filters

Heat(G[, scale, normalize])

Design a filter bank of heat kernels.

Band-pass filters

These filters can be configured to be low-pass, high-pass, or band-pass.

Expwin(G[, band_min, band_max, slope])

Design an exponential window filter.

Rectangular(G[, band_min, band_max])

Design a rectangular filter.

Filter banks of two filters: a low-pass and a high-pass

Regular(G[, degree])

Design 2 filters with the regular construction (tight frame).

Held(G[, a])

Design 2 filters with the Held construction (tight frame).

Simoncelli(G[, a])

Design 2 filters with the Simoncelli construction (tight frame).

Papadakis(G[, a])

Design 2 filters with the Papadakis construction (tight frame).

Filter banks composed of dilated or translated filters

Abspline(G[, Nf, lpfactor, scales])

Design an A B cubic spline wavelet filter bank.

HalfCosine(G[, Nf])

Design an half cosine filter bank (tight frame).

Itersine(G[, Nf, overlap])

Design an itersine filter bank (tight frame).

MexicanHat(G[, Nf, lpfactor, scales, normalize])

Design a filter bank of Mexican hat wavelets.

Meyer(G[, Nf, scales])

Design a filter bank of Meyer wavelets (tight frame).

SimpleTight(G[, Nf, scales])

Design a simple tight frame filter bank (tight frame).

Filter banks for vertex-frequency analyzes

Those filter banks are composed of shifted versions of a mother filter, one per graph frequency (Laplacian eigenvalue). They can analyze frequency content locally, as a windowed graph Fourier transform.

Gabor(graph, kernel)

Design a filter bank with a kernel centered at each frequency.

Modulation(graph, kernel[, modulation_first])

Design a filter bank with a kernel centered at each frequency.

Approximations

Moreover, two approximation methods are provided for fast filtering. The computational complexity of filtering with those approximations is linear with the number of edges. The complexity of the exact solution, which is to use the Fourier basis, is quadratic with the number of nodes (without taking into account the cost of the necessary eigendecomposition of the graph Laplacian).

Chebyshev polynomials

compute_cheby_coeff(f[, m, N])

Compute Chebyshev coefficients for a Filterbank.

compute_jackson_cheby_coeff(filter_bounds, …)

To compute the m+1 coefficients of the polynomial approximation of an ideal band-pass between a and b, between a range of values defined by lambda_min and lambda_max.

cheby_op(G, c, signal, **kwargs)

Chebyshev polynomial of graph Laplacian applied to vector.

cheby_rect(G, bounds, signal, **kwargs)

Fast filtering using Chebyshev polynomial for a perfect rectangle filter.

Lanczos algorithm

lanczos(A, order, x)

TODO short description

lanczos_op(f, s[, order])

Perform the lanczos approximation of the signal s.