Scale and location parameters of the 1D wavelet decomposition using wavedec

8 views (last 30 days)
Hello!
I am using wavedec function to decompose a streamflow time series into frequencies.
My idea is use the dyadic scale for the DWT where the constant dilation step is 2 and the location parameter is 1. My question is: how is it possible to apply the dyadic scale using the wavedec function? I understand that it is already apply in the algorithm of the wavedec function. Am I correct?
and my other question is: how is it possible to know the scale and the translation parameters used in the decomposition?
From the material of matlab. I understand that the DWT follows the following equation:
"This means that at scale, 2j, you always translate by 2jm where m is a nonnegative integer." (https://es.mathworks.com/help/wavelet/gs/continuous-and-discrete-wavelet-transforms.html)
How is possible to know then the value of j and m apply in each decomposition level?
Thank you,
Sara

Answers (1)

Abhimenyu
Abhimenyu on 7 Jun 2024
Hi Sara,
I understand that you have queries regarding the wavedec function of MATLAB. You are correct in understanding that the wavedec function in MATLAB inherently uses a dyadic scale for the Discrete Wavelet Transform (DWT). This means that the function automatically applies the dyadic scaling (doubling of scale at each level) and translation as part of its algorithm.
When the wavedec function is used for decomposing a signal, the dyadic scaling is a fundamental part of the DWT algorithm. The function decomposes the signal into various frequency bands using wavelets, where each subsequent decomposition level halves the frequency band, effectively doubling the scale. This is in line with the DWT's nature, where:
  • At level 0, you have the original signal.
  • At level 1, the signal is decomposed into approximation (low-frequency) and detail (high-frequency) components.
  • At level 2 and beyond, the process continues on the approximation component from the previous level, each time halving the frequency band (or doubling the scale).
The scale (j) and translation (m) parameters in the context of the wavedec function are implicitly defined by the level of decomposition and the position within each level's output. For a given level j, the scale is 2^j, and the translation parameter m varies across the coefficients within that level.
  • Scale (j): The decomposition level directly indicates the scale. For example, level 1 corresponds to j=1 (scale=2^1), level 2 to j=2 (scale=2^2), and so on.
  • Translation (m): Within each level, the coefficients represent different translations. The exact value of m is not typically exposed directly by the wavedec function, as the focus is on the hierarchical decomposition of the signal into frequency bands rather than on specific translations. However, the position of a coefficient within a level's output array can be thought of as corresponding to different values of m.
In practical applications using wavedec as given by this MATLAB R2024a documentation link: https://www.mathworks.com/help/wavelet/ref/wavedec.html , the j and m parameters are not usually calculated for each coefficient. Instead, the computations involve the entire array of coefficients at each level. To analyze or modify specific details at a given scale, the coefficients for that level are interacted with as a whole.
Please follow this example MATLAB code that illustrates the use of wavedec function:
% Sample signal
x = randn(1, 1024); % Example signal
% Wavelet decomposition
[coeffs, L] = wavedec(x, 3, 'db1') % Decompose into 3 levels using Daubechies 1 wavelet
coeffs = 1x1024
-0.3581 0.3266 -0.2811 0.2841 -0.5406 1.7822 -0.4293 -2.1417 -0.0270 0.9468 -0.4727 0.3215 -1.0821 0.1427 0.4713 0.9605 -0.4029 0.0143 0.5013 -0.6212 0.2318 1.7458 0.3475 1.6297 -0.4535 -1.5772 0.2934 -0.2019 1.1865 -0.2088
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
L = 1x5
128 128 256 512 1024
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
% coeffs contains the approximation and detail coefficients
% L contains the lengths of the coefficient arrays at each level
% Accessing specific levels
approxLevel3 = coeffs(1:L(1)) % Approximation coefficients at level 3
approxLevel3 = 1x128
-0.3581 0.3266 -0.2811 0.2841 -0.5406 1.7822 -0.4293 -2.1417 -0.0270 0.9468 -0.4727 0.3215 -1.0821 0.1427 0.4713 0.9605 -0.4029 0.0143 0.5013 -0.6212 0.2318 1.7458 0.3475 1.6297 -0.4535 -1.5772 0.2934 -0.2019 1.1865 -0.2088
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
detailLevel1 = coeffs(end-L(end)+1:end) % Detail coefficients at level 1
detailLevel1 = 1x1024
-0.3581 0.3266 -0.2811 0.2841 -0.5406 1.7822 -0.4293 -2.1417 -0.0270 0.9468 -0.4727 0.3215 -1.0821 0.1427 0.4713 0.9605 -0.4029 0.0143 0.5013 -0.6212 0.2318 1.7458 0.3475 1.6297 -0.4535 -1.5772 0.2934 -0.2019 1.1865 -0.2088
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
In this example, the scale and translation are implicitly managed by wavedec and the structure of coeffs and L. The level of decomposition (e.g., 3 levels) directly informs you about the scale used (2^j for each level j), and the coefficients within each level represent different translations, though the exact m values are abstracted away.
I hope this helps!

Categories

Find more on Discrete Multiresolution Analysis in Help Center and File Exchange

Products


Release

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!