| sgwt_forward | R Documentation |
Transform signal(s) to spectral domain and apply SGWT filters. Handles both single signals (vector) and multiple signals (matrix) efficiently. Stores original and filtered Fourier coefficients for analysis.
sgwt_forward(
signal,
eigenvectors,
eigenvalues,
scales,
lmax = NULL,
kernel_type = "heat"
)
signal |
Input signal vector OR matrix where each column is a signal (n_vertices x n_signals) |
eigenvectors |
Eigenvectors of the graph Laplacian |
eigenvalues |
Eigenvalues of the graph Laplacian |
scales |
Vector of scales for the wavelets |
lmax |
Maximum eigenvalue (optional) |
kernel_type |
Kernel family that defines both scaling and wavelet filters (default: "heat") |
List containing:
List with original and filtered Fourier coefficients
Filter bank used
# Create example data and compute graph
data <- data.frame(x = runif(50), y = runif(50), signal = rnorm(50))
SG <- initSGWT(data, signals = "signal", J = 3)
SG <- runSpecGraph(SG, k = 10)
eigenvectors <- SG$Graph$eigenvectors
eigenvalues <- SG$Graph$eigenvalues
scales <- SG$Parameters$scales
# Single signal
signal <- data$signal
result <- sgwt_forward(signal, eigenvectors, eigenvalues, scales)
# Multiple signals (batch processing)
signals_matrix <- cbind(data$signal, data$signal * 2, data$signal * 0.5)
result <- sgwt_forward(signals_matrix, eigenvectors, eigenvalues, scales)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.