Generalized Haar-Walsh Transform
MultiscaleGraphSignalTransforms.GHWT.GHWT_jkl
MultiscaleGraphSignalTransforms.GHWT.fine2coarse!
MultiscaleGraphSignalTransforms.GHWT.ghwt_analysis!
MultiscaleGraphSignalTransforms.GHWT.ghwt_bestbasis
MultiscaleGraphSignalTransforms.GHWT.ghwt_c2f_bestbasis
MultiscaleGraphSignalTransforms.GHWT.ghwt_core!
MultiscaleGraphSignalTransforms.GHWT.ghwt_core!
MultiscaleGraphSignalTransforms.GHWT.ghwt_f2c_bestbasis
MultiscaleGraphSignalTransforms.GHWT.ghwt_synthesis
MultiscaleGraphSignalTransforms.GHWT.ghwt_synthesis
MultiscaleGraphSignalTransforms.GHWT_2d.ghwt_2d_haar
MultiscaleGraphSignalTransforms.GHWT_2d.ghwt_analysis_2d
MultiscaleGraphSignalTransforms.GHWT_2d.ghwt_bestbasis_2d
MultiscaleGraphSignalTransforms.GHWT.GHWT_jkl
— Methodfunction 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 objectdrow
: the row of the expansion coefficientdcol
: the column of the expansion coefficient
Output Argument
j
: the level index of the expansion coefficientk
: the subregion index of the expansion coefficientl
: the tag of the expansion coefficient
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
MultiscaleGraphSignalTransforms.GHWT.ghwt_analysis!
— Methoddmatrix = 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 objectGP::GraphPart
: an input GraphPart object (optional); after this function is run,GP
'scompinfo
,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)
MultiscaleGraphSignalTransforms.GHWT.ghwt_bestbasis
— Method(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 coefficientsGP::GraphPart
: an input GraphPart objectcfspec::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 basisBS::BasisSpec
: a BasisSpec object which specifies the best basis
MultiscaleGraphSignalTransforms.GHWT.ghwt_c2f_bestbasis
— Method(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 coefficientsGP::GraphPart
: an input GraphPart objectcfspec::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 basisBSc2f::BasisSpec
: a BasisSpec object which specifies the coarse-to-fine best basis
MultiscaleGraphSignalTransforms.GHWT.ghwt_core!
— Methodghwt_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 executeddmatrix::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
MultiscaleGraphSignalTransforms.GHWT.ghwt_core!
— Methodghwt_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
MultiscaleGraphSignalTransforms.GHWT.ghwt_f2c_bestbasis
— Method(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 coefficientsGP::GraphPart
: an input GraphPart objectcfspec::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 basisBSf2c::BasisSpec
: a BasisSpec object which specifies the fine-to-coarse best basis
MultiscaleGraphSignalTransforms.GHWT.ghwt_synthesis
— Method(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 basisGP::GraphPart
: an input GraphPart objectBS::BasisSpec
: an input BasisSpec objectG::GraphSig
: an input GraphSig object
Output Arguments
f::Matrix{Float64}
: the reconstructed signal(s)GS::GraphSig
: the reconstructed GraphSig object
MultiscaleGraphSignalTransforms.GHWT.ghwt_synthesis
— Methodf = 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 basisGP::GraphPart
: an input GraphPart objectBS::BasisSpec
: an input BasisSpec object
Output Arguments
f::Matrix{Float64}
: the reconstructed signal(s)
MultiscaleGraphSignalTransforms.GHWT_2d.ghwt_2d_haar
— Methoddvec = 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 analyzedGProws
the recursive partitioning on the rowsGPcols
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)
MultiscaleGraphSignalTransforms.GHWT_2d.ghwt_analysis_2d
— Methoddmatrix = 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)
MultiscaleGraphSignalTransforms.GHWT_2d.ghwt_bestbasis_2d
— Methoddvec, 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 analyzedGProws
the recursive partitioning on the rowsGPcols
the recursive partitioning on the columnscostfun_rows
the cost functional to be used for the rowscostfun_cols
the cost functional to be used for the columnsflatten_rows
the method for flattening vector-valued data to scalar-valued data for the rowsflatten_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 rowsBScols
the best basis on the columns
Copyright 2019 The Regents of the University of California
Implemented by Yiqun Shao (Adviser: Dr. Naoki Saito)