GSP_DEMO - Tutorial on the GSPBox

Description

In this demo, we are going to show the basic operations of the GSPBox.
To lauch the toolbox, just go into the repository where the GSPBox was
extracted and type:

gsp_start;

A banner will popup telling you that everything happens correctly. To
speedup some processing, you might want to compile some mexfile. Refer
to gsp_make for more informations. However, if the compilation is not
working on your computer, keep quiet, everything should still work and
most of the routine are implemented only in matlab.

Most likely, the first thing you would like to do is to create a graph.
To do so, you only need the adjacendy or the weight matrix \(W\). Once
you have it, you can construct a graph using:

G = gsp_graph(W);

This function will create a full structure ready to be used with the
toolbox. To know a bit more about what is in this structure, you can
refer to the help of the function gsp_graph_default_parameters.

The GSPBox contains also a list of graph generators. To see a full list
of these graphs, type:

In the folder 'plotting', the GSPBox contains some plotting routine.
For instance, we can plot a graph using:

gsp_plot_graph(G);

GSP graph

This figure shows the result of the command 'gsp_plot_graph(G)'

Wonderful! Isn't it? Now, let us start to analyse this graph. To compute
graph Fourier transform or exact graph filtering, you need to
precompute the Fourier basis of the graph. This operation could be
relatively long since it involves a full diagonalization of the
Laplacian. Don't worry, you do not need to perform this operation to
filter signals on graph. The fourier basis is computed by:

Now, we are going to show a basic filtering operation. Filters are usually
defined in the spectral domain. To define the following filter

\begin{equation*}
h(x) =\frac{1}{1+\tau x},
\end{equation*}

just write in Matlab:

tau = 1;
h = @(x) 1./(1+tau*x);

Hint: You can define filterbank using cell array!

Let's display this filter:

gsp_plot_filter(G,h);

Low pass filter \(h\)

The filter \(h\) is plotted along all the spectrum of the graph.
The black cross are the eigenvalues of the Laplacian. They are the
points where the continuous filter will be evaluated to create a
discrete filter.

To apply the filter to a given signal, you only need to run a single
function: