Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Daubechies wavelet
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Implementation== While software such as [[Mathematica]] supports Daubechies wavelets directly<ref> [http://reference.wolfram.com/mathematica/ref/DaubechiesWavelet.html Daubechies Wavelet in Mathematica. Note that in there ''n'' is ''n''/2 from the text.]</ref> a basic implementation is possible in [[MATLAB]] (in this case, Daubechies 4). This implementation uses periodization to handle the problem of finite length signals. Other, more sophisticated methods are available, but often it is not necessary to use these as it only affects the very ends of the transformed signal. The periodization is accomplished in the forward transform directly in MATLAB vector notation, and the inverse transform by using the <code>circshift()</code> function: ===Transform, D4=== It is assumed that ''S'', a column vector with an even number of elements, has been pre-defined as the signal to be analyzed. Note that the D4 coefficients are [1 + {{radic|3}}, 3 + {{radic|3}}, 3 β {{radic|3}}, 1 β {{radic|3}}]/4. <syntaxhighlight lang="matlab"> N = length(S); sqrt3 = sqrt(3); s_odd = S(1:2:N-1); s_even = S(2:2:N); s = (sqrt3+1)*s_odd + (3+sqrt3)*s_even + (3-sqrt3)*[s_odd(2:N/2);s_odd(1)] + (1-sqrt3)*[s_even(2:N/2);s_even(1)]; d = (1-sqrt3)*[s_odd(N/2);s_odd(1:N/2-1)] + (sqrt3-3)*[s_even(N/2);s_even(1:N/2-1)] + (3+sqrt3)*s_odd + (-1-sqrt3)*s_even s = s / (4*sqrt(2)); d = d / (4*sqrt(2)); </syntaxhighlight> ===Inverse transform, D4=== <syntaxhighlight lang="matlab"> d1 = d * ((sqrt(3) - 1) / sqrt(2)); s2 = s * ((sqrt(3) + 1) / sqrt(2)); s1 = s2 + circshift(d1, - 1); S(2:2:N) = d1 + sqrt(3) / 4 * s1 + (sqrt(3) - 2) / 4 * circshift(s1, 1); S(1:2:N - 1) = s1 - sqrt(3) * S(2:2:N); </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)