Stationary Wavelet Transform

Transforms on 1 Signal

Public API

WaveletsExt.SWT.sdwtFunction
sdwt(x, wt[, L])

Computes the stationary discrete wavelet transform (SDWT) for L levels.

Arguments

  • x::AbstractVector{T} or x::AbstractMatrix{T} where T<:Number: Original signal, preferably of size 2ᴷ where $K \in \mathbb{N}$.
  • wt::OrthoFilter: Orthogonal wavelet filter.
  • L::Integer: (Default: maxtransformlevels(x)) Number of levels of decomposition.

Returns

::Matrix{T} or ::Array{T,3}: Output from SDWT on x.

Examples

using Wavelets, WaveletsExt

# Setup
x = generatesignals(:heavysine)
wt = wavelet(WT.haar)

# SDWT
xw = sdwt(x, wt)

See also: swpd, swpt, isdwt

source
WaveletsExt.SWT.sdwt!Function
sdwt!(xw, x, wt[, L])

Same as sdwt but without array allocation.

Arguments

  • xw::AbstractArray{T,2} or xw::AbstractArray{T,3} where T<:Number: An allocated array of dimension (n,L+1) to write the outputs of x onto.
  • x::AbstractVector{T} or x::AbstractMatrix{T} where T<:Number: Original signal, preferably of size 2ᴷ where $K \in \mathbb{N}$.
  • wt::OrthoFilter: Orthogonal wavelet filter.
  • L::Integer: (Default: maxtransformlevels(x)) Number of levels of decomposition.

Returns

xw::Array{T,2} or xw::Array{T,3}: Output from SDWT on x.

Examples

using Wavelets, WaveletsExt

# Setup
x = generatesignals(:heavysine, 7)
wt = wavelet(WT.haar)

# SDWT
xw = Matrix{Float64}(undef, (128,5))
sdwt!(xw, x, wt, 4)

See also: sdwt

source
WaveletsExt.SWT.isdwtFunction
isdwt(xw, wt[, sm])

Computes the inverse stationary discrete wavelet transform (iSDWT) on xw.

Arguments

  • xw::AbstractArray{T,2} or xw::AbstractArray{T,3} where T<:Number: SDWT-transformed array.
  • wt::OrthoFilter: Orthogonal wavelet filter.
  • sm::Integer: If sm is included as an argument, the sm-shifted inverse transform will be computed. This results in significantly faster computation, but fails to fully utilize the strength of redundant wavelet transforms.

Returns

::Vector{T} or ::Matrix{T}: Inverse transformed signal.

Examples

using Wavelets, WaveletsExt

# Setup
x = generatesignals(:heavysine)
wt = wavelet(WT.haar)

# SDWT
xw = sdwt(x, wt)

#  Shift-based iSDWT
x̂ = isdwt(xw, wt, 5)

# Average-based iSDWT
x̃ = isdwt(xw, wt)

See also: isdwt_step, iswpt, sdwt

source
WaveletsExt.SWT.isdwt!Function
isdwt!(x, xw, wt[, sm])

Same as isdwt but with no array allocation.

Arguments

  • x::AbstractVector{T} or x::AbstractMatrix{T} where T<:Number: Allocation for reconstructed signal.
  • xw::AbstractArray{T,2} or xw::AbstractArray{T,3} where T<:Number: SDWT-transformed array.
  • wt::OrthoFilter: Orthogonal wavelet filter.
  • sm::Integer: If sm is included as an argument, the sm-shifted inverse transform will be computed. This results in significantly faster computation, but fails to fully utilize the strength of redundant wavelet transforms.

Returns

x::Vector{T} or x::Matrix{T}: Inverse transformed signal.

Examples

using Wavelets, WaveletsExt

# Setup
x = generatesignals(:heavysine)
wt = wavelet(WT.haar)

# SDWT
xw = sdwt(x, wt)

#  Shift-based iSDWT
x̂ = similar(x)
isdwt!(x̂, xw, wt, 5)

# Average-based iSDWT
isdwt(x̂, xw, wt)

See also: isdwt

source
WaveletsExt.SWT.swptFunction
swpt(x, wt[, L])

Computes L levels of stationary wavelet packet transform (SWPT) on x.

Arguments

  • x::AbstractVector{T} or x::AbstractMatrix{T} where T<:Number: Original signal, preferably of size 2ᴷ where $K \in \mathbb{N}$.
  • wt::OrthoFilter: Orthogonal wavelet filter.
  • L::Integer: (Default: maxtransformlevels(x)) Number of levels of decomposition.

