# Legendre wavelet

In functional analysis, compactly supported wavelets derived from Legendre polynomials are termed Legendre wavelets or spherical harmonic wavelets.[1] Legendre functions have widespread applications in which spherical coordinate system is appropriate. [2][3][4] As with many wavelets there is no nice analytical formula for describing these harmonic spherical wavelets. The low-pass filter associated to Legendre multiresolution analysis is a finite impulse response (FIR) filter.

Wavelets associated to FIR filters are commonly preferred in most applications.[3] An extra appealing feature is that the Legendre filters are linear phase FIR (i.e. multiresolution analysis associated with linear phase filters). These wavelets have been implemented on MATLAB (wavelet toolbox). Although being compactly supported wavelet, legdN are not orthogonal (but for N = 1).[5]

## Legendre multiresolution filters

Associated Legendre polynomials are the colatitudinal part of the spherical harmonics which are common to all separations of Laplace's equation in spherical polar coordinates.[2] The radial part of the solution varies from one potential to another, but the harmonics are always the same and are a consequence of spherical symmetry. Spherical harmonics ${\displaystyle P_{n}(z)}$ are solutions of the Legendre ${\displaystyle 2^{nd}}$-order differential equation, n integer:

${\displaystyle (1-z^{2}){\frac {d^{2}y}{dz^{2}}}-2z{\frac {dy}{dz}}+n(n+1)y=0.}$

${\displaystyle P_{n}(\cos {\theta })}$ polynomials can be used to define the smoothing filter ${\displaystyle H(\omega )}$ of a multiresolution analysis (MRA).[6] Since the appropriate boundary conditions for an MRA are ${\displaystyle |H(0)|=1}$ and ${\displaystyle |H(\pi )|=0}$, the smoothing filter of an MRA can be defined so that the magnitude of the low-pass ${\displaystyle |H(\omega )|}$ can be associated to Legendre polynomials according to: ${\displaystyle \nu =2n+1}$.

${\displaystyle |H_{\nu }(\omega )|=|{\frac {P_{\nu }(\cos {{\frac {\omega }{2}})}}{P_{\nu }\cos(0)}}|}$

Illustrative examples of filter transfer functions for a Legendre MRA are shown in figure 1, for ${\displaystyle \nu }$=1,3 and 5. A low-pass behaviour is exhibited for the filter H, as expected. The number of zeroes within ${\displaystyle -\pi <\omega <\pi }$ is equal to the degree of the Legendre polynomial. Therefore, the roll-off of side-lobes with frequency is easily controlled by the parameter ${\displaystyle \nu }$.

Figure 1 - Magnitude of the transfer function for Legendre multiresolution smoothing filters. Filter ${\displaystyle |H_{\nu }(\omega )|}$ for a few orders: ${\displaystyle \nu }$=1 (solid line), ${\displaystyle \nu }$=3 (dot line), and ${\displaystyle \nu }$=5 (dashdot line).

The low-pass filter transfer function is given by

${\displaystyle H_{\nu }(\omega )=-e^{-j\nu {\frac {\omega -\pi }{2}}}P_{\nu }(\cos({\frac {\omega }{2}}))}$

The transfer function of the high-pass analysing filter ${\displaystyle G_{\nu }(\omega )}$ is chosen according to Quadrature mirror filter condition,[6][7] yielding:

${\displaystyle H_{\nu }(\omega )=-e^{-j{(\nu -2)}{\frac {\omega }{2}}}P_{\nu }(\sin({\frac {\omega }{2}}))}$

Indeed, ${\displaystyle |G_{\nu }(0)|=0}$ and ${\displaystyle |G_{\nu }(\pi )|=1}$, as expected.

## Legendre multiresolution filter coefficients

A suitable phase assignment is done so as to properly adjust the transfer function ${\displaystyle H_{\nu }(\omega )}$ to the form ${\displaystyle H_{\nu }(\omega )={\frac {1}{\sqrt {2}}}\sum _{k\in Z}h_{k}^{\nu }e^{-j\omega k}}$
The filter coefficients ${\displaystyle \{h_{k}\}}$, ${\displaystyle k\in Z}$ are given by: ${\displaystyle {\frac {h_{k}^{\nu }}{\sqrt {2}}}=-{\frac {1}{2^{2\nu }}}.{\binom {2k}{k}}.{\binom {2\nu -2k}{\nu -k}}}$
It follows then the symmetry: ${\displaystyle {h_{k}^{\nu }}={h_{\nu -k}^{\nu }}}$. There are just ${\displaystyle \nu +1}$ non-zero filter coefficients on ${\displaystyle H_{n}(\omega )}$, so that the Legendre wavelets have compact support for every odd integer ${\displaystyle \nu }$.

