Learn R Programming

GSD (version 1.0.0)

gfdecomp: Graph Fourier Decomposition

Description

This function performs the graph Fourier decomposition.

Usage

gfdecomp(graph, K)

Value

fc

list of frequency components according to the frequencies with fc[[1]] the lowest-frequency component.

residue

residue signal after extracting frequency components.

Arguments

graph

an igraph graph object with vertex attributes of coordinates x, y, a signal z, and edge attribute of weight.

K

specifies the number of frequency components.

Details

This function performs the graph Fourier decomposition.

References

Ortega, A., Frossard, P., Kovačević, J., Moura, J. M. F., and Vandergheynst, P. (2018). Graph signal processing: overview, challenges, and applications. Proceedings of the IEEE 106, 808--828. tools:::Rd_expr_doi("https://doi.org/10.1109/JPROC.2018.2820126")

Shuman, D. I., Narang, S. K., Frossard, P., Ortega, A., and Vandergheynst, P. (2013). The emerging field of signal processing on graphs: Extending high-dimensional data analysis to networks and other irregular domains. IEEE Signal Processing Magazine, 30(3), 83--98. tools:::Rd_expr_doi("https://doi.org/10.1109/MSP.2012.2235192")

See Also

sgemd.

Examples

Run this code
#### example : composite of two components having different frequencies

## define vertex coordinate
x <- y <- seq(0, 1, length=30)
xy <- expand.grid(x=x, y=y)

## weighted adjacency matrix by Gaussian kernel 
## for connecting vertices within distance 0.04
A <- adjmatrix(xy, method = "dist", 0.04) 

## signal
# high-frequency component
signal1 <- rep(sin(12.5*pi*x - 1.25*pi), 30)

# low-frequency component
signal2 <- rep(sin(5*pi*x - 0.5*pi), 30)

# composite signal
signal0 <- signal1 + signal2

# noisy signal with SNR(signal-to-noise ratio)=5
signal <- signal0 + rnorm(900, 0, sqrt(var(signal0) / 5)) 

# graph with signal
gsig <- gsignal(vertex = cbind(xy, signal), edge = A, edgetype = "matrix")
# \donttest{
# display of absolute values of the graph Fourier coefficients vs the eigenvalues 
gftplot(gsig)
gftplot(gsig, K=5, size=3)
outgft <- gftplot(gsig, K=5, plot=FALSE)
outgft$eigenvalues
# }
# graph Fourier decomposition 
out <- gfdecomp(gsig, K=4)
names(out)

# display of a signal, the extracted low- and high-frequency components by GFD
gplot(gsig, size=3) 
gplot(gsig, out$fc[[1]]+out$fc[[2]], size=3) 
gplot(gsig, out$fc[[3]]+out$fc[[4]], size=3) 

Run the code above in your browser using DataLab