(************** 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[ 7224, 247]*) (*NotebookOutlinePosition[ 7886, 270]*) (* CellTagsIndexPosition[ 7842, 266]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["Biorthogonal Filters", "Subtitle"], Cell["\<\ Patrick J. Van Fleet Minicourse #5, Joint Mathematics Meetings New Orleans, LA\ \>", "Subsubtitle"], Cell["Objective", "Section"], Cell[CellGroupData[{ Cell["\<\ In this notebook, we will construct a biorthogonal filter pair.\ \>", "Subsubtitle"], Cell["Conventions", "Section"] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ "This notebook uses the package ", StyleBox["WaveletFunctions", FontColor->RGBColor[0.501961, 0, 0]], " (written by Patrick Van Fleet). All commands from the WaveletFunctions \ library will be denoted in ", StyleBox["maroon", FontColor->RGBColor[0.501961, 0, 0]], ". Help is available for almost every command in ", StyleBox["WaveletFunctions", FontColor->RGBColor[0.501961, 0, 0]], ". Click on Help and then Help Browser (or Shift F1). Next click the \ Add-ons & Links tab. Scroll down until you find ", StyleBox["WaveletFunctions", FontColor->RGBColor[0.501961, 0, 0]], ". Like all ", StyleBox["Mathematica", FontSlant->"Italic"], " help screens, the help is \"live\" - you can either execute the commands \ in the help to see the effects of the command or cut and paste them into your \ own notebook.\n\nValues that can be changed by the user are defined using ", StyleBox["blue", FontColor->RGBColor[0, 0, 1]], ".\n\nComments are useful within cells of code. Any code enclosed by (* \ *) is a comment and ignored by the ", StyleBox["Mathematica", FontSlant->"Italic"], " kernel." }], "Subsubtitle"], Cell[CellGroupData[{ Cell["Load WaveletFunctions", "Section"], Cell[BoxData[ \(<< WaveletFunctions`WaveletFunctions`\)], "Input"] }, Open ]], Cell["Spelling Off", "Section"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ This turns off the annoying error messages you get when the spelling of two \ variable names is close.\ \>", "Subsubtitle"], Cell[BoxData[{ \(\(Off[General::spell];\)\), "\[IndentingNewLine]", \(\(Off[General::spell1];\)\)}], "Input"], Cell["Solving for the Length-5 Filter", "Section"] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ "We need two Fourier series ", Cell[BoxData[ \(TraditionalForm\`\(H\& \[Tilde] \)\ \((\[Omega])\)\ and\ \(\(H(\ \[Omega])\)\(.\)\)\)]], " The first is known while the second has unknown coefficients ", Cell[BoxData[ \(TraditionalForm\`h\_\(-2\)\ = \ h\_2, \ h\_\(-1\)\ = \ h\_1, \ and\ \(\(h\_0\)\(.\)\)\)]] }], "Subsubtitle"], Cell[BoxData[{ \(\(Clear[h];\)\), "\[IndentingNewLine]", \(\(htilde = {Sqrt[2]/4, Sqrt[2]/2, Sqrt[2]/4};\)\), "\[IndentingNewLine]", \(\(Ht[w_] := htilde . Table[E^\((I*k*w)\), {k, \(-1\), 1}];\)\), "\[IndentingNewLine]", \(\(f\ = \ {h[2], h[1], h[0], h[1], h[2]};\)\), "\[IndentingNewLine]", \(\(H[w_] := f . Table[ E^\((I*k*w)\), {k, \(-2\), 2}];\)\), "\[IndentingNewLine]", \(\(Print[\*"\"\\"", Ht[w], "\< and H(\[Omega]) = \>", H[w], "\<.\>"];\)\)}], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Next, let's define the Fourier series associated with h. ", \ "Subsubtitle"], Cell[BoxData[{ \(\(P[w_] := Ht[w]*H[\(-w\)]\ + \ Ht[w + Pi]*H[\(-w\) + Pi];\)\), "\[IndentingNewLine]", \(Expand[P[w]]\)}], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ Now we equate coefficients. The above expression must be 2. This gives rise \ to two equations:\ \>", "Subsubtitle"], Cell[BoxData[{ \(\(eqs = Table[Coefficient[Expand[P[w]], E^\((I*w)\), 2*k] \[Equal] 2*DiscreteDelta[k], {k, 0, 1}];\)\), "\[IndentingNewLine]", \(TableForm[eqs]\)}], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ The first equation is one of the lowpass conditions. Since the above cell is \ an underdetermined system of equations, we'll add the other lowpass \ condition.\ \>", "Subsubtitle"], Cell[BoxData[{ \(\(equations = Append[eqs, h[2] - h[1] + h[0] - h[1] + h[2] \[Equal] 0];\)\), "\[IndentingNewLine]", \(TableForm[equations]\), "\[IndentingNewLine]", \(\)}], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Now we can solve the system!", "Subsubtitle"], Cell[BoxData[{ \(\(s = Solve[equations, {h[0], h[1], h[2]}];\)\), "\[IndentingNewLine]", \(TableForm[s]\)}], "Input"] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ "Here is some ", StyleBox["Mathematica", FontSlant->"Italic"], " code to strip out the arrows from the solutions. The ", StyleBox["/.", FontWeight->"Bold"], " simply replaces all the h[0], h[1], h[2] with their values" }], "Subsubtitle"], Cell[BoxData[{ \(\(v = Flatten[{h[0], h[1], h[2]} /. s];\)\), "\[IndentingNewLine]", \(\(Print["\", v, "\<.\>"];\)\)}], "Input"] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ "In practice, the short filter is multiplied by ", Cell[BoxData[ \(TraditionalForm\`\@2\ and\ the\ long\ filter\ is\ divided\ by\ \ \@2\)]], ". The result is the LeGall filter pair:" }], "Subsubtitle"], Cell[BoxData[{ \(\(Clear[h];\)\), "\[IndentingNewLine]", \(h = Join[Take[Reverse[v], 2], v]/Sqrt[2]\), "\[IndentingNewLine]", \(ht = Sqrt[2]*htilde\)}], "Input"], Cell[BoxData[""], "Input"] }, Open ]] }, Open ]] }, FrontEndVersion->"5.2 for Microsoft Windows", ScreenRectangle->{{0, 1024}, {0, 695}}, WindowSize->{1015, 651}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, Magnification->1 ] (******************************************************************* 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, 40, 0, 51, "Subtitle"], Cell[1819, 55, 109, 4, 70, "Subsubtitle"], Cell[1931, 61, 28, 0, 73, "Section"], Cell[CellGroupData[{ Cell[1984, 65, 94, 2, 30, "Subsubtitle"], Cell[2081, 69, 30, 0, 73, "Section"] }, Open ]], Cell[CellGroupData[{ Cell[2148, 74, 1184, 28, 172, "Subsubtitle"], Cell[CellGroupData[{ Cell[3357, 106, 40, 0, 73, "Section"], Cell[3400, 108, 70, 1, 30, "Input"] }, Open ]], Cell[3485, 112, 31, 0, 73, "Section"] }, Open ]], Cell[CellGroupData[{ Cell[3553, 117, 133, 3, 30, "Subsubtitle"], Cell[3689, 122, 118, 2, 50, "Input"], Cell[3810, 126, 50, 0, 73, "Section"] }, Open ]], Cell[CellGroupData[{ Cell[3897, 131, 372, 9, 34, "Subsubtitle"], Cell[4272, 142, 609, 12, 133, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[4918, 159, 82, 1, 30, "Subsubtitle"], Cell[5003, 162, 162, 4, 50, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[5202, 171, 128, 3, 30, "Subsubtitle"], Cell[5333, 176, 205, 4, 50, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[5575, 185, 191, 4, 50, "Subsubtitle"], Cell[5769, 191, 229, 6, 70, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[6035, 202, 51, 0, 30, "Subsubtitle"], Cell[6089, 204, 135, 3, 50, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[6261, 212, 272, 8, 32, "Subsubtitle"], Cell[6536, 222, 186, 3, 50, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[6759, 230, 230, 6, 32, "Subsubtitle"], Cell[6992, 238, 175, 3, 70, "Input"], Cell[7170, 243, 26, 0, 30, "Input"] }, Open ]] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)