Table I - Smoothing Legendre FIR filter coefficients for ${\displaystyle \nu }$=1,3,5 (N is the wavelet order.)
 ${\displaystyle \nu =1}$ (N=1) ${\displaystyle \nu =3}$ (N=2) ${\displaystyle \nu =5}$ (N=3) ${\displaystyle h_{0}}$ ${\displaystyle -{\sqrt {2}}/2}$ ${\displaystyle -5{\sqrt {2}}/16}$ ${\displaystyle -63{\sqrt {2}}/256}$ ${\displaystyle h_{1}}$ ${\displaystyle -{\sqrt {2}}/2}$ ${\displaystyle -3{\sqrt {2}}/16}$ ${\displaystyle -35{\sqrt {2}}/256}$ ${\displaystyle h_{2}}$ ${\displaystyle -3{\sqrt {2}}/16}$ ${\displaystyle -30{\sqrt {2}}/256}$ ${\displaystyle h_{3}}$ ${\displaystyle -5{\sqrt {2}}/16}$ ${\displaystyle -30{\sqrt {2}}/256}$ ${\displaystyle h_{4}}$ ${\displaystyle -35{\sqrt {2}}/256}$ ${\displaystyle h_{5}}$ ${\displaystyle -63{\sqrt {2}}/256}$
N.B. The minus signal can be suppressed.

## MATLAB implementation of Legendre wavelets

Legendre wavelets can be easily loaded into the MATLAB wavelet toolbox—The m-files to allow the computation of Legendre wavelet transform, details and filter are (freeware) available. The finite support width Legendre family is denoted by legd (short name). Wavelets: 'legdN'. The parameter N in the legdN family is found according to 2N=${\displaystyle \nu }$+1 (length of the MRA filters).
Legendre wavelets can be derived from the low-pass reconstruction filter by an iterative procedure (the cascade algorithm). The wavelet has compact support and finite impulse response AMR filters (FIR) are used (table 1). The first wavelet of the Legendre's family is exactly the well-known Haar wavelet. Figure 2 shows an emerging pattern that progressively looks like the wavelet's shape.

Figure 2 - Shape of Legendre Wavelets of degree ${\displaystyle \nu }$=3 (legd2) derived after 4 and 8 iteration of the cascade algorithm, respectively. Shape of Legendre Wavelets of degree ${\displaystyle \nu }$=5 (legd3) derived by the cascade algorithm after 4 and 8 iterations of the cascade algorithm, respectively.

The Legendre wavelet shape can be visualised using the wavemenu command of MATLAB. Figure 3 shows legd8 wavelet displayed using MATLABTM. Legendre Polynomials are also associated with windows families.[8]

Figure 3 - legd8 wavelet display over MATLABTM using the wavemenu command.

## Legendre wavelet packets

Wavelet packets (WP) systems derived from Legendre wavelets can also be easily accomplished. Figure 5 illustrates the WP functions derived from legd2.

Figure 5 - Legendre (legd2) Wavelet Packets W system functions: WP from 0 to 9.

## References

1. ^ Lira et al
2. ^ a b Gradshteyn, Izrail Solomonovich; Ryzhik, Iosif Moiseevich; Geronimus, Yuri Veniaminovich; Tseytlin, Michail Yulyevich; Jeffrey, Alan (2015) [October 2014]. Zwillinger, Daniel; Moll, Victor Hugo, eds. Table of Integrals, Series, and Products. Translated by Scripta Technica, Inc. (8 ed.). Academic Press, Inc. ISBN 0-12-384933-0. LCCN 2014010276. ISBN 978-0-12-384933-5.
3. ^ a b Colomer and Colomer
4. ^ Ramm and Zaslavsky
5. ^ Herley and Vetterli
6. ^ a b Mallat
7. ^ Vetterli and Herley