gextrema {GSD}R Documentation

Finding Local Extrema of a Graph Signal

Description

This function finds the local extrema of a graph signal identifying the edge between neighboring vertices.

Usage

gextrema(ad_mat, signal)

Arguments

ad_mat

an weighted adjacency matrix.

signal

a graph signal.

Details

This function finds the local extrema of a graph signal identifying the edge between neighboring vertices.

Value

maxima_list

vertex index of local maxima of a signal.

minima_list

vertex index of local minima of a signal.

n_extrema

the number of local maxima and local minima of a signal.

References

Tremblay, N., Borgnat, P., and Flandrin, P. (2014). Graph empirical mode decomposition. 22nd European Signal Processing Conference (EUSIPCO), 2350–2354.

See Also

ginterpolating, gsmoothing, sgemd.

Examples

#### 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")

# local extrema
gextrema(A, signal)

# local extrema using graph object
gextrema(as_adjacency_matrix(gsig, attr="weight"), V(gsig)$z)

[Package GSD version 1.0.0 Index]