f_hat=gsp_gft(G,f);
G | Graph or Fourier basis |
f | f (signal) |
f_hat | Graph Fourier transform of f |
'gsp_gft(G,f)' computes a graph Fourier transform of the signal \(f\) with respect to the Fourier basis of the graph G: G.U. Alternatively, one can provide directly the Fourier basis instead of the graph G.
To compute the Fourier basis of a graph G, you can use the function:
G = gsp_compute_fourier_basis(G);
Example:
N = 30; G = gsp_sensor(N); G = gsp_compute_fourier_basis(G); f = sin((1:N)'*2*pi/N); fhat = gsp_gft(G,f); gsp_plot_signal_spectral(G,fhat);