Returns

::Matrix{T} or ::Array{T,3}: Output from SWPT on x.

Examples

using Wavelets, WaveletsExt

# Setup
x = generatesignals(:heavysine)
wt = wavelet(WT.haar)

# SWPT
xw = swpt(x, wt)

See also: sdwt, swpd

source
WaveletsExt.SWT.swpt!Function
swpt!(xw, x, wt[, L])

Same as swpt but without array allocation.

Arguments

  • xw::AbstractArray{T,2} or xw::AbstractArray{T,3} where T<:Number: Allocation for transformed signal.
  • x::AbstractVector{T} or x::AbstractMatrix{T} where T<:Number: Original signal, preferably of size 2ᴷ where $K \in \mathbb{N}$.
  • wt::OrthoFilter: Orthogonal wavelet filter.
  • L::Integer: (Default: maxtransformlevels(x)) Number of levels of decomposition.

Returns

xw::Matrix{T} or xw::Array{T,3}: Output from SWPT on x.

Examples

using Wavelets, WaveletsExt

# Setup
x = generatesignals(:heavysine)
wt = wavelet(WT.haar)

# SWPT
xw = Array{Float64,2}(undef, (128,128))
swpt!(xw, x, wt)

See also: swpt

source
WaveletsExt.SWT.iswptFunction
iswpt(xw, wt[, sm])

Computes the inverse stationary wavelet packet transform (iSWPT) on xw.

Arguments

  • xw::AbstractArray{T,2} or xw::AbstractArray{T,3} where T<:Number: SWPT-transformed array.
  • wt::OrthoFilter: Orthogonal wavelet filter.
  • sm::Integer: If sm is included as an argument, the sm-shifted inverse transform will be computed. This results in significantly faster computation, but fails to fully utilize the strength of redundant wavelet transforms.

Returns

::Vector{T} or ::Matrix{T}: Inverse transformed signal.

Examples

using Wavelets, WaveletsExt

# Setup
x = generatesignals(:heavysine)
wt = wavelet(WT.haar)

# SWPT
xw = swpt(x, wt)

# Shift-based iSWPT
x̂ = iswpt(xw, wt, 5)

# Average-based iSWPT
x̃ = iswpt(xw, wt)

See also: isdwt_step, isdwt, swpt

source
WaveletsExt.SWT.iswpt!Function
iswpt!(x, xw, wt[, sm])

Same as iswpt but with no array allocation.

Arguments

  • x::AbstractVector{T} or x::AbstractMatrix{T} where T<:Number: Allocation for inverse transform.
  • xw::AbstractArray{T,2} or xw::AbstractArray{T,3} where T<:Number: SWPT-transformed array.
  • wt::OrthoFilter: Orthogonal wavelet filter.
  • sm::Integer: If sm is included as an argument, the sm-shifted inverse transform will be computed. This results in significantly faster computation, but fails to fully utilize the strength of redundant wavelet transforms.

Returns

x::Vector{T} or x::Matrix{T}: Inverse transformed signal.

Examples

using Wavelets, WaveletsExt

# Setup
x = generatesignals(:heavysine)
wt = wavelet(WT.haar)

# SWPT
xw = swpt(x, wt)

# Shift-based iSWPT
x̂ = similar(x)
iswpt!(x̂, xw, wt, 5)

# Average-based iSWPT
iswpt!(x̂, xw, wt)

See also: iswpt

source
WaveletsExt.SWT.swpdFunction
swpd(x, wt[, L])

Computes L levels of stationary wavelet packet decomposition (SWPD) on x.

Arguments

  • x::AbstractVector{T} or x::AbstractMatrix{T} where T<:Number: Original signal, preferably of size 2ᴷ where $K \in \mathbb{N}$.
  • wt::OrthoFilter: Orthogonal wavelet filter.
  • L::Integer: (Default: maxtransformlevels(x)) Number of levels of decomposition.

Returns

::Matrix{T} or ::Array{T,3}: Output from SWPD on x.

Examples

using Wavelets, WaveletsExt

# Setup
x = generatesignals(:heavysine)
wt = wavelet(WT.haar)

# SWPD
xw = swpd(x, wt)

See also: iswpd, swpt

source
WaveletsExt.SWT.swpd!Function
swpd!(xw, x, wt[, L])

Same as swpd but without array allocation.

