INTERNATIONAL JOURNAL OF SCIENTIFIC & TECHNOLOGY RESEARCH VOLUME 3, ISSUE 9, SEPTEMBER 2014 ISSN 2277-8616 Discrete Transforms Of Haar’s Wavelet

Bahram Dastourian, Elias Dastourian, Shahram Dastourian, Omid Mahnaie

Abstract: Wavelet play an important role not only in the theoretic but also in many kinds of applications, and have been widely applied in signal processing, sampling, coding and communications, filter bank theory, system modeling, and so on. This paper focus on the Haar’s wavelet. We discuss on some command of Haar’s wavelet with its signal by MATLAB programming. The base of this study followed from multiresolution analysis.

Keyword: approximation; detail; filter; Haar’s wavelet; MATLAB programming, multiresolution analysis. ————————————————————

1 INTRODUCTION Definition 4. Let 퐻 be a i) A family 풙 ⊂ 푯 is an orthonormal system if are a relatively recent development in applied 풋 풋∈푱 mathematics. Their name itself was coined approximately a decade ago (Morlet, Arens, Fourgeau, and Giard [11], Morlet 1 푖 = 푗, ∀푖, 푗 ∈ 퐽 ∶ 푥 , 푥 = [10], Grossmann, Morlet [3] and Mallat[9]); in recently years 푖 푗 0 푖 ≠ 푗. interest in them has grown at an explosive rate. There are several reasons for their present success. On the one hand, ii) A family 풙 ⊂ 푯 is total if for all 풙 ∈ 푯 the following the concept of wavelets can be viewed as a synthesis of ideas 풋 풋∈푱 which originated during the last twenty or thirty years in implication holds engineering (subband coding), physics (coherent states, renormalization group), and pure mathematics (study of ∀푗 ∈ 퐽 ∶ 푥, 푥푗 = 0 ⇒ 푥 = 0. Calderon-Zygmund operators). As a consequence of these interdisciplinary origins, wavelets appeal to scientists and iii) A total orthonormal system is called . engineers of many different backgrounds. On the other hand, wavelets are a fairly simple mathematical tool with a great Definition 5. Let 퐻 and 퐻0 be Hilbert spaces and 푇: 퐻 → 퐻0 variety of possible applications. Already they have led to be a bounded linear operator. Then 푇 is an (orthogonal) exciting applications in signal analysis (sound, images) (some projection if 푇 = 푇∗ = 푇2. early references are Kronland-Martinet, Morlet and Grossmann [4], Mallat [6], [8]; more recent references are Definition 6. Let (푋, 훽, 휇) be a measure space. given later) and numerical analysis (fast algorithms for integral i) 푓: 푋 → 푅푛 is called measurable if 푓−1 퐵 ∈ 훽 for all Borel transforms in Beylkin, Coifman, and Rokhlin [1]); many other sets 퐵. The space of measurable functions 푋 → 퐶 is denoted applications are being studied. This wide applicability also by 푀(푋). contributes to the interest they generate. P.J. Wood in [15] developed the wavelet in the Hilbert C*-module case. Also J.A. ii) For 1 ≤ 푝 < ∞, the space 퐿푝 푋, 휇 = 퐿푝 (푋) is defined by Packer and M.A. Rieffel [12] and Z. Liu, X. Mu and G. Wu [5] 푝 푝 studies this concept in L2(Rd ). 퐿 푋 = {푓 ∈ 푀 푋 ∶ 푓 푥 푑휇 푥 < ∞ 푋 endowed with the 퐿푝 -norm 2 PRELIMINARIES 1 푝 푝 Detailed In this section we give some Definition and Theorem 푓 푝 = 푓 푥 푑휇 푥 that we need for the results. For more details about following 푋 concepts and proof of Theorems one can see [2, 7, 14]. In the sequel, we denoted the integer, real and complex numbers by For 풑 = ∞ we let 푍, 푅 and 퐶, respectively. ∞ 퐿 푋 = {푓 ∈ 푀 푋 ∶ 푓 ∞ < ∞}

Where

푓 ∞ = inf 훼 ∶ 푓 푥 < 훼 푎. 푒. .

퐿푝 푋 is complete with respect to the metric 푑(푓, 푔) = 푓 − 푔 ; this makes 퐿푝 푋 a . 퐿2 푋 is a Hilbert 푝 space, with scalar product

______푓, 푔 = 푓 푥 푔 푥 푑휇 푥 .  Bahram Dastourian, Department of Mathematics, 푋 Dehdasht Branch, Islamic Azad University, Dehdasht, Iran. E-mail: [email protected] For more details one can saw [13].

 Shahram Dastourian, Elias Dastourian, Omid Definition 7. The Fourier transform of a function 푓 ∈ 퐿1(푅) is Mahnaie, Department of Mathematics, Dehdasht −2휋푖푤푥 1 Branch, Islamic Azad University, Dehdasht, Iran 푓 휔 = ∫ 푓 푥 푒 푑휇(푥), for 휔 ∈ 푅. If 푓 ∈ 퐿 (푅) then 푓 is

247 IJSTR©2014 www.ijstr.org INTERNATIONAL JOURNAL OF SCIENTIFIC & TECHNOLOGY RESEARCH VOLUME 3, ISSUE 9, SEPTEMBER 2014 ISSN 2277-8616 continuous with 푓 푥 = ∫ 푓 푤 푒2휋푖푤푥 푑휇(푤). The Fourier (inverse) scale or (with some freedom) frequency parameter. transform is the linear operator 퐹: 푓 → 푓 . Thus the inclusion property ―1‖ has a quite natural interpretation: Increasing resolution amounts to adding Definition 8. Let 휔, 푥, 푎 ∈ 푅, with 푎 ≠ 0. We define information. If we denote by 푃푗 the projection onto 푉푗 , we obtain the characterizations 2 푇푥 푓 푦 = 푓 푦 − 푥 , 푇푟푎푛푠푙푎푡푖표푛 표푝푒푟푎푡표푟 "2" ⇔ ∀ 푓 ∈ 퐿 푅 : 푓 − 푃푗 푓 → 0, 푎푠 푗 → ∞ −1/2 −1 2 퐷푎 푓 푦 = 푎 푓 푎 푦 , 퐷푖푙푎푡푖표푛 표푝푒푟푎푡표푟 "3" ⇔ ∀ 푓 ∈ 퐿 푅 : 푃푗 푓 → 0 , 푎푠 푗 → −∞ −2휋푖휔푦 푀휔 푓 푦 = 푒 푓 푦 , 푀표푑푢푙푎푡푖표푛 표푝푒푟푎푡표푟 푃푗 푓 can be interpreted as an approximation to 푓 with resolution 2푗 . Thus ―2‖ implies that this approximation converges to 푓, as All these operators are easily checked to be unitary on 퐿2(푅). resolution increases. Dilation and translation have a simple geometrical meaning. 푇푥 amounts to shifting a graph of a function by 푥, whereas 퐷 is a 푎 Definition 3. Let 푉푗 denote an MRA. A space 푉푗 is called dilation of the graph by a along the 푥-axis, with a dilation 푗 ∈푍 approximation space of scale 푗. Denote by 푊 the orthogonal by 푎 −1/2 along the 푦-axis: If 푠푢푝푝푓 = [0, 1], then 푗 complement of 푉푗 in 푉푗 +1, so that we have the orthogonal 푠푢푝푝(퐷푎 푓) = [0, 푎] and 푠푢푝푝(푇푥 푓) = [푥, 푥 + 1], where decomposition 푊 ⊕ 푉 = 푉 . 푊 is called the detail space of 푠푢푝푝 푔 = {푥 ∶ 푔 푥 ≠ 0}. 푗 푗 푗 +1 푗 scale 푗. Definition 9. If 푓, 푔 are complex-valued functions defined on 푅, their convolution 푓 ∗ 푔 is the function (푓 ∗ 푔) 푥 = 3 MAIN RESULTS ∫ 푓 푥 − 푦 푔 푦 푑휇(푦), provided that the integral exists. As Throughout this section we fix a multiresolution analysis 푉 with scaling function 휑, wavelet 휓 and scaling 푗 푗 ∈푍 Definition ???. Let 푚: 푅 → 퐶 be a bounded measurable coefficients 푎푘 푘∈푍. Given 푓 ∈ 푉0, we can expand it with function. Then the associated multiplication operator respect to two different orthonormal basis: 2 2 푆푚 : 퐿 푅 → 퐿 (푅), 푆푚 (푓)(푥) = 푚(푥)푓(푥) is a bounded linear operator. An operator 푄: 퐿2 푅 → 퐿2(푅) is called (linear) filter if ∞ 푓 = 푐0,푘 푇푘 휑 = 푑−1,푘 퐷2푇푘 휓 + 푐−1,푘 퐷2푇푘 휑 there exists 푚 ∈ 퐿 (푅) such that 푘∈푍 푘∈푍 푘∈푍

For all 푓 ∈ 퐿2(푅), 푄푓 ̂ 휔 = 푓 휔 푚 휔 . Here we use the notations

Definition 1. A multiresolution analysis (MRA) is a sequence 푐푗 ,푘 = 푓, 퐷2−푗 푇푘 휑 , "푎푝푝푟표푥푖푚푎푡푖표푛 푐표푒푓푓푖푐푖푒푛푡" of closed subspaces 푉 of 퐿2(푅) with the following list of 푗 푗 ∈푍 푑 = 푓, 퐷 −푗 푇 휓 , "푑푒푡푎푖푙 푐표푒푓푓푖푐푖푒푛푡" properties: 푗 ,푘 2 푘

1. ∀퐣 ∈ 퐙 ∶ 퐕퐣 ⊂ 퐕퐣+ퟏ, In the following we will use 푑푗 = 푑 and 푐푗 = 푐 . 2. 퐕 = 퐋ퟐ(퐑), −푗 ,푘 푘∈푍 −푗 ,푘 푘∈푍 퐣∈퐙 퐣 At the heart of the fast are explicit formulae 3. 퐣∈퐙 퐕퐣 = {ퟎ}, ퟐ for the correspondence 퐣 4. ∀퐣 ∈ 퐉, ∀퐟 ∈ 퐋 퐑 ∶ 퐟 ∈ 퐕퐣 ⇔ 퐃ퟐ 퐟 ∈ 퐕ퟎ, 5. 퐟 ∈ 퐕ퟎ ⇒ ∀퐦 ∈ 퐙 ∶ 퐓퐦퐟 ∈ 퐕ퟎ, 푐0 ↔ (푐1, 푑1) 6. There exists 훗 ∈ 퐕ퟎ such that (퐓퐦훗)퐦∈퐙 is an orthonormal basis of 퐕ퟎ. For this purpose we require one more piece of notation. Definition 10. The up- and downsampling operators ↑ 2 and ↓ 2 In ―6‖ 휑 is called scaling function of 푉 . The properties ―1‖- 푗 푗 ∈푍 are given by ―6‖ are somewhat redundant. They are just listed for a better understanding of the construction. The following discussion ↓ 2푓 푛 = 푓 2푛 , "푑표푤푛" will successively strip down ―1‖-―6‖ to the essential. 0 푛 표푑푑, ↑ 2푓 푛 = "푢푝" Remarks 2. (a) Properties ―4‖ and ―6‖ imply that the scaling 푓 푘 푛 = 2푘. function 휑 uniquely determines the multiresolution analysis: We have We have (↑ 2)^ ∗= (↓ 2), as well as ↓ 2 표 ↑ 2 = 퐼, where 퐼 is the identity operator. In particular, ↑ 2 is an isometry. Theorem 11. The bijection 푐0 ↔ (푐1, 푑1) is given by 푉0 = 푠푝푎푛(푇푘 휑 ∶ 푘 ∈ 푍)

푗 +1 푗 푗+1 푗 by ―6‖ (which incidentally takes care of ―5‖) and 퐴푛푎푙푦푠푖푠: 푐 =↓ 2 푐 ∗ ℓ , 푑 =↓ 2 푐 ∗ 푕

And 푉푗 = 퐷 −푗 푉0 2 푗 푗 +1 ∗ 푗 +1 ∗ is prescribed by ―4‖. What is missing are criteria for ―1‖-―3‖ and 푆푦푛푡푕푒푠푖푠: 푐 = ↑ 2푐 ∗ 푕 + ↑ 2푑 ∗ ℓ ―6‖. However, note that in the following the focus of attention Here the filters 푕, ℓ are given by 푕 푘 = −1 1+푘 푎 / 2 and shifts from the spaces 푉푗 to the scaling function 휑. 1+푘 ℓ 푘 = 푎−푘 / 2. (b) The parameter 푗 can be interpreted as resolution or

248 IJSTR©2014 www.ijstr.org INTERNATIONAL JOURNAL OF SCIENTIFIC & TECHNOLOGY RESEARCH VOLUME 3, ISSUE 9, SEPTEMBER 2014 ISSN 2277-8616

Remark 12. The ―Cascade Algorithm‖: Iteration of the analysis  Lo_D is the decomposition low-pass filter. step yields 푐푗 , 푑푗 for 푗 ≥ 1.  Hi_D is the decomposition high-pass filter.

Lo_D and Hi_D must be the same length.

Starting from a signal s, two sets of coefficients are computed: approximation coefficients CA1, and detail coefficients CD1. Whereas the synthesis step is given by These vectors are obtained by convolving s with the low-pass filter Lo_D for approximation and with the high-pass filter Hi_D for detail, followed by dyadic decimation. More precisely, the first step is

The decomposition step corresponds to the orthogonal decompositions

For example we give the Haar wavelet as follow. Note that in MATLAB we have, Example. The Haar wavelet is the following simple step function: ℓ = 퐿푖_퐷, 푕 = 퐻푖_퐷. 1 0 ≤ x < 1/2,

휓 푥 = χ[0,1/2[ − χ[1/2,1[ = −1 1/2 ≤ x < 1 We can compute the high pass and low pass filters 푕, ℓ as 0 o. w. follows: Define ℓ = 1/ 2 1/ 2 , 푕 = [−1/ 2 1/ 2] . 2 푉0 = {푓 ∈ 퐿 푅 ∶ ∀푛 ∈ 푍 ∶ 푓 푛,푛+1 푖푠 푐표푛푠푡푎푛푡} The programming in the MATLAB is as follows: If we set 휑 = 휒[0,1[, it is not hard to see that 푇푘 휑 푘∈푍 is an orthonarmal basis of 푉0. 휑 induces an MRA. Note that in this case

2 푉푗 = {푓 ∈ 퐿 푅 ∶ ∀푛 ∈ 푍 ∶ 푓 푛,푛+1 푖푠 푐표푛푠푡푎푛푡}

Thus the closed subspace 푉 is indeed a multiresolution 푗 푗 ∈푍 analysis, so called Haar multiresolution analysis. The Haar wavelet and it’s Fourier is as follows:

With the following figure.

Original signal 600

500

400

Fig 1: The Haar wavelet and its Fourier transform (only the 300 200 absolute value) 0 100 200 300 400 500 600 700 800 900 1000 Approx. coef. for haar Detail coef. for haar 800 30

A. DWT 700 20 dwt command performs a single-level one-dimensional 600 10 wavelet decomposition with respect to either a particular 500 0 wavelet ('wname') or particular wavelet decomposition filters 400 -10 300 -20 (Lo_D and Hi_D) that you specify. [cA,cD]=dwt(X,'wname') 0 200 400 600 0 200 400 600 computes the approximation coefficients vector cA and detail coefficients vector cD, obtained by a wavelet decomposition of the vector X. The string 'wname' contains the wavelet name. B. IDWT [cA,cD]=dwt(X,Lo_D,Hi_D) computes the wavelet The idwt command performs a single-level one-dimensional decomposition as above, given these filters as input: wavelet reconstruction with respect to either a particular 249 IJSTR©2014 www.ijstr.org INTERNATIONAL JOURNAL OF SCIENTIFIC & TECHNOLOGY RESEARCH VOLUME 3, ISSUE 9, SEPTEMBER 2014 ISSN 2277-8616 wavelet ('wname') or particular wavelet reconstruction filters (Lo_R and Hi_R) that you specify. X=idwt(cA,cD,'wname') returns the single-level reconstructed approximation coefficients vector X based on approximation and detail coefficients vectors cA and cD, and using the wavelet 'wname'. X = idwt(cA,cD,Lo_R,Hi_R) reconstructs as above using filters that you specify.  Lo_R is the reconstruction low-pass filter.  Hi_R is the reconstruction high-pass filter.

Lo_R and Hi_R must be the same length. idwt is the inverse function of dwt in the sense that the abstract statement idwt(dwt(X,'wname'),'wname') would give back X. Starting from the approximation and detail coefficients at level j, cAj and cDj, the inverse discrete wavelet transform reconstructs cAj−1, inverting the decomposition step by inserting zeros and convolving the results with the reconstruction filters.

C. WAVDEC wavedec performs a multilevel one-dimensional wavelet analysis using either a specific wavelet ('wname') or a specific wavelet decomposition filters (Lo_D and Hi_D). [C,L] = wavedec(X,N,'wname') returns the wavelet decomposition of the signal X at level N, using 'wname'. N must be a strictly positive integer. The output decomposition structure contains the wavelet decomposition vector C and the bookkeeping vector L. The structure is organized as in this level-3 decomposition example.

Note that in MATLAB we have,

ℓ∗ = 퐿표_푅, 푕∗ = 퐻푖_푅.

We can compute the high and low pass filters 푕, ℓ as follows:

ℓ = 1/ 2 1/ 2 , 푕 = [−1/ 2 1/ 2]

The programming in the MATLAB is as follows:

[C,L]=wavedec(X,N,Lo_D,Hi_D) returns the decomposition structure as above, given the low- and high-pass decomposition filters you specify.

D. DETCOEF detcoef is a one-dimensional wavelet analysis function. D = detcoef(C,L,N) extracts the detail coefficients at level N from the wavelet decomposition structure [C,L]. Level N must be an integer such that 1 ≤ N ≤ NMAX where NMAX = length(L)-2. D With the following figure. = detcoef(C,L) extracts the detail coefficients at last level NMAX.

E. APPCOEF appcoef is a one-dimensional wavelet analysis function.appcoef computes the approximation coefficients of a one-dimensional signal. A = appcoef(C,L,'wname',N) computes the approximation coefficients at level N using the wavelet decomposition structure [C,L]. 'wname' is a string 250 IJSTR©2014 www.ijstr.org INTERNATIONAL JOURNAL OF SCIENTIFIC & TECHNOLOGY RESEARCH VOLUME 3, ISSUE 9, SEPTEMBER 2014 ISSN 2277-8616 containing the wavelet name. Level N must be an integer such that 0 ≤ N ≤ length(L)-2. Instead of giving the wavelet name, [6] S. Mallat, ―A theory for multiresolution signal you can give the filters. For A = appcoef(C,L,Lo_R,Hi_R) or A decomposition: the wavelet representation,‖ IEEE Trans. = appcoef(C,L,Lo_R,Hi_R,N), Lo_R is the reconstruction low- PAMI, vol. 11, pp. 674-693, 1989. pass filter and Hi_R is the reconstruction high-pass filter. The following programming is in level-3. [7] S. Mallat, ―A Wavelet Tour of Signal Processing.‖ 2nd ed. Academic Press, 1999.

[8] S. Mallat, ―Multifrequency channel decompositions of images and wavelet models,‖ IEEE Trans. Acoust . Signal Speech Process., vol. 37, pp. 2091-2110, 1989.

[9] S. Mallat, ―Multiresolution approximation and wavelets,‖ Trans. Amer. Math. Soc., vol. 315, pp. 69-88, 1989.

[10] J. Morlet, ―Sampling theory and wave propagation,‖ in NATO ASI Series, Vol. 1, Issues in Acoustic signal/Image processing and recognition, C. H. Chen, ed., Springer- Verlag, Berlin, pp. 233-261, 1983.

[11] J. Morlet, G. Arens, I . Fourgeau, and D. Giard, ―Wave propagation and sampling theory,‖ Geophysics, vol. 47, pp. 203-236, 1982.

[12] J.A. Packer and M.A. Rieffel, ―Projective multi-resolution 2 d analyses for L (R ),‖ J. Fourier Anal. Appl. 10, 439–464, Also we have the following figure for this. 2004.

[13] W. Rudin, ―Real and Complex Analysis,‖ Mcgraw-Hill, New York, 1987.

[14] P. Wojtaszczyk, ‖A Mathematical Introduction to Wavelets,‖ London Mathematical Society Student Texts 37. Cambridge University Press, 1997.

[15] P.J. Wood, ―Wavelets and C*-algebras,‖ PhD thesis, Flinders University of South Australia, 2003.

REFERENCES [1] G. Beylkin, R. Coifman and V. Rokhlin, ―Fast wavelet tmnsforms and numerical algorithms,‖ Comm. Pure Appl. Math. , vol. 44, pp. 141-183, 1991.

[2] I. Daubechies, ―Ten Lectures on Wavelets.‖ CBMS-NFS regional series in applied mathematics. SIAM, 1992.

[3] A. Grossmann and J. Morlet, ―Decomposition of Hardy junctions into square integrable wavelets of constant shape,‖ SIAM J. Math. Anal., vol. 15, pp. 723-736, 1984.

[4] R. Kronland-Martinet , J. Morlet, and A. Grossmann, ―Analysis of sound patterns through wavelet tronsforms,‖ Internat. J. Pattern Recognition and Artificial Intelligence, vol. 1, pp. 273-301, 1987.

[5] Z. Liu, X. Mu and G. Wu, ―MRA Pparseval frame multiwavelets in L2(Rd),‖ Bulletin of the Iranian Mathematical Society Vol. 38, No. 4, pp 1021-1045, 2012.

251 IJSTR©2014 www.ijstr.org