Learn R Programming

BioGSP (version 1.0.0)

sgwt_forward: Forward SGWT transform (single or batch)

Description

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.

Usage

sgwt_forward(
  signal,
  eigenvectors,
  eigenvalues,
  scales,
  lmax = NULL,
  kernel_type = "heat"
)

Value

List containing:

fourier_coefficients

List with original and filtered Fourier coefficients

filters

Filter bank used

Arguments

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

Examples

Run this code
# \donttest{
# 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)
# }

Run the code above in your browser using DataLab