Arguments

  • xw::AbstractArray{T,2} or xw::AbstractArray{T,3} where T<:Number: Allocation for transformed signal.
  • x::AbstractVector{T} or x::AbstractMatrix{T} where T<:Number: Original signal, preferably of size 2ᴷ where $K \in \mathbb{N}$.
  • wt::OrthoFilter: Orthogonal wavelet filter.
  • L::Integer: (Default: maxtransformlevels(x)) Number of levels of decomposition.

Returns

xw::Matrix{T} or xw::Array{T,3}: Output from SWPD on x.

Examples

using Wavelets, WaveletsExt

# Setup
x = generatesignals(:heavysine)
wt = wavelet(WT.haar)

# SWPD
xw = Matrix{T}(undef, (128, 255))
swpd!(xw, x, wt)

See also: swpd

source
WaveletsExt.SWT.iswpdFunction
iswpd(xw, wt, L, sm)
iswpd(xw, wt[, L])
iswpd(xw, wt, tree[, sm])

Computes the inverse stationary wavelet packet transform (iSWPT) on xw.

Note

This function might not be very useful if one is looking to reconstruct a raw decomposed signal. The purpose of this function would be better utilized in applications such as denoising, where a signal is decomposed (swpd) and thresholded (denoise/denoiseall) before being reconstructed.

Arguments

  • xw::AbstractArray{T,2} or x::AbstractArray{T,3} where T<:Number: SWPD-transformed array.
  • wt::OrthoFilter: Orthogonal wavelet filter.
  • L::Integer: (Default: maxtransformlevels(x) or minimum(size(xw)[1:end-1]) |> maxtransformlevels) Number of levels of decomposition used for reconstruction.
  • tree::BitVector: Binary/Quad tree for inverse transform to be computed accordingly.
  • sm::Integer: If sm is included as an argument, the sm-shifted inverse transform will be computed. This results in significantly faster computation, but fails to fully utilize the strength of redundant wavelet transforms.

Returns

::Vector{T} or ::Matrix{T}: Inverse transformed signal.

Examples

using Wavelets, WaveletsExt

# Setup
x = generatesignals(:heavysine)
wt = wavelet(WT.haar)

# SWPD
xw = swpt(x, wt)

# Shift-based iSWPD
x̂ = iswpd(xw, wt, maxtransformlevels(xw,1), 5)

# Average-based iSWPD
x̃ = iswpd(xw, wt)

See also: isdwt_step, iswpt, swpd, iswpd!

source
WaveletsExt.SWT.iswpd!Function
iswpd!(x, xw, wt, L, sm)
iswpd!(x, xw, wt[, L])
iswpd!(x, xw, wt, tree, sm)
iswpd!(x, xw, wt, tree)

Same as iswpd but with no array allocation.

Arguments

  • x::AbstractVector{T} or x::AbstractMatrix{T} where T<:Number: Allocated array for output.
  • xw::AbstractArray{T,2} or xw::AbstractArray{T,3} where T<:Number: SWPD-transformed array.
  • wt::OrthoFilter: Orthogonal wavelet filter.
  • L::Integer: (Default: maxtransformlevels(x) or minimum(size(xw)[1:end-1]) |> maxtransformlevels) Number of levels of decomposition used for reconstruction.
  • tree::BitVector: Binary/Quad tree for inverse transform to be computed accordingly.
  • sm::Integer: If sm is included as an argument, the sm-shifted inverse transform will be computed. This results in significantly faster computation, but fails to fully utilize the strength of redundant wavelet transforms.

Returns

x::Vector{T} or x::Matrix{T}: Inverse transformed signal.

Examples

using Wavelets, WaveletsExt

# Setup
x = generatesignals(:heavysine)
wt = wavelet(WT.haar)

# SWPD
xw = swpd(x, wt)

# ISWPD
x̂ = similar(x)
iswpd!(x̂, xw, wt, 4, 5)
iswpd!(x̂, xw, wt, maketree(x), 5)
iswpd!(x̂, xw, wt, 4)
iswpd!(x̂, xw, wt, maketree(x))

See also: iswpd

source

Transforms on Multiple Signals

Public API

WaveletsExt.SWT.sdwtallFunction
sdwtall(x, wt[, L])

Computes the stationary discrete wavelet transform (SDWT) on each slice of signal.

Arguments

  • x::AbstractArray{T} where T<:Number: Input N-1-D signals, where each signal is sliced at dimension N.
  • wt::OrthoFilter: Orthogonal wavelet filter.
  • L::Integer: (Default: Wavelets.maxtransformlevels(xᵢ)) Number of levels of wavelet transforms.

