MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

wavelet

  • To: mathgroup at smc.vnet.net
  • Subject: [mg104966] wavelet
  • From: clansa <dauphinester at gmail.com>
  • Date: Sun, 15 Nov 2009 05:56:20 -0500 (EST)

With the package Wavelet
I have made this little program that is OK with 256 or 512 data, but
the graphics  (PlotCoefficients, and  ListPlot of the cumulative
energy don't work with 1024 data and more.

(*D=E9composition en ondelettes*)
(*La s=E9rie =E9tudi=E9e doit avoir 32, 64, \
128, 256, 512, 1024,... valeurs*)
(*Importation des donn=E9es*)
\
ClearAll["Global`*"]
d = Import[SystemDialogInput["FileOpen"]];
d = Flatten[d];
Print["longueur de la s=E9rie = ", n1 = Length[d]]

(*Choisir ordre du filtre et niveau de d=E9composition*)
\
Needs["Wavelets`Wavelets`"]
a = N[ChoiceDialog[
    "Choisir l'ordre du filtre", {1 -> "1", 2 -> "2", 3 -> "3",
     4 -> "4", 5 -> "5", 6 -> "6", 7 -> "7"}]];
a = ToExpression[a];
ab = N[ChoiceDialog[
    "Choisir le niveau de d=E9composition maximum au-dela de 2", {3 ->
      "3", 4 -> "4", 5 -> "5", 6 -> "6", 7 -> "7"}]];
ab = ToExpression[ab];

(*Il faut entrer le nom du filtre pour calculer les coefficients \
d'ondelettes et de multiresolution, Daubechies par d=E9faut*)

d2 = DaubechiesFilter[a, 25];
cv = N[WaveletTransform[d, d2, ab], 25];
Dimensions[cv];
Length /@ cv
Print[]
Print["Coefficients d'ondelettes = "];

ListPlot[cv, ImageSize -> {500, 400}]

PlotCoefficients[cv, Frame -> True]


(*=E9tude de l'=E9nergie absolue cumul=E9e et de l'=E9nergie relative cumul=
=E9e
\
pour tous les niveaux*)
Print[]
Print[]
et = CumulativeEnergy[cv] // N;
e = N[et/Flatten[cv].Flatten[cv]];
ListPlot[et, ImageSize -> {500, 400}, PlotRange -> All,
  Joined -> True,
  PlotLabel -> "=E9nergie totale absolue cumul=E9e"] ListPlot[e,
  ImageSize -> {500, 400}, PlotRange -> All, Joined -> True,
  PlotLabel -> "=E9nergie totale relative cumul=E9e"]


(*Calculs statistiques simples sur les coefficients d'ondelettes*)
\
Print[]
Print["Entropie des coefficients d'ondelette par niveau "];
entropcv = Table[Entropy[cv[[n1]]], {n1, 1, ab + 1}] // N



  • Prev by Date: Re: Error when working with a derivative
  • Next by Date: Re: Error when working with a derivative
  • Previous by thread: Re: Fyi, Listing of Mathematica 7 functions (1869 functions)
  • Next by thread: Re: wavelet