| runSGCC | R Documentation |
Calculate energy-normalized weighted similarity between two signals using Fourier domain coefficients directly (no vertex domain reconstruction). Excludes DC component and uses energy-based weighting consistent with Parseval's theorem.
runSGCC(
signal1,
signal2,
SG = NULL,
eps = 1e-12,
validate = TRUE,
return_parts = TRUE,
low_only = FALSE
)
signal1 |
Either a signal name (character) for SG object, or SGWT Forward result, or SGWT object |
signal2 |
Either a signal name (character) for SG object, or SGWT Forward result, or SGWT object |
SG |
SGWT object (required if signal1/signal2 are signal names) |
eps |
Small numeric for numerical stability (default: 1e-12) |
validate |
Logical; if TRUE, check consistency (default: TRUE) |
return_parts |
Logical; if TRUE, return detailed components (default: TRUE) |
low_only |
Logical; if TRUE, compute only low-frequency similarity (default: FALSE) |
Similarity analysis results computed in Fourier domain
# Create example data and compute SGWT
data <- data.frame(x = runif(100), y = runif(100),
signal1 = rnorm(100), signal2 = rnorm(100))
SG <- initSGWT(data, signals = c("signal1", "signal2"))
SG <- runSpecGraph(SG, k = 15)
SG <- runSGWT(SG)
# Between two signals in same SGWT object
similarity <- runSGCC("signal1", "signal2", SG = SG)
print(similarity)
# Between two SGWT objects
data2 <- data.frame(x = runif(100), y = runif(100), signal = rnorm(100))
SG2 <- initSGWT(data2, signals = "signal")
SG2 <- runSpecGraph(SG2, k = 15)
SG2 <- runSGWT(SG2)
similarity2 <- runSGCC(SG, SG2)
print(similarity2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.