Returns

  • ::Array{T}: Slices of transformed signals.

Examples

using Wavelets, WaveletsExt

# Generate random signals
x = randn(32, 5)
# Create wavelet
wt = wavelet(WT.db4)

# SDWT on all signals in x
xw = sdwtall(x, wt)

See also: sdwt

source
WaveletsExt.SWT.isdwtallFunction
isdwtall(xw[, wt])
isdwtall(xw, wt, sm)

Computes the inverse stationary discrete wavelet transform (ISDWT) on each slice of signal.

Arguments

  • xw::AbstractArray{T} where T<:Number: SDWT-transformed signal.
  • wt::OrthoFilter: (Default: nothing) Orthogonal wavelet filter.
  • sm::Integer: If sm is included as an argument, the sm-shifted inverse transform will be computed. This results in significantly faster computation, but fails to fully utilize the strength of redundant wavelet transforms.

Returns

  • ::Array{T}: Slices of reconstructed signals.

Examples

using Wavelets, WaveletsExt

# Generate random signals
x = randn(32, 5)
# Create wavelet
wt = wavelet(WT.db4)

# SDWT on all signals in x
xw = sdwtall(x, wt)

# ISDWT on all signals in xw
x̂ = isdwtall(xw)

See also: isdwt

source
WaveletsExt.SWT.swptallFunction
swptall(x, wt[, L])

Computes the stationary wavelet packet transform (SWPT) on each slice of signal.

Arguments

  • x::AbstractArray{T} where T<:Number: Input N-1-D signals, where each signal is sliced at dimension N.
  • wt::OrthoFilter: Orthogonal wavelet filter.
  • L::Integer: (Default: Wavelets.maxtransformlevels(xᵢ)) Number of levels of wavelet transforms.

Returns

  • ::Array{T}: Slices of transformed signals.

Examples

using Wavelets, WaveletsExt

# Generate random signals
x = randn(32, 5)
# Create wavelet
wt = wavelet(WT.db4)

# SWPT on all signals in x
xw = swptall(x, wt)

See also: swpt

source
WaveletsExt.SWT.iswptallFunction
iswptall(xw[, wt])
iswptall(xw, wt, sm)

Computes the inverse stationary wavelet packet transform (ISWPT) on each slice of signal.

Arguments

  • xw::AbstractArray{T} where T<:Number: SWPT-transformed signal.
  • wt::Union{OrthoFilter, Nothing}: (Default: nothing) Orthogonal wavelet filter.
  • sm::Integer: If sm is included as an argument, the sm-shifted inverse transform will be computed. This results in significantly faster computation, but fails to fully utilize the strength of redundant wavelet transforms.

Returns

  • ::Array{T}: Slices of reconstructed signals.

Examples

using Wavelets, WaveletsExt

# Generate random signals
x = randn(32, 5)
# Create wavelet
wt = wavelet(WT.db4)

# SWPT on all signals in x
xw = swptall(x, wt)

# ISWPT on all signals in xw
x̂ = iswptall(xw)

See also: iswpt

source
WaveletsExt.SWT.swpdallFunction
swpdall(x, wt[, L])

Computes the stationary wavelet packet decomposition (SWPD) on each slice of signal.

Arguments

  • x::AbstractArray{T} where T<:Number: Input N-1-D signals, where each signal is sliced at dimension N.
  • wt::OrthoFilter: Orthogonal wavelet filter.
  • L::Integer: (Default: Wavelets.maxtransformlevels(xᵢ)) Number of levels of wavelet transforms.

Returns

  • ::Array{T}: Slices of transformed signals.

Examples

using Wavelets, WaveletsExt

# Generate random signals
x = randn(32, 5)
# Create wavelet
wt = wavelet(WT.db4)

# SWPD on all signals in x
xw = swpdall(x, wt)

See also: swpd

source
WaveletsExt.SWT.iswpdallFunction
iswpdall(xw, wt, L, sm)
iswpdall(xw, wt[, L])
iswpdall(xw, wt, tree, sm)
iswpdall(xw, wt, tree)

Computes the inverse autocorrelation wavelet packet decomposition (ISWPD) on each slice of signal.

Arguments

  • xw::AbstractArray{T} where T<:Number: SWPD-transformed signal.
  • wt::Union{OrthoFilter, Nothing}: (Default: nothing) Orthogonal wavelet filter.
  • L::Integer: (Default: minimum(size(xw)[1:end-2]) |> maxtransformlevels) Number of levels of wavelet transforms.
  • tree::BitVector: Binary tree for inverse transform to be computed accordingly.
  • sm::Integer: If sm is included as an argument, the sm-shifted inverse transform will be computed. This results in significantly faster computation, but fails to fully utilize the strength of redundant wavelet transforms.

