Generalized Haar-Walsh Transform

MultiscaleGraphSignalTransforms.GHWT.GHWT_jklMethod
function GHWT_jkl(GP::GraphPart, drow::Int, dcol::Int; c2f::Bool = true)

Generate the (j,k,l) indices for the GHWT basis vector corresponding to the coefficient dmatrix(drow,dcol)

Input Arguments

  • GP: a GraphPart object
  • drow: the row of the expansion coefficient
  • dcol: the column of the expansion coefficient

Output Argument

  • j: the level index of the expansion coefficient
  • k: the subregion index of the expansion coefficient
  • l: the tag of the expansion coefficient
source
MultiscaleGraphSignalTransforms.GHWT.fine2coarse!Method
(dmatrixf2c, IX) = fine2coarse!(GP::GraphPart;
dmatrix::Array{Float64,3} = zeros(0, 0, 0),
coefp::Bool = false, indp::Bool = false)

Fill in the fine-to-coarse info (rs2f2c, tagf2c, and compinfof2c) in a GraphPart object. Also, rearrange a matrix of expansion coefficients.

Input Arguments

  • GP::GraphPart: an input GraphPart object without fine-to-coarse info (rsf2c, tagf2c, compinfof2c); after this function, rsf2c, tagf2c, compinfof2c are filled. Note that rs, tag, compinfo are intact.
  • dmatrix::Array{Float64,3}: a matrix of expansion coefficients in coarse-to-fine arrangement (default: null matrix)
  • coefp::Bool: a flag to return the rearranged f2c coefficients (default: false)
  • indp::Bool: a flag to return the reordering index (default: false)

Output Arguments

  • dmatrixf2c::Array{Float64,3}: a matrix of expansion coefficients in fine-to-coarse arrangement (if requested)
  • IX::Vector{Unsigned}: the reordering index for all levels
source
MultiscaleGraphSignalTransforms.GHWT.ghwt_analysis!Method
dmatrix = ghwt_analysis!(G::GraphSig, GP::GraphPart = nothing, c2f::Bool = true)

For a GraphSig object G, generate the matrix of GHWT expansion coefficients

Input Arguments

  • G::GraphSig: an input GraphSig object
  • GP::GraphPart: an input GraphPart object (optional); after this function is run, GP's compinfo, tag, etc. are filled

Output Argument

  • dmatrix::Array{Float64,3}: the 3D array of expansion coefficients (i.e., for each input signal vector, the matrix of coefficients; hence, for multiple input signals, the coefficients are organized as a 3D array)
source
MultiscaleGraphSignalTransforms.GHWT.ghwt_bestbasisMethod
(dvec, BS) = ghwt_bestbasis(dmatrix::Array{Float64,3}, GP::GraphPart; cfspec::Any, flatten::Any = 1.0)

Select the overall best basis among the c2f and f2c best bases

Input Arguments

  • dmatrix::Array{Float64,3}: the matrix of expansion coefficients
  • GP::GraphPart: an input GraphPart object
  • cfspec::Any: the specification of cost functional to be used (default: 1.0, i.e., 1-norm)
  • flatten::Any: the method for flattening vector-valued data to scalar-valued data (default: 1.0, i.e., 1-norm)

Output Arguments

  • dvec::Matrix{Float64}: the vector of expansion coefficients corresponding to the best basis
  • BS::BasisSpec: a BasisSpec object which specifies the best basis
source
MultiscaleGraphSignalTransforms.GHWT.ghwt_c2f_bestbasisMethod
(dvecc2f, BSc2f) = ghwt_c2f_bestbasis(dmatrix::Array{Float64,3}, GP::GraphPart;
                                      cfspec::Any = 1.0, flatten::Any = 1.0,
                                      j_start::Int = 1, j_end::Int = size(dmatrix,2),
                                      useParent::Bool = true)

Select the coarse-to-fine best basis from the matrix of GHWT expansion coefficients

Input Arguments

  • dmatrix::Array{Float64,3}: the matrix of expansion coefficients
  • GP::GraphPart: an input GraphPart object
  • cfspec::Any: the specification of cost functional to be used (default = 1.0, i.e., 1-norm)
  • flatten::Any: the method for flattening vector-valued data to scalar-valued data (default = 1.0, i.e, 1-norm)
  • useParent::Bool: the flag to indicate if we update the selected best basis subspace to the parent when parent and child have the same cost (default = true)

Output Arguments

  • dvecc2f::Matrix{Float64}: the vector of expansion coefficients corresponding to the coarse-to-fine best basis
  • BSc2f::BasisSpec: a BasisSpec object which specifies the coarse-to-fine best basis
source
MultiscaleGraphSignalTransforms.GHWT.ghwt_core!Method
ghwt_core!(GP::GraphPart, dmatrix::Array{Float64,3})

performs the forward GHWT transform, which generates expansion coefficients, tag, and compinfo.

Input Arguments

  • GP::GraphPart: a GraphPart object (with or without tag and compinfo data); note that tag and compinfo will be modified after this function is executed
  • dmatrix::Array{Float64,3}: a matrix of expansion coefficients with only the last column filled in as the original input signal(s) f; after this function is executed, this matrix contains whole expansion coefficients of the input signal(s) relative to the GHWT dictionary
source
MultiscaleGraphSignalTransforms.GHWT.ghwt_core!Method
ghwt_core!(GP::GraphPart)

performs the forward GHWT transform, which computes tag and compinfo of GP, but not the expansion coefficients.

