(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 5.2' Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. *******************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 23366, 705]*) (*NotebookOutlinePosition[ 24132, 731]*) (* CellTagsIndexPosition[ 24088, 727]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["Coding the 1D Haar Transform", "Title"], Cell["\<\ Wavelet Workshop June 6-9, 2007 University of St. Thomas\ \>", "Subtitle"], Cell[CellGroupData[{ Cell["Objectives", "Section"], Cell["\<\ The purpose of this notebook is to show you how to code and use the \ one-dimensional Discrete Haar Wavelet Transform.\ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["DiscreteWavelets", "Section"], Cell[TextData[{ StyleBox["You should run this cell each time you open this notebook!!", FontColor->RGBColor[1, 0, 0]], " It loads the ", StyleBox["Mathematica", FontSlant->"Italic"], " package ", StyleBox["DiscreteWavelets", FontFamily->"Courier"], " for use in subsequent computations." }], "Text"], Cell[BoxData[ StyleBox[\(<< DiscreteWavelets`DiscreteWavelets`\), FontColor->GrayLevel[0.500008]]], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Help on DiscreteWavelets", "Section"], Cell[TextData[{ "If you ever need help with ", StyleBox["DiscreteWavelets", FontFamily->"Courier"], ", go to ", StyleBox["Help", FontSlant->"Italic"], ", then ", StyleBox["Help Browser", FontSlant->"Italic"], ", and click on ", StyleBox["AddOns & Links", FontSlant->"Italic"], ". If you scroll down you will find ", StyleBox["DiscreteWavelets", FontFamily->"Courier"], ". " }], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["One Iteration of the HWT", "Section"], Cell[TextData[{ StyleBox["DiscreteWavelets", FontFamily->"Courier"], " comes with a command called ", StyleBox["H", FontWeight->"Bold"], StyleBox["WT1D1", FontWeight->"Bold"], ". This module takes as input a vector of even length and returns one \ iteration of the one-dimensional Haar wavelet transform.\n\nHere are some \ example calls." }], "Text"], Cell[BoxData[{\(v = {1, 1, 1, 1, 1, 1, 1, 1};\), "\[IndentingNewLine]", RowBox[{ RowBox[{"wt", "=", RowBox[{ StyleBox["HWT1D1", FontColor->GrayLevel[0.500008]], "[", "v", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{\(Print["\", v, "\< is \>", wt, "\<.\>"];\), "\[IndentingNewLine]"}], "\[IndentingNewLine]", \(w = Table[\((\(-1\))\)^k, {k, 1, 8}];\), "\[IndentingNewLine]", RowBox[{ RowBox[{"wt", "=", RowBox[{ StyleBox["HWT1D1", FontColor->GrayLevel[0.500008]], "[", "w", "]"}]}], ";"}], "\[IndentingNewLine]", \(Print["\", w, "\< is \>", wt, "\<.\>"];\)}], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Writing code for HWT1D1", "Section"], Cell[TextData[{ "In this group of cells, you will write a module to perform one iteration \ of the one-dimensional HWT. Use the code provided in Lecture 4. To \ distinguish this routine from the one in ", StyleBox["DiscreteWavelets", FontFamily->"Courier"], ", we will call it ", StyleBox["sHWT1D1", FontWeight->"Bold"], ". Remember ", StyleBox["sHWT1D1", FontWeight->"Bold"], " will be a module that takes one argument (typically a list of numbers). \ You will need to list local variables and make sure to use the ", StyleBox["Return", FontWeight->"Bold"], " statement. Use the ", StyleBox["CEnergy", FontWeight->"Bold"], " module from the measures.nb as a reference for writing a module. Put \ your code in the cell below." }], "Text"], Cell[BoxData[ \(\(sHWT1D1[v_] := Module[\({ (*\ Replace\ this\ comment\ with\ local\ variables\ *) }\)\(,\)\ \[IndentingNewLine] (*\ Replace\ this\ comment\ with\ your\ \(\(code\)\(.\)\)\ \ *) \[IndentingNewLine]];\)\)], "Input"], Cell[TextData[{ "Once your code is working, execute the cell below and compare it to the \ results you obtained in the cell before the ", StyleBox["sHWT1D1", FontWeight->"Bold"], " module." }], "Text"], Cell[BoxData[{ \(\(v = {1, 1, 1, 1, 1, 1, 1, 1};\)\), "\[IndentingNewLine]", \(\(wt = sHWT1D1[v];\)\), "\[IndentingNewLine]", \(\(Print["\", v, "\< is \>", wt, "\<.\>"];\)\[IndentingNewLine]\), "\[IndentingNewLine]", \(\(w = Table[\((\(-1\))\)^k, {k, 1, 8}];\)\), "\[IndentingNewLine]", \(\(wt = sHWT1D1[w];\)\), "\[IndentingNewLine]", \(\(Print["\", w, "\< is \>", wt, "\<.\>"];\)\)}], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["An Enlightening Example for Students", "Section"], Cell["\<\ Here is a fun example to work for students. First, sample and plot a common \ function from Calculus.\ \>", "Text"], Cell[BoxData[{ \(\(f[t_] := Cos[2*Pi*t];\)\), "\[IndentingNewLine]", \(\(v = Table[f[k/200], {k, 0, 199}];\)\), "\[IndentingNewLine]", \(\(ListPlot[v, PlotStyle \[Rule] Red];\)\)}], "Input"], Cell[TextData[{ "Now compute its Haar transform. You can use the command ", StyleBox["WaveletVectorPlot", FontWeight->"Bold"], " from ", StyleBox["DiscreteWavelets", FontFamily->"Courier"], " to plot the transform. " }], "Text"], Cell[BoxData[{ RowBox[{\(wt = sHWT1D1[v];\), "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ StyleBox["WaveletVectorPlot", FontColor->GrayLevel[0.500008]], "[", \(wt, NumIterations \[Rule] 1, Axes \[Rule] True, DivideLines \[Rule] True, UseColors \[Rule] True\), "]"}], ";"}]}], "Input"], Cell["\<\ The above graph isn't real illuminating until you plot the individual \ portions of the output:\ \>", "Text"], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{ StyleBox["WaveletVectorPlot", FontColor->GrayLevel[0.500008]], "[", \(wt, NumIterations \[Rule] 1, Axes \[Rule] True, DivideLines \[Rule] True, UseColors \[Rule] True, Region \[Rule] LowPass, PlotLabel -> "\"\), "]"}], ";"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ StyleBox["WaveletVectorPlot", FontColor->GrayLevel[0.500008]], "[", \(wt, NumIterations \[Rule] 1, Axes \[Rule] True, DivideLines \[Rule] True, UseColors \[Rule] True, Region \[Rule] HighPass, PlotLabel -> "\"\), "]"}], ";"}]}], "Input"], Cell["\<\ Now go back and change f to some other typical function from calculus. \ Repeat the exercise 2-3 times. How does the highpass portion compare to the \ lowpass portion of the transform?\ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["One Iteration of the IHWT", "Section"], Cell[TextData[{ StyleBox["DiscreteWavelets", FontFamily->"Courier"], " comes with a command called I", StyleBox["H", FontWeight->"Bold"], StyleBox["WT1D1", FontWeight->"Bold"], ". This module takes as input a vector of even length and returns one \ iteration of the inverse one-dimensional Haar wavelet transform.\n\nHere are \ some example calls." }], "Text"], Cell[BoxData[{\(v = {1, 1, 1, 1, 1, 1, 1, 1};\), "\[IndentingNewLine]", RowBox[{ RowBox[{"wt", "=", RowBox[{ StyleBox["HWT1D1", FontColor->GrayLevel[0.500008]], "[", "v", "]"}]}], ";"}], "\[IndentingNewLine]", \(u = IHWT1D1[wt];\), "\[IndentingNewLine]", RowBox[{\(u - v\), "\[IndentingNewLine]"}], "\[IndentingNewLine]", \(w = Table[\((\(-1\))\)^k, {k, 1, 8}];\), "\[IndentingNewLine]", RowBox[{ RowBox[{"wt", "=", RowBox[{ StyleBox["HWT1D1", FontColor->GrayLevel[0.500008]], "[", "w", "]"}]}], ";"}], "\[IndentingNewLine]", \(u = IHWT1D1[wt];\), "\[IndentingNewLine]", \(u - w\)}], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Writing code for IHWT1D1", "Section"], Cell[TextData[{ "In this group of cells, you will write a module to perform one iteration \ of the inverse one-dimensional HWT. Use the code provided in Lecture 4. \ To distinguish this routine from the one in ", StyleBox["DiscreteWavelets", FontFamily->"Courier"], ", we will call it ", StyleBox["sIHWT1D1", FontWeight->"Bold"], ". Remember ", StyleBox["sIHWT1D1", FontWeight->"Bold"], " will be a module that takes one argument (typically a list of numbers). \ You will need to list local variables and make sure to use the ", StyleBox["Return", FontWeight->"Bold"], " statement. Use the ", StyleBox["CEnergy", FontWeight->"Bold"], " module from the measures.nb as a reference for writing a module. Put \ your code in the cell below." }], "Text"], Cell[BoxData[ \(\(sIHWT1D1[v_] := Module[\({ (*\ Replace\ this\ comment\ with\ local\ variables\ *) }\)\(,\)\ \[IndentingNewLine] (*\ Replace\ this\ comment\ with\ your\ \(\(code\)\(.\)\)\ \ *) \[IndentingNewLine]];\)\)], "Input"], Cell[TextData[{ "Once your code is working, execute the cell below and compare it to the \ results you obtained in the cell before the ", StyleBox["sHWT1D1", FontWeight->"Bold"], " module." }], "Text"], Cell[BoxData[{ \(\(v = {1, 1, 1, 1, 1, 1, 1, 1};\)\), "\[IndentingNewLine]", \(\(wt = sHWT1D1[v];\)\), "\[IndentingNewLine]", \(\(u = sIHWT1D1[wt];\)\), "\[IndentingNewLine]", \(u - v\[IndentingNewLine]\), "\[IndentingNewLine]", \(\(w = Table[\((\(-1\))\)^k, {k, 1, 8}];\)\), "\[IndentingNewLine]", \(\(wt = sHWT1D1[w];\)\), "\[IndentingNewLine]", \(\(u = sIHWT1D1[wt];\)\), "\[IndentingNewLine]", \(u - w\)}], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Iterating the HWT", "Section"], Cell["Let's input a data set and compute it's HWT.", "Text"], Cell[BoxData[{ RowBox[{ RowBox[{"data", "=", RowBox[{ StyleBox["DataNames", FontColor->GrayLevel[0.500008]], "[", "]"}]}], ";", " ", \( (*\ There\ is\ only\ one\ data\ file\ in\ the\ package\ *) \), "\[IndentingNewLine]", \(file = OpenRead[data[\([1]\)]]\), ";"}], "\[IndentingNewLine]", \(data = ReadList[ file];\), "\[IndentingNewLine]", \(Print["\", Length[data], "\<.\>"];\)}], "Input"], Cell["\<\ Note that the length of the data set is divisible by 2 but not by 4. We use \ ChopVector to make sure the length of the data is divisible by 16.\ \>", "Text"], Cell[BoxData[{ RowBox[{ RowBox[{"data", "=", RowBox[{ StyleBox["ChopVector", FontColor->GrayLevel[0.500008]], "[", \(data, PowersOfTwo \[Rule] 4\), "]"}]}], ";"}], "\[IndentingNewLine]", \(Print["\", Length[data], "\<.\>"];\)}], "Input"], Cell["\<\ The values in the list are speeds of a sailboats (measured in knots) recorded \ every second for 71 minutes and 44 seconds. The data set is courtesy of \ Chris Greene,Jeff Jalkio, Mike Hennessey, and student Colin Sullivan from the \ UST College of Engineering. They collected the data as part of a research \ study they were performing to determine the optimal path of a sailboat in a \ certain area on Lake Superior. Here is a plot of the sailboat speeds:\ \>", "Text"], Cell[BoxData[ \(\(ListPlot[data, PlotJoined \[Rule] True, PlotStyle \[Rule] Blue, PlotLabel -> "\"];\)\)], "Input"], Cell["\<\ This data set is noisy and on Friday, we will denoise it. To do so, we need \ to make some improvements in the HWT. To motivate the improvements, we plot the cumulative energy of the sailboat \ speeds.\ \>", "Text"], Cell[BoxData[{ RowBox[{ RowBox[{"ce", "=", RowBox[{ StyleBox["CE", FontColor->GrayLevel[0.500008]], "[", "data", "]"}]}], ";"}], "\[IndentingNewLine]", \(plt1 = ListPlot[ce, PlotStyle \[Rule] Red, PlotLabel \[Rule] "\"];\)}], "Input"], Cell["\<\ Now let's compute the HWT and plot it and its cumulative energy vector:\ \>", "Text"], Cell[BoxData[{\(wt = sHWT1D1[data];\), "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ StyleBox["WaveletVectorPlot", FontColor->GrayLevel[0.500008]], "[", \(wt, NumIterations \[Rule] 1, Axes \[Rule] True, DivideLines \[Rule] True, UseColors \[Rule] True, PlotRange \[Rule] All, PlotLabel -> "\"\), "]"}], ";"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"cewt", "=", RowBox[{ StyleBox["CE", FontColor->GrayLevel[0.500008]], "[", "wt", "]"}]}], ";"}], "\[IndentingNewLine]", \(plt2 = ListPlot[cewt, PlotStyle \[Rule] Blue, PlotLabel \[Rule] "\"];\)}], "Input"], Cell["Let's show the cumulative energy vectors on the same graph.", "Text"], Cell[BoxData[ \(\(Show[{plt1, plt2}, PlotLabel -> "\"];\)\)], "Input"], Cell["\<\ Now let's extract the lowpass portion of the wavelet transform and apply the \ HWT to it. This is called iterating the HWT - we are performing a second \ iteration.\ \>", "Text"], Cell[BoxData[{ \(\(n = Length[wt];\)\), "\[IndentingNewLine]", \(\(lp1 = Take[wt, n/2];\)\), "\[IndentingNewLine]", \(\(hp1 = Drop[wt, n/2];\)\[IndentingNewLine]\), "\[IndentingNewLine]", \(\(wtlp = sHWT1D1[lp];\)\)}], "Input"], Cell[TextData[{ "We rebuild the vector wt. In this rebuild, we append hp to wtlp and then \ plot the result. Note the number of iterations has now changed to 2 in ", StyleBox["WaveletVectorPlot", FontWeight->"Bold"], "." }], "Text"], Cell[BoxData[{\(wt2 = Join[wtlp, hp1];\), "\[IndentingNewLine]", RowBox[{ RowBox[{ StyleBox["WaveletVectorPlot", FontColor->GrayLevel[0.500008]], "[", \(wt2, NumIterations \[Rule] 2, Axes \[Rule] True, DivideLines \[Rule] True, UseColors \[Rule] True, PlotRange \[Rule] All, PlotLabel -> "\"\), "]"}], ";"}]}], "Input"], Cell["Let's plot the cumulative energy of wt2:", "Text"], Cell[BoxData[{ RowBox[{ RowBox[{"cewt2", "=", RowBox[{ StyleBox["CE", FontColor->GrayLevel[0.500008]], "[", "wt2", "]"}]}], ";"}], "\[IndentingNewLine]", \(plt3 = ListPlot[cewt2, PlotStyle \[Rule] Purple];\)}], "Input"], Cell["Let's combine all three cumulative energy plots:", "Text"], Cell[BoxData[ \(\(Show[{plt1, plt2, plt3}, PlotLabel -> "\"];\)\)], "Input"], Cell[TextData[{ "Now that wt2 does a better job conserving energy!\n\nThe twice iterated \ transform is completely invertible. We can think of wt2 as a lists of lists. \ That is, wt2 = {lp2, hp2, hp1}. To invert, we apply ", StyleBox["sIHWT1D1", FontWeight->"Bold"], " to {lp2, hp2} to obtain lp1. Then we apply sIHWT1D1 to {lp1,hp1} to \ obtain v.\n\nWe can iterate the wavelet transform a maximum of p times where \ p is the largest integer such that ", Cell[BoxData[ \(2\^p\)]], "divides the length of the input vector." }], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["The Iterated One-Dimensional HWT", "Section"], Cell["\<\ The package DiscreteWavelets comes with a module called HWT1D that performs i \ iterations of the one-dimensional HWT on input vector v. The value i is \ entered as a directive. Here is an example call:\ \>", "Text"], Cell[BoxData[{ \(\(v = Table[2*k, {k, 1, 16}];\)\), "\[IndentingNewLine]", \(\(wt = sHWT1D[v, NumIterations \[Rule] 2];\)\), "\[IndentingNewLine]", \(\(Print["\", v, "\< gives \>", wt, "\<.\>"];\)\)}], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Writing Code for the Iterated One-Dimensional DHWT", "Section"], Cell[TextData[{ "We will now write a module that will perform i iterations of the \ one-dimensional HWT. We will call the module ", StyleBox["sHWT1D", FontWeight->"Bold"], ". Before writing the code we need an idea how the routine should flow.\n\n\ Pseudocode for this process appears as Algorithm 6.3 on pages 180-181 of the \ text. There is a typo in the text: ", Cell[BoxData[ \(b\^\(1 \[ScriptL]\)\)]], " and ", Cell[BoxData[ \(\(\(b\^\(1 h\)\)\(\ \)\)\)]], "should simply be ", Cell[BoxData[ \(b\^\[ScriptL]\)]], "and ", Cell[BoxData[ \(b\^h\)]], ", respectively.\n\nAnother major caveat of ", StyleBox["Mathematica", FontSlant->"Italic"], ". You CANNOT overwrite a variable passed to a module - you need to make a \ copy of the variable inside the module!!\n\nHere is the basic skeleton of the \ module. Note that I have made a copy of v (called a) and there is a second \ argument called opts that holds all directive values. Code is provided to \ grab the number of iterations from this variable:\n\nYou can do For loops in \ ", StyleBox["Mathematica", FontSlant->"Italic"], ". The syntax is quite simple - it is identical to the For loop in \ Algorithm 6.3 except each statement inside the loop and the closing ] should \ end with a semicolon ( ; )." }], "Text"], Cell[BoxData[ \(\(\(sHWT1D[v_, opts___] := Module[{a, i, (*\ Put\ additional\ local\ variables\ here\ *) }, \ \[IndentingNewLine]a = v; \[IndentingNewLine]i = \(NumIterations /. {opts}\) /. Options[HWT1D];\[IndentingNewLine]\[IndentingNewLine] (*\ Put\ the\ remainder\ of\ your\ code\ \(\(here\)\(.\)\)\ \ *) \[IndentingNewLine]\[IndentingNewLine]];\)\(\[IndentingNewLine]\)\(\ \[IndentingNewLine]\) \)\)], "Input"], Cell["\<\ Once you have your module written, test it on the vector below and compare \ your results to the cell above the module.\ \>", "Text"], Cell[BoxData[{ \(\(v = Table[2*k, {k, 1, 16}];\)\), "\n", \(\(wt = sHWT1D[v, NumIterations \[Rule] 2];\)\), "\n", \(\(Print["\", v, "\< gives \>", wt, "\<.\>"];\)\)}], "Input"], Cell["\<\ The sailboat speed is stored in a variable called data. In the cell below, \ we compute three iterations of the HWT using HWT1D and sHWT1D. These vectors \ should be identical.\ \>", "Text"], Cell[BoxData[{ RowBox[{ RowBox[{"y", "=", RowBox[{ StyleBox["HWT1D", FontColor->GrayLevel[0.500008]], "[", \(data, NumIterations \[Rule] 3\), "]"}]}], ";"}], "\[IndentingNewLine]", \(z = sHWT1D[data, NumIterations \[Rule] 3];\), "\[IndentingNewLine]", \(Max[ Abs[y - z]]\)}], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Challenge Problem: Writing a Module for IHWT", "Section"], Cell["\<\ In the cell below, write a module that computes i iterations of the inverse \ one-dimensional Haar wavelet transform. We will call the module sIHWT1D. \ Algorithm 6.4 on pages 181-182 will be useful. \ \>", "Text"], Cell[BoxData[ \(\(sIHWT1D[v_, opts___] := Module[{\(i\)\(,\) (*\ Put\ other\ local\ variables\ here\ *) }, \[IndentingNewLine]i\ \ = \ \(NumIterations /. {opts}\) /. Options[IHWT1D]; \[IndentingNewLine] (*\ Put\ code\ here\ *) \[IndentingNewLine]];\)\)], "Input"], Cell["You can test your module below:", "Text"], Cell[BoxData[{ \(\(v = Table[Random[Integer, {\(-10\), 10}], {k, 1, 32}];\)\), "\[IndentingNewLine]", \(\(wt = sHWT1D[v, NumIterations \[Rule] 4];\)\), "\[IndentingNewLine]", \(\(u = sIHWT1D[wt, NumIterations \[Rule] 4];\)\), "\[IndentingNewLine]", \(Max[Abs[wt - u]]\)}], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["A Fun Test for sIHWT1D", "Section"], Cell[TextData[{ "Execute this cell once before proceeding - it lets you hear sound files. \ There is some overlap with a package ", StyleBox["DiscreteWavelets", FontFamily->"Courier"], " uses and thus there will be some warning messages. You can safely ignore \ them." }], "Text"], Cell[BoxData[ \(<< Miscellaneous`Audio`\)], "Input"], Cell[TextData[{ "Here is a fun test for your module ", StyleBox["sIHWT1D", FontWeight->"Bold"], ". The following cell imports the iterated HWT of some sound file. You \ have to guess the number of iterations and then call sIHWT1D with that number \ of iterations to produce the original sound file. \n\nTo help you, the cell \ below loads the file and \"plays\" the transform. It takes a while to load \ the file." }], "Text"], Cell[BoxData[{ \(\(url = \ "\";\)\), "\ \[IndentingNewLine]", \(\(v = Import[url, "\"];\)\), "\[IndentingNewLine]", \(\(srate = v[\([1]\)];\)\), "\[IndentingNewLine]", \(\(v = Drop[v, 1];\)\), "\[IndentingNewLine]", \(\(ListPlay[v, SampleRate \[Rule] srate];\)\)}], "Input"], Cell[TextData[{ "In the cell below, make a guess at the number of iterations i and then \ compute the inverse transform and play the result. The length of the \ sounddata1.raw sample is divisible by ", Cell[BoxData[ \(2\^9\)]], " but not ", Cell[BoxData[ \(2\^10\)]], ". " }], "Text"], Cell[BoxData[{ \(\(\(\(i\)\(=\)\) (*\ Replace\ this\ comment\ with\ a\ number\ of\ iterations\ *) ;\)\), "\ \[IndentingNewLine]", \(\(u = sIHWT1D[v, NumIterations \[Rule] i];\)\), "\[IndentingNewLine]", \(\(ListPlay[u, SampleRate \[Rule] srate];\)\)}], "Input"], Cell["\<\ You can repeat the exercise for sounddata#.raw where # goes from 1 to 5.\ \>", "Text"] }, Open ]] }, Open ]] }, FrontEndVersion->"5.2 for Microsoft Windows", ScreenRectangle->{{0, 1024}, {0, 685}}, AutoGeneratedPackage->None, ScreenStyleEnvironment->"Presentation", WindowSize->{1016, 651}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, ShowSelection->True, StyleDefinitions -> "Report.nb" ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1776, 53, 45, 0, 117, "Title"], Cell[1824, 55, 84, 4, 143, "Subtitle"], Cell[CellGroupData[{ Cell[1933, 63, 29, 0, 96, "Section"], Cell[1965, 65, 142, 3, 40, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[2144, 73, 35, 0, 96, "Section"], Cell[2182, 75, 324, 10, 63, "Text"], Cell[2509, 87, 118, 2, 51, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[2664, 94, 43, 0, 96, "Section"], Cell[2710, 96, 429, 17, 64, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[3176, 118, 43, 0, 96, "Section"], Cell[3222, 120, 374, 11, 107, "Text"], Cell[3599, 133, 726, 16, 207, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[4362, 154, 42, 0, 96, "Section"], Cell[4407, 156, 791, 21, 129, "Text"], Cell[5201, 179, 270, 6, 103, "Input"], Cell[5474, 187, 211, 6, 62, "Text"], Cell[5688, 195, 461, 7, 207, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[6186, 207, 55, 0, 96, "Section"], Cell[6244, 209, 126, 3, 40, "Text"], Cell[6373, 214, 204, 3, 103, "Input"], Cell[6580, 219, 248, 8, 63, "Text"], Cell[6831, 229, 363, 8, 129, "Input"], Cell[7197, 239, 119, 3, 40, "Text"], Cell[7319, 244, 746, 16, 155, "Input"], Cell[8068, 262, 210, 4, 62, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[8315, 271, 44, 0, 96, "Section"], Cell[8362, 273, 383, 11, 107, "Text"], Cell[8748, 286, 729, 17, 259, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[9514, 308, 43, 0, 96, "Section"], Cell[9560, 310, 801, 21, 129, "Text"], Cell[10364, 333, 271, 6, 103, "Input"], Cell[10638, 341, 211, 6, 62, "Text"], Cell[10852, 349, 458, 8, 259, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[11347, 362, 36, 0, 96, "Section"], Cell[11386, 364, 60, 0, 40, "Text"], Cell[11449, 366, 498, 11, 129, "Input"], Cell[11950, 379, 169, 3, 62, "Text"], Cell[12122, 384, 334, 8, 77, "Input"], Cell[12459, 394, 484, 9, 150, "Text"], Cell[12946, 405, 146, 2, 77, "Input"], Cell[13095, 409, 227, 6, 84, "Text"], Cell[13325, 417, 329, 8, 77, "Input"], Cell[13657, 427, 95, 2, 40, "Text"], Cell[13755, 431, 767, 17, 207, "Input"], Cell[14525, 450, 75, 0, 40, "Text"], Cell[14603, 452, 111, 2, 51, "Input"], Cell[14717, 456, 189, 4, 62, "Text"], Cell[14909, 462, 246, 4, 155, "Input"], Cell[15158, 468, 244, 6, 62, "Text"], Cell[15405, 476, 381, 7, 103, "Input"], Cell[15789, 485, 56, 0, 40, "Text"], Cell[15848, 487, 276, 7, 77, "Input"], Cell[16127, 496, 64, 0, 40, "Text"], Cell[16194, 498, 117, 2, 51, "Input"], Cell[16314, 502, 559, 12, 172, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[16910, 519, 51, 0, 96, "Section"], Cell[16964, 521, 228, 4, 62, "Text"], Cell[17195, 527, 265, 4, 103, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[17497, 536, 69, 0, 96, "Section"], Cell[17569, 538, 1346, 33, 326, "Text"], Cell[18918, 573, 487, 10, 285, "Input"], Cell[19408, 585, 143, 3, 40, "Text"], Cell[19554, 590, 231, 4, 103, "Input"], Cell[19788, 596, 202, 4, 62, "Text"], Cell[19993, 602, 369, 10, 103, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[20399, 617, 64, 0, 96, "Section"], Cell[20466, 619, 229, 4, 62, "Text"], Cell[20698, 625, 305, 5, 129, "Input"], Cell[21006, 632, 47, 0, 40, "Text"], Cell[21056, 634, 331, 7, 129, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[21424, 646, 41, 0, 96, "Section"], Cell[21468, 648, 292, 7, 63, "Text"], Cell[21763, 657, 56, 1, 51, "Input"], Cell[21822, 660, 443, 9, 128, "Text"], Cell[22268, 671, 371, 7, 155, "Input"], Cell[22642, 680, 310, 10, 62, "Text"], Cell[22955, 692, 284, 5, 103, "Input"], Cell[23242, 699, 96, 2, 40, "Text"] }, Open ]] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)