Returns

  • ::Array{T}: Slices of reconstructed signals.

Examples

using Wavelets, WaveletsExt

# Generate random signals
x = randn(32, 5)
# Create wavelet
wt = wavelet(WT.db4)

# SWPD on all signals in x
xw = swpdall(x, wt)

# ISWPD on all signals in xw
x̂ = iswpdall(xw)
x̂ = iswpdalll(xw, maketree(x))
x̂ = iswpdall(xw, 5)

See also: iswpd

source

Single Step Transforms

Private API

WaveletsExt.SWT.sdwt_stepFunction
sdwt_step(v, d, h, g)

Perform one level of the stationary discrete wavelet transform (SDWT) on the vector v, which is the d-th level scaling coefficients (Note the 0th level scaling coefficients is the raw signal). The vectors h and g are the detail and scaling filters.

Arguments

  • v::AbstractArray{T} where T<:Number: Array of coefficients from a node at level d.
  • d::Integer: Depth level of v.
  • h::Vector{S} where S<:Number: High pass filter.
  • g::Vector{S} where S<:Number: Low pass filter.

Returns

  • w₁::AbstractVector{T} where T<:Number or w₁::AbstractMatrix{T} where T<:Number: Output from low pass filter (1D case); or output from low + low pass filter (2D case).
  • w₂::AbstractVector{T} where T<:Number or w₂::AbstractMatrix{T} where T<:Number: Output from high pass filter (1D case); or output from low + high pass filter (2D case).
  • w₃::AbstractVector{T} where T<:Number or w₃::AbstractMatrix{T} where T<:Number: Output from high + low pass filter (2D case).
  • w₄::AbstractVector{T} where T<:Number or w₄::AbstractMatrix{T} where T<:Number: Output from high + high pass filter (2D case).

Examples

using Wavelets, WaveletsExt

# Setup
v = randn(8)
wt = wavelet(WT.haar)
g, h = WT.makereverseqmfpair(wt, true)

# One step of SDWT
SWT.sdwt_step(v, 0, h, g)

See also: sdwt_step!

source
WaveletsExt.SWT.sdwt_step!Function
sdwt_step!(w₁, w₂, v, d, h, g)

Same as sdwt_step but without array allocation.

Arguments

  • w₁::AbstractVector{T} where T<:Number or w₁::AbstractMatrix{T} where T<:Number: Vector allocation for output from low pass filter (1D case); or matrix allocation for output from low + low pass filter (2D case).
  • w₂::AbstractVector{T} where T<:Number or w₂::AbstractMatrix{T} where T<:Number: Vector allocation for output from high pass filter (1D case); or matrix allocation for output from low + high pass filter (2D case).
  • w₃::AbstractVector{T} where T<:Number or w₃::AbstractMatrix{T} where T<:Number: Matrix allocation for output from high + low pass filter (2D case).
  • w₄::AbstractVector{T} where T<:Number or w₄::AbstractMatrix{T} where T<:Number: Matrix allocation for output from high + high pass filter (2D case).
  • v::AbstractArray{T} where T<:Number: Array of coefficients from a node at level d.
  • d::Integer: Depth level of v.
  • h::Vector{S} where S<:Number: High pass filter.
  • g::Vector{S} where S<:Number: Low pass filter.

Returns

  • w₁::AbstractVector{T} where T<:Number or w₁::AbstractMatrix{T} where T<:Number: Output from low pass filter (1D case); or output from low + low pass filter (2D case).
  • w₂::AbstractVector{T} where T<:Number or w₂::AbstractMatrix{T} where T<:Number: Output from high pass filter (1D case); or output from low + high pass filter (2D case).
  • w₃::AbstractVector{T} where T<:Number or w₃::AbstractMatrix{T} where T<:Number: Output from high + low pass filter (2D case).
  • w₄::AbstractVector{T} where T<:Number or w₄::AbstractMatrix{T} where T<:Number: Output from high + high pass filter (2D case).

Examples

using Wavelets, WaveletsExt

# Setup
v = randn(8)
wt = wavelet(WT.haar)
g, h = WT.makereverseqmfpair(wt, true)
w₁ = zeros(8)
w₂ = zeros(8)

