MATLAB Answers

FW
0

Generating Approximations from "appcoef" in Wavelet Toolbox

Asked by FW
on 22 Oct 2019 at 1:08
I have a question regarding the MATLAB example for "1-D approximation coefficients" https://www.mathworks.com/help/wavelet/ref/appcoef.html
The initial number of data points in the signal are 4320. It is decomposed by sym4 wavelet to level 5.
One can see the approximate cofficients, say at level 3, from a3 = appcoef(C,L,'sym4',Lev); which has 490 points.
How can one generate approximation 3 (or a3 as it appears in Wavelet Toolbox)? Is there a command for generating a1, a2, a3, a4, and a5, which will have original number of data points.
I know one can use the toolbox and go to "Separate Mode" and see all approximations and export them, but there is a restriction is level 12. I was curious to look at some 1D signals at levels higher than 12 and look at approximations higher than 12.
Thanks.
The MATLAB example has the following code:
Level 3 Approximation Coefficients
This example shows how to extract the level 3 approximation coefficients.
Load the signal consisting of electricity usage data.
load leleccum;
sig = leleccum(1:3920);
Obtain the DWT down to level 5 with the 'sym4' wavelet.
[C,L] = wavedec(sig,5,'sym4');
Extract the level-3 approximation coefficients. Plot the original signal and the approximation coefficients.
Lev = 3;
a3 = appcoef(C,L,'sym4',Lev);
subplot(2,1,1)
plot(sig); title('Original Signal');
subplot(2,1,2)
plot(a3); title('Level-3 Approximation Coefficients');
You can substitute any value from 1 to 5 for Lev to obtain the approximation coefficients for the corresponding level.

  0 Comments

Sign in to comment.

Products


Release

R2019a

0 Answers