Input Arguments

  • GP::GraphPart: a GraphPart object (with or without tag and compinfo data); note that tag and compinfo will be modified after this function is executed
source
MultiscaleGraphSignalTransforms.GHWT.ghwt_f2c_bestbasisMethod
(dvecf2c, BSf2c) = ghwt_f2c_bestbasis(dmatrix::Array{Float64,3}, GP::GraphPart;
                                      cfspec::Any = 1.0, flatten::Any = 1.0,
                                      j_start::Int = 1, j_end::Int = size(dmatrix,2),
                                      useParent::Bool = true)

Select the fine-to-coarse best basis from the matrix of GHWT expansion coefficients

Input Arguments

  • dmatrix::Array{Float64,3}: the matrix of expansion coefficients
  • GP::GraphPart: an input GraphPart object
  • cfspec::Any: the specification of cost functional to be used (default: 1.0, i.e., 1-norm)
  • flatten::Any: the method for flattening vector-valued data to scalar-valued data (default: 1.0, i.e., 1-norm)
  • useParent::Bool: the flag to indicate if we update the selected best basis subspace to the parent when parent and child have the same cost (default = true)

Output Arguments

  • dvecf2c::Matrix{Float64}: the vector of expansion coefficients corresponding to the fine-to-coarse best basis
  • BSf2c::BasisSpec: a BasisSpec object which specifies the fine-to-coarse best basis
source
MultiscaleGraphSignalTransforms.GHWT.ghwt_synthesisMethod
(f, GS) = ghwt_synthesis(dvec::Matrix{Float64}, GP::GraphPart, BS::BasisSpec, G::GraphSig)

Given a vector of GHWT expansion coefficients and info about the graph partitioning and the choice of basis, reconstruct the signal

Input Arguments

  • dvec::Matrix{Float64}: the expansion coefficients corresponding to the chosen basis
  • GP::GraphPart: an input GraphPart object
  • BS::BasisSpec: an input BasisSpec object
  • G::GraphSig: an input GraphSig object

Output Arguments

  • f::Matrix{Float64}: the reconstructed signal(s)
  • GS::GraphSig: the reconstructed GraphSig object
source
MultiscaleGraphSignalTransforms.GHWT.ghwt_synthesisMethod
f = ghwt_synthesis(dvec::Matrix{Float64}, GP::GraphPart, BS::BasisSpec)

Given a vector of GHWT expansion coefficients and info about the graph partitioning and the choice of basis, reconstruct the signal

Input Arguments

  • dvec::Matrix{Float64}: the expansion coefficients corresponding to the chosen basis
  • GP::GraphPart: an input GraphPart object
  • BS::BasisSpec: an input BasisSpec object

Output Arguments

  • f::Matrix{Float64}: the reconstructed signal(s)
source
MultiscaleGraphSignalTransforms.GHWT_2d.ghwt_2d_haarMethod
dvec = ghwt_2d_dmatrix2dvec(matrix::Array{Float64,2},BSrows::BasisSpec,BScols::BasisSpec)

For a matrix, equipped with row and column weight recursive partitionings and weight matrices, generate the (non-redundant) matrix of GHWT expansion coefficients, using the best basis algorithm to select best bases for the rows and columns

Input Argument

  • matrix the matrix to be analyzed
  • GProws the recursive partitioning on the rows
  • GPcols the recursive partitioning on the columns

Output Argument

  • dvec the GHWT expansion coefficients (not redundant)

Copyright 2019 The Regents of the University of California

Implemented by Yiqun Shao (Adviser: Dr. Naoki Saito)

source
MultiscaleGraphSignalTransforms.GHWT_2d.ghwt_analysis_2dMethod
dmatrix = ghwt_analysis_2d(matrix::Array{Float64,2}, GProws::GraphPart, GPcols::GraphPart)

For a matrix, equipped with row and column weight recursive partitionings and weight matrices, generate the redundant matrix of GHWT expansion coefficients.

Input Arguments

matrix the matrix to be analyzed GProws the recursive partitioning on the rows GPcols the recursive partitioning on the columns

Output Arguments

dmatrix the GHWT dictionary expansion coefficients

Copyright 2019 The Regents of the University of California

Implemented by Yiqun Shao (Adviser: Dr. Naoki Saito)

source
MultiscaleGraphSignalTransforms.GHWT_2d.ghwt_bestbasis_2dMethod
dvec, BSrows, BScols = ghwt_2d_bestbasis(matrix::Array{Float64,2},GProws::GraphPart,GPcols::GraphPart,
costfun_rows::Any = 1.0, costfun_cols::Any = 1.0, flatten_rows::Any = 1.0, flatten_cols::Any = 1.0)

For a matrix, equipped with row and column weight recursive partitionings and weight matrices, generate the (non-redundant) matrix of GHWT expansion coefficients, using the best basis algorithm to select best bases for the rows and columns

Input Argument

  • matrix the matrix to be analyzed
  • GProws the recursive partitioning on the rows
  • GPcols the recursive partitioning on the columns
  • costfun_rows the cost functional to be used for the rows
  • costfun_cols the cost functional to be used for the columns
  • flatten_rows the method for flattening vector-valued data to scalar-valued data for the rows
  • flatten_cols the method for flattening vector-valued data to scalar-valued data for the columns

Output Argument

  • dvec the GHWT expansion coefficients (not redundant)
  • BSrows the best basis on the rows
  • BScols the best basis on the columns

Copyright 2019 The Regents of the University of California

Implemented by Yiqun Shao (Adviser: Dr. Naoki Saito)

source