# One step of SDWT
SWT.sdwt_step!(w₁, w₂, v, 0, h, g)

See also: sdwt_step

source
WaveletsExt.SWT.isdwt_stepFunction
isdwt_step(w₁, w₂, d, h, g)
isdwt_step(w₁, w₂, d, sv, sw, h, g)

Perform one level of the inverse stationary discrete wavelet transform (ISDWT) on the vectors w₁ and w₂, which are the d+1-th level scaling coefficients (Note the 0th level scaling coefficients is the raw signal). The vectors h and g are the detail and scaling filters.

Note

One can decide to choose the average-based inverse transform or the shift-based inverse transform. For shift based, one needs to specify the shifts of the parent and children nodes; for the average based, the output is the average of all possible shift-based inverse transform outputs.

Arguments

  • w₁::AbstractVector{T} where T<:Number or w₁::AbstractMatrix{T} where T<:Number: Coefficients of left child node (1D case); or coefficients from top left child node (2D case).
  • w₂::AbstractVector{T} where T<:Number or w₂::AbstractMatrix{T} where T<:Number: Coefficients of right child node (1D case); or coefficients from top right child node (2D case).
  • w₃::AbstractVector{T} where T<:Number or w₃::AbstractMatrix{T} where T<:Number: Coefficients from bottom left child node (2D case).
  • w₄::AbstractVector{T} where T<:Number or w₄::AbstractMatrix{T} where T<:Number: Coefficients from bottom right child node (2D case).
  • d::Integer: Depth level of parent node of w₁ and w₂.
  • sv::Integer: Shift of parent node v.
  • sw::Integer: Shift of children nodes w₁ and w₂.
  • h::Vector{S} where S<:Number: High pass filter.
  • g::Vector{S} where S<:Number: Low pass filter.

Returns

  • v::Vector{T}: Reconstructed coefficients.

Examples

using Wavelets, WaveletsExt

# Setup
v = randn(8)
wt = wavelet(WT.haar)
g, h = WT.makereverseqmfpair(wt, true)

# One step of SDWT
w₁, w₂ = SWT.sdwt_step(v, 0, h, g)

# One step of ISDWT
v̂ = SWT.isdwt_step(w₁, w₂, 0, h, g)         # Average based
ṽ = SWT.isdwt_step(w₁, w₂, 0, 0, 1, h, g)   # Shift based

See also: isdwt_step!

source
WaveletsExt.SWT.isdwt_step!Function
isdwt_step!(v, w₁, w₂, d, h, g)
isdwt_step!(v, w₁, w₂, d, sv, sw, h, g[; add2out])

Same as isdwt_step but without array allocation.

Arguments

  • v::AbstractArray{T} where T<:Number: Array allocation for reconstructed coefficients.
  • w₁::AbstractVector{T} where T<:Number or w₁::AbstractMatrix{T} where T<:Number: Coefficients of left child node (1D case); or coefficients from top left child node (2D case).
  • w₂::AbstractVector{T} where T<:Number or w₂::AbstractMatrix{T} where T<:Number: Coefficients of right child node (1D case); or coefficients from top right child node (2D case).
  • w₃::AbstractVector{T} where T<:Number or w₃::AbstractMatrix{T} where T<:Number: Coefficients from bottom left child node (2D case).
  • w₄::AbstractVector{T} where T<:Number or w₄::AbstractMatrix{T} where T<:Number: Coefficients from bottom right child node (2D case).
  • d::Integer: Depth level of parent node of w₁ and w₂.
  • sv::Integer: Shift of parent node v.
  • sw::Integer: Shift of children nodes w₁ and w₂.
  • h::Vector{S} where S<:Number: High pass filter.
  • g::Vector{S} where S<:Number: Low pass filter.

Keyword Arguments

  • add2out::Bool: (Default: false) Whether to add computed result directly to output v or rewrite computed result to v.

Returns

  • v::Array{T}: Reconstructed coefficients.

Examples

using Wavelets, WaveletsExt

# Setup
v = randn(8)
v̂ = similar(v)
ṽ = similar(v)
wt = wavelet(WT.haar)
g, h = WT.makereverseqmfpair(wt, true)

# One step of SDWT
w₁, w₂ = SWT.sdwt_step(v, 0, h, g)

# One step of ISDWT
SWT.isdwt_step!(v̂, w₁, w₂, 0, h, g)          # Average based
SWT.isdwt_step!(ṽ, w₁, w₂, 0, 0, 1, h, g)    # Shift based

See also: isdwt_step

source