if (FALSE) {
# Compute the Laplacian matrix and its eigen-decomposition
L <- laplacian_mat(grid1$sA)
decomp <- eigensort(L)
# Randomly select a vertex
vertex_i <- sample(1:nrow(L), 1)
f_sgwt <- localize_sgwt(vertex_i, evalues=decomp$evalues, evectors=decomp$evectors, b=2)
# Select one scale j from f_sgwt.
N <- nrow(grid1$sA)
j <- 5 # change scale j to view other scales
f <- f_sgwt[ ((j-1)*N+1):(j*N)]
# Plot the localized kernel (for the chosen scale) as a signal on the graph
plot_signal(grid1, f)
# Plot the magnitude of the GFT coefficients
barplot(abs(f_gft), main="GFT of Localized Signal",
xlab="Eigenvalue Index", ylab="Magnitude")
}
Run the code above in your browser using DataLab