1-D approximation coefficients
Extract Approximation Coefficients
Load the signal consisting of electricity usage data.
Obtain the DWT down to level 5 using the
[c,l] = wavedec(leleccum,5,"sym4");
Extract the approximation coefficients at the coarsest scale. Plot the original signal and the approximation coefficients.
lev = 5; a3 = appcoef(c,l,"sym4",lev); tiledlayout(2,1) nexttile plot(leleccum) axis tight title("Original Signal") nexttile plot(a3) axis tight title("Level "+num2str(lev)+" Approximation Coefficients")
c — Wavelet decomposition vector
Wavelet decomposition vector of a 1-D signal, specified as a vector. For
more information, see
[c,l] = wavedec(randn(1,256),4,"coif1") returns
the wavelet decomposition of a vector down to level 4.
Complex Number Support: Yes
l — Bookkeeping vector
vector of positive integers
wname — Wavelet
character vector | string scalar
Wavelet used to generate the wavelet decomposition
l], specified as a
character vector or string scalar. The wavelet is from one of the following
wavelet families: Best-localized Daubechies, Beylkin, Coiflets, Daubechies,
Fejér-Korovkin, Haar, Han linear-phase moments, Morris minimum-bandwidth,
Symlets, Vaidyanathan, Discrete Meyer, Biorthogonal, and Reverse
wavemngr for the wavelets
available in each family.
LoR,HiR — Wavelet reconstruction filters
even-length real-valued vectors
Wavelet reconstruction filters, specified as a pair of even-length
LoR is the lowpass reconstruction
HiR is the highpass reconstruction filter.
The lengths of
HiR must be
equal. For perfect reconstruction,
HiR must be the reconstruction filters associated
with the same wavelet used to obtain the wavelet decomposition
l. For more information,
extmode — Extension mode
"spd" | ...
Extension mode to use for the inverse DWT, specified as:
DWT Extension Mode
Smooth extension of order 0
Smooth extension of order 1
Symmetric extension (half point): boundary value symmetric replication
Symmetric extension (whole point): boundary value symmetric replication
Antisymmetric extension (half point): boundary value antisymmetric replication
Antisymmetric extension (whole point): boundary value antisymmetric replication
If the signal
length is odd and
NMAX = length(l)-2; then
c = [A(NMAX) D(NMAX) ...
A and the
D are vectors.
N = NMAX, then a simple extraction is done; otherwise,
appcoef computes iteratively the approximation coefficients
using the inverse wavelet transform.
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Usage notes and limitations:
Variable-size data support must be enabled.
wnamemust be constant.
Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™.
Usage notes and limitations:
"per"extension modes are supported.
gpuArrayinput, the DWT extension mode used by
"sym"unless the extension mode is
"per". For more information, see
Version HistoryIntroduced before R2006a
R2023b: Specify DWT Extension Mode
appcoef function can use a DWT extension mode you specify
which is different from the default global extension mode.