Top Banner
Research Article Implementation of 2D Discrete Wavelet Transform by Number Theoretic Transform and 2D Overlap-Save Method Lina Yang, 1,2 Yuan Yan Tang, 1 and Qi Sun 3 1 Department of Computer and Information Science, University of Macau, Avenida Padre Tomas Pereira, Taipa 1356, Macau 2 Department of Mathematics and Computer Science, Guangxi Normal University of Nationalities, Chongzuo 532200, China 3 Department of Mathematics, Sichuan University, Chengdu, Sichuan 610064, China Correspondence should be addressed to Yuan Yan Tang; [email protected] Received 14 January 2014; Accepted 25 April 2014; Published 27 May 2014 Academic Editor: Cristian Toma Copyright © 2014 Lina Yang et al. is is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. To reduce the computation complexity of wavelet transform, this paper presents a novel approach to be implemented. It consists of two key techniques: (1) fast number theoretic transform(FNTT) In the FNTT, linear convolution is replaced by the circular one. It can speed up the computation of 2D discrete wavelet transform. (2) In two-dimensional overlap-save method directly calculating the FNTT to the whole input sequence may meet two difficulties; namely, a big modulo obstructs the effective implementation of the FNTT and a long input sequence slows the computation of the FNTT down. To fight with such deficiencies, a new technique which is referred to as 2D overlap-save method is developed. Experiments have been conducted. e fast number theoretic transform and 2D overlap-method have been used to implement the dyadic wavelet transform and applied to contour extraction in pattern recognition. 1. Introduction Wavelet transform plays an important role in image process- ing, pattern recognition, document analyses, and so forth [112]. e basic operation of it, in fact, is a linear convolution. In digital signal processing, a signal is represented by a discrete sequence. erefore, the discrete wavelet transform can be utilized to process it. We have [13] (, ) = ∬ (, V) ( − , − V) V =∑ , ( − 1 − , − 1 − ) , , , (1) where , , =∬ [,+1]×[,+1] (, V) V =∫ (+1)/ / (+1)/ / (, V)V, = 1, 2. (2) Explicitly, either continuous wavelet transform or discrete wavelet transform is essentially the operation of filtering. Directly calculating (1) may be time-consuming, because the number of multiplication operations may come large in this way. Although Mallat algorithm [14] can implement the wavelet transform successfully in some special cases, that is, in an orthogonal wavelet basis or in the multiresolution analysis, it is not a solution of all kinds of wavelet transforms. erefore, studying how to speed up the general discrete wavelet transform is of great practical significance. Actually, the filtering is a linear convolution in signal processing. In the following, without loss of generality, we will begin with the definition of Linear Convolution of two 2D sequences. e equation for a 2D finite impulse response of a filter can be represented in the similar way and given by 1 , 2 = 2 −1 1 =0 2 −1 2 =0 1 , 2 1 1 , 2 2 1 1 ≥0, 2 2 ≥0 1 = 0, 1, . . . , 2 = 0, 1, . . . , (3) Hindawi Publishing Corporation Mathematical Problems in Engineering Volume 2014, Article ID 532979, 15 pages http://dx.doi.org/10.1155/2014/532979
16

Research Article Implementation of 2D Discrete Wavelet ...downloads.hindawi.com/journals/mpe/2014/532979.pdfResearch Article Implementation of 2D Discrete Wavelet Transform by Number

Mar 15, 2018

Download

Documents

nguyentu
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Research Article Implementation of 2D Discrete Wavelet ...downloads.hindawi.com/journals/mpe/2014/532979.pdfResearch Article Implementation of 2D Discrete Wavelet Transform by Number

Research ArticleImplementation of 2D Discrete Wavelet Transform by NumberTheoretic Transform and 2D Overlap-Save Method

Lina Yang12 Yuan Yan Tang1 and Qi Sun3

1 Department of Computer and Information Science University of Macau Avenida Padre Tomas Pereira Taipa 1356 Macau2Department of Mathematics and Computer Science Guangxi Normal University of Nationalities Chongzuo 532200 China3Department of Mathematics Sichuan University Chengdu Sichuan 610064 China

Correspondence should be addressed to Yuan Yan Tang yytangumacmo

Received 14 January 2014 Accepted 25 April 2014 Published 27 May 2014

Academic Editor Cristian Toma

Copyright copy 2014 Lina Yang et alThis is an open access article distributed under theCreativeCommonsAttributionLicensewhichpermits unrestricted use distribution and reproduction in any medium provided the original work is properly cited

To reduce the computation complexity of wavelet transform this paper presents a novel approach to be implemented It consists oftwo key techniques (1) fast number theoretic transform(FNTT) In the FNTT linear convolution is replaced by the circular one Itcan speed up the computation of 2D discrete wavelet transform (2) In two-dimensional overlap-save method directly calculatingthe FNTT to thewhole input sequencemaymeet two difficulties namely a bigmodulo obstructs the effective implementation of theFNTT and a long input sequence slows the computation of the FNTT down To fight with such deficiencies a new technique whichis referred to as 2D overlap-save method is developed Experiments have been conducted The fast number theoretic transformand 2D overlap-method have been used to implement the dyadic wavelet transform and applied to contour extraction in patternrecognition

1 Introduction

Wavelet transform plays an important role in image process-ing pattern recognition document analyses and so forth [1ndash12] The basic operation of it in fact is a linear convolution

In digital signal processing a signal is represented by adiscrete sequence Therefore the discrete wavelet transformcan be utilized to process it We have [13]

119882119894

119904119891 (119899119898) = ∬119891 (119906 V) 120595119894

119904(119899 minus 119906119898 minus V) 119889119906 119889V

= sum

119896119897

119891 (119899 minus 1 minus 119896119898 minus 1 minus 119897) 120595119904119894

119896119897

(1)

where

120595119904119894

119896119897= ∬[119896119896+1]times[119897119897+1]

120595119894

119904(119906 V) 119889119906 119889V

= int

(119896+1)119904

119896119904

119889119906int

(119897+1)119904

119897119904

120595119894(119906 V) 119889V 119894 = 1 2

(2)

Explicitly either continuous wavelet transform or discretewavelet transform is essentially the operation of filtering

Directly calculating (1) may be time-consuming becausethe number of multiplication operations may come large inthis way Although Mallat algorithm [14] can implement thewavelet transform successfully in some special cases thatis in an orthogonal wavelet basis or in the multiresolutionanalysis it is not a solution of all kinds of wavelet transformsTherefore studying how to speed up the general discretewavelet transform is of great practical significance

Actually the filtering is a linear convolution in signalprocessing In the following without loss of generality wewill begin with the definition of Linear Convolution of two2D sequences

The equation for a 2D finite impulse response of a filtercan be represented in the similar way and given by

11991011989911198992

=

1198972minus1

sum

1198961=0

1198982minus1

sum

1198962=0

ℎ11989611198962

1199091198991minus11989611198992minus1198962

1198991minus1198961ge0 1198992minus1198962ge0

1198991= 0 1 119899

2= 0 1

(3)

Hindawi Publishing CorporationMathematical Problems in EngineeringVolume 2014 Article ID 532979 15 pageshttpdxdoiorg1011552014532979

2 Mathematical Problems in Engineering

where 11990911989911198992

and 11991011989911198992

(1198991

= 0 1 1198992

= 0 1 ) standfor the input and output of the filter respectively and ℎ

11989611198962

denote the filtering coefficients (1198961

= 0 1 1198972minus 1 119896

2=

0 1 1198982minus 1)

In many certain applications we are required to computeonly such an output sequence which is with a finite length in(3) Let 119909

11989911198992

be a 2D finite input of the filter with lengths 1198971

and 1198981 We compute the finite output as follows

11991011989911198992

=

1198972minus1

sum

1198961=0

1198982minus1

sum

1198962=0

ℎ11989611198962

1199091198991minus11989611198992minus1198962

0le1198991minus1198961lt1198971

0le1198992minus1198962lt1198981

1198991= 0 1 119897

1minus 1 119899

2= 0 1 119898

1minus 1

(4)

In practice the difference between the length of the inputsignal and that of the filter is often large If we calculateconvolution (4) directly a large number of multiplicationoperations will be executed In the meantime a series ofcalculations to treat zeros will be performed if fast Fouriertransform (FFT) is used to speed up the computation Bothof these twomethods will be time-consuming to compute thelinear convolution To overcome this problem in this paperwe will present a novel approach which is referred to ourprevious work as number theoretic transform (NTT) [15ndash17] Also we will prove that the computation of the linearconvolution can be replaced by that of the cyclic convolutionof two 2D sequences with lengths 119873

1= 1198971

+ 1198972

minus 1 and1198732= 1198981+ 1198982minus 1 respectively

For two 2D sequences 11990911989911198992

and ℎ11989911198992

of finite lengths1198731

and 1198732 their cyclic convolution can be written by

11991011989911198992

=

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

11990911989611198962

ℎ⟨1198991minus1198961⟩1198731⟨1198992minus1198962⟩1198732

=

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

ℎ11989611198962

119909⟨1198991minus1198961⟩1198731⟨1198992minus1198962⟩1198732

1198991= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1

(5)

where ⟨119909⟩119873denotes the remainder 119903 of 119909 modulo 119873 that is

119909 = 119902119873 + 119903 119902 is any integer and 0 le 119903 lt 119873The number theoretic transform (NTT) provides an

effective way to calculate the cyclic convolution Howeverthere exist two difficulties if directly applying the NTT to thewhole input sequence namely

(i) a considerable big modulo M has to be imposed Itobstructs the effective implementation of the NTTdue to the limited length of the word which is usedto store data in computers It will thus become abottleneck in the computation of convolution

(iii) the advantage of the fast computation of the NTTcannot be reached when the difference between thelength of the input sequence and that of the filtersequence is large Thus it may not speed up thecalculation of convolution in this case

To avoid using a big modulo M we can use Chineseremainder theorem to reduce the length of the modulo Mand successfully apply the NTT to calculate the convolutionUnfortunately the number of multiplication operations willbe at least doubled and thus the computational complexitywill increase The second key technique will be worked outin this paper to overcome the above difficulties and speed upthe calculation of the convolution It is termed 2D overlap-save method which is an expansion of the 1D overlap-save method It can be used to implement the 2D wavelettransform when a big difference between the length of theinput sequence 119909

11989911198992

and that of the filter sequence ℎ11989911198992

occurs This method consists of three steps

(i) First the original 2D input sequence is equivalentlydivided into many small separated sections Thisdivision brings two evident improvements

(a) The size of each section is much smaller thanthat of the whole input sequence such that asmallmodulo M can be used and the NTT cantherefore be performed in a computer system

(b) The difference between the length of one sectionand that of the filter sequence becomes smallerwhich makes the effective application of theNTT

(ii) In the second step we calculate the cyclic convolutionof each section with the filter sequence by NTT

(iii) Finally the result of (4) is obtained by picking out datafrom each of the results calculated in the second stepand combining these data together

In comparison with direct method and fast Fouriertransform (FFT) it will be proved explicitly that the numberof multiplication operations in the 2D overlap-save methodwill be smaller than that in any of those twomethods inmanyparticular cases

In the next section the number theoretic transform(NTT) will be presented Details of the 2D overlap-methodwill be discussed in Section 3 A comparison of computationof the multiplication in three methods will be given inSection 4 A computational example will be presented aswell as a practical experiment in Section 5 which will verifythe efficiency of the proposed approach In the experimentthe fast number theoretic transform and 2D overlap-methodwere applied to implement the dyadic wavelet transformextracting the contours in recognition of Chinese handwrit-ing

2 Number Theoretic Transform (NTT)

Suppose that ℎ11989611198962

are the filter coefficients (1198961= 0 1 119897

2minus

1 1198962

= 0 1 1198982minus 1) 119909

11989911198992

and 11991011989911198992

(1198991

= 0 1 1198971minus

1 1198992

= 0 1 1198981

minus 1) are the input and output of thefilter respectively In the concrete applications of the discretewavelet transform (DWT) the lengths of the input and outputare very long (119897

1and 119898

1are very big) while lengths of the

filter coefficients are short (1198972and 119898

2are small) Therefore if

Mathematical Problems in Engineering 3

the directmethod is used to calculate their linear convolutionthe number of multiplication operations will be large Inthis section the 2D number theoretic transform (FNTT) willbe applied to calculate the 2D circular convolution of 2Dsequences of lengths119873

1= 1198971+1198972minus1 and119873

2= 1198981+1198982minus1 In a

2D number theoretic transform (NTT) if a modulo119872 is toobig the Chinese remainder theorem (CRT) will be utilized toreduce the length

21 2D Linear Convolution and 2D Circular ConvolutionGiven two 2-dimensional sequences 119909

11989911198992

(1198991= 0 1 119897

1minus

1 1198992= 0 1 119898

1minus 1) and ℎ

11989911198992

(1198991= 0 1 119897

2minus 1 119899

2=

0 1 1198982minus 1) their linear convolution is defined by

11991011989911198992

=

1198971minus1

sum

1198961=0

1198981minus1

sum

1198962=0

11990911989611198962

ℎ1198991minus11989611198992minus1198962

0le1198991minus1198961lt1198972

0le1198992minus1198962lt1198982

=

1198972minus1

sum

1198961=0

1198982minus1

sum

1198962=0

ℎ11989611198962

1199091198991minus11989611198992minus1198962

0le1198991minus1198961lt1198971

0le1198992minus1198962lt1198981

1198991= 0 1 119897

1+ 1198972minus 2 119899

2= 0 1 119898

1+ 1198982minus 2

(6)

Given two 2-dimensional sequences 11990911989911198992

and ℎ11989911198992

oflengths 119873

1and 119873

2 respectively their circular convolution is

11991011989911198992

=

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

11990911989611198962

ℎ⟨1198991minus1198961⟩1198731⟨1198992minus1198962⟩1198732

=

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

ℎ11989611198962

119909⟨1198991minus1198961⟩1198731⟨1198992minus1198962⟩1198732

1198991= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1

(7)

where ⟨119909⟩119873denotes the remainder 119903 119909 = 119902119873+119903 0 le 119903 lt 119873

Proposition 1 The linear convolution (6) can be computed bycomputing circular convolution of two 2-dimensional sequencesof lengths 119873

1= 1198971+ 1198972minus 1 and 119873

2= 1198981+ 1198982minus 1 respectively

22 Using 2D Number Theoretic Transform to Calculate the2D Circular Convolution Let 119872 be a positive integer andsuppose that 119909

11989911198992

and ℎ11989911198992

are two 2-dimensional integersequences (119899

1= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1)

Let

11988311989611198962

equiv

1198731minus1

sum

1198991=0

1198732minus1

sum

1198992=0

11990911989911198992

1205721198991119896112057311989921198962(mod 119872) (8)

11986711989611198962

equiv

1198731minus1

sum

1198991=0

1198732minus1

sum

1198992=0

ℎ11989911198992

1205721198991119896112057311989921198962(mod 119872) (9)

11988411989611198962

equiv

1198731minus1

sum

1198991=0

1198732minus1

sum

1198992=0

11991011989911198992

1205721198991119896112057311989921198962(mod 119872) (10)

where (1198961

= 0 1 1198731minus 1 119896

2= 0 1 119873

2minus 1) and 120572

and 120573 are two given integers and 11991011989911198992

denote the circularconvolution as shown in (7) 119899

1= 0 1 119873

1minus 1 119899

2=

0 1 1198732minus 1

If a 2-dimensional transform (8) has an inverse transform

11990911989911198992

equiv 119873minus1

1sdot 119873minus1

2

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

11988311989611198962

120572minus11989911198961120572minus11989921198962(mod 119872)

(11)

(1198991= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1) and has circular

convolution property

11988411989611198962

equiv 11988311989611198962

11986711989611198962(mod 119872)

(1198961= 0 1 119873

1minus 1 119896

2= 0 1 119873

2minus 1)

(12)

then congruence equation (8) is referred to as a 2-dimensional number theoretic transform mod119872 and canbe abbreviated to NTT mod 119872

Agarwal and Burrus gave some sufficient conditions forexistence of 2-dimensional NTT given with 119872 gt 1 119873

1gt 1

and1198732gt 1 (see [15]) In [17] the authors gave some sufficient

and necessary conditions for existenceWe have the followingtheorem

Theorem 2 If 119872 = 1199011198971

1sdot sdot sdot 119901119897119904

119904 (119897119895ge 1 119895 = 1 119904) 119901

1 119901

119904

are distinct primes then the congruence equation (8) is a 2-dimensional NTT mod119872 with the first dimension of length1198731and the second dimension of length119873

2 if and only if 1205721198731 equiv

1 (mod119872) 1205731198732 equiv 1 (mod119872) and 120572119895

equiv 1 (mod119901119896) (1 le

119895 le 1198731minus 1) 120573119894 equiv 1 (mod 119901

119896) (1 le 119894 le 119873

2minus 1) 119896 = 1 119904

Corollary 3 The congruence equation (8) is a 2-dimensionalNTT mod119872 if and only if

lcm [1198731 1198732] | gcd (119901

1minus 1 119901

119904minus 1) (13)

where lcm[1198731 1198732] denotes the least common multiple of two

integers1198731and119873

2and gcd(119886 119887) denotes the greatest common

divisor of two integers 119886 and 119887

Corollary 4 Let 119901 be an odd prime and 119872 = 119901 Thenthe congruence equation (8) is a 2-dimensional NTT mod119901 ifand only if 1205721198731 equiv 1 (mod119901) and 120572

119895equiv 1 (mod119901) (1 le 119895 le

1198731minus 1) 1205731198732 equiv 1 (mod119901) and 120573

119895equiv 1 (mod119901) (1 le 119895 le

1198732minus 1)

Clearly from congruence equations (8) (9) (11) and(12) we can use the 2-dimensional NTT to calculate a 2-dimensional circular convolution

Finally we obtain

11991011989911198992

equiv

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

11990911989611198962

ℎ⟨1198991minus1198961⟩1198731⟨1198992minus1198962⟩1198732

(mod 119872)

1198991= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1

(14)

4 Mathematical Problems in Engineering

Select 119872 so that

1003816100381610038161003816100381611991011989911198992

10038161003816100381610038161003816le min

1003816100381610038161003816100381611990911989911198992

10038161003816100381610038161003816max

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

10038161003816100381610038161003816ℎ11989611198962

10038161003816100381610038161003816

10038161003816100381610038161003816ℎ11989911198992

10038161003816100381610038161003816max

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

1003816100381610038161003816100381611990911989611198962

10038161003816100381610038161003816

lt119872

2

(15)

where 1198991= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1 and 119872 is

an oddIf we use the 2-dimensional NTT to calculate the 2-

dimensional circular convolution11991011989911198992

so that |11991011989911198992

| lt 1198722then form congruence equation (14) we deduce that

11991011989911198992

=

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

11990911989611198962

ℎ⟨1198991minus1198961⟩1198731⟨1198992minus1198962⟩1198732

1198991= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1

(16)

23 Fast Number Theoretic Transform (FNTT) The idea ofFFT can be used to perform the NTT In this subsection atheoretic description will be presented briefly More detailswill be given in Section 5

Let

11988001198962

equiv

1198732minus1

sum

1198992=0

11990901198992

12057311989921198962 119880

1198731minus11198962

equiv

1198732minus1

sum

1198992=0

1199091198731minus11198992

12057311989921198962(mod119872)

1198962= 0 1 119873

2minus 1

(17)

From congruence equation (17) we deduce that

11988311989610

equiv

1198731minus1

sum

1198991=0

1198801198991012057211989911198961 119883

11989611198732minus1

equiv

1198731minus1

sum

1198991=0

11988011989911198732minus1

12057211989911198961(mod 119872)

1198961= 0 1 119873

1minus 1

(18)

Suppose that 1198731and 119873

2satisfy inequalities and we then

can use the idea of FFT to calculate the congruence equations(17) and (18)

For computing every

11988011989911198962

equiv

1198732minus1

sum

1198992=0

11990911989911198992

12057311989921198962(mod 119872)

(1198962= 0 1 119873

2minus 1)

(19)

in congruence equation (17) the numbers of all multipli-cation necessary are (119873

2log1198732)2 by using FFT algorithm

Hence if using FFT algorithm to calculate the congruence

11988011989911198962

equiv

1198732minus1

sum

1198992=0

11990911989911198992

12057311989921198962(mod119872)

(1198962= 0 1 119873

2minus 1)

(20)

in congruence equation (17) the numbers of all multiplica-tion necessary are ((119873

11198732)2) log119873

2

Similarly if using FFT algorithm to calculate all congru-ence equations in (18) then the numbers of all multiplicationnecessary are ((119873

21198731)2) log119873

1

Therefore if using the fast number theoretic transform(FNTT) to calculate the congruence equation (8) the numberof all multiplication necessary is

11987311198732

2log1198732+

11987321198731

2log1198731=

11987311198732

2log (119873

11198732) (21)

If119872 is very large wemay reduce the length of aword by usingChinese remainder theorem and it can be abbreviated toCRT

Therefore we have the following proposition

Proposition 5 Suppose that congruence equation (8) is a 2-dimensional NTT mod119872 where 119872 = 119901

1198971

1sdot sdot sdot 119901119897119904

119904 1199011 119901

119904

are distinct primes then we have a total of s 2-dimensionalNTT mod 119901

119897119894

119894 and they are described as follows

11988311989611198962

equiv

1198731minus1

sum

1198991=0

1198732minus1

sum

1198992=0

11990911989911198992

12057211989911198961

11989412057311989921198962

119894 (mod 119901

119897119894

119894)

1198961= 0 1 119873

1minus 1 119896

2= 0 1 119873

2minus 1

(22)

where 120572119894= ⟨120572⟩

119901119897119894

119894

120573119894= ⟨120573⟩

119901119897119894

119894

119894 = 1 2 119904If

11991011989911198992

=

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

11990911989611198962

ℎ⟨1198991minus1198961⟩1198731

⟨1198992minus1198962⟩1198732

equiv 119910(119894)

11989911198992

(mod 119901119897119894

119894)

(1198991= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1)

(23)

then

11991011989911198992

equiv

119904

sum

119894=1

1198721015840

119894119872119894119910(119894)

11989911198992

(mod119872)

(1198991= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1)

(24)

where 119872 = 119901119897119894

1198941198721198941198721015840

119894119872119894equiv 1 (mod 119901

119897119894

119894) 119894 = 1 119904

Mathematical Problems in Engineering 5

Proof Because the congruence equation (8) is a 2-dimen-sional NTT mod119872 hence

1205721198731 equiv 1 (mod119872) 120573

1198732 equiv 1 (mod 119872)

1205721198731 equiv 1 (mod 119901

119894) 120572

119895equiv 1 (mod 119901

119894) 1 le 119895 lt 119873

1

1205731198732 equiv 1 (mod 119901

119894) 120573

ℎequiv (mod 119901

119894) 1 le ℎ lt 119873

2

119894 = 1 2 119904

(25)

so

1205721198731 equiv 1 (mod 119901

119897119894

119894) 120573

1198732 equiv 1 (mod 119901

119897119894

119894)

1205721198731

119894equiv 1205721198731 equiv 1 (mod 119901

119894) 120572

119895

119894equiv 1 (mod 119901

119894)

1 le 119895 lt 1198731

1205731198732

119894equiv 1205731198732 equiv 1 (mod 119901

119894) 120573

119894equiv 1 (mod 119901

119894)

1 le ℎ lt 1198732

119894 = 1 119904

(26)

Hence the congruence equation (22) has a total of 119904 2-dimensional NTTs mod 119901

119897119894

119894 119894 = 1 119904 From CRT and the

congruence equation (23) we deduce that the congruenceequation (24) holds

3 Two-Dimensional Overlap-Save Method

Select two positive integers 1198731015840 and 1198721015840 so that 1198731015840 + 119897

2minus 1 =

119873 lt 1198971and 119872

1015840+ 1198982minus 1 = 119872 lt 119898

1 either 119873 or 119872 is given

by an integer power of 2 that is 119873 = 21198891 and 119872 = 2

1198892 where

1198891and 119889

2are two positive integers

Assuming that the input sequence 11990911989911198992

(1198991

=

0 1 1198971

minus 1 1198992

= 0 1 1198981

minus 1) is divided intomany small sections which are termed submatrices

1199091198991+V111987310158401198992+V211987210158401198991=119873minus1 119899

2=119872minus1

1198991=0 1198992=0

(V1= 0 1 V

2= 0 1 )

(27)

The consecutive matrix is overlapped by the previous oneAs a simple example four blocks chosen from the dividedinput matrices are overlapped and are graphically shown inFigure 1 Parameters V

1and V

2can be considered as shift

parameters because changing either V1or V2will select dif-

ferent submatrix For the first submatrix shown in Figure 1(a)we select V

1= 0 and V

2= 0 Second submatrix (V

1= 0 and

V2= 1) is displayed in Figure 1(b)Third one with parameters

of V1

= 1 and V2

= 0 is given in Figure 1(c) Fourth matrixshown in Figure 1(d) has parameters V

1= 1 and V

2= 1 The

procedure of the overlapping is also graphically illustrated inFigure 1

For the operation of circular convolution it is necessaryto have two sequences with the same length Taking (7) for

example the sequences 11990911989911198992

and ℎ11989911198992

are of the same lengthof1198731times1198732 Since the input sequence has already divided into

submatrices of119873times119872 by (27) the filter sequence has to be oflength119873times119872Therefore119873minus119897

2augmenting zeros are required

to be added to the row and119872minus1198982zeros to the column of the

filter sequence ℎ11989911198992

As a result the sequence ℎ11989911198992

becomes

ℎ1015840

11989911198992

=ℎ11989911198992

if 1198991= 0 1 119897

2minus 1 119899

2= 0 1 119898

2minus 1

0 if 1198972le 1198991lt 119873 or 119898

2le 1198992lt 119872

(28)

where 1198991= 0 1 119873 minus 1 and 119899

2= 0 1 119872 minus 1

The following form shows how a sequence ℎ101584011989911198992

is yieldedby adding augmenting zeros to the filter sequence ℎ

11989911198992

ℎ 997904rArr ℎ1015840 =

0 (29)

For each of the divided submatrices we can give V1and V

2

and compute the circular convolution of two 2D sequences1199091198991+V111987310158401198992+V21198721015840 and ℎ

1015840

11989911198992

(1198991

= 0 1 119873 minus 1 1198992

=

0 1 119872 minus 1) by

11991011990511199052

=

119873minus1

sum

1198991=0

119872minus1

sum

1198992=0

ℎ1015840

11989911198992

119909⟨1199051minus1198991⟩119873+V11198731015840⟨1199052minus1198992⟩119872+V21198721015840

1199051= 0 1 119873 minus 1 119905

2= 0 1 119872 minus 1

(30)

From (28) we deduce that

11991011990511199052

=

1198972minus1

sum

1198991=0

1198982minus1

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩119873+V11198731015840⟨1199052minus1198992⟩119872+V21198721015840 (31)

The result of (31) is that of circular convolution As we willsee below there exists an important connection between thecircular convolution and the linear one In fact since 119899

1=

0 1 1198972minus 1 and 119899

2= 0 1 119898

2minus 1 we can choose 119905

1=

1198972minus1 119873minus1 and 119905

2= 1198982minus1 119872minus1 in (31) this makes

119873 gt 1199051minus 1198991

gt 0 and 119872 gt 1199052minus 1198992

gt 0 in (31) Thus theremainder can exactly be equal to 119905

1minus 1198991and 1199052minus 1198992 Then

the circular convolution of (31) becomes

11991011990511199052

=

1198972minus1

sum

1198991=0

1198982minus1

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩119873+V11198731015840⟨1199052minus1198992⟩119872+V21198721015840

=

1198972minus1

sum

1198991=0

1198982minus1

sum

1198992=0

ℎ11989911198992

1199091199051minus1198991+V111987310158401199052minus1198992+V21198721015840

= 1199101199051+V111987310158401199052+V21198721015840

(32)

In order to clearly understand the procedure of obtainingthe components of linear convolution from the circularconvolution equation (31) a graphic description of it can befound in Figure 2 We show a dashed rectangle with size of119873 by 119872 in Figure 2(a) to represent the circular convolutionwhich is described in (31) and a darkened rectangle with sizeof1198731015840 by119872

1015840 to indicate the linear convolution stated in (32)

6 Mathematical Problems in Engineering

2N

m

n

2M

M

N1 = 0 2 = 0

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(a)

m

n

2N

2M

M

N1 = 1 2 = 0

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(b)

m

n

2N

2M

M

N

1 = 0 2 = 1

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(c)

m

n

2N

2M

M

N

1 = 1 2 = 1l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(d)

Figure 1 Four divided input submatrices are overlapped using the 2D overlap-save method (a) the first submatrix with parameters V1

=

0 V2= 0 is located on the top-left corner (b) the second one (V

1= 1 V

2= 0) overlaps by the first submatrix and the size of the overlapping

between them is119873 times1198982minus1 (c) the third divided input submatrix has parameters of V

1= 0 V

2= 1 It is overlapped by the first submatrix

and the size of the overlapping between them is 1198972minus 1 times 119872 (d) the fourth one with V

1= 1 V

2= 1 is overlapped by the first submatrix

and the size of the overlapping between them is 1198972minus 1 times 119898

2minus 1

m

n

2N

2M

M

N

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(a)

m

n

2N

2M

M

N

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(b)

Figure 2 Two consecutive output submatrices (a) the first block of V1= 0 and V

2= 0 and (b) the second block of V

1= 1 and V

2= 1

Mathematical Problems in Engineering 7

Obviously if the first 1198972minus 1 data in rows and the first 119898

2minus 1

data in columns are discarded from the dashed rectangle thedarkened rectangle can be obtained In the following we willexplain how to obtain the result of (4)

The output of the whole equation (4) can be representedin the following matrix

119884 = (

11991000

sdot sdot sdot sdot sdot sdot 11991001198981minus1

1199101198971minus10

sdot sdot sdot sdot sdot sdot 1199101198971minus11198981minus1

) (33)

which is an 1198971times 1198981matrix

So (32) gives a1198731015840times1198721015840 submatrix of matrix 119884 (note that

1198731015840= 119873 minus 119897

2+ 1 and that 1198721015840 = 119872 minus 119898

2+ 1)

(

1199101198972minus1+V111987310158401198982minus1+V21198721015840 sdot sdot sdot sdot sdot sdot 119910

1198972minus1+V11198731015840119872minus1+V

21198721015840

119910119873minus1+V

111987310158401198982minus1+V21198721015840 sdot sdot sdot sdot sdot sdot 119910

119873minus1+V11198731015840119872minus1+V

21198721015840

) (34)

Next to obtain the whole result we need to compute the cir-cular convolution of two 2D sequences 119909

1198991+(V1+1)119873

10158401198992+(V2+1)119872

1015840

and ℎ1015840

11989911198992

(1198991

= 0 1 119873 minus 1 1198992

= 0 1 119872 minus 1) Withthe same reasoning as above a consecutive submatrix of thematrix (34) is evinced as follows

(

119910119873+V11198731015840119872+V

21198721015840 sdot sdot sdot sdot sdot sdot 119910

119873+V11198731015840119872+119872

1015840minus1+V21198721015840

119910119873+119873

1015840minus1+V11198731015840119872+V

21198721015840 sdot sdot sdot sdot sdot sdot 119910

119873+1198731015840minus1+V11198731015840119872+119872

1015840minus1+V21198721015840

)

(35)

The corresponding graphic description is indicated inFigure 2(b) We will darken the rectangle in Figure 2(b) toexpress the submatrix (35) and the dashed one on its upper-left-corner to be the graphic description of the submatrix(34)

Clearly if (V1 V2) = (V10158401 V10158402) then (119905

1+ V11198731015840 1199052

+

V21198721015840) = (1199051015840

1+ V101584011198731015840 1199051015840

2+ V101584021198721015840) where 119897

2minus 1 le 119905

1 1199051015840

1le

119873 minus 1 1198982minus 1 le 119905

2and 1199051015840

2le 119872 minus 1 Let [119909] represent

the largest integer that is less than or equal to the realnumber 119909 therefore when V

1= 0 1 [(119897

1minus 119873)119873

1015840] and

V2

= 0 1 [(1198981minus 119872)119872

1015840] we will obtain all 1198731015840 times 119872

1015840

submatrices of thematrix119884 If 1198971= 11990411198731015840+119873 and119898

1= 11990421198721015840+

119872 then [(1198971minus 119873)119873

1015840] = (1198971minus 119873)119873

1015840 and [(1198981minus 119872)119872

1015840] =

(1198981minus119872)119872

1015840 The input matrix 11990911989911198992

will be divided with noremainder Figure 3 displays a series of small rectangles Eachrectangle stands for one1198731015840times119872

1015840 submatrixThe entirematrix119884 can be obtained by combining them

In Figure 3 there is a white Γ-type area indicating thatthere are no output data Two calculation methods canbe applied to obtain the data The first way is by using adirect method because only a few computations are neededAlternatively we can compute the data of Γ-type area with theoverlap-savemethod proposed above if1198731015840 = 119897

2minus1 and119872

1015840=

1198982minus 1 The detail of it is presented in the Technical Report

[18] The entire result is completed and is demonstrated inFigure 4 graphically

The two-dimensional overlap-save method is summa-rized as follows

m

n

Figure 3 All 1198731015840

times 1198721015840 submatrices of the output except the

boundary of Γ-type area

m

n

Figure 4 The full result of (4) computed by 2D overlap-savemethod where 119897

1= 11990411198731015840+ 119873 119898

1= 11990421198721015840+ 119872 and 119873

1015840+ 1198972minus 1 =

119873 lt 1198971and 119872

1015840+ 1198982minus 1 = 119872 lt 119898

1

(i) Select two positive integers 1198731015840 and 119872

1015840 so that 1198731015840 +1198972minus 1 = 119873 lt 119897

1and 119872

1015840+ 1198982minus 1 = 119872 lt 119898

1 Either

119873 or119872 is given by an integer power of 2 for using anFFT that is 119873 = 2

1198891 and 119872 = 2

1198892 where 119889

1and 119889

2

are two positive integers

(ii) Let ℎ101584011989911198992

satisfy (28)

(iii) Compute the circular convolution of two sequences1199091198991+V111987310158401198992+V21198721015840 and ℎ

1015840

11989911198992

(1198991

= 0 1 119873 minus 1 1198992

=

0 1 119872 minus 1) When 1199051

= 1198972minus 1 119873 minus 1 119905

2=

1198982minus 1 119872 minus 1 and V

1= 0 1 [(119897

1minus 119873)119873

1015840]

V2= 0 1 [(119898

1minus 119872)119872

1015840] we obtain all 1198731015840 times 119872

1015840

submatrices of the matrix of 119884 whose form is as (34)

8 Mathematical Problems in Engineering

If 1198971

= 11990411198731015840+ 119873 and 119898

1= 11990421198721015840+ 119872 then [(119897

1minus

119873)1198731015840] = (1198971minus 119873)119873

1015840 and [(1198981minus 119872)119872

1015840] = (119898

1minus

119872)1198721015840 The input matrix 119909

11989911198992

will be divided withno remainder

(iv) For 1199051= 0 1 119897

2minus 2 1199052= 0 1 119898

1minus 1 and 119905

1=

0 1 1198971minus 1 119905

2= 0 1 119898

2minus 2 compute 119910

11990511199052

byusing the direct method

If 1198731015840 = 1198972minus 1 and 119872

1015840= 1198982minus 1 we will add zeros

to the sequence 11990911989911198992

so that the 2D sequences are oflengths 119897

1+ 1198731015840 and 119898

1+ 1198721015840 Then we will compute

11991011989911198992

(1199051

= 0 1 1198972minus 2 1199052

= 0 1 1198981minus 1 and

1199051= 0 1 119897

1minus 1 1199052= 0 1 119898

2minus 2) by using an

overlap-save method The detail of it is presented inthe Technical Report [18]

We will introduce the way of using FNTT and 2Doverlap-save method with two examples One is numericalcomputation and the other is an experiment of extracting thecontour of a Chinese handwritten character

4 Comparison of the Numbersof Multiplication

Let119873 = 1198731015840+ 1198972minus 1 lt 119897

1119872 = 119872

1015840+1198982minus 1 lt 119898

11198731015840 = 119897

2minus 1

1198721015840= 1198982minus 1 1198972= 2119906+ 1 119898

2= 21199061015840

+ 1 and 1198971= 11990411198731015840+ 119873

1198981= 11990421198721015840+ 119872 Suppose that 119886

1and 1198862satisfy 2

1198861minus1

lt 1198971+

1198972minus 1 le 2

1198861 = 119873

1and 1198861198862minus1

lt 1198981+1198982minus 1 le 2

1198862 = 119873

2 Let 119871

1

1198712 and 119871

3denote the numbers of multiplication necessary

for computing the convolution (4) by using direct methodFNTT or FFT to calculate (4) (using Proposition 1) and2D overlap-save method respectively In [18] we comparedthe number of multiplications necessary for computing theconvolution (4) of two 2D sequences 119909

11989911198992

(1198991= 0 1 119897

1minus

1 1198992

= 0 1 1198981minus 1) and ℎ

11989911198992

(1198991

= 0 1 1198972minus 1

1198992= 0 1 119898

2minus 1) by three different methods

We proved the following results

(1) If 1198972lt 1198971 1198982lt 1198981 then

1198711=

11989721198982(1198972+ 1) (119898

2+ 1)

4+ (1198981minus 1198982)1198982

1198972(1198972+ 1)

2

+ (1198971minus 1198972) 1198972

1198982(1198982+ 1)

2+ (1198971minus 1198972) (1198981minus 1198982) 11989721198982

(36)

Also if 1198971= 1198981= 119897 1198972= 1198982= 1198971015840 then

1198711= (

1198971015840(2119897 minus 119897

1015840+ 1)

2)

2

(37)

(2) Consider

1198712= 21198861+1198862minus1

(31198861+ 31198862+ 2) (38)

(3) If 1198971= 1198981= 2119906+ℎ 1198972= 1198982= 2119906+ 1 119873 = 119872 = 2

119906+1and 119873

1015840= 1198721015840= 2119906 where 119906 ge 3 ℎ ge 2 then

1198711= ((2119906+ 1)2119906minus1

(2ℎ+1

minus 1))2

1198712= 22119906+2ℎ+1

(6119906 + 6ℎ + 8)

1198713= 2(2

119906+ℎ)2

(6119906 + 8)

(39)

In this section wewill suppose that1198731015840 = 1198972minus1 119872

1015840= 1198982minus

1 Let 119873 = 1198731015840+ 1198972minus 1 lt 119897

1 119872 = 119872

1015840+ 1198982minus 1 lt 119898

1 and

1198971= 11990411198731015840+119873 119898

1= 11990421198721015840+119872 For 119905

1= 0 1 119897

2minus 2 119905

2=

0 1 1198981minus 1 and 119905

1= 0 1 119897

1minus 1 119905

2= 0 1 119898

2minus 2

we computer 11991011990511199052

by using the direct methodWe have the following proposition

Proposition 6 If 1198972lt 1198971 1198982lt 1198981 then

119871 =11989721198982

4((1198972minus 1) (119898

2minus 1) + 2 (119897

2minus 1)

times (1198981minus 1198982+ 1) + 2 (119898

2minus 1) (119897

1minus 1198972+ 1))

(40)

where 119871 denotes the number of multiplication necessary forcomputing119910

11989911198992

by using the directmethod 1199051= 0 1 119897

2minus2

1199052= 0 1 119898

1minus1 and 119905

1= 0 1 119897

1minus1 1199052= 0 1 119898

2minus

2Also if 119897

1= 1198981= 119897 and 119897

2= 1198982= 1198971015840 then

119871 =

11989710158402

(1198971015840minus 1)

4(4119897 minus 3119897

1015840+ 3) (41)

Proof Let I II and III denote the number of multiplicationnecessary for computing the 119860 119861 and 119862 by direct methodrespectively where

119860 = (

11991000

sdot sdot sdot 11991001198982minus2

1199101198972minus20

sdot sdot sdot 1199101198972minus21198982minus2

)

119861 = (

11991001198982minus1

sdot sdot sdot 11991001198981minus1

1199101198972minus21198982minus1

sdot sdot sdot 1199101198972minus21198981minus1

)

119862 = (

1199101198972minus10

sdot sdot sdot 1199101198972minus11198982minus2

1199101198972minus10

sdot sdot sdot 1199101198972minus11198982minus2

)

(42)

Mathematical Problems in Engineering 9

Then

119868 = (1 + 2 + sdot sdot sdot + (1198982minus 1)) (1 + 2 + sdot sdot sdot + (119897

2minus 1))

=11989721198982(1198972minus 1) (119898

2minus 1)

4

119868119868 = 1198982(1 + 2 + sdot sdot sdot + (119897

2minus 1)) (119898

1minus 1 minus (119898

2minus 2))

=11989721198982(1198972minus 1) (119898

1minus 1198982+ 1)

2

119868119868119868 = 1198972(1 + 2 + sdot sdot sdot + (119898

2minus 1)) (119897

1minus 1 minus (119897

2minus 2))

=11989721198982(1198982minus 1) (119897

1minus 1198972+ 1)

2

(43)

So

119871 = 119868 + 119868119868 + 119868119868119868

=11989721198982

4((1198972minus 1) (119898

2minus 1) + 2 (119897

2minus 1) (119898

1minus 1198982+ 1)

+2 (1198982minus 1) (119897

1minus 1198972+ 1))

(44)

Clearly if 1198971= 1198981= 119897 and 119897

2= 1198982= 1198971015840 then (41) holds This

completes the proof

Proposition 7 If 1198971

= 1198981

= 2119906+ℎ 1198972

= 1198982

= 2119906+ 1 119873 =

119872 = 2119906+2 and119873

1015840= 1198721015840= 3sdot2

119906 where 119906 ge 3 ℎ equiv 0 (mod 2)ℎ ge 4 then

1198714= (2119906+ 1)222(119906minus1)

(2ℎ+2

minus 3)

+ (4(2ℎminus2

minus 1)

3+ 1)

2

22(119906+2)

(3119906 + 7)

(45)

where 1198714denotes the number of multiplication necessary for

computing (4) by using 2D overlap-save method

Proof Because 1198731015840

= 1198972minus 1 1198721015840 = 119898

2minus 1 1198971= 1198981= 2119906+ℎ and

1198972= 1198982= 2119906+ 1 by (41) we have

119871 = (2119906+ 1)2sdot 2119906minus2

(2119906+ℎ+2

minus 3 (2119906+ 1) + 3)

= (2119906+ 1)222(119906minus1)

(2ℎ+2

minus 3)

(46)

Compute the cyclic convolution of two sequences1199091198991+V111987310158401198992+V21198721015840 and ℎ

1015840

11989911198992

(1198991

= 0 1 2119906+2

minus 11198992

= 0 1 2119906+2

minus 1) that is compute matrix (35) byusing FNNT It is well known that using FNTT to calculatethe (35) requires

119873119872(3

2log119873119872 + 1) = 2

2(119906+2)(3119906 + 7) (47)

where 119873 = 119872 = 2119906+2

When 119873 = 119872 = 2119906+2 1198731015840 = 119872

1015840= 3 sdot 2

119906 119906 ge 3 ℎ equiv

0 (mod 2) and ℎ ge 4 then

[1198971minus 119873

1198731015840] = [

1198981minus 119872

1198721015840] = [

2119906+ℎ

minus 2119906+2

3 sdot 2119906]

= [

4 (2ℎminus2

minus 1)

3] =

4 (2ℎminus2

minus 1)

3

(48)

where 4(2ℎminus2

minus 1)3 is a positive integerSo the input matrix 119909

11989911198992

will be divided with noremainder When V

1= 0 1 [(119897

1minus 119873)119873

1015840] and V

2=

0 1 [(1198981minus119872)119872

1015840] we obtain all matrices as (35) Thus

1198714= (2119906+ 1)222(119906minus1)

(2ℎ+2

minus 3)

+ (4(2ℎminus2

minus 1)

3+ 1)

2

22(119906+2)

(3119906 + 7)

(49)

equal to (45) holds This completes the proof

Example 8 Suppose that 119906 = ℎ = 4 that is 1198971= 1198981= 256

1198972= 1198982= 17 119873 = 119872 = 64 and 119873

1015840= 1198721015840= 48 then

1198714= 3073856 (50)

If 1198971= 1198981= 256 119897

2= 1198982= 17 119873 = 119872 = 32 and 119873

1015840= 1198721015840=

16 then

1198713= 4194304 (51)

This example shows that 1198714lt 1198713in some particular cases

5 Experiments

The theoretic description of the 2D overlap-save method hasbeen provided in the preceding section This section furtherexamines how such a technique will be performed and howit will be applied to the wavelet transform Particularly wewill use image processing as an exampleThe experiment willfocus on the application of the 2D overlap-savemethod to thedyadic wavelet transform extracting the contours of Chinesehandwriting

51 Numerical Computation Let ℎ11989911198992

denote a digital filterand let a two-dimensional sequence

(ℎ11989911198992

) = (

1 0 1

1 1 0

0 1 1

) (52)

be the coefficients of the filter A two-dimensional sequence

(11990911989911198992

) =

((((

(

1 3 2 minus3 0 2 1 1

3 1 0 minus1 2 minus2 minus1 0

0 minus1 1 1 3 2 0 minus1

2 3 minus1 1 0 1 1 0

3 minus2 1 0 minus1 1 1 1

minus1 0 2 3 1 1 0 1

1 minus1 0 1 0 1 minus1 0

minus1 0 1 1 0 1 0 1

))))

)

(53)

10 Mathematical Problems in Engineering

represents the input of the filter In this example because 1198971=

1198981= 8 and 119897

2= 1198982= 3 the length of input matrix is 8 times 8

and that of the filter is 3 times 3Using the overlap-save method to calculate the output of

the filter

11991011989911198992

=

2

sum

1198961=0

2

sum

1198962=0

ℎ11989611198962

1199091198991minus11989611198992minus1198962

0le1198991minus1198961lt8

0le1198992minus1198962lt8

1198991= 0 1 2 3 4 5 6 7 119899

2= 0 1 2 3 4 5 6 7

(54)

means that the elements of the matrix

119884 = (

11991000

11991001

sdot sdot sdot 11991007

11991010

11991011

sdot sdot sdot 11991017

11991070

11991071

sdot sdot sdot 11991077

) (55)

need to be computedThe solution is given belowSince 119897

1= 1198981= 8 1198972= 1198982= 3 by selecting 119873

1015840= 1198972minus 1 =

2 and 1198721015840= 1198982minus 1 = 2 we have 119873 = 119872 = 4 In order to

use the FNTT the input matrix is divided into 9 submatricesof size 4times 4 Each consecutive submatrix is partly overlappedwith the size of 2 times 2 pixels In addition zeros of size 1 times 1

are added to the filtering sequence to ensure that its lengthis equivalent to that of the submatrix Therefore the filteringsequence ℎ

11989911198992

is extended to ℎ1015840

11989911198992

that is

ℎ1015840

11989911198992

= ℎ11989911198992

if 1198991= 0 1 2 119899

2= 0 1 2

0 if 1198991= 3 or 119899

2= 3

(56)

where 1198991= 0 1 2 3 119899

2= 0 1 2 3

Next we compute the circular convolution of the twosequences 119909

1198991+2V11198992+2V2

and ℎ1015840

11989911198992

(1198991

= 0 1 2 3 1198992

=

0 1 2 3)

11991011990511199052

=

3

sum

1198991=0

3

sum

1198992=0

ℎ1015840

11989911198992

119909⟨1199051minus1198991⟩4+2V1⟨1199052minus1198992⟩4+2V2

=

2

sum

1198991=0

2

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩4+2V1⟨1199052minus1198992⟩4+2V2

(57)

where 1199051= 0 1 2 3 119905

2= 0 1 2 3

When 1199051= 2 3 119905

2= 2 3 we arrive at the following result

11991011990511199052

=

2

sum

1198991=0

2

sum

1198992=0

ℎ11989911198992

1199091199051minus1198991+2V11199052minus1198992+2V2

= 1199101199051+2V11199052+2V2

(58)

After choosing all the parameters of V1

= 0 1 2 V2

=

0 1 2 ([(1198971minus 119873)119873

1015840] = [(119898

1minus 119872)119872

1015840] = [(8 minus 4)2] = 2)

all 2 times 2 submatrices of the matrix 119884 defined in (34) will beobtained as follows

(11991022

11991023

11991032

11991033

)(11991024

11991025

11991034

11991035

)(11991026

11991027

11991036

11991037

)

(11991042

11991043

11991052

11991053

)(11991044

11991045

11991054

11991055

)(11991046

11991047

11991056

11991057

)

(11991062

11991063

11991072

11991073

)(11991064

11991065

11991074

11991075

)(11991066

11991067

11991076

11991077

)

(59)

For 11991011990511199052

(1199051

= 0 1 1199052

= 0 1 2 3 4 5 6 7 1199051

=

0 1 2 3 4 5 6 7 1199052

= 0 1) we can compute it by usingan overlap-save method The detail of it is presented in theTechnical Report [18]

The fast number theoretic transform (FNTT) is nowapplied to the implementation of the circular convolution

11991011990511199052

=

3

sum

1198991=0

3

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩4⟨1199052minus1198992⟩4

1199051= 0 1 2 3 119905

2= 0 1 2 3

(60)

The computation is performed in the following five stepsshown in Figure 5

Step 1 (choosing 119872) Since

1003816100381610038161003816100381611991011990511199052

10038161003816100381610038161003816le

1003816100381610038161003816100381611990911989911198992

10038161003816100381610038161003816max

3

sum

1198961=0

3

sum

1198962=0

10038161003816100381610038161003816ℎ11989611198962

10038161003816100381610038161003816= 3 times 6 = 18 (61)

we can select119898 = 257 = 28+ 1 so that 18 lt 2572 where 257

is a prime Clearly 164 equiv 1 (mod257) and 16119895

equiv 1 (mod257) for 1 le 119895 le 3

Thus

11988311989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

11990911989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(62)

is a 2D number theoretic transform It has the followinginverse transform

11990911989911198992

equiv 4minus1

sdot 4minus1

3

sum

1198961=0

3

sum

1198962=0

11988311989611198962(minus16)11989911198961(minus16)11989921198962(mod 257)

1198991= 0 1 2 3 119899

2= 0 1 2 3

(63)

where 4minus1 denotes an integer so that (4minus1) sdot 4 equiv 1 (mod 257)

Mathematical Problems in Engineering 11

linear convolutionof the output matrixof the output matrix

cyclic convolutionCalculate the

of the filtering matrix

Calculate the

Calculate the numbertheoretic transformof the input matrix

Choose M

theoretic transformCalculate the number

Figure 5 Five steps of applying FNTT to calculate the output of (54)

Step 2 (calculating the number theoretic transform of inputmatrix by the FNTT) For computational convenience hereone writes

11988001198962

equiv

3

sum

1198992=0

11990901198992

1611989921198962 119880

11198962

equiv

3

sum

1198992=0

11990911198992

1611989921198962(mod 257)

11988021198962

equiv

3

sum

1198992=0

11990921198992

1611989921198962 119880

31198962

equiv

3

sum

1198992=0

11990931198992

1611989921198962(mod 257)

1198962= 0 1 2 3

(64)

Then (62) becomes

11988311989610

equiv

3

sum

1198991=0

11988011989910

1611989911198961 119883

11989611

equiv

3

sum

1198991=0

11988011989911

1611989911198961(mod 257)

11988311989612

equiv

3

sum

1198991=0

11988011989912

1611989911198961 119883

11989613

equiv

3

sum

1198991=0

11988011989913

1611989911198961(mod 257)

1198961= 0 1 2 3

(65)

Use the FNTT to calculate (64) and (65)So

(

11988000

11988001

11988002

11988003

11988010

11988011

11988012

11988013

11988020

11988021

11988022

11988023

11988030

11988031

11988032

11988033

)

equiv (

3 95 3 minus97

3 35 3 minus29

1 minus33 1 31

5 35 minus3 minus29

) (mod 257)

119883 = (

11988300

11988301

11988302

11988303

11988310

11988311

11988312

11988313

11988320

11988321

11988322

11988323

11988330

11988331

11988332

11988333

)

equiv (

12 132 4 minus124

minus30 128 98 minus128

minus4 minus8 4 minus8

34 128 minus94 minus128

) (mod 257)

(66)

Step 3 (calculating the number theoretic transformof the filterby the FNTT) The FNTT of the filter ℎ

11989911198992

is written as

11986711989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

ℎ1015840

11989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(67)

Similarly we have

119867 = (

11986700

11986701

11986702

11986703

11986710

11986711

11986712

11986713

11986720

11986721

11986722

11986723

11986730

11986731

11986732

11986733

)

equiv (

6 32 2 minus32

32 0 2 34

2 minus2 2 minus2

minus32 minus30 2 0

) (mod 257)

(68)

Step 4 (compute the number theoretic transformof the outputof the filter) From the preceding three steps we can computethe circular convolution of the filter by defining the productof 119883 and 119867 as

119884 = (

11988400

11988401

11988402

11988403

11988410

11988411

11988412

11988413

11988420

11988421

11988422

11988423

11988430

11988431

11988432

11988433

)

equiv 119883 ⊙ 119867 = (

11988300

11986700

11988301

11986701

11988302

11986702

11988303

11986703

11988310

11986710

11988311

11986711

11988312

11986712

11988313

11986713

11988320

11986720

11988321

11986721

11988322

11986722

11988323

11986723

11988330

11986730

11988331

11986731

11988332

11986732

11988333

11986733

)

equiv (

72 112 8 113

68 0 minus61 17

minus8 16 8 16

minus60 15 69 0

) (mod 257)

(69)

where

11988411989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

11991011989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(70)

12 Mathematical Problems in Engineering

Table 1 Filtering coefficients 12059521198951

119896119897 (119895 = 2) 120595(119903) are a quadratic spline wavelet

119897119896 119896 = 0 119896 = 1 119896 = 2 119896 = 3

119897 = 0 minus00838140026 minus00472041145 minus00129809398 minus00012592132119897 = 1 minus01416904181 minus00758706033 minus00196341425 minus00012698699119897 = 2 minus00651057437 minus00327749476 minus00063385521 minus00000750836119897 = 3 minus00088690016 minus00030044997 minus00001088651

(a) (b)

Figure 6 A 2-dimensional image of an aircraft was processed with 2D overlap-save method (a) Original Chinese handwriting and (b) thedivided up subimages of the character

and the 11991011989911198992

(1198991

= 0 1 2 3 1198992

= 0 1 2 3) is the circularconvolution of (60)

Step 5 (calculate the output of the linear convolution) From(63) we deduce the inverse transform of (70)

11991011989911198992

equiv 4minus1

sdot 4minus1

3

sum

1198961=0

3

sum

1198962=0

11988411989611198962(minus16)11989911198961

sdot (minus16)11989921198962(mod 257)

1198991= 0 1 2 3 119899

2= 0 1 2 3

(71)

Using FNTT to calculate (71) we have

(

11991000

11991001

11991002

11991003

11991010

11991011

11991012

11991013

11991020

11991021

11991022

11991023

11991030

11991031

11991032

11991033

) equiv (

8 6 4 0

1 7 13 1

2 2 6 4

1 5 5 7

) (mod 257)

(72)

Then the linear convolution in (58) is obtained

(11991022

11991023

11991032

11991033

) = (11991022

11991023

11991032

11991033

) = (6 4

5 7) (73)

52 Application to Image Processing The proposed methodcan be applied to many fields such as image processingand pattern recognition An example of the application to

the image processing is illustrated in Figure 6 The originalimage shown in Figure 6(a) is a 2-dimensional image of anaircraft with a size of 256 times 256 pixels that is 119897

1= 1198981

=

256 Our task is to extract its contours The discrete wavelettransform with scale 119904 = 2

119895 where 119895 = 2 was applied and thespline wavelet described in (1) of size 17 times 17 was chosenthat is 119897

2= 1198982

= 17 We use the filtering coefficientstabulated in Table 1 Using the 2D overlap-save method thisoriginal image was divided into 25 sections with each onehaving the dimension of 64 times 64 pixels that is we select119873 = 119872 = 64 1198731015840 = 119872

1015840= 48 [(119897

1minus 119873)119873

1015840] = [(119898

1minus

119872)1198721015840] = 4 (See Example 8 in Section 4) Figure 6(b)

shows these subimages The overlapped part can be explicitlyobserved in each subimage

To facilitate the presentation of the 2D overlap-savemethod the procedure of it is diagonally displayed inFigure 7 where a series of the divided subimages are illus-tratedThe image in Figure 6(a) was equivalently divided into25 sections by applying (27) In Figure 7(a) we represent 5subimages of V

0= 0 V

1= 0 V

0= 1 V

1= 1 V

0= 2 V

1= 2

and V0

= 3 V1

= 3 and V0

= 4 V1

= 4 consecutively Thelower-right corner of each subimage is repeated in the upper-left corner of its consecutive subimage Four subimages aredisplayed in Figure 7(b) and the parameters of V

0= 0 V1= 1

V0

= 1 V1

= 2 V0

= 2 V1

= 3 and V0

= 3 V1

= 4 werechosen In Figure 7(c) we selected 3 subimages of V

0= 0

V1

= 2 V0

= 1 V1

= 3 and V0

= 2 V1

= 4 There are3 subimages of V

0= 0 V

1= 3 and V

0= 1 V

1= 4 in

Figure 7(d) Figure 7(e) displays subimages of V0= 0 V

1= 4

Mathematical Problems in Engineering 13

(a) (b) (c)

(d) (e) (f)

(g) (h) (i)

Figure 7 A 2-dimensional image of an aircraft is dividing into separated small subimages the parameters of V0and V

1are chosen as follows

(a) V0= 0 V

1= 0 V

0= 1 V

1= 1 V

0= 2 V

1= 2 and V

0= 3 V

1= 3 and V

0= 4 and V

1= 4 (b) V

0= 0 V

1= 1 V

0= 1 V

1= 2 V

0= 2 V

1= 3 and

V0= 3 and V

1= 4 (c) V

0= 0 V

1= 2 V

0= 1 V

1= 3 and V

0= 2 and V

1= 4 (d) V

0= 0 V

1= 3 and V

0= 1 and V

1= 4 (e) V

0= 0 and V

1= 4 (f)

V0= 1 V

1= 0 V

0= 2 V

1= 1 V

0= 3 V

1= 2 and V

0= 4 and V

1= 3 (g) V

0= 2 V

1= 0 V

0= 3 V

1= 1 and V

0= 4 and V

1= 2 (h) V

0= 3 V

1= 0

and V0= 4 and V

1= 1 and (i) V

0= 4 and V

1= 0

In Figure 7(f) V0= 1 V

1= 0 V

0= 2 V

1= 1 V

0= 3 V

1= 2

and V0= 4 V1= 3were chosen In Figure 7(g) the parameters

were decided upon V0= 2 V

1= 0 V

0= 3 V

1= 1 and V

0= 4

V1= 2 Two subimages are shown in Figure 7(h) by selecting

V0= 3 V

1= 0 and V

0= 4 V

1= 1 There is one subimage of

V0= 4 V

1= 0 in Figure 7(i)

We select a 2D NTT

11988311989611198962

equiv

63

sum

1198991=0

63

sum

1198992=0

11990911989911198992

211989911198961211989921198962 (mod 2

32+ 1) (74)

14 Mathematical Problems in Engineering

(a) (b)

(c) (d)

Figure 8 The linear outputs of 2D overlap-save method (a) the outputs of the linear convolution of each subimages (b) the left border andthe upper border of the outputs of the image of aircraft (c) the combined outputs of linear convolution except Γ-type border and (d) theentire contour extracted using 2D overlap-save method under wavelet transform

which has inverse transform

11990911989911198992

equiv 64minus1

64minus1

63

sum

1198961=0

63

sum

1198962=0

11988311989611198962

(minus231)11989911198961

times (minus231)11989921198962

(mod 232

+ 1)

1198991= 0 1 63 119899

2= 0 1 63

(75)

where 64minus1 denotes integer so that (64minus1)64 equiv 1 (mod 2

32+

1) and |11990911989911198992

| le 255The FNTT was applied to calculate the circular convo-

lution of each subimage After applying (31) to each of thesubblocks a series of segments of the contours were obtained

By using (32) we can gradually reach the final result of thelinear convolution Figure 8(a) illustrates those pixels whichsatisfy (35) where 119897

2= 1198982= 17 119873 = 119872 = 64 1198731015840 = 119872

1015840=

48 and V1 V2

= 0 1 2 3 4 Combining them together thecontours of the whole character were obtained and displayedin Figure 8(c) which excludes the Γ-type border Next the

Γ-type border was computed by direct method Figure 8(b)shows the result Combining this result with that shown inFigure 8(c) the entire contours of the Chinese handwritingwere combined Figure 8(d) represents the entire contour

6 Conclusions

A novel approach to reduce the computation complexityof the wavelet transform has been presented in this paperTwo key techniques have been applied in this new methodnamely fast number theoretic transform (FNTT) and two-dimensional overlap-save technique In the fast numbertheoretic transform the linear convolution is replaced bythe circular convolution It can speed up the computationof 2D discrete wavelet transform Directly calculating thefast number theoretic transform to the whole input sequencemay meet two difficulties namely a big modulo obstructsthe effective implementation of the fast number theoretictransform and a long input sequence slows the computation

Mathematical Problems in Engineering 15

of the fast number theoretic transform down To fight withsuch deficiencies a new technique which is referred to as 2Doverlap-save method has been developed Experiments havebeen conducted The fast number theoretic transform and2D overlap-method have been used to implement the dyadicwavelet transform and applied to contour extraction in imageprocessing and pattern recognition

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Acknowledgments

This work was supported by the Research GrantsMYRG205(Y1-L4)-FST11-TYY and MYRG187(Y1-L3)-FST11-TYY and Chair Prof Grants RDG009FST-TYY ofUniversity of Macau as well as Macau FDC Grants T-100-2012-A3 and 026ndash2013-A This research project was alsosupported by the National Natural Science Foundation ofChina 61273244

References

[1] P L Combettes and J-C Pesquet ldquoWavelet-constrained imagerestorationrdquo International Journal of Wavelets Multiresolutionand Information Processing vol 2 no 4 pp 371ndash389 2004

[2] M Ehler and K Koch ldquoThe construction of multiwavelet bi-frames and applications to variational image denoisingrdquo Inter-national Journal of Wavelets Multiresolution and InformationProcessing vol 8 no 3 pp 431ndash455 2010

[3] P Jain and S N Merchant ldquoWavelet-based multiresolutionhistogram for fast image retrievalrdquo International Journal ofWavelets Multiresolution and Information Processing vol 2 no1 pp 59ndash73 2004

[4] S Mallat and W L Hwang ldquoSingularity detection and pro-cessing with waveletsrdquo Institute of Electrical and ElectronicsEngineers Transactions on InformationTheory vol 38 no 2 pp617ndash643 1992

[5] B U Shankar S K Meher and A Ghosh ldquoNeuro-waveletclassifier formultispectral remote sensing imagesrdquo InternationalJournal of Wavelets Multiresolution and Information Processingvol 5 no 4 pp 589ndash611 2007

[6] S Shi Y Zhang and Y Hu ldquoA wavelet-based image edgedetection and estimationmethod with adaptive scale selectionrdquoInternational Journal of Wavelets Multiresolution and Informa-tion Processing vol 8 no 3 pp 385ndash405 2010

[7] Y Y Tang Wavelets Theory Approach to Pattern RecognitionWorld Scientific Singapor 2009

[8] Q M Tieng and W Boles ldquoWavelet-based affine invariantrepresentation a tool for recognizing planar objects in 3Dspacerdquo IEEE Transactions on Pattern Analysis and MachineIntelligence vol 19 no 8 pp 921ndash925 1997

[9] P Wunsch and A F Laine ldquoWavelet descriptors for mul-tiresolution recognition of handprinted charactersrdquo PatternRecognition vol 28 no 8 pp 1237ndash1249 1995

[10] H Yin and H Liu ldquoA Bregman iterative regularization methodfor wavelet-based image deblurringrdquo International Journal of

Wavelets Multiresolution and Information Processing vol 8 no3 pp 485ndash499 2010

[11] X You and Y Y Tang ldquoWavelet-based approach to characterskeletonrdquo IEEE Transactions on Image Processing vol 16 no 5pp 1220ndash1231 2007

[12] T Zhang Q Fan and Q Gao ldquoWavelet characterization ofHardy space ℎ

1 and its application in variational image decom-positionrdquo International Journal of Wavelets Multiresolution andInformation Processing vol 8 no 1 pp 71ndash87 2010

[13] Y Y Tang L Y Li Feng and J Liu ldquoScale-independent waveletalgorithm for detecting step-structure edgesrdquo Tech Rep IEEETransactions on InformationTheory Brisbane Australia 1998

[14] S G Mallat ldquoMultiresolution approximations and waveletorthonormal bases of 119871

2(R)rdquo Transactions of the American

Mathematical Society vol 315 no 1 pp 69ndash87 1989[15] J H McClellan and C M Rader Number Theory in Digital Sig-

nal Processing Prentice Hall Signal Processing Series PrenticeHall Englewood Cliffs NJ USA 1979

[16] X Ran and K J R Liu ldquoFast algorithms for 2-D circularconvolutions and number theoretic transforms based on poly-nomial transforms over finite ringsrdquo IEEE Transactions onSignal Processing vol 43 no 3 pp 569ndash578 1995

[17] Q Sun ldquoSome results in the application of the number theoryto digital signal processing and public-key systemsrdquo in NumberTheory and Its Applications in China vol 77 of ContemporaryMathematics pp 107ndash112 American Mathematical SocietyProvidence RI USA 1988

[18] Y Y Tang Q Sun L H Yang and L Feng ldquoAn overlap-save method for the calculation of the two-dimensional digitalconvolutionrdquo Tech Rep Department of Computer ScienceHong Kong Baptist University 1998

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 2: Research Article Implementation of 2D Discrete Wavelet ...downloads.hindawi.com/journals/mpe/2014/532979.pdfResearch Article Implementation of 2D Discrete Wavelet Transform by Number

2 Mathematical Problems in Engineering

where 11990911989911198992

and 11991011989911198992

(1198991

= 0 1 1198992

= 0 1 ) standfor the input and output of the filter respectively and ℎ

11989611198962

denote the filtering coefficients (1198961

= 0 1 1198972minus 1 119896

2=

0 1 1198982minus 1)

In many certain applications we are required to computeonly such an output sequence which is with a finite length in(3) Let 119909

11989911198992

be a 2D finite input of the filter with lengths 1198971

and 1198981 We compute the finite output as follows

11991011989911198992

=

1198972minus1

sum

1198961=0

1198982minus1

sum

1198962=0

ℎ11989611198962

1199091198991minus11989611198992minus1198962

0le1198991minus1198961lt1198971

0le1198992minus1198962lt1198981

1198991= 0 1 119897

1minus 1 119899

2= 0 1 119898

1minus 1

(4)

In practice the difference between the length of the inputsignal and that of the filter is often large If we calculateconvolution (4) directly a large number of multiplicationoperations will be executed In the meantime a series ofcalculations to treat zeros will be performed if fast Fouriertransform (FFT) is used to speed up the computation Bothof these twomethods will be time-consuming to compute thelinear convolution To overcome this problem in this paperwe will present a novel approach which is referred to ourprevious work as number theoretic transform (NTT) [15ndash17] Also we will prove that the computation of the linearconvolution can be replaced by that of the cyclic convolutionof two 2D sequences with lengths 119873

1= 1198971

+ 1198972

minus 1 and1198732= 1198981+ 1198982minus 1 respectively

For two 2D sequences 11990911989911198992

and ℎ11989911198992

of finite lengths1198731

and 1198732 their cyclic convolution can be written by

11991011989911198992

=

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

11990911989611198962

ℎ⟨1198991minus1198961⟩1198731⟨1198992minus1198962⟩1198732

=

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

ℎ11989611198962

119909⟨1198991minus1198961⟩1198731⟨1198992minus1198962⟩1198732

1198991= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1

(5)

where ⟨119909⟩119873denotes the remainder 119903 of 119909 modulo 119873 that is

119909 = 119902119873 + 119903 119902 is any integer and 0 le 119903 lt 119873The number theoretic transform (NTT) provides an

effective way to calculate the cyclic convolution Howeverthere exist two difficulties if directly applying the NTT to thewhole input sequence namely

(i) a considerable big modulo M has to be imposed Itobstructs the effective implementation of the NTTdue to the limited length of the word which is usedto store data in computers It will thus become abottleneck in the computation of convolution

(iii) the advantage of the fast computation of the NTTcannot be reached when the difference between thelength of the input sequence and that of the filtersequence is large Thus it may not speed up thecalculation of convolution in this case

To avoid using a big modulo M we can use Chineseremainder theorem to reduce the length of the modulo Mand successfully apply the NTT to calculate the convolutionUnfortunately the number of multiplication operations willbe at least doubled and thus the computational complexitywill increase The second key technique will be worked outin this paper to overcome the above difficulties and speed upthe calculation of the convolution It is termed 2D overlap-save method which is an expansion of the 1D overlap-save method It can be used to implement the 2D wavelettransform when a big difference between the length of theinput sequence 119909

11989911198992

and that of the filter sequence ℎ11989911198992

occurs This method consists of three steps

(i) First the original 2D input sequence is equivalentlydivided into many small separated sections Thisdivision brings two evident improvements

(a) The size of each section is much smaller thanthat of the whole input sequence such that asmallmodulo M can be used and the NTT cantherefore be performed in a computer system

(b) The difference between the length of one sectionand that of the filter sequence becomes smallerwhich makes the effective application of theNTT

(ii) In the second step we calculate the cyclic convolutionof each section with the filter sequence by NTT

(iii) Finally the result of (4) is obtained by picking out datafrom each of the results calculated in the second stepand combining these data together

In comparison with direct method and fast Fouriertransform (FFT) it will be proved explicitly that the numberof multiplication operations in the 2D overlap-save methodwill be smaller than that in any of those twomethods inmanyparticular cases

In the next section the number theoretic transform(NTT) will be presented Details of the 2D overlap-methodwill be discussed in Section 3 A comparison of computationof the multiplication in three methods will be given inSection 4 A computational example will be presented aswell as a practical experiment in Section 5 which will verifythe efficiency of the proposed approach In the experimentthe fast number theoretic transform and 2D overlap-methodwere applied to implement the dyadic wavelet transformextracting the contours in recognition of Chinese handwrit-ing

2 Number Theoretic Transform (NTT)

Suppose that ℎ11989611198962

are the filter coefficients (1198961= 0 1 119897

2minus

1 1198962

= 0 1 1198982minus 1) 119909

11989911198992

and 11991011989911198992

(1198991

= 0 1 1198971minus

1 1198992

= 0 1 1198981

minus 1) are the input and output of thefilter respectively In the concrete applications of the discretewavelet transform (DWT) the lengths of the input and outputare very long (119897

1and 119898

1are very big) while lengths of the

filter coefficients are short (1198972and 119898

2are small) Therefore if

Mathematical Problems in Engineering 3

the directmethod is used to calculate their linear convolutionthe number of multiplication operations will be large Inthis section the 2D number theoretic transform (FNTT) willbe applied to calculate the 2D circular convolution of 2Dsequences of lengths119873

1= 1198971+1198972minus1 and119873

2= 1198981+1198982minus1 In a

2D number theoretic transform (NTT) if a modulo119872 is toobig the Chinese remainder theorem (CRT) will be utilized toreduce the length

21 2D Linear Convolution and 2D Circular ConvolutionGiven two 2-dimensional sequences 119909

11989911198992

(1198991= 0 1 119897

1minus

1 1198992= 0 1 119898

1minus 1) and ℎ

11989911198992

(1198991= 0 1 119897

2minus 1 119899

2=

0 1 1198982minus 1) their linear convolution is defined by

11991011989911198992

=

1198971minus1

sum

1198961=0

1198981minus1

sum

1198962=0

11990911989611198962

ℎ1198991minus11989611198992minus1198962

0le1198991minus1198961lt1198972

0le1198992minus1198962lt1198982

=

1198972minus1

sum

1198961=0

1198982minus1

sum

1198962=0

ℎ11989611198962

1199091198991minus11989611198992minus1198962

0le1198991minus1198961lt1198971

0le1198992minus1198962lt1198981

1198991= 0 1 119897

1+ 1198972minus 2 119899

2= 0 1 119898

1+ 1198982minus 2

(6)

Given two 2-dimensional sequences 11990911989911198992

and ℎ11989911198992

oflengths 119873

1and 119873

2 respectively their circular convolution is

11991011989911198992

=

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

11990911989611198962

ℎ⟨1198991minus1198961⟩1198731⟨1198992minus1198962⟩1198732

=

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

ℎ11989611198962

119909⟨1198991minus1198961⟩1198731⟨1198992minus1198962⟩1198732

1198991= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1

(7)

where ⟨119909⟩119873denotes the remainder 119903 119909 = 119902119873+119903 0 le 119903 lt 119873

Proposition 1 The linear convolution (6) can be computed bycomputing circular convolution of two 2-dimensional sequencesof lengths 119873

1= 1198971+ 1198972minus 1 and 119873

2= 1198981+ 1198982minus 1 respectively

22 Using 2D Number Theoretic Transform to Calculate the2D Circular Convolution Let 119872 be a positive integer andsuppose that 119909

11989911198992

and ℎ11989911198992

are two 2-dimensional integersequences (119899

1= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1)

Let

11988311989611198962

equiv

1198731minus1

sum

1198991=0

1198732minus1

sum

1198992=0

11990911989911198992

1205721198991119896112057311989921198962(mod 119872) (8)

11986711989611198962

equiv

1198731minus1

sum

1198991=0

1198732minus1

sum

1198992=0

ℎ11989911198992

1205721198991119896112057311989921198962(mod 119872) (9)

11988411989611198962

equiv

1198731minus1

sum

1198991=0

1198732minus1

sum

1198992=0

11991011989911198992

1205721198991119896112057311989921198962(mod 119872) (10)

where (1198961

= 0 1 1198731minus 1 119896

2= 0 1 119873

2minus 1) and 120572

and 120573 are two given integers and 11991011989911198992

denote the circularconvolution as shown in (7) 119899

1= 0 1 119873

1minus 1 119899

2=

0 1 1198732minus 1

If a 2-dimensional transform (8) has an inverse transform

11990911989911198992

equiv 119873minus1

1sdot 119873minus1

2

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

11988311989611198962

120572minus11989911198961120572minus11989921198962(mod 119872)

(11)

(1198991= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1) and has circular

convolution property

11988411989611198962

equiv 11988311989611198962

11986711989611198962(mod 119872)

(1198961= 0 1 119873

1minus 1 119896

2= 0 1 119873

2minus 1)

(12)

then congruence equation (8) is referred to as a 2-dimensional number theoretic transform mod119872 and canbe abbreviated to NTT mod 119872

Agarwal and Burrus gave some sufficient conditions forexistence of 2-dimensional NTT given with 119872 gt 1 119873

1gt 1

and1198732gt 1 (see [15]) In [17] the authors gave some sufficient

and necessary conditions for existenceWe have the followingtheorem

Theorem 2 If 119872 = 1199011198971

1sdot sdot sdot 119901119897119904

119904 (119897119895ge 1 119895 = 1 119904) 119901

1 119901

119904

are distinct primes then the congruence equation (8) is a 2-dimensional NTT mod119872 with the first dimension of length1198731and the second dimension of length119873

2 if and only if 1205721198731 equiv

1 (mod119872) 1205731198732 equiv 1 (mod119872) and 120572119895

equiv 1 (mod119901119896) (1 le

119895 le 1198731minus 1) 120573119894 equiv 1 (mod 119901

119896) (1 le 119894 le 119873

2minus 1) 119896 = 1 119904

Corollary 3 The congruence equation (8) is a 2-dimensionalNTT mod119872 if and only if

lcm [1198731 1198732] | gcd (119901

1minus 1 119901

119904minus 1) (13)

where lcm[1198731 1198732] denotes the least common multiple of two

integers1198731and119873

2and gcd(119886 119887) denotes the greatest common

divisor of two integers 119886 and 119887

Corollary 4 Let 119901 be an odd prime and 119872 = 119901 Thenthe congruence equation (8) is a 2-dimensional NTT mod119901 ifand only if 1205721198731 equiv 1 (mod119901) and 120572

119895equiv 1 (mod119901) (1 le 119895 le

1198731minus 1) 1205731198732 equiv 1 (mod119901) and 120573

119895equiv 1 (mod119901) (1 le 119895 le

1198732minus 1)

Clearly from congruence equations (8) (9) (11) and(12) we can use the 2-dimensional NTT to calculate a 2-dimensional circular convolution

Finally we obtain

11991011989911198992

equiv

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

11990911989611198962

ℎ⟨1198991minus1198961⟩1198731⟨1198992minus1198962⟩1198732

(mod 119872)

1198991= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1

(14)

4 Mathematical Problems in Engineering

Select 119872 so that

1003816100381610038161003816100381611991011989911198992

10038161003816100381610038161003816le min

1003816100381610038161003816100381611990911989911198992

10038161003816100381610038161003816max

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

10038161003816100381610038161003816ℎ11989611198962

10038161003816100381610038161003816

10038161003816100381610038161003816ℎ11989911198992

10038161003816100381610038161003816max

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

1003816100381610038161003816100381611990911989611198962

10038161003816100381610038161003816

lt119872

2

(15)

where 1198991= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1 and 119872 is

an oddIf we use the 2-dimensional NTT to calculate the 2-

dimensional circular convolution11991011989911198992

so that |11991011989911198992

| lt 1198722then form congruence equation (14) we deduce that

11991011989911198992

=

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

11990911989611198962

ℎ⟨1198991minus1198961⟩1198731⟨1198992minus1198962⟩1198732

1198991= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1

(16)

23 Fast Number Theoretic Transform (FNTT) The idea ofFFT can be used to perform the NTT In this subsection atheoretic description will be presented briefly More detailswill be given in Section 5

Let

11988001198962

equiv

1198732minus1

sum

1198992=0

11990901198992

12057311989921198962 119880

1198731minus11198962

equiv

1198732minus1

sum

1198992=0

1199091198731minus11198992

12057311989921198962(mod119872)

1198962= 0 1 119873

2minus 1

(17)

From congruence equation (17) we deduce that

11988311989610

equiv

1198731minus1

sum

1198991=0

1198801198991012057211989911198961 119883

11989611198732minus1

equiv

1198731minus1

sum

1198991=0

11988011989911198732minus1

12057211989911198961(mod 119872)

1198961= 0 1 119873

1minus 1

(18)

Suppose that 1198731and 119873

2satisfy inequalities and we then

can use the idea of FFT to calculate the congruence equations(17) and (18)

For computing every

11988011989911198962

equiv

1198732minus1

sum

1198992=0

11990911989911198992

12057311989921198962(mod 119872)

(1198962= 0 1 119873

2minus 1)

(19)

in congruence equation (17) the numbers of all multipli-cation necessary are (119873

2log1198732)2 by using FFT algorithm

Hence if using FFT algorithm to calculate the congruence

11988011989911198962

equiv

1198732minus1

sum

1198992=0

11990911989911198992

12057311989921198962(mod119872)

(1198962= 0 1 119873

2minus 1)

(20)

in congruence equation (17) the numbers of all multiplica-tion necessary are ((119873

11198732)2) log119873

2

Similarly if using FFT algorithm to calculate all congru-ence equations in (18) then the numbers of all multiplicationnecessary are ((119873

21198731)2) log119873

1

Therefore if using the fast number theoretic transform(FNTT) to calculate the congruence equation (8) the numberof all multiplication necessary is

11987311198732

2log1198732+

11987321198731

2log1198731=

11987311198732

2log (119873

11198732) (21)

If119872 is very large wemay reduce the length of aword by usingChinese remainder theorem and it can be abbreviated toCRT

Therefore we have the following proposition

Proposition 5 Suppose that congruence equation (8) is a 2-dimensional NTT mod119872 where 119872 = 119901

1198971

1sdot sdot sdot 119901119897119904

119904 1199011 119901

119904

are distinct primes then we have a total of s 2-dimensionalNTT mod 119901

119897119894

119894 and they are described as follows

11988311989611198962

equiv

1198731minus1

sum

1198991=0

1198732minus1

sum

1198992=0

11990911989911198992

12057211989911198961

11989412057311989921198962

119894 (mod 119901

119897119894

119894)

1198961= 0 1 119873

1minus 1 119896

2= 0 1 119873

2minus 1

(22)

where 120572119894= ⟨120572⟩

119901119897119894

119894

120573119894= ⟨120573⟩

119901119897119894

119894

119894 = 1 2 119904If

11991011989911198992

=

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

11990911989611198962

ℎ⟨1198991minus1198961⟩1198731

⟨1198992minus1198962⟩1198732

equiv 119910(119894)

11989911198992

(mod 119901119897119894

119894)

(1198991= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1)

(23)

then

11991011989911198992

equiv

119904

sum

119894=1

1198721015840

119894119872119894119910(119894)

11989911198992

(mod119872)

(1198991= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1)

(24)

where 119872 = 119901119897119894

1198941198721198941198721015840

119894119872119894equiv 1 (mod 119901

119897119894

119894) 119894 = 1 119904

Mathematical Problems in Engineering 5

Proof Because the congruence equation (8) is a 2-dimen-sional NTT mod119872 hence

1205721198731 equiv 1 (mod119872) 120573

1198732 equiv 1 (mod 119872)

1205721198731 equiv 1 (mod 119901

119894) 120572

119895equiv 1 (mod 119901

119894) 1 le 119895 lt 119873

1

1205731198732 equiv 1 (mod 119901

119894) 120573

ℎequiv (mod 119901

119894) 1 le ℎ lt 119873

2

119894 = 1 2 119904

(25)

so

1205721198731 equiv 1 (mod 119901

119897119894

119894) 120573

1198732 equiv 1 (mod 119901

119897119894

119894)

1205721198731

119894equiv 1205721198731 equiv 1 (mod 119901

119894) 120572

119895

119894equiv 1 (mod 119901

119894)

1 le 119895 lt 1198731

1205731198732

119894equiv 1205731198732 equiv 1 (mod 119901

119894) 120573

119894equiv 1 (mod 119901

119894)

1 le ℎ lt 1198732

119894 = 1 119904

(26)

Hence the congruence equation (22) has a total of 119904 2-dimensional NTTs mod 119901

119897119894

119894 119894 = 1 119904 From CRT and the

congruence equation (23) we deduce that the congruenceequation (24) holds

3 Two-Dimensional Overlap-Save Method

Select two positive integers 1198731015840 and 1198721015840 so that 1198731015840 + 119897

2minus 1 =

119873 lt 1198971and 119872

1015840+ 1198982minus 1 = 119872 lt 119898

1 either 119873 or 119872 is given

by an integer power of 2 that is 119873 = 21198891 and 119872 = 2

1198892 where

1198891and 119889

2are two positive integers

Assuming that the input sequence 11990911989911198992

(1198991

=

0 1 1198971

minus 1 1198992

= 0 1 1198981

minus 1) is divided intomany small sections which are termed submatrices

1199091198991+V111987310158401198992+V211987210158401198991=119873minus1 119899

2=119872minus1

1198991=0 1198992=0

(V1= 0 1 V

2= 0 1 )

(27)

The consecutive matrix is overlapped by the previous oneAs a simple example four blocks chosen from the dividedinput matrices are overlapped and are graphically shown inFigure 1 Parameters V

1and V

2can be considered as shift

parameters because changing either V1or V2will select dif-

ferent submatrix For the first submatrix shown in Figure 1(a)we select V

1= 0 and V

2= 0 Second submatrix (V

1= 0 and

V2= 1) is displayed in Figure 1(b)Third one with parameters

of V1

= 1 and V2

= 0 is given in Figure 1(c) Fourth matrixshown in Figure 1(d) has parameters V

1= 1 and V

2= 1 The

procedure of the overlapping is also graphically illustrated inFigure 1

For the operation of circular convolution it is necessaryto have two sequences with the same length Taking (7) for

example the sequences 11990911989911198992

and ℎ11989911198992

are of the same lengthof1198731times1198732 Since the input sequence has already divided into

submatrices of119873times119872 by (27) the filter sequence has to be oflength119873times119872Therefore119873minus119897

2augmenting zeros are required

to be added to the row and119872minus1198982zeros to the column of the

filter sequence ℎ11989911198992

As a result the sequence ℎ11989911198992

becomes

ℎ1015840

11989911198992

=ℎ11989911198992

if 1198991= 0 1 119897

2minus 1 119899

2= 0 1 119898

2minus 1

0 if 1198972le 1198991lt 119873 or 119898

2le 1198992lt 119872

(28)

where 1198991= 0 1 119873 minus 1 and 119899

2= 0 1 119872 minus 1

The following form shows how a sequence ℎ101584011989911198992

is yieldedby adding augmenting zeros to the filter sequence ℎ

11989911198992

ℎ 997904rArr ℎ1015840 =

0 (29)

For each of the divided submatrices we can give V1and V

2

and compute the circular convolution of two 2D sequences1199091198991+V111987310158401198992+V21198721015840 and ℎ

1015840

11989911198992

(1198991

= 0 1 119873 minus 1 1198992

=

0 1 119872 minus 1) by

11991011990511199052

=

119873minus1

sum

1198991=0

119872minus1

sum

1198992=0

ℎ1015840

11989911198992

119909⟨1199051minus1198991⟩119873+V11198731015840⟨1199052minus1198992⟩119872+V21198721015840

1199051= 0 1 119873 minus 1 119905

2= 0 1 119872 minus 1

(30)

From (28) we deduce that

11991011990511199052

=

1198972minus1

sum

1198991=0

1198982minus1

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩119873+V11198731015840⟨1199052minus1198992⟩119872+V21198721015840 (31)

The result of (31) is that of circular convolution As we willsee below there exists an important connection between thecircular convolution and the linear one In fact since 119899

1=

0 1 1198972minus 1 and 119899

2= 0 1 119898

2minus 1 we can choose 119905

1=

1198972minus1 119873minus1 and 119905

2= 1198982minus1 119872minus1 in (31) this makes

119873 gt 1199051minus 1198991

gt 0 and 119872 gt 1199052minus 1198992

gt 0 in (31) Thus theremainder can exactly be equal to 119905

1minus 1198991and 1199052minus 1198992 Then

the circular convolution of (31) becomes

11991011990511199052

=

1198972minus1

sum

1198991=0

1198982minus1

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩119873+V11198731015840⟨1199052minus1198992⟩119872+V21198721015840

=

1198972minus1

sum

1198991=0

1198982minus1

sum

1198992=0

ℎ11989911198992

1199091199051minus1198991+V111987310158401199052minus1198992+V21198721015840

= 1199101199051+V111987310158401199052+V21198721015840

(32)

In order to clearly understand the procedure of obtainingthe components of linear convolution from the circularconvolution equation (31) a graphic description of it can befound in Figure 2 We show a dashed rectangle with size of119873 by 119872 in Figure 2(a) to represent the circular convolutionwhich is described in (31) and a darkened rectangle with sizeof1198731015840 by119872

1015840 to indicate the linear convolution stated in (32)

6 Mathematical Problems in Engineering

2N

m

n

2M

M

N1 = 0 2 = 0

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(a)

m

n

2N

2M

M

N1 = 1 2 = 0

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(b)

m

n

2N

2M

M

N

1 = 0 2 = 1

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(c)

m

n

2N

2M

M

N

1 = 1 2 = 1l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(d)

Figure 1 Four divided input submatrices are overlapped using the 2D overlap-save method (a) the first submatrix with parameters V1

=

0 V2= 0 is located on the top-left corner (b) the second one (V

1= 1 V

2= 0) overlaps by the first submatrix and the size of the overlapping

between them is119873 times1198982minus1 (c) the third divided input submatrix has parameters of V

1= 0 V

2= 1 It is overlapped by the first submatrix

and the size of the overlapping between them is 1198972minus 1 times 119872 (d) the fourth one with V

1= 1 V

2= 1 is overlapped by the first submatrix

and the size of the overlapping between them is 1198972minus 1 times 119898

2minus 1

m

n

2N

2M

M

N

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(a)

m

n

2N

2M

M

N

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(b)

Figure 2 Two consecutive output submatrices (a) the first block of V1= 0 and V

2= 0 and (b) the second block of V

1= 1 and V

2= 1

Mathematical Problems in Engineering 7

Obviously if the first 1198972minus 1 data in rows and the first 119898

2minus 1

data in columns are discarded from the dashed rectangle thedarkened rectangle can be obtained In the following we willexplain how to obtain the result of (4)

The output of the whole equation (4) can be representedin the following matrix

119884 = (

11991000

sdot sdot sdot sdot sdot sdot 11991001198981minus1

1199101198971minus10

sdot sdot sdot sdot sdot sdot 1199101198971minus11198981minus1

) (33)

which is an 1198971times 1198981matrix

So (32) gives a1198731015840times1198721015840 submatrix of matrix 119884 (note that

1198731015840= 119873 minus 119897

2+ 1 and that 1198721015840 = 119872 minus 119898

2+ 1)

(

1199101198972minus1+V111987310158401198982minus1+V21198721015840 sdot sdot sdot sdot sdot sdot 119910

1198972minus1+V11198731015840119872minus1+V

21198721015840

119910119873minus1+V

111987310158401198982minus1+V21198721015840 sdot sdot sdot sdot sdot sdot 119910

119873minus1+V11198731015840119872minus1+V

21198721015840

) (34)

Next to obtain the whole result we need to compute the cir-cular convolution of two 2D sequences 119909

1198991+(V1+1)119873

10158401198992+(V2+1)119872

1015840

and ℎ1015840

11989911198992

(1198991

= 0 1 119873 minus 1 1198992

= 0 1 119872 minus 1) Withthe same reasoning as above a consecutive submatrix of thematrix (34) is evinced as follows

(

119910119873+V11198731015840119872+V

21198721015840 sdot sdot sdot sdot sdot sdot 119910

119873+V11198731015840119872+119872

1015840minus1+V21198721015840

119910119873+119873

1015840minus1+V11198731015840119872+V

21198721015840 sdot sdot sdot sdot sdot sdot 119910

119873+1198731015840minus1+V11198731015840119872+119872

1015840minus1+V21198721015840

)

(35)

The corresponding graphic description is indicated inFigure 2(b) We will darken the rectangle in Figure 2(b) toexpress the submatrix (35) and the dashed one on its upper-left-corner to be the graphic description of the submatrix(34)

Clearly if (V1 V2) = (V10158401 V10158402) then (119905

1+ V11198731015840 1199052

+

V21198721015840) = (1199051015840

1+ V101584011198731015840 1199051015840

2+ V101584021198721015840) where 119897

2minus 1 le 119905

1 1199051015840

1le

119873 minus 1 1198982minus 1 le 119905

2and 1199051015840

2le 119872 minus 1 Let [119909] represent

the largest integer that is less than or equal to the realnumber 119909 therefore when V

1= 0 1 [(119897

1minus 119873)119873

1015840] and

V2

= 0 1 [(1198981minus 119872)119872

1015840] we will obtain all 1198731015840 times 119872

1015840

submatrices of thematrix119884 If 1198971= 11990411198731015840+119873 and119898

1= 11990421198721015840+

119872 then [(1198971minus 119873)119873

1015840] = (1198971minus 119873)119873

1015840 and [(1198981minus 119872)119872

1015840] =

(1198981minus119872)119872

1015840 The input matrix 11990911989911198992

will be divided with noremainder Figure 3 displays a series of small rectangles Eachrectangle stands for one1198731015840times119872

1015840 submatrixThe entirematrix119884 can be obtained by combining them

In Figure 3 there is a white Γ-type area indicating thatthere are no output data Two calculation methods canbe applied to obtain the data The first way is by using adirect method because only a few computations are neededAlternatively we can compute the data of Γ-type area with theoverlap-savemethod proposed above if1198731015840 = 119897

2minus1 and119872

1015840=

1198982minus 1 The detail of it is presented in the Technical Report

[18] The entire result is completed and is demonstrated inFigure 4 graphically

The two-dimensional overlap-save method is summa-rized as follows

m

n

Figure 3 All 1198731015840

times 1198721015840 submatrices of the output except the

boundary of Γ-type area

m

n

Figure 4 The full result of (4) computed by 2D overlap-savemethod where 119897

1= 11990411198731015840+ 119873 119898

1= 11990421198721015840+ 119872 and 119873

1015840+ 1198972minus 1 =

119873 lt 1198971and 119872

1015840+ 1198982minus 1 = 119872 lt 119898

1

(i) Select two positive integers 1198731015840 and 119872

1015840 so that 1198731015840 +1198972minus 1 = 119873 lt 119897

1and 119872

1015840+ 1198982minus 1 = 119872 lt 119898

1 Either

119873 or119872 is given by an integer power of 2 for using anFFT that is 119873 = 2

1198891 and 119872 = 2

1198892 where 119889

1and 119889

2

are two positive integers

(ii) Let ℎ101584011989911198992

satisfy (28)

(iii) Compute the circular convolution of two sequences1199091198991+V111987310158401198992+V21198721015840 and ℎ

1015840

11989911198992

(1198991

= 0 1 119873 minus 1 1198992

=

0 1 119872 minus 1) When 1199051

= 1198972minus 1 119873 minus 1 119905

2=

1198982minus 1 119872 minus 1 and V

1= 0 1 [(119897

1minus 119873)119873

1015840]

V2= 0 1 [(119898

1minus 119872)119872

1015840] we obtain all 1198731015840 times 119872

1015840

submatrices of the matrix of 119884 whose form is as (34)

8 Mathematical Problems in Engineering

If 1198971

= 11990411198731015840+ 119873 and 119898

1= 11990421198721015840+ 119872 then [(119897

1minus

119873)1198731015840] = (1198971minus 119873)119873

1015840 and [(1198981minus 119872)119872

1015840] = (119898

1minus

119872)1198721015840 The input matrix 119909

11989911198992

will be divided withno remainder

(iv) For 1199051= 0 1 119897

2minus 2 1199052= 0 1 119898

1minus 1 and 119905

1=

0 1 1198971minus 1 119905

2= 0 1 119898

2minus 2 compute 119910

11990511199052

byusing the direct method

If 1198731015840 = 1198972minus 1 and 119872

1015840= 1198982minus 1 we will add zeros

to the sequence 11990911989911198992

so that the 2D sequences are oflengths 119897

1+ 1198731015840 and 119898

1+ 1198721015840 Then we will compute

11991011989911198992

(1199051

= 0 1 1198972minus 2 1199052

= 0 1 1198981minus 1 and

1199051= 0 1 119897

1minus 1 1199052= 0 1 119898

2minus 2) by using an

overlap-save method The detail of it is presented inthe Technical Report [18]

We will introduce the way of using FNTT and 2Doverlap-save method with two examples One is numericalcomputation and the other is an experiment of extracting thecontour of a Chinese handwritten character

4 Comparison of the Numbersof Multiplication

Let119873 = 1198731015840+ 1198972minus 1 lt 119897

1119872 = 119872

1015840+1198982minus 1 lt 119898

11198731015840 = 119897

2minus 1

1198721015840= 1198982minus 1 1198972= 2119906+ 1 119898

2= 21199061015840

+ 1 and 1198971= 11990411198731015840+ 119873

1198981= 11990421198721015840+ 119872 Suppose that 119886

1and 1198862satisfy 2

1198861minus1

lt 1198971+

1198972minus 1 le 2

1198861 = 119873

1and 1198861198862minus1

lt 1198981+1198982minus 1 le 2

1198862 = 119873

2 Let 119871

1

1198712 and 119871

3denote the numbers of multiplication necessary

for computing the convolution (4) by using direct methodFNTT or FFT to calculate (4) (using Proposition 1) and2D overlap-save method respectively In [18] we comparedthe number of multiplications necessary for computing theconvolution (4) of two 2D sequences 119909

11989911198992

(1198991= 0 1 119897

1minus

1 1198992

= 0 1 1198981minus 1) and ℎ

11989911198992

(1198991

= 0 1 1198972minus 1

1198992= 0 1 119898

2minus 1) by three different methods

We proved the following results

(1) If 1198972lt 1198971 1198982lt 1198981 then

1198711=

11989721198982(1198972+ 1) (119898

2+ 1)

4+ (1198981minus 1198982)1198982

1198972(1198972+ 1)

2

+ (1198971minus 1198972) 1198972

1198982(1198982+ 1)

2+ (1198971minus 1198972) (1198981minus 1198982) 11989721198982

(36)

Also if 1198971= 1198981= 119897 1198972= 1198982= 1198971015840 then

1198711= (

1198971015840(2119897 minus 119897

1015840+ 1)

2)

2

(37)

(2) Consider

1198712= 21198861+1198862minus1

(31198861+ 31198862+ 2) (38)

(3) If 1198971= 1198981= 2119906+ℎ 1198972= 1198982= 2119906+ 1 119873 = 119872 = 2

119906+1and 119873

1015840= 1198721015840= 2119906 where 119906 ge 3 ℎ ge 2 then

1198711= ((2119906+ 1)2119906minus1

(2ℎ+1

minus 1))2

1198712= 22119906+2ℎ+1

(6119906 + 6ℎ + 8)

1198713= 2(2

119906+ℎ)2

(6119906 + 8)

(39)

In this section wewill suppose that1198731015840 = 1198972minus1 119872

1015840= 1198982minus

1 Let 119873 = 1198731015840+ 1198972minus 1 lt 119897

1 119872 = 119872

1015840+ 1198982minus 1 lt 119898

1 and

1198971= 11990411198731015840+119873 119898

1= 11990421198721015840+119872 For 119905

1= 0 1 119897

2minus 2 119905

2=

0 1 1198981minus 1 and 119905

1= 0 1 119897

1minus 1 119905

2= 0 1 119898

2minus 2

we computer 11991011990511199052

by using the direct methodWe have the following proposition

Proposition 6 If 1198972lt 1198971 1198982lt 1198981 then

119871 =11989721198982

4((1198972minus 1) (119898

2minus 1) + 2 (119897

2minus 1)

times (1198981minus 1198982+ 1) + 2 (119898

2minus 1) (119897

1minus 1198972+ 1))

(40)

where 119871 denotes the number of multiplication necessary forcomputing119910

11989911198992

by using the directmethod 1199051= 0 1 119897

2minus2

1199052= 0 1 119898

1minus1 and 119905

1= 0 1 119897

1minus1 1199052= 0 1 119898

2minus

2Also if 119897

1= 1198981= 119897 and 119897

2= 1198982= 1198971015840 then

119871 =

11989710158402

(1198971015840minus 1)

4(4119897 minus 3119897

1015840+ 3) (41)

Proof Let I II and III denote the number of multiplicationnecessary for computing the 119860 119861 and 119862 by direct methodrespectively where

119860 = (

11991000

sdot sdot sdot 11991001198982minus2

1199101198972minus20

sdot sdot sdot 1199101198972minus21198982minus2

)

119861 = (

11991001198982minus1

sdot sdot sdot 11991001198981minus1

1199101198972minus21198982minus1

sdot sdot sdot 1199101198972minus21198981minus1

)

119862 = (

1199101198972minus10

sdot sdot sdot 1199101198972minus11198982minus2

1199101198972minus10

sdot sdot sdot 1199101198972minus11198982minus2

)

(42)

Mathematical Problems in Engineering 9

Then

119868 = (1 + 2 + sdot sdot sdot + (1198982minus 1)) (1 + 2 + sdot sdot sdot + (119897

2minus 1))

=11989721198982(1198972minus 1) (119898

2minus 1)

4

119868119868 = 1198982(1 + 2 + sdot sdot sdot + (119897

2minus 1)) (119898

1minus 1 minus (119898

2minus 2))

=11989721198982(1198972minus 1) (119898

1minus 1198982+ 1)

2

119868119868119868 = 1198972(1 + 2 + sdot sdot sdot + (119898

2minus 1)) (119897

1minus 1 minus (119897

2minus 2))

=11989721198982(1198982minus 1) (119897

1minus 1198972+ 1)

2

(43)

So

119871 = 119868 + 119868119868 + 119868119868119868

=11989721198982

4((1198972minus 1) (119898

2minus 1) + 2 (119897

2minus 1) (119898

1minus 1198982+ 1)

+2 (1198982minus 1) (119897

1minus 1198972+ 1))

(44)

Clearly if 1198971= 1198981= 119897 and 119897

2= 1198982= 1198971015840 then (41) holds This

completes the proof

Proposition 7 If 1198971

= 1198981

= 2119906+ℎ 1198972

= 1198982

= 2119906+ 1 119873 =

119872 = 2119906+2 and119873

1015840= 1198721015840= 3sdot2

119906 where 119906 ge 3 ℎ equiv 0 (mod 2)ℎ ge 4 then

1198714= (2119906+ 1)222(119906minus1)

(2ℎ+2

minus 3)

+ (4(2ℎminus2

minus 1)

3+ 1)

2

22(119906+2)

(3119906 + 7)

(45)

where 1198714denotes the number of multiplication necessary for

computing (4) by using 2D overlap-save method

Proof Because 1198731015840

= 1198972minus 1 1198721015840 = 119898

2minus 1 1198971= 1198981= 2119906+ℎ and

1198972= 1198982= 2119906+ 1 by (41) we have

119871 = (2119906+ 1)2sdot 2119906minus2

(2119906+ℎ+2

minus 3 (2119906+ 1) + 3)

= (2119906+ 1)222(119906minus1)

(2ℎ+2

minus 3)

(46)

Compute the cyclic convolution of two sequences1199091198991+V111987310158401198992+V21198721015840 and ℎ

1015840

11989911198992

(1198991

= 0 1 2119906+2

minus 11198992

= 0 1 2119906+2

minus 1) that is compute matrix (35) byusing FNNT It is well known that using FNTT to calculatethe (35) requires

119873119872(3

2log119873119872 + 1) = 2

2(119906+2)(3119906 + 7) (47)

where 119873 = 119872 = 2119906+2

When 119873 = 119872 = 2119906+2 1198731015840 = 119872

1015840= 3 sdot 2

119906 119906 ge 3 ℎ equiv

0 (mod 2) and ℎ ge 4 then

[1198971minus 119873

1198731015840] = [

1198981minus 119872

1198721015840] = [

2119906+ℎ

minus 2119906+2

3 sdot 2119906]

= [

4 (2ℎminus2

minus 1)

3] =

4 (2ℎminus2

minus 1)

3

(48)

where 4(2ℎminus2

minus 1)3 is a positive integerSo the input matrix 119909

11989911198992

will be divided with noremainder When V

1= 0 1 [(119897

1minus 119873)119873

1015840] and V

2=

0 1 [(1198981minus119872)119872

1015840] we obtain all matrices as (35) Thus

1198714= (2119906+ 1)222(119906minus1)

(2ℎ+2

minus 3)

+ (4(2ℎminus2

minus 1)

3+ 1)

2

22(119906+2)

(3119906 + 7)

(49)

equal to (45) holds This completes the proof

Example 8 Suppose that 119906 = ℎ = 4 that is 1198971= 1198981= 256

1198972= 1198982= 17 119873 = 119872 = 64 and 119873

1015840= 1198721015840= 48 then

1198714= 3073856 (50)

If 1198971= 1198981= 256 119897

2= 1198982= 17 119873 = 119872 = 32 and 119873

1015840= 1198721015840=

16 then

1198713= 4194304 (51)

This example shows that 1198714lt 1198713in some particular cases

5 Experiments

The theoretic description of the 2D overlap-save method hasbeen provided in the preceding section This section furtherexamines how such a technique will be performed and howit will be applied to the wavelet transform Particularly wewill use image processing as an exampleThe experiment willfocus on the application of the 2D overlap-savemethod to thedyadic wavelet transform extracting the contours of Chinesehandwriting

51 Numerical Computation Let ℎ11989911198992

denote a digital filterand let a two-dimensional sequence

(ℎ11989911198992

) = (

1 0 1

1 1 0

0 1 1

) (52)

be the coefficients of the filter A two-dimensional sequence

(11990911989911198992

) =

((((

(

1 3 2 minus3 0 2 1 1

3 1 0 minus1 2 minus2 minus1 0

0 minus1 1 1 3 2 0 minus1

2 3 minus1 1 0 1 1 0

3 minus2 1 0 minus1 1 1 1

minus1 0 2 3 1 1 0 1

1 minus1 0 1 0 1 minus1 0

minus1 0 1 1 0 1 0 1

))))

)

(53)

10 Mathematical Problems in Engineering

represents the input of the filter In this example because 1198971=

1198981= 8 and 119897

2= 1198982= 3 the length of input matrix is 8 times 8

and that of the filter is 3 times 3Using the overlap-save method to calculate the output of

the filter

11991011989911198992

=

2

sum

1198961=0

2

sum

1198962=0

ℎ11989611198962

1199091198991minus11989611198992minus1198962

0le1198991minus1198961lt8

0le1198992minus1198962lt8

1198991= 0 1 2 3 4 5 6 7 119899

2= 0 1 2 3 4 5 6 7

(54)

means that the elements of the matrix

119884 = (

11991000

11991001

sdot sdot sdot 11991007

11991010

11991011

sdot sdot sdot 11991017

11991070

11991071

sdot sdot sdot 11991077

) (55)

need to be computedThe solution is given belowSince 119897

1= 1198981= 8 1198972= 1198982= 3 by selecting 119873

1015840= 1198972minus 1 =

2 and 1198721015840= 1198982minus 1 = 2 we have 119873 = 119872 = 4 In order to

use the FNTT the input matrix is divided into 9 submatricesof size 4times 4 Each consecutive submatrix is partly overlappedwith the size of 2 times 2 pixels In addition zeros of size 1 times 1

are added to the filtering sequence to ensure that its lengthis equivalent to that of the submatrix Therefore the filteringsequence ℎ

11989911198992

is extended to ℎ1015840

11989911198992

that is

ℎ1015840

11989911198992

= ℎ11989911198992

if 1198991= 0 1 2 119899

2= 0 1 2

0 if 1198991= 3 or 119899

2= 3

(56)

where 1198991= 0 1 2 3 119899

2= 0 1 2 3

Next we compute the circular convolution of the twosequences 119909

1198991+2V11198992+2V2

and ℎ1015840

11989911198992

(1198991

= 0 1 2 3 1198992

=

0 1 2 3)

11991011990511199052

=

3

sum

1198991=0

3

sum

1198992=0

ℎ1015840

11989911198992

119909⟨1199051minus1198991⟩4+2V1⟨1199052minus1198992⟩4+2V2

=

2

sum

1198991=0

2

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩4+2V1⟨1199052minus1198992⟩4+2V2

(57)

where 1199051= 0 1 2 3 119905

2= 0 1 2 3

When 1199051= 2 3 119905

2= 2 3 we arrive at the following result

11991011990511199052

=

2

sum

1198991=0

2

sum

1198992=0

ℎ11989911198992

1199091199051minus1198991+2V11199052minus1198992+2V2

= 1199101199051+2V11199052+2V2

(58)

After choosing all the parameters of V1

= 0 1 2 V2

=

0 1 2 ([(1198971minus 119873)119873

1015840] = [(119898

1minus 119872)119872

1015840] = [(8 minus 4)2] = 2)

all 2 times 2 submatrices of the matrix 119884 defined in (34) will beobtained as follows

(11991022

11991023

11991032

11991033

)(11991024

11991025

11991034

11991035

)(11991026

11991027

11991036

11991037

)

(11991042

11991043

11991052

11991053

)(11991044

11991045

11991054

11991055

)(11991046

11991047

11991056

11991057

)

(11991062

11991063

11991072

11991073

)(11991064

11991065

11991074

11991075

)(11991066

11991067

11991076

11991077

)

(59)

For 11991011990511199052

(1199051

= 0 1 1199052

= 0 1 2 3 4 5 6 7 1199051

=

0 1 2 3 4 5 6 7 1199052

= 0 1) we can compute it by usingan overlap-save method The detail of it is presented in theTechnical Report [18]

The fast number theoretic transform (FNTT) is nowapplied to the implementation of the circular convolution

11991011990511199052

=

3

sum

1198991=0

3

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩4⟨1199052minus1198992⟩4

1199051= 0 1 2 3 119905

2= 0 1 2 3

(60)

The computation is performed in the following five stepsshown in Figure 5

Step 1 (choosing 119872) Since

1003816100381610038161003816100381611991011990511199052

10038161003816100381610038161003816le

1003816100381610038161003816100381611990911989911198992

10038161003816100381610038161003816max

3

sum

1198961=0

3

sum

1198962=0

10038161003816100381610038161003816ℎ11989611198962

10038161003816100381610038161003816= 3 times 6 = 18 (61)

we can select119898 = 257 = 28+ 1 so that 18 lt 2572 where 257

is a prime Clearly 164 equiv 1 (mod257) and 16119895

equiv 1 (mod257) for 1 le 119895 le 3

Thus

11988311989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

11990911989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(62)

is a 2D number theoretic transform It has the followinginverse transform

11990911989911198992

equiv 4minus1

sdot 4minus1

3

sum

1198961=0

3

sum

1198962=0

11988311989611198962(minus16)11989911198961(minus16)11989921198962(mod 257)

1198991= 0 1 2 3 119899

2= 0 1 2 3

(63)

where 4minus1 denotes an integer so that (4minus1) sdot 4 equiv 1 (mod 257)

Mathematical Problems in Engineering 11

linear convolutionof the output matrixof the output matrix

cyclic convolutionCalculate the

of the filtering matrix

Calculate the

Calculate the numbertheoretic transformof the input matrix

Choose M

theoretic transformCalculate the number

Figure 5 Five steps of applying FNTT to calculate the output of (54)

Step 2 (calculating the number theoretic transform of inputmatrix by the FNTT) For computational convenience hereone writes

11988001198962

equiv

3

sum

1198992=0

11990901198992

1611989921198962 119880

11198962

equiv

3

sum

1198992=0

11990911198992

1611989921198962(mod 257)

11988021198962

equiv

3

sum

1198992=0

11990921198992

1611989921198962 119880

31198962

equiv

3

sum

1198992=0

11990931198992

1611989921198962(mod 257)

1198962= 0 1 2 3

(64)

Then (62) becomes

11988311989610

equiv

3

sum

1198991=0

11988011989910

1611989911198961 119883

11989611

equiv

3

sum

1198991=0

11988011989911

1611989911198961(mod 257)

11988311989612

equiv

3

sum

1198991=0

11988011989912

1611989911198961 119883

11989613

equiv

3

sum

1198991=0

11988011989913

1611989911198961(mod 257)

1198961= 0 1 2 3

(65)

Use the FNTT to calculate (64) and (65)So

(

11988000

11988001

11988002

11988003

11988010

11988011

11988012

11988013

11988020

11988021

11988022

11988023

11988030

11988031

11988032

11988033

)

equiv (

3 95 3 minus97

3 35 3 minus29

1 minus33 1 31

5 35 minus3 minus29

) (mod 257)

119883 = (

11988300

11988301

11988302

11988303

11988310

11988311

11988312

11988313

11988320

11988321

11988322

11988323

11988330

11988331

11988332

11988333

)

equiv (

12 132 4 minus124

minus30 128 98 minus128

minus4 minus8 4 minus8

34 128 minus94 minus128

) (mod 257)

(66)

Step 3 (calculating the number theoretic transformof the filterby the FNTT) The FNTT of the filter ℎ

11989911198992

is written as

11986711989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

ℎ1015840

11989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(67)

Similarly we have

119867 = (

11986700

11986701

11986702

11986703

11986710

11986711

11986712

11986713

11986720

11986721

11986722

11986723

11986730

11986731

11986732

11986733

)

equiv (

6 32 2 minus32

32 0 2 34

2 minus2 2 minus2

minus32 minus30 2 0

) (mod 257)

(68)

Step 4 (compute the number theoretic transformof the outputof the filter) From the preceding three steps we can computethe circular convolution of the filter by defining the productof 119883 and 119867 as

119884 = (

11988400

11988401

11988402

11988403

11988410

11988411

11988412

11988413

11988420

11988421

11988422

11988423

11988430

11988431

11988432

11988433

)

equiv 119883 ⊙ 119867 = (

11988300

11986700

11988301

11986701

11988302

11986702

11988303

11986703

11988310

11986710

11988311

11986711

11988312

11986712

11988313

11986713

11988320

11986720

11988321

11986721

11988322

11986722

11988323

11986723

11988330

11986730

11988331

11986731

11988332

11986732

11988333

11986733

)

equiv (

72 112 8 113

68 0 minus61 17

minus8 16 8 16

minus60 15 69 0

) (mod 257)

(69)

where

11988411989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

11991011989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(70)

12 Mathematical Problems in Engineering

Table 1 Filtering coefficients 12059521198951

119896119897 (119895 = 2) 120595(119903) are a quadratic spline wavelet

119897119896 119896 = 0 119896 = 1 119896 = 2 119896 = 3

119897 = 0 minus00838140026 minus00472041145 minus00129809398 minus00012592132119897 = 1 minus01416904181 minus00758706033 minus00196341425 minus00012698699119897 = 2 minus00651057437 minus00327749476 minus00063385521 minus00000750836119897 = 3 minus00088690016 minus00030044997 minus00001088651

(a) (b)

Figure 6 A 2-dimensional image of an aircraft was processed with 2D overlap-save method (a) Original Chinese handwriting and (b) thedivided up subimages of the character

and the 11991011989911198992

(1198991

= 0 1 2 3 1198992

= 0 1 2 3) is the circularconvolution of (60)

Step 5 (calculate the output of the linear convolution) From(63) we deduce the inverse transform of (70)

11991011989911198992

equiv 4minus1

sdot 4minus1

3

sum

1198961=0

3

sum

1198962=0

11988411989611198962(minus16)11989911198961

sdot (minus16)11989921198962(mod 257)

1198991= 0 1 2 3 119899

2= 0 1 2 3

(71)

Using FNTT to calculate (71) we have

(

11991000

11991001

11991002

11991003

11991010

11991011

11991012

11991013

11991020

11991021

11991022

11991023

11991030

11991031

11991032

11991033

) equiv (

8 6 4 0

1 7 13 1

2 2 6 4

1 5 5 7

) (mod 257)

(72)

Then the linear convolution in (58) is obtained

(11991022

11991023

11991032

11991033

) = (11991022

11991023

11991032

11991033

) = (6 4

5 7) (73)

52 Application to Image Processing The proposed methodcan be applied to many fields such as image processingand pattern recognition An example of the application to

the image processing is illustrated in Figure 6 The originalimage shown in Figure 6(a) is a 2-dimensional image of anaircraft with a size of 256 times 256 pixels that is 119897

1= 1198981

=

256 Our task is to extract its contours The discrete wavelettransform with scale 119904 = 2

119895 where 119895 = 2 was applied and thespline wavelet described in (1) of size 17 times 17 was chosenthat is 119897

2= 1198982

= 17 We use the filtering coefficientstabulated in Table 1 Using the 2D overlap-save method thisoriginal image was divided into 25 sections with each onehaving the dimension of 64 times 64 pixels that is we select119873 = 119872 = 64 1198731015840 = 119872

1015840= 48 [(119897

1minus 119873)119873

1015840] = [(119898

1minus

119872)1198721015840] = 4 (See Example 8 in Section 4) Figure 6(b)

shows these subimages The overlapped part can be explicitlyobserved in each subimage

To facilitate the presentation of the 2D overlap-savemethod the procedure of it is diagonally displayed inFigure 7 where a series of the divided subimages are illus-tratedThe image in Figure 6(a) was equivalently divided into25 sections by applying (27) In Figure 7(a) we represent 5subimages of V

0= 0 V

1= 0 V

0= 1 V

1= 1 V

0= 2 V

1= 2

and V0

= 3 V1

= 3 and V0

= 4 V1

= 4 consecutively Thelower-right corner of each subimage is repeated in the upper-left corner of its consecutive subimage Four subimages aredisplayed in Figure 7(b) and the parameters of V

0= 0 V1= 1

V0

= 1 V1

= 2 V0

= 2 V1

= 3 and V0

= 3 V1

= 4 werechosen In Figure 7(c) we selected 3 subimages of V

0= 0

V1

= 2 V0

= 1 V1

= 3 and V0

= 2 V1

= 4 There are3 subimages of V

0= 0 V

1= 3 and V

0= 1 V

1= 4 in

Figure 7(d) Figure 7(e) displays subimages of V0= 0 V

1= 4

Mathematical Problems in Engineering 13

(a) (b) (c)

(d) (e) (f)

(g) (h) (i)

Figure 7 A 2-dimensional image of an aircraft is dividing into separated small subimages the parameters of V0and V

1are chosen as follows

(a) V0= 0 V

1= 0 V

0= 1 V

1= 1 V

0= 2 V

1= 2 and V

0= 3 V

1= 3 and V

0= 4 and V

1= 4 (b) V

0= 0 V

1= 1 V

0= 1 V

1= 2 V

0= 2 V

1= 3 and

V0= 3 and V

1= 4 (c) V

0= 0 V

1= 2 V

0= 1 V

1= 3 and V

0= 2 and V

1= 4 (d) V

0= 0 V

1= 3 and V

0= 1 and V

1= 4 (e) V

0= 0 and V

1= 4 (f)

V0= 1 V

1= 0 V

0= 2 V

1= 1 V

0= 3 V

1= 2 and V

0= 4 and V

1= 3 (g) V

0= 2 V

1= 0 V

0= 3 V

1= 1 and V

0= 4 and V

1= 2 (h) V

0= 3 V

1= 0

and V0= 4 and V

1= 1 and (i) V

0= 4 and V

1= 0

In Figure 7(f) V0= 1 V

1= 0 V

0= 2 V

1= 1 V

0= 3 V

1= 2

and V0= 4 V1= 3were chosen In Figure 7(g) the parameters

were decided upon V0= 2 V

1= 0 V

0= 3 V

1= 1 and V

0= 4

V1= 2 Two subimages are shown in Figure 7(h) by selecting

V0= 3 V

1= 0 and V

0= 4 V

1= 1 There is one subimage of

V0= 4 V

1= 0 in Figure 7(i)

We select a 2D NTT

11988311989611198962

equiv

63

sum

1198991=0

63

sum

1198992=0

11990911989911198992

211989911198961211989921198962 (mod 2

32+ 1) (74)

14 Mathematical Problems in Engineering

(a) (b)

(c) (d)

Figure 8 The linear outputs of 2D overlap-save method (a) the outputs of the linear convolution of each subimages (b) the left border andthe upper border of the outputs of the image of aircraft (c) the combined outputs of linear convolution except Γ-type border and (d) theentire contour extracted using 2D overlap-save method under wavelet transform

which has inverse transform

11990911989911198992

equiv 64minus1

64minus1

63

sum

1198961=0

63

sum

1198962=0

11988311989611198962

(minus231)11989911198961

times (minus231)11989921198962

(mod 232

+ 1)

1198991= 0 1 63 119899

2= 0 1 63

(75)

where 64minus1 denotes integer so that (64minus1)64 equiv 1 (mod 2

32+

1) and |11990911989911198992

| le 255The FNTT was applied to calculate the circular convo-

lution of each subimage After applying (31) to each of thesubblocks a series of segments of the contours were obtained

By using (32) we can gradually reach the final result of thelinear convolution Figure 8(a) illustrates those pixels whichsatisfy (35) where 119897

2= 1198982= 17 119873 = 119872 = 64 1198731015840 = 119872

1015840=

48 and V1 V2

= 0 1 2 3 4 Combining them together thecontours of the whole character were obtained and displayedin Figure 8(c) which excludes the Γ-type border Next the

Γ-type border was computed by direct method Figure 8(b)shows the result Combining this result with that shown inFigure 8(c) the entire contours of the Chinese handwritingwere combined Figure 8(d) represents the entire contour

6 Conclusions

A novel approach to reduce the computation complexityof the wavelet transform has been presented in this paperTwo key techniques have been applied in this new methodnamely fast number theoretic transform (FNTT) and two-dimensional overlap-save technique In the fast numbertheoretic transform the linear convolution is replaced bythe circular convolution It can speed up the computationof 2D discrete wavelet transform Directly calculating thefast number theoretic transform to the whole input sequencemay meet two difficulties namely a big modulo obstructsthe effective implementation of the fast number theoretictransform and a long input sequence slows the computation

Mathematical Problems in Engineering 15

of the fast number theoretic transform down To fight withsuch deficiencies a new technique which is referred to as 2Doverlap-save method has been developed Experiments havebeen conducted The fast number theoretic transform and2D overlap-method have been used to implement the dyadicwavelet transform and applied to contour extraction in imageprocessing and pattern recognition

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Acknowledgments

This work was supported by the Research GrantsMYRG205(Y1-L4)-FST11-TYY and MYRG187(Y1-L3)-FST11-TYY and Chair Prof Grants RDG009FST-TYY ofUniversity of Macau as well as Macau FDC Grants T-100-2012-A3 and 026ndash2013-A This research project was alsosupported by the National Natural Science Foundation ofChina 61273244

References

[1] P L Combettes and J-C Pesquet ldquoWavelet-constrained imagerestorationrdquo International Journal of Wavelets Multiresolutionand Information Processing vol 2 no 4 pp 371ndash389 2004

[2] M Ehler and K Koch ldquoThe construction of multiwavelet bi-frames and applications to variational image denoisingrdquo Inter-national Journal of Wavelets Multiresolution and InformationProcessing vol 8 no 3 pp 431ndash455 2010

[3] P Jain and S N Merchant ldquoWavelet-based multiresolutionhistogram for fast image retrievalrdquo International Journal ofWavelets Multiresolution and Information Processing vol 2 no1 pp 59ndash73 2004

[4] S Mallat and W L Hwang ldquoSingularity detection and pro-cessing with waveletsrdquo Institute of Electrical and ElectronicsEngineers Transactions on InformationTheory vol 38 no 2 pp617ndash643 1992

[5] B U Shankar S K Meher and A Ghosh ldquoNeuro-waveletclassifier formultispectral remote sensing imagesrdquo InternationalJournal of Wavelets Multiresolution and Information Processingvol 5 no 4 pp 589ndash611 2007

[6] S Shi Y Zhang and Y Hu ldquoA wavelet-based image edgedetection and estimationmethod with adaptive scale selectionrdquoInternational Journal of Wavelets Multiresolution and Informa-tion Processing vol 8 no 3 pp 385ndash405 2010

[7] Y Y Tang Wavelets Theory Approach to Pattern RecognitionWorld Scientific Singapor 2009

[8] Q M Tieng and W Boles ldquoWavelet-based affine invariantrepresentation a tool for recognizing planar objects in 3Dspacerdquo IEEE Transactions on Pattern Analysis and MachineIntelligence vol 19 no 8 pp 921ndash925 1997

[9] P Wunsch and A F Laine ldquoWavelet descriptors for mul-tiresolution recognition of handprinted charactersrdquo PatternRecognition vol 28 no 8 pp 1237ndash1249 1995

[10] H Yin and H Liu ldquoA Bregman iterative regularization methodfor wavelet-based image deblurringrdquo International Journal of

Wavelets Multiresolution and Information Processing vol 8 no3 pp 485ndash499 2010

[11] X You and Y Y Tang ldquoWavelet-based approach to characterskeletonrdquo IEEE Transactions on Image Processing vol 16 no 5pp 1220ndash1231 2007

[12] T Zhang Q Fan and Q Gao ldquoWavelet characterization ofHardy space ℎ

1 and its application in variational image decom-positionrdquo International Journal of Wavelets Multiresolution andInformation Processing vol 8 no 1 pp 71ndash87 2010

[13] Y Y Tang L Y Li Feng and J Liu ldquoScale-independent waveletalgorithm for detecting step-structure edgesrdquo Tech Rep IEEETransactions on InformationTheory Brisbane Australia 1998

[14] S G Mallat ldquoMultiresolution approximations and waveletorthonormal bases of 119871

2(R)rdquo Transactions of the American

Mathematical Society vol 315 no 1 pp 69ndash87 1989[15] J H McClellan and C M Rader Number Theory in Digital Sig-

nal Processing Prentice Hall Signal Processing Series PrenticeHall Englewood Cliffs NJ USA 1979

[16] X Ran and K J R Liu ldquoFast algorithms for 2-D circularconvolutions and number theoretic transforms based on poly-nomial transforms over finite ringsrdquo IEEE Transactions onSignal Processing vol 43 no 3 pp 569ndash578 1995

[17] Q Sun ldquoSome results in the application of the number theoryto digital signal processing and public-key systemsrdquo in NumberTheory and Its Applications in China vol 77 of ContemporaryMathematics pp 107ndash112 American Mathematical SocietyProvidence RI USA 1988

[18] Y Y Tang Q Sun L H Yang and L Feng ldquoAn overlap-save method for the calculation of the two-dimensional digitalconvolutionrdquo Tech Rep Department of Computer ScienceHong Kong Baptist University 1998

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 3: Research Article Implementation of 2D Discrete Wavelet ...downloads.hindawi.com/journals/mpe/2014/532979.pdfResearch Article Implementation of 2D Discrete Wavelet Transform by Number

Mathematical Problems in Engineering 3

the directmethod is used to calculate their linear convolutionthe number of multiplication operations will be large Inthis section the 2D number theoretic transform (FNTT) willbe applied to calculate the 2D circular convolution of 2Dsequences of lengths119873

1= 1198971+1198972minus1 and119873

2= 1198981+1198982minus1 In a

2D number theoretic transform (NTT) if a modulo119872 is toobig the Chinese remainder theorem (CRT) will be utilized toreduce the length

21 2D Linear Convolution and 2D Circular ConvolutionGiven two 2-dimensional sequences 119909

11989911198992

(1198991= 0 1 119897

1minus

1 1198992= 0 1 119898

1minus 1) and ℎ

11989911198992

(1198991= 0 1 119897

2minus 1 119899

2=

0 1 1198982minus 1) their linear convolution is defined by

11991011989911198992

=

1198971minus1

sum

1198961=0

1198981minus1

sum

1198962=0

11990911989611198962

ℎ1198991minus11989611198992minus1198962

0le1198991minus1198961lt1198972

0le1198992minus1198962lt1198982

=

1198972minus1

sum

1198961=0

1198982minus1

sum

1198962=0

ℎ11989611198962

1199091198991minus11989611198992minus1198962

0le1198991minus1198961lt1198971

0le1198992minus1198962lt1198981

1198991= 0 1 119897

1+ 1198972minus 2 119899

2= 0 1 119898

1+ 1198982minus 2

(6)

Given two 2-dimensional sequences 11990911989911198992

and ℎ11989911198992

oflengths 119873

1and 119873

2 respectively their circular convolution is

11991011989911198992

=

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

11990911989611198962

ℎ⟨1198991minus1198961⟩1198731⟨1198992minus1198962⟩1198732

=

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

ℎ11989611198962

119909⟨1198991minus1198961⟩1198731⟨1198992minus1198962⟩1198732

1198991= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1

(7)

where ⟨119909⟩119873denotes the remainder 119903 119909 = 119902119873+119903 0 le 119903 lt 119873

Proposition 1 The linear convolution (6) can be computed bycomputing circular convolution of two 2-dimensional sequencesof lengths 119873

1= 1198971+ 1198972minus 1 and 119873

2= 1198981+ 1198982minus 1 respectively

22 Using 2D Number Theoretic Transform to Calculate the2D Circular Convolution Let 119872 be a positive integer andsuppose that 119909

11989911198992

and ℎ11989911198992

are two 2-dimensional integersequences (119899

1= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1)

Let

11988311989611198962

equiv

1198731minus1

sum

1198991=0

1198732minus1

sum

1198992=0

11990911989911198992

1205721198991119896112057311989921198962(mod 119872) (8)

11986711989611198962

equiv

1198731minus1

sum

1198991=0

1198732minus1

sum

1198992=0

ℎ11989911198992

1205721198991119896112057311989921198962(mod 119872) (9)

11988411989611198962

equiv

1198731minus1

sum

1198991=0

1198732minus1

sum

1198992=0

11991011989911198992

1205721198991119896112057311989921198962(mod 119872) (10)

where (1198961

= 0 1 1198731minus 1 119896

2= 0 1 119873

2minus 1) and 120572

and 120573 are two given integers and 11991011989911198992

denote the circularconvolution as shown in (7) 119899

1= 0 1 119873

1minus 1 119899

2=

0 1 1198732minus 1

If a 2-dimensional transform (8) has an inverse transform

11990911989911198992

equiv 119873minus1

1sdot 119873minus1

2

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

11988311989611198962

120572minus11989911198961120572minus11989921198962(mod 119872)

(11)

(1198991= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1) and has circular

convolution property

11988411989611198962

equiv 11988311989611198962

11986711989611198962(mod 119872)

(1198961= 0 1 119873

1minus 1 119896

2= 0 1 119873

2minus 1)

(12)

then congruence equation (8) is referred to as a 2-dimensional number theoretic transform mod119872 and canbe abbreviated to NTT mod 119872

Agarwal and Burrus gave some sufficient conditions forexistence of 2-dimensional NTT given with 119872 gt 1 119873

1gt 1

and1198732gt 1 (see [15]) In [17] the authors gave some sufficient

and necessary conditions for existenceWe have the followingtheorem

Theorem 2 If 119872 = 1199011198971

1sdot sdot sdot 119901119897119904

119904 (119897119895ge 1 119895 = 1 119904) 119901

1 119901

119904

are distinct primes then the congruence equation (8) is a 2-dimensional NTT mod119872 with the first dimension of length1198731and the second dimension of length119873

2 if and only if 1205721198731 equiv

1 (mod119872) 1205731198732 equiv 1 (mod119872) and 120572119895

equiv 1 (mod119901119896) (1 le

119895 le 1198731minus 1) 120573119894 equiv 1 (mod 119901

119896) (1 le 119894 le 119873

2minus 1) 119896 = 1 119904

Corollary 3 The congruence equation (8) is a 2-dimensionalNTT mod119872 if and only if

lcm [1198731 1198732] | gcd (119901

1minus 1 119901

119904minus 1) (13)

where lcm[1198731 1198732] denotes the least common multiple of two

integers1198731and119873

2and gcd(119886 119887) denotes the greatest common

divisor of two integers 119886 and 119887

Corollary 4 Let 119901 be an odd prime and 119872 = 119901 Thenthe congruence equation (8) is a 2-dimensional NTT mod119901 ifand only if 1205721198731 equiv 1 (mod119901) and 120572

119895equiv 1 (mod119901) (1 le 119895 le

1198731minus 1) 1205731198732 equiv 1 (mod119901) and 120573

119895equiv 1 (mod119901) (1 le 119895 le

1198732minus 1)

Clearly from congruence equations (8) (9) (11) and(12) we can use the 2-dimensional NTT to calculate a 2-dimensional circular convolution

Finally we obtain

11991011989911198992

equiv

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

11990911989611198962

ℎ⟨1198991minus1198961⟩1198731⟨1198992minus1198962⟩1198732

(mod 119872)

1198991= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1

(14)

4 Mathematical Problems in Engineering

Select 119872 so that

1003816100381610038161003816100381611991011989911198992

10038161003816100381610038161003816le min

1003816100381610038161003816100381611990911989911198992

10038161003816100381610038161003816max

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

10038161003816100381610038161003816ℎ11989611198962

10038161003816100381610038161003816

10038161003816100381610038161003816ℎ11989911198992

10038161003816100381610038161003816max

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

1003816100381610038161003816100381611990911989611198962

10038161003816100381610038161003816

lt119872

2

(15)

where 1198991= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1 and 119872 is

an oddIf we use the 2-dimensional NTT to calculate the 2-

dimensional circular convolution11991011989911198992

so that |11991011989911198992

| lt 1198722then form congruence equation (14) we deduce that

11991011989911198992

=

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

11990911989611198962

ℎ⟨1198991minus1198961⟩1198731⟨1198992minus1198962⟩1198732

1198991= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1

(16)

23 Fast Number Theoretic Transform (FNTT) The idea ofFFT can be used to perform the NTT In this subsection atheoretic description will be presented briefly More detailswill be given in Section 5

Let

11988001198962

equiv

1198732minus1

sum

1198992=0

11990901198992

12057311989921198962 119880

1198731minus11198962

equiv

1198732minus1

sum

1198992=0

1199091198731minus11198992

12057311989921198962(mod119872)

1198962= 0 1 119873

2minus 1

(17)

From congruence equation (17) we deduce that

11988311989610

equiv

1198731minus1

sum

1198991=0

1198801198991012057211989911198961 119883

11989611198732minus1

equiv

1198731minus1

sum

1198991=0

11988011989911198732minus1

12057211989911198961(mod 119872)

1198961= 0 1 119873

1minus 1

(18)

Suppose that 1198731and 119873

2satisfy inequalities and we then

can use the idea of FFT to calculate the congruence equations(17) and (18)

For computing every

11988011989911198962

equiv

1198732minus1

sum

1198992=0

11990911989911198992

12057311989921198962(mod 119872)

(1198962= 0 1 119873

2minus 1)

(19)

in congruence equation (17) the numbers of all multipli-cation necessary are (119873

2log1198732)2 by using FFT algorithm

Hence if using FFT algorithm to calculate the congruence

11988011989911198962

equiv

1198732minus1

sum

1198992=0

11990911989911198992

12057311989921198962(mod119872)

(1198962= 0 1 119873

2minus 1)

(20)

in congruence equation (17) the numbers of all multiplica-tion necessary are ((119873

11198732)2) log119873

2

Similarly if using FFT algorithm to calculate all congru-ence equations in (18) then the numbers of all multiplicationnecessary are ((119873

21198731)2) log119873

1

Therefore if using the fast number theoretic transform(FNTT) to calculate the congruence equation (8) the numberof all multiplication necessary is

11987311198732

2log1198732+

11987321198731

2log1198731=

11987311198732

2log (119873

11198732) (21)

If119872 is very large wemay reduce the length of aword by usingChinese remainder theorem and it can be abbreviated toCRT

Therefore we have the following proposition

Proposition 5 Suppose that congruence equation (8) is a 2-dimensional NTT mod119872 where 119872 = 119901

1198971

1sdot sdot sdot 119901119897119904

119904 1199011 119901

119904

are distinct primes then we have a total of s 2-dimensionalNTT mod 119901

119897119894

119894 and they are described as follows

11988311989611198962

equiv

1198731minus1

sum

1198991=0

1198732minus1

sum

1198992=0

11990911989911198992

12057211989911198961

11989412057311989921198962

119894 (mod 119901

119897119894

119894)

1198961= 0 1 119873

1minus 1 119896

2= 0 1 119873

2minus 1

(22)

where 120572119894= ⟨120572⟩

119901119897119894

119894

120573119894= ⟨120573⟩

119901119897119894

119894

119894 = 1 2 119904If

11991011989911198992

=

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

11990911989611198962

ℎ⟨1198991minus1198961⟩1198731

⟨1198992minus1198962⟩1198732

equiv 119910(119894)

11989911198992

(mod 119901119897119894

119894)

(1198991= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1)

(23)

then

11991011989911198992

equiv

119904

sum

119894=1

1198721015840

119894119872119894119910(119894)

11989911198992

(mod119872)

(1198991= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1)

(24)

where 119872 = 119901119897119894

1198941198721198941198721015840

119894119872119894equiv 1 (mod 119901

119897119894

119894) 119894 = 1 119904

Mathematical Problems in Engineering 5

Proof Because the congruence equation (8) is a 2-dimen-sional NTT mod119872 hence

1205721198731 equiv 1 (mod119872) 120573

1198732 equiv 1 (mod 119872)

1205721198731 equiv 1 (mod 119901

119894) 120572

119895equiv 1 (mod 119901

119894) 1 le 119895 lt 119873

1

1205731198732 equiv 1 (mod 119901

119894) 120573

ℎequiv (mod 119901

119894) 1 le ℎ lt 119873

2

119894 = 1 2 119904

(25)

so

1205721198731 equiv 1 (mod 119901

119897119894

119894) 120573

1198732 equiv 1 (mod 119901

119897119894

119894)

1205721198731

119894equiv 1205721198731 equiv 1 (mod 119901

119894) 120572

119895

119894equiv 1 (mod 119901

119894)

1 le 119895 lt 1198731

1205731198732

119894equiv 1205731198732 equiv 1 (mod 119901

119894) 120573

119894equiv 1 (mod 119901

119894)

1 le ℎ lt 1198732

119894 = 1 119904

(26)

Hence the congruence equation (22) has a total of 119904 2-dimensional NTTs mod 119901

119897119894

119894 119894 = 1 119904 From CRT and the

congruence equation (23) we deduce that the congruenceequation (24) holds

3 Two-Dimensional Overlap-Save Method

Select two positive integers 1198731015840 and 1198721015840 so that 1198731015840 + 119897

2minus 1 =

119873 lt 1198971and 119872

1015840+ 1198982minus 1 = 119872 lt 119898

1 either 119873 or 119872 is given

by an integer power of 2 that is 119873 = 21198891 and 119872 = 2

1198892 where

1198891and 119889

2are two positive integers

Assuming that the input sequence 11990911989911198992

(1198991

=

0 1 1198971

minus 1 1198992

= 0 1 1198981

minus 1) is divided intomany small sections which are termed submatrices

1199091198991+V111987310158401198992+V211987210158401198991=119873minus1 119899

2=119872minus1

1198991=0 1198992=0

(V1= 0 1 V

2= 0 1 )

(27)

The consecutive matrix is overlapped by the previous oneAs a simple example four blocks chosen from the dividedinput matrices are overlapped and are graphically shown inFigure 1 Parameters V

1and V

2can be considered as shift

parameters because changing either V1or V2will select dif-

ferent submatrix For the first submatrix shown in Figure 1(a)we select V

1= 0 and V

2= 0 Second submatrix (V

1= 0 and

V2= 1) is displayed in Figure 1(b)Third one with parameters

of V1

= 1 and V2

= 0 is given in Figure 1(c) Fourth matrixshown in Figure 1(d) has parameters V

1= 1 and V

2= 1 The

procedure of the overlapping is also graphically illustrated inFigure 1

For the operation of circular convolution it is necessaryto have two sequences with the same length Taking (7) for

example the sequences 11990911989911198992

and ℎ11989911198992

are of the same lengthof1198731times1198732 Since the input sequence has already divided into

submatrices of119873times119872 by (27) the filter sequence has to be oflength119873times119872Therefore119873minus119897

2augmenting zeros are required

to be added to the row and119872minus1198982zeros to the column of the

filter sequence ℎ11989911198992

As a result the sequence ℎ11989911198992

becomes

ℎ1015840

11989911198992

=ℎ11989911198992

if 1198991= 0 1 119897

2minus 1 119899

2= 0 1 119898

2minus 1

0 if 1198972le 1198991lt 119873 or 119898

2le 1198992lt 119872

(28)

where 1198991= 0 1 119873 minus 1 and 119899

2= 0 1 119872 minus 1

The following form shows how a sequence ℎ101584011989911198992

is yieldedby adding augmenting zeros to the filter sequence ℎ

11989911198992

ℎ 997904rArr ℎ1015840 =

0 (29)

For each of the divided submatrices we can give V1and V

2

and compute the circular convolution of two 2D sequences1199091198991+V111987310158401198992+V21198721015840 and ℎ

1015840

11989911198992

(1198991

= 0 1 119873 minus 1 1198992

=

0 1 119872 minus 1) by

11991011990511199052

=

119873minus1

sum

1198991=0

119872minus1

sum

1198992=0

ℎ1015840

11989911198992

119909⟨1199051minus1198991⟩119873+V11198731015840⟨1199052minus1198992⟩119872+V21198721015840

1199051= 0 1 119873 minus 1 119905

2= 0 1 119872 minus 1

(30)

From (28) we deduce that

11991011990511199052

=

1198972minus1

sum

1198991=0

1198982minus1

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩119873+V11198731015840⟨1199052minus1198992⟩119872+V21198721015840 (31)

The result of (31) is that of circular convolution As we willsee below there exists an important connection between thecircular convolution and the linear one In fact since 119899

1=

0 1 1198972minus 1 and 119899

2= 0 1 119898

2minus 1 we can choose 119905

1=

1198972minus1 119873minus1 and 119905

2= 1198982minus1 119872minus1 in (31) this makes

119873 gt 1199051minus 1198991

gt 0 and 119872 gt 1199052minus 1198992

gt 0 in (31) Thus theremainder can exactly be equal to 119905

1minus 1198991and 1199052minus 1198992 Then

the circular convolution of (31) becomes

11991011990511199052

=

1198972minus1

sum

1198991=0

1198982minus1

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩119873+V11198731015840⟨1199052minus1198992⟩119872+V21198721015840

=

1198972minus1

sum

1198991=0

1198982minus1

sum

1198992=0

ℎ11989911198992

1199091199051minus1198991+V111987310158401199052minus1198992+V21198721015840

= 1199101199051+V111987310158401199052+V21198721015840

(32)

In order to clearly understand the procedure of obtainingthe components of linear convolution from the circularconvolution equation (31) a graphic description of it can befound in Figure 2 We show a dashed rectangle with size of119873 by 119872 in Figure 2(a) to represent the circular convolutionwhich is described in (31) and a darkened rectangle with sizeof1198731015840 by119872

1015840 to indicate the linear convolution stated in (32)

6 Mathematical Problems in Engineering

2N

m

n

2M

M

N1 = 0 2 = 0

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(a)

m

n

2N

2M

M

N1 = 1 2 = 0

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(b)

m

n

2N

2M

M

N

1 = 0 2 = 1

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(c)

m

n

2N

2M

M

N

1 = 1 2 = 1l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(d)

Figure 1 Four divided input submatrices are overlapped using the 2D overlap-save method (a) the first submatrix with parameters V1

=

0 V2= 0 is located on the top-left corner (b) the second one (V

1= 1 V

2= 0) overlaps by the first submatrix and the size of the overlapping

between them is119873 times1198982minus1 (c) the third divided input submatrix has parameters of V

1= 0 V

2= 1 It is overlapped by the first submatrix

and the size of the overlapping between them is 1198972minus 1 times 119872 (d) the fourth one with V

1= 1 V

2= 1 is overlapped by the first submatrix

and the size of the overlapping between them is 1198972minus 1 times 119898

2minus 1

m

n

2N

2M

M

N

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(a)

m

n

2N

2M

M

N

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(b)

Figure 2 Two consecutive output submatrices (a) the first block of V1= 0 and V

2= 0 and (b) the second block of V

1= 1 and V

2= 1

Mathematical Problems in Engineering 7

Obviously if the first 1198972minus 1 data in rows and the first 119898

2minus 1

data in columns are discarded from the dashed rectangle thedarkened rectangle can be obtained In the following we willexplain how to obtain the result of (4)

The output of the whole equation (4) can be representedin the following matrix

119884 = (

11991000

sdot sdot sdot sdot sdot sdot 11991001198981minus1

1199101198971minus10

sdot sdot sdot sdot sdot sdot 1199101198971minus11198981minus1

) (33)

which is an 1198971times 1198981matrix

So (32) gives a1198731015840times1198721015840 submatrix of matrix 119884 (note that

1198731015840= 119873 minus 119897

2+ 1 and that 1198721015840 = 119872 minus 119898

2+ 1)

(

1199101198972minus1+V111987310158401198982minus1+V21198721015840 sdot sdot sdot sdot sdot sdot 119910

1198972minus1+V11198731015840119872minus1+V

21198721015840

119910119873minus1+V

111987310158401198982minus1+V21198721015840 sdot sdot sdot sdot sdot sdot 119910

119873minus1+V11198731015840119872minus1+V

21198721015840

) (34)

Next to obtain the whole result we need to compute the cir-cular convolution of two 2D sequences 119909

1198991+(V1+1)119873

10158401198992+(V2+1)119872

1015840

and ℎ1015840

11989911198992

(1198991

= 0 1 119873 minus 1 1198992

= 0 1 119872 minus 1) Withthe same reasoning as above a consecutive submatrix of thematrix (34) is evinced as follows

(

119910119873+V11198731015840119872+V

21198721015840 sdot sdot sdot sdot sdot sdot 119910

119873+V11198731015840119872+119872

1015840minus1+V21198721015840

119910119873+119873

1015840minus1+V11198731015840119872+V

21198721015840 sdot sdot sdot sdot sdot sdot 119910

119873+1198731015840minus1+V11198731015840119872+119872

1015840minus1+V21198721015840

)

(35)

The corresponding graphic description is indicated inFigure 2(b) We will darken the rectangle in Figure 2(b) toexpress the submatrix (35) and the dashed one on its upper-left-corner to be the graphic description of the submatrix(34)

Clearly if (V1 V2) = (V10158401 V10158402) then (119905

1+ V11198731015840 1199052

+

V21198721015840) = (1199051015840

1+ V101584011198731015840 1199051015840

2+ V101584021198721015840) where 119897

2minus 1 le 119905

1 1199051015840

1le

119873 minus 1 1198982minus 1 le 119905

2and 1199051015840

2le 119872 minus 1 Let [119909] represent

the largest integer that is less than or equal to the realnumber 119909 therefore when V

1= 0 1 [(119897

1minus 119873)119873

1015840] and

V2

= 0 1 [(1198981minus 119872)119872

1015840] we will obtain all 1198731015840 times 119872

1015840

submatrices of thematrix119884 If 1198971= 11990411198731015840+119873 and119898

1= 11990421198721015840+

119872 then [(1198971minus 119873)119873

1015840] = (1198971minus 119873)119873

1015840 and [(1198981minus 119872)119872

1015840] =

(1198981minus119872)119872

1015840 The input matrix 11990911989911198992

will be divided with noremainder Figure 3 displays a series of small rectangles Eachrectangle stands for one1198731015840times119872

1015840 submatrixThe entirematrix119884 can be obtained by combining them

In Figure 3 there is a white Γ-type area indicating thatthere are no output data Two calculation methods canbe applied to obtain the data The first way is by using adirect method because only a few computations are neededAlternatively we can compute the data of Γ-type area with theoverlap-savemethod proposed above if1198731015840 = 119897

2minus1 and119872

1015840=

1198982minus 1 The detail of it is presented in the Technical Report

[18] The entire result is completed and is demonstrated inFigure 4 graphically

The two-dimensional overlap-save method is summa-rized as follows

m

n

Figure 3 All 1198731015840

times 1198721015840 submatrices of the output except the

boundary of Γ-type area

m

n

Figure 4 The full result of (4) computed by 2D overlap-savemethod where 119897

1= 11990411198731015840+ 119873 119898

1= 11990421198721015840+ 119872 and 119873

1015840+ 1198972minus 1 =

119873 lt 1198971and 119872

1015840+ 1198982minus 1 = 119872 lt 119898

1

(i) Select two positive integers 1198731015840 and 119872

1015840 so that 1198731015840 +1198972minus 1 = 119873 lt 119897

1and 119872

1015840+ 1198982minus 1 = 119872 lt 119898

1 Either

119873 or119872 is given by an integer power of 2 for using anFFT that is 119873 = 2

1198891 and 119872 = 2

1198892 where 119889

1and 119889

2

are two positive integers

(ii) Let ℎ101584011989911198992

satisfy (28)

(iii) Compute the circular convolution of two sequences1199091198991+V111987310158401198992+V21198721015840 and ℎ

1015840

11989911198992

(1198991

= 0 1 119873 minus 1 1198992

=

0 1 119872 minus 1) When 1199051

= 1198972minus 1 119873 minus 1 119905

2=

1198982minus 1 119872 minus 1 and V

1= 0 1 [(119897

1minus 119873)119873

1015840]

V2= 0 1 [(119898

1minus 119872)119872

1015840] we obtain all 1198731015840 times 119872

1015840

submatrices of the matrix of 119884 whose form is as (34)

8 Mathematical Problems in Engineering

If 1198971

= 11990411198731015840+ 119873 and 119898

1= 11990421198721015840+ 119872 then [(119897

1minus

119873)1198731015840] = (1198971minus 119873)119873

1015840 and [(1198981minus 119872)119872

1015840] = (119898

1minus

119872)1198721015840 The input matrix 119909

11989911198992

will be divided withno remainder

(iv) For 1199051= 0 1 119897

2minus 2 1199052= 0 1 119898

1minus 1 and 119905

1=

0 1 1198971minus 1 119905

2= 0 1 119898

2minus 2 compute 119910

11990511199052

byusing the direct method

If 1198731015840 = 1198972minus 1 and 119872

1015840= 1198982minus 1 we will add zeros

to the sequence 11990911989911198992

so that the 2D sequences are oflengths 119897

1+ 1198731015840 and 119898

1+ 1198721015840 Then we will compute

11991011989911198992

(1199051

= 0 1 1198972minus 2 1199052

= 0 1 1198981minus 1 and

1199051= 0 1 119897

1minus 1 1199052= 0 1 119898

2minus 2) by using an

overlap-save method The detail of it is presented inthe Technical Report [18]

We will introduce the way of using FNTT and 2Doverlap-save method with two examples One is numericalcomputation and the other is an experiment of extracting thecontour of a Chinese handwritten character

4 Comparison of the Numbersof Multiplication

Let119873 = 1198731015840+ 1198972minus 1 lt 119897

1119872 = 119872

1015840+1198982minus 1 lt 119898

11198731015840 = 119897

2minus 1

1198721015840= 1198982minus 1 1198972= 2119906+ 1 119898

2= 21199061015840

+ 1 and 1198971= 11990411198731015840+ 119873

1198981= 11990421198721015840+ 119872 Suppose that 119886

1and 1198862satisfy 2

1198861minus1

lt 1198971+

1198972minus 1 le 2

1198861 = 119873

1and 1198861198862minus1

lt 1198981+1198982minus 1 le 2

1198862 = 119873

2 Let 119871

1

1198712 and 119871

3denote the numbers of multiplication necessary

for computing the convolution (4) by using direct methodFNTT or FFT to calculate (4) (using Proposition 1) and2D overlap-save method respectively In [18] we comparedthe number of multiplications necessary for computing theconvolution (4) of two 2D sequences 119909

11989911198992

(1198991= 0 1 119897

1minus

1 1198992

= 0 1 1198981minus 1) and ℎ

11989911198992

(1198991

= 0 1 1198972minus 1

1198992= 0 1 119898

2minus 1) by three different methods

We proved the following results

(1) If 1198972lt 1198971 1198982lt 1198981 then

1198711=

11989721198982(1198972+ 1) (119898

2+ 1)

4+ (1198981minus 1198982)1198982

1198972(1198972+ 1)

2

+ (1198971minus 1198972) 1198972

1198982(1198982+ 1)

2+ (1198971minus 1198972) (1198981minus 1198982) 11989721198982

(36)

Also if 1198971= 1198981= 119897 1198972= 1198982= 1198971015840 then

1198711= (

1198971015840(2119897 minus 119897

1015840+ 1)

2)

2

(37)

(2) Consider

1198712= 21198861+1198862minus1

(31198861+ 31198862+ 2) (38)

(3) If 1198971= 1198981= 2119906+ℎ 1198972= 1198982= 2119906+ 1 119873 = 119872 = 2

119906+1and 119873

1015840= 1198721015840= 2119906 where 119906 ge 3 ℎ ge 2 then

1198711= ((2119906+ 1)2119906minus1

(2ℎ+1

minus 1))2

1198712= 22119906+2ℎ+1

(6119906 + 6ℎ + 8)

1198713= 2(2

119906+ℎ)2

(6119906 + 8)

(39)

In this section wewill suppose that1198731015840 = 1198972minus1 119872

1015840= 1198982minus

1 Let 119873 = 1198731015840+ 1198972minus 1 lt 119897

1 119872 = 119872

1015840+ 1198982minus 1 lt 119898

1 and

1198971= 11990411198731015840+119873 119898

1= 11990421198721015840+119872 For 119905

1= 0 1 119897

2minus 2 119905

2=

0 1 1198981minus 1 and 119905

1= 0 1 119897

1minus 1 119905

2= 0 1 119898

2minus 2

we computer 11991011990511199052

by using the direct methodWe have the following proposition

Proposition 6 If 1198972lt 1198971 1198982lt 1198981 then

119871 =11989721198982

4((1198972minus 1) (119898

2minus 1) + 2 (119897

2minus 1)

times (1198981minus 1198982+ 1) + 2 (119898

2minus 1) (119897

1minus 1198972+ 1))

(40)

where 119871 denotes the number of multiplication necessary forcomputing119910

11989911198992

by using the directmethod 1199051= 0 1 119897

2minus2

1199052= 0 1 119898

1minus1 and 119905

1= 0 1 119897

1minus1 1199052= 0 1 119898

2minus

2Also if 119897

1= 1198981= 119897 and 119897

2= 1198982= 1198971015840 then

119871 =

11989710158402

(1198971015840minus 1)

4(4119897 minus 3119897

1015840+ 3) (41)

Proof Let I II and III denote the number of multiplicationnecessary for computing the 119860 119861 and 119862 by direct methodrespectively where

119860 = (

11991000

sdot sdot sdot 11991001198982minus2

1199101198972minus20

sdot sdot sdot 1199101198972minus21198982minus2

)

119861 = (

11991001198982minus1

sdot sdot sdot 11991001198981minus1

1199101198972minus21198982minus1

sdot sdot sdot 1199101198972minus21198981minus1

)

119862 = (

1199101198972minus10

sdot sdot sdot 1199101198972minus11198982minus2

1199101198972minus10

sdot sdot sdot 1199101198972minus11198982minus2

)

(42)

Mathematical Problems in Engineering 9

Then

119868 = (1 + 2 + sdot sdot sdot + (1198982minus 1)) (1 + 2 + sdot sdot sdot + (119897

2minus 1))

=11989721198982(1198972minus 1) (119898

2minus 1)

4

119868119868 = 1198982(1 + 2 + sdot sdot sdot + (119897

2minus 1)) (119898

1minus 1 minus (119898

2minus 2))

=11989721198982(1198972minus 1) (119898

1minus 1198982+ 1)

2

119868119868119868 = 1198972(1 + 2 + sdot sdot sdot + (119898

2minus 1)) (119897

1minus 1 minus (119897

2minus 2))

=11989721198982(1198982minus 1) (119897

1minus 1198972+ 1)

2

(43)

So

119871 = 119868 + 119868119868 + 119868119868119868

=11989721198982

4((1198972minus 1) (119898

2minus 1) + 2 (119897

2minus 1) (119898

1minus 1198982+ 1)

+2 (1198982minus 1) (119897

1minus 1198972+ 1))

(44)

Clearly if 1198971= 1198981= 119897 and 119897

2= 1198982= 1198971015840 then (41) holds This

completes the proof

Proposition 7 If 1198971

= 1198981

= 2119906+ℎ 1198972

= 1198982

= 2119906+ 1 119873 =

119872 = 2119906+2 and119873

1015840= 1198721015840= 3sdot2

119906 where 119906 ge 3 ℎ equiv 0 (mod 2)ℎ ge 4 then

1198714= (2119906+ 1)222(119906minus1)

(2ℎ+2

minus 3)

+ (4(2ℎminus2

minus 1)

3+ 1)

2

22(119906+2)

(3119906 + 7)

(45)

where 1198714denotes the number of multiplication necessary for

computing (4) by using 2D overlap-save method

Proof Because 1198731015840

= 1198972minus 1 1198721015840 = 119898

2minus 1 1198971= 1198981= 2119906+ℎ and

1198972= 1198982= 2119906+ 1 by (41) we have

119871 = (2119906+ 1)2sdot 2119906minus2

(2119906+ℎ+2

minus 3 (2119906+ 1) + 3)

= (2119906+ 1)222(119906minus1)

(2ℎ+2

minus 3)

(46)

Compute the cyclic convolution of two sequences1199091198991+V111987310158401198992+V21198721015840 and ℎ

1015840

11989911198992

(1198991

= 0 1 2119906+2

minus 11198992

= 0 1 2119906+2

minus 1) that is compute matrix (35) byusing FNNT It is well known that using FNTT to calculatethe (35) requires

119873119872(3

2log119873119872 + 1) = 2

2(119906+2)(3119906 + 7) (47)

where 119873 = 119872 = 2119906+2

When 119873 = 119872 = 2119906+2 1198731015840 = 119872

1015840= 3 sdot 2

119906 119906 ge 3 ℎ equiv

0 (mod 2) and ℎ ge 4 then

[1198971minus 119873

1198731015840] = [

1198981minus 119872

1198721015840] = [

2119906+ℎ

minus 2119906+2

3 sdot 2119906]

= [

4 (2ℎminus2

minus 1)

3] =

4 (2ℎminus2

minus 1)

3

(48)

where 4(2ℎminus2

minus 1)3 is a positive integerSo the input matrix 119909

11989911198992

will be divided with noremainder When V

1= 0 1 [(119897

1minus 119873)119873

1015840] and V

2=

0 1 [(1198981minus119872)119872

1015840] we obtain all matrices as (35) Thus

1198714= (2119906+ 1)222(119906minus1)

(2ℎ+2

minus 3)

+ (4(2ℎminus2

minus 1)

3+ 1)

2

22(119906+2)

(3119906 + 7)

(49)

equal to (45) holds This completes the proof

Example 8 Suppose that 119906 = ℎ = 4 that is 1198971= 1198981= 256

1198972= 1198982= 17 119873 = 119872 = 64 and 119873

1015840= 1198721015840= 48 then

1198714= 3073856 (50)

If 1198971= 1198981= 256 119897

2= 1198982= 17 119873 = 119872 = 32 and 119873

1015840= 1198721015840=

16 then

1198713= 4194304 (51)

This example shows that 1198714lt 1198713in some particular cases

5 Experiments

The theoretic description of the 2D overlap-save method hasbeen provided in the preceding section This section furtherexamines how such a technique will be performed and howit will be applied to the wavelet transform Particularly wewill use image processing as an exampleThe experiment willfocus on the application of the 2D overlap-savemethod to thedyadic wavelet transform extracting the contours of Chinesehandwriting

51 Numerical Computation Let ℎ11989911198992

denote a digital filterand let a two-dimensional sequence

(ℎ11989911198992

) = (

1 0 1

1 1 0

0 1 1

) (52)

be the coefficients of the filter A two-dimensional sequence

(11990911989911198992

) =

((((

(

1 3 2 minus3 0 2 1 1

3 1 0 minus1 2 minus2 minus1 0

0 minus1 1 1 3 2 0 minus1

2 3 minus1 1 0 1 1 0

3 minus2 1 0 minus1 1 1 1

minus1 0 2 3 1 1 0 1

1 minus1 0 1 0 1 minus1 0

minus1 0 1 1 0 1 0 1

))))

)

(53)

10 Mathematical Problems in Engineering

represents the input of the filter In this example because 1198971=

1198981= 8 and 119897

2= 1198982= 3 the length of input matrix is 8 times 8

and that of the filter is 3 times 3Using the overlap-save method to calculate the output of

the filter

11991011989911198992

=

2

sum

1198961=0

2

sum

1198962=0

ℎ11989611198962

1199091198991minus11989611198992minus1198962

0le1198991minus1198961lt8

0le1198992minus1198962lt8

1198991= 0 1 2 3 4 5 6 7 119899

2= 0 1 2 3 4 5 6 7

(54)

means that the elements of the matrix

119884 = (

11991000

11991001

sdot sdot sdot 11991007

11991010

11991011

sdot sdot sdot 11991017

11991070

11991071

sdot sdot sdot 11991077

) (55)

need to be computedThe solution is given belowSince 119897

1= 1198981= 8 1198972= 1198982= 3 by selecting 119873

1015840= 1198972minus 1 =

2 and 1198721015840= 1198982minus 1 = 2 we have 119873 = 119872 = 4 In order to

use the FNTT the input matrix is divided into 9 submatricesof size 4times 4 Each consecutive submatrix is partly overlappedwith the size of 2 times 2 pixels In addition zeros of size 1 times 1

are added to the filtering sequence to ensure that its lengthis equivalent to that of the submatrix Therefore the filteringsequence ℎ

11989911198992

is extended to ℎ1015840

11989911198992

that is

ℎ1015840

11989911198992

= ℎ11989911198992

if 1198991= 0 1 2 119899

2= 0 1 2

0 if 1198991= 3 or 119899

2= 3

(56)

where 1198991= 0 1 2 3 119899

2= 0 1 2 3

Next we compute the circular convolution of the twosequences 119909

1198991+2V11198992+2V2

and ℎ1015840

11989911198992

(1198991

= 0 1 2 3 1198992

=

0 1 2 3)

11991011990511199052

=

3

sum

1198991=0

3

sum

1198992=0

ℎ1015840

11989911198992

119909⟨1199051minus1198991⟩4+2V1⟨1199052minus1198992⟩4+2V2

=

2

sum

1198991=0

2

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩4+2V1⟨1199052minus1198992⟩4+2V2

(57)

where 1199051= 0 1 2 3 119905

2= 0 1 2 3

When 1199051= 2 3 119905

2= 2 3 we arrive at the following result

11991011990511199052

=

2

sum

1198991=0

2

sum

1198992=0

ℎ11989911198992

1199091199051minus1198991+2V11199052minus1198992+2V2

= 1199101199051+2V11199052+2V2

(58)

After choosing all the parameters of V1

= 0 1 2 V2

=

0 1 2 ([(1198971minus 119873)119873

1015840] = [(119898

1minus 119872)119872

1015840] = [(8 minus 4)2] = 2)

all 2 times 2 submatrices of the matrix 119884 defined in (34) will beobtained as follows

(11991022

11991023

11991032

11991033

)(11991024

11991025

11991034

11991035

)(11991026

11991027

11991036

11991037

)

(11991042

11991043

11991052

11991053

)(11991044

11991045

11991054

11991055

)(11991046

11991047

11991056

11991057

)

(11991062

11991063

11991072

11991073

)(11991064

11991065

11991074

11991075

)(11991066

11991067

11991076

11991077

)

(59)

For 11991011990511199052

(1199051

= 0 1 1199052

= 0 1 2 3 4 5 6 7 1199051

=

0 1 2 3 4 5 6 7 1199052

= 0 1) we can compute it by usingan overlap-save method The detail of it is presented in theTechnical Report [18]

The fast number theoretic transform (FNTT) is nowapplied to the implementation of the circular convolution

11991011990511199052

=

3

sum

1198991=0

3

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩4⟨1199052minus1198992⟩4

1199051= 0 1 2 3 119905

2= 0 1 2 3

(60)

The computation is performed in the following five stepsshown in Figure 5

Step 1 (choosing 119872) Since

1003816100381610038161003816100381611991011990511199052

10038161003816100381610038161003816le

1003816100381610038161003816100381611990911989911198992

10038161003816100381610038161003816max

3

sum

1198961=0

3

sum

1198962=0

10038161003816100381610038161003816ℎ11989611198962

10038161003816100381610038161003816= 3 times 6 = 18 (61)

we can select119898 = 257 = 28+ 1 so that 18 lt 2572 where 257

is a prime Clearly 164 equiv 1 (mod257) and 16119895

equiv 1 (mod257) for 1 le 119895 le 3

Thus

11988311989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

11990911989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(62)

is a 2D number theoretic transform It has the followinginverse transform

11990911989911198992

equiv 4minus1

sdot 4minus1

3

sum

1198961=0

3

sum

1198962=0

11988311989611198962(minus16)11989911198961(minus16)11989921198962(mod 257)

1198991= 0 1 2 3 119899

2= 0 1 2 3

(63)

where 4minus1 denotes an integer so that (4minus1) sdot 4 equiv 1 (mod 257)

Mathematical Problems in Engineering 11

linear convolutionof the output matrixof the output matrix

cyclic convolutionCalculate the

of the filtering matrix

Calculate the

Calculate the numbertheoretic transformof the input matrix

Choose M

theoretic transformCalculate the number

Figure 5 Five steps of applying FNTT to calculate the output of (54)

Step 2 (calculating the number theoretic transform of inputmatrix by the FNTT) For computational convenience hereone writes

11988001198962

equiv

3

sum

1198992=0

11990901198992

1611989921198962 119880

11198962

equiv

3

sum

1198992=0

11990911198992

1611989921198962(mod 257)

11988021198962

equiv

3

sum

1198992=0

11990921198992

1611989921198962 119880

31198962

equiv

3

sum

1198992=0

11990931198992

1611989921198962(mod 257)

1198962= 0 1 2 3

(64)

Then (62) becomes

11988311989610

equiv

3

sum

1198991=0

11988011989910

1611989911198961 119883

11989611

equiv

3

sum

1198991=0

11988011989911

1611989911198961(mod 257)

11988311989612

equiv

3

sum

1198991=0

11988011989912

1611989911198961 119883

11989613

equiv

3

sum

1198991=0

11988011989913

1611989911198961(mod 257)

1198961= 0 1 2 3

(65)

Use the FNTT to calculate (64) and (65)So

(

11988000

11988001

11988002

11988003

11988010

11988011

11988012

11988013

11988020

11988021

11988022

11988023

11988030

11988031

11988032

11988033

)

equiv (

3 95 3 minus97

3 35 3 minus29

1 minus33 1 31

5 35 minus3 minus29

) (mod 257)

119883 = (

11988300

11988301

11988302

11988303

11988310

11988311

11988312

11988313

11988320

11988321

11988322

11988323

11988330

11988331

11988332

11988333

)

equiv (

12 132 4 minus124

minus30 128 98 minus128

minus4 minus8 4 minus8

34 128 minus94 minus128

) (mod 257)

(66)

Step 3 (calculating the number theoretic transformof the filterby the FNTT) The FNTT of the filter ℎ

11989911198992

is written as

11986711989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

ℎ1015840

11989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(67)

Similarly we have

119867 = (

11986700

11986701

11986702

11986703

11986710

11986711

11986712

11986713

11986720

11986721

11986722

11986723

11986730

11986731

11986732

11986733

)

equiv (

6 32 2 minus32

32 0 2 34

2 minus2 2 minus2

minus32 minus30 2 0

) (mod 257)

(68)

Step 4 (compute the number theoretic transformof the outputof the filter) From the preceding three steps we can computethe circular convolution of the filter by defining the productof 119883 and 119867 as

119884 = (

11988400

11988401

11988402

11988403

11988410

11988411

11988412

11988413

11988420

11988421

11988422

11988423

11988430

11988431

11988432

11988433

)

equiv 119883 ⊙ 119867 = (

11988300

11986700

11988301

11986701

11988302

11986702

11988303

11986703

11988310

11986710

11988311

11986711

11988312

11986712

11988313

11986713

11988320

11986720

11988321

11986721

11988322

11986722

11988323

11986723

11988330

11986730

11988331

11986731

11988332

11986732

11988333

11986733

)

equiv (

72 112 8 113

68 0 minus61 17

minus8 16 8 16

minus60 15 69 0

) (mod 257)

(69)

where

11988411989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

11991011989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(70)

12 Mathematical Problems in Engineering

Table 1 Filtering coefficients 12059521198951

119896119897 (119895 = 2) 120595(119903) are a quadratic spline wavelet

119897119896 119896 = 0 119896 = 1 119896 = 2 119896 = 3

119897 = 0 minus00838140026 minus00472041145 minus00129809398 minus00012592132119897 = 1 minus01416904181 minus00758706033 minus00196341425 minus00012698699119897 = 2 minus00651057437 minus00327749476 minus00063385521 minus00000750836119897 = 3 minus00088690016 minus00030044997 minus00001088651

(a) (b)

Figure 6 A 2-dimensional image of an aircraft was processed with 2D overlap-save method (a) Original Chinese handwriting and (b) thedivided up subimages of the character

and the 11991011989911198992

(1198991

= 0 1 2 3 1198992

= 0 1 2 3) is the circularconvolution of (60)

Step 5 (calculate the output of the linear convolution) From(63) we deduce the inverse transform of (70)

11991011989911198992

equiv 4minus1

sdot 4minus1

3

sum

1198961=0

3

sum

1198962=0

11988411989611198962(minus16)11989911198961

sdot (minus16)11989921198962(mod 257)

1198991= 0 1 2 3 119899

2= 0 1 2 3

(71)

Using FNTT to calculate (71) we have

(

11991000

11991001

11991002

11991003

11991010

11991011

11991012

11991013

11991020

11991021

11991022

11991023

11991030

11991031

11991032

11991033

) equiv (

8 6 4 0

1 7 13 1

2 2 6 4

1 5 5 7

) (mod 257)

(72)

Then the linear convolution in (58) is obtained

(11991022

11991023

11991032

11991033

) = (11991022

11991023

11991032

11991033

) = (6 4

5 7) (73)

52 Application to Image Processing The proposed methodcan be applied to many fields such as image processingand pattern recognition An example of the application to

the image processing is illustrated in Figure 6 The originalimage shown in Figure 6(a) is a 2-dimensional image of anaircraft with a size of 256 times 256 pixels that is 119897

1= 1198981

=

256 Our task is to extract its contours The discrete wavelettransform with scale 119904 = 2

119895 where 119895 = 2 was applied and thespline wavelet described in (1) of size 17 times 17 was chosenthat is 119897

2= 1198982

= 17 We use the filtering coefficientstabulated in Table 1 Using the 2D overlap-save method thisoriginal image was divided into 25 sections with each onehaving the dimension of 64 times 64 pixels that is we select119873 = 119872 = 64 1198731015840 = 119872

1015840= 48 [(119897

1minus 119873)119873

1015840] = [(119898

1minus

119872)1198721015840] = 4 (See Example 8 in Section 4) Figure 6(b)

shows these subimages The overlapped part can be explicitlyobserved in each subimage

To facilitate the presentation of the 2D overlap-savemethod the procedure of it is diagonally displayed inFigure 7 where a series of the divided subimages are illus-tratedThe image in Figure 6(a) was equivalently divided into25 sections by applying (27) In Figure 7(a) we represent 5subimages of V

0= 0 V

1= 0 V

0= 1 V

1= 1 V

0= 2 V

1= 2

and V0

= 3 V1

= 3 and V0

= 4 V1

= 4 consecutively Thelower-right corner of each subimage is repeated in the upper-left corner of its consecutive subimage Four subimages aredisplayed in Figure 7(b) and the parameters of V

0= 0 V1= 1

V0

= 1 V1

= 2 V0

= 2 V1

= 3 and V0

= 3 V1

= 4 werechosen In Figure 7(c) we selected 3 subimages of V

0= 0

V1

= 2 V0

= 1 V1

= 3 and V0

= 2 V1

= 4 There are3 subimages of V

0= 0 V

1= 3 and V

0= 1 V

1= 4 in

Figure 7(d) Figure 7(e) displays subimages of V0= 0 V

1= 4

Mathematical Problems in Engineering 13

(a) (b) (c)

(d) (e) (f)

(g) (h) (i)

Figure 7 A 2-dimensional image of an aircraft is dividing into separated small subimages the parameters of V0and V

1are chosen as follows

(a) V0= 0 V

1= 0 V

0= 1 V

1= 1 V

0= 2 V

1= 2 and V

0= 3 V

1= 3 and V

0= 4 and V

1= 4 (b) V

0= 0 V

1= 1 V

0= 1 V

1= 2 V

0= 2 V

1= 3 and

V0= 3 and V

1= 4 (c) V

0= 0 V

1= 2 V

0= 1 V

1= 3 and V

0= 2 and V

1= 4 (d) V

0= 0 V

1= 3 and V

0= 1 and V

1= 4 (e) V

0= 0 and V

1= 4 (f)

V0= 1 V

1= 0 V

0= 2 V

1= 1 V

0= 3 V

1= 2 and V

0= 4 and V

1= 3 (g) V

0= 2 V

1= 0 V

0= 3 V

1= 1 and V

0= 4 and V

1= 2 (h) V

0= 3 V

1= 0

and V0= 4 and V

1= 1 and (i) V

0= 4 and V

1= 0

In Figure 7(f) V0= 1 V

1= 0 V

0= 2 V

1= 1 V

0= 3 V

1= 2

and V0= 4 V1= 3were chosen In Figure 7(g) the parameters

were decided upon V0= 2 V

1= 0 V

0= 3 V

1= 1 and V

0= 4

V1= 2 Two subimages are shown in Figure 7(h) by selecting

V0= 3 V

1= 0 and V

0= 4 V

1= 1 There is one subimage of

V0= 4 V

1= 0 in Figure 7(i)

We select a 2D NTT

11988311989611198962

equiv

63

sum

1198991=0

63

sum

1198992=0

11990911989911198992

211989911198961211989921198962 (mod 2

32+ 1) (74)

14 Mathematical Problems in Engineering

(a) (b)

(c) (d)

Figure 8 The linear outputs of 2D overlap-save method (a) the outputs of the linear convolution of each subimages (b) the left border andthe upper border of the outputs of the image of aircraft (c) the combined outputs of linear convolution except Γ-type border and (d) theentire contour extracted using 2D overlap-save method under wavelet transform

which has inverse transform

11990911989911198992

equiv 64minus1

64minus1

63

sum

1198961=0

63

sum

1198962=0

11988311989611198962

(minus231)11989911198961

times (minus231)11989921198962

(mod 232

+ 1)

1198991= 0 1 63 119899

2= 0 1 63

(75)

where 64minus1 denotes integer so that (64minus1)64 equiv 1 (mod 2

32+

1) and |11990911989911198992

| le 255The FNTT was applied to calculate the circular convo-

lution of each subimage After applying (31) to each of thesubblocks a series of segments of the contours were obtained

By using (32) we can gradually reach the final result of thelinear convolution Figure 8(a) illustrates those pixels whichsatisfy (35) where 119897

2= 1198982= 17 119873 = 119872 = 64 1198731015840 = 119872

1015840=

48 and V1 V2

= 0 1 2 3 4 Combining them together thecontours of the whole character were obtained and displayedin Figure 8(c) which excludes the Γ-type border Next the

Γ-type border was computed by direct method Figure 8(b)shows the result Combining this result with that shown inFigure 8(c) the entire contours of the Chinese handwritingwere combined Figure 8(d) represents the entire contour

6 Conclusions

A novel approach to reduce the computation complexityof the wavelet transform has been presented in this paperTwo key techniques have been applied in this new methodnamely fast number theoretic transform (FNTT) and two-dimensional overlap-save technique In the fast numbertheoretic transform the linear convolution is replaced bythe circular convolution It can speed up the computationof 2D discrete wavelet transform Directly calculating thefast number theoretic transform to the whole input sequencemay meet two difficulties namely a big modulo obstructsthe effective implementation of the fast number theoretictransform and a long input sequence slows the computation

Mathematical Problems in Engineering 15

of the fast number theoretic transform down To fight withsuch deficiencies a new technique which is referred to as 2Doverlap-save method has been developed Experiments havebeen conducted The fast number theoretic transform and2D overlap-method have been used to implement the dyadicwavelet transform and applied to contour extraction in imageprocessing and pattern recognition

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Acknowledgments

This work was supported by the Research GrantsMYRG205(Y1-L4)-FST11-TYY and MYRG187(Y1-L3)-FST11-TYY and Chair Prof Grants RDG009FST-TYY ofUniversity of Macau as well as Macau FDC Grants T-100-2012-A3 and 026ndash2013-A This research project was alsosupported by the National Natural Science Foundation ofChina 61273244

References

[1] P L Combettes and J-C Pesquet ldquoWavelet-constrained imagerestorationrdquo International Journal of Wavelets Multiresolutionand Information Processing vol 2 no 4 pp 371ndash389 2004

[2] M Ehler and K Koch ldquoThe construction of multiwavelet bi-frames and applications to variational image denoisingrdquo Inter-national Journal of Wavelets Multiresolution and InformationProcessing vol 8 no 3 pp 431ndash455 2010

[3] P Jain and S N Merchant ldquoWavelet-based multiresolutionhistogram for fast image retrievalrdquo International Journal ofWavelets Multiresolution and Information Processing vol 2 no1 pp 59ndash73 2004

[4] S Mallat and W L Hwang ldquoSingularity detection and pro-cessing with waveletsrdquo Institute of Electrical and ElectronicsEngineers Transactions on InformationTheory vol 38 no 2 pp617ndash643 1992

[5] B U Shankar S K Meher and A Ghosh ldquoNeuro-waveletclassifier formultispectral remote sensing imagesrdquo InternationalJournal of Wavelets Multiresolution and Information Processingvol 5 no 4 pp 589ndash611 2007

[6] S Shi Y Zhang and Y Hu ldquoA wavelet-based image edgedetection and estimationmethod with adaptive scale selectionrdquoInternational Journal of Wavelets Multiresolution and Informa-tion Processing vol 8 no 3 pp 385ndash405 2010

[7] Y Y Tang Wavelets Theory Approach to Pattern RecognitionWorld Scientific Singapor 2009

[8] Q M Tieng and W Boles ldquoWavelet-based affine invariantrepresentation a tool for recognizing planar objects in 3Dspacerdquo IEEE Transactions on Pattern Analysis and MachineIntelligence vol 19 no 8 pp 921ndash925 1997

[9] P Wunsch and A F Laine ldquoWavelet descriptors for mul-tiresolution recognition of handprinted charactersrdquo PatternRecognition vol 28 no 8 pp 1237ndash1249 1995

[10] H Yin and H Liu ldquoA Bregman iterative regularization methodfor wavelet-based image deblurringrdquo International Journal of

Wavelets Multiresolution and Information Processing vol 8 no3 pp 485ndash499 2010

[11] X You and Y Y Tang ldquoWavelet-based approach to characterskeletonrdquo IEEE Transactions on Image Processing vol 16 no 5pp 1220ndash1231 2007

[12] T Zhang Q Fan and Q Gao ldquoWavelet characterization ofHardy space ℎ

1 and its application in variational image decom-positionrdquo International Journal of Wavelets Multiresolution andInformation Processing vol 8 no 1 pp 71ndash87 2010

[13] Y Y Tang L Y Li Feng and J Liu ldquoScale-independent waveletalgorithm for detecting step-structure edgesrdquo Tech Rep IEEETransactions on InformationTheory Brisbane Australia 1998

[14] S G Mallat ldquoMultiresolution approximations and waveletorthonormal bases of 119871

2(R)rdquo Transactions of the American

Mathematical Society vol 315 no 1 pp 69ndash87 1989[15] J H McClellan and C M Rader Number Theory in Digital Sig-

nal Processing Prentice Hall Signal Processing Series PrenticeHall Englewood Cliffs NJ USA 1979

[16] X Ran and K J R Liu ldquoFast algorithms for 2-D circularconvolutions and number theoretic transforms based on poly-nomial transforms over finite ringsrdquo IEEE Transactions onSignal Processing vol 43 no 3 pp 569ndash578 1995

[17] Q Sun ldquoSome results in the application of the number theoryto digital signal processing and public-key systemsrdquo in NumberTheory and Its Applications in China vol 77 of ContemporaryMathematics pp 107ndash112 American Mathematical SocietyProvidence RI USA 1988

[18] Y Y Tang Q Sun L H Yang and L Feng ldquoAn overlap-save method for the calculation of the two-dimensional digitalconvolutionrdquo Tech Rep Department of Computer ScienceHong Kong Baptist University 1998

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 4: Research Article Implementation of 2D Discrete Wavelet ...downloads.hindawi.com/journals/mpe/2014/532979.pdfResearch Article Implementation of 2D Discrete Wavelet Transform by Number

4 Mathematical Problems in Engineering

Select 119872 so that

1003816100381610038161003816100381611991011989911198992

10038161003816100381610038161003816le min

1003816100381610038161003816100381611990911989911198992

10038161003816100381610038161003816max

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

10038161003816100381610038161003816ℎ11989611198962

10038161003816100381610038161003816

10038161003816100381610038161003816ℎ11989911198992

10038161003816100381610038161003816max

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

1003816100381610038161003816100381611990911989611198962

10038161003816100381610038161003816

lt119872

2

(15)

where 1198991= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1 and 119872 is

an oddIf we use the 2-dimensional NTT to calculate the 2-

dimensional circular convolution11991011989911198992

so that |11991011989911198992

| lt 1198722then form congruence equation (14) we deduce that

11991011989911198992

=

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

11990911989611198962

ℎ⟨1198991minus1198961⟩1198731⟨1198992minus1198962⟩1198732

1198991= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1

(16)

23 Fast Number Theoretic Transform (FNTT) The idea ofFFT can be used to perform the NTT In this subsection atheoretic description will be presented briefly More detailswill be given in Section 5

Let

11988001198962

equiv

1198732minus1

sum

1198992=0

11990901198992

12057311989921198962 119880

1198731minus11198962

equiv

1198732minus1

sum

1198992=0

1199091198731minus11198992

12057311989921198962(mod119872)

1198962= 0 1 119873

2minus 1

(17)

From congruence equation (17) we deduce that

11988311989610

equiv

1198731minus1

sum

1198991=0

1198801198991012057211989911198961 119883

11989611198732minus1

equiv

1198731minus1

sum

1198991=0

11988011989911198732minus1

12057211989911198961(mod 119872)

1198961= 0 1 119873

1minus 1

(18)

Suppose that 1198731and 119873

2satisfy inequalities and we then

can use the idea of FFT to calculate the congruence equations(17) and (18)

For computing every

11988011989911198962

equiv

1198732minus1

sum

1198992=0

11990911989911198992

12057311989921198962(mod 119872)

(1198962= 0 1 119873

2minus 1)

(19)

in congruence equation (17) the numbers of all multipli-cation necessary are (119873

2log1198732)2 by using FFT algorithm

Hence if using FFT algorithm to calculate the congruence

11988011989911198962

equiv

1198732minus1

sum

1198992=0

11990911989911198992

12057311989921198962(mod119872)

(1198962= 0 1 119873

2minus 1)

(20)

in congruence equation (17) the numbers of all multiplica-tion necessary are ((119873

11198732)2) log119873

2

Similarly if using FFT algorithm to calculate all congru-ence equations in (18) then the numbers of all multiplicationnecessary are ((119873

21198731)2) log119873

1

Therefore if using the fast number theoretic transform(FNTT) to calculate the congruence equation (8) the numberof all multiplication necessary is

11987311198732

2log1198732+

11987321198731

2log1198731=

11987311198732

2log (119873

11198732) (21)

If119872 is very large wemay reduce the length of aword by usingChinese remainder theorem and it can be abbreviated toCRT

Therefore we have the following proposition

Proposition 5 Suppose that congruence equation (8) is a 2-dimensional NTT mod119872 where 119872 = 119901

1198971

1sdot sdot sdot 119901119897119904

119904 1199011 119901

119904

are distinct primes then we have a total of s 2-dimensionalNTT mod 119901

119897119894

119894 and they are described as follows

11988311989611198962

equiv

1198731minus1

sum

1198991=0

1198732minus1

sum

1198992=0

11990911989911198992

12057211989911198961

11989412057311989921198962

119894 (mod 119901

119897119894

119894)

1198961= 0 1 119873

1minus 1 119896

2= 0 1 119873

2minus 1

(22)

where 120572119894= ⟨120572⟩

119901119897119894

119894

120573119894= ⟨120573⟩

119901119897119894

119894

119894 = 1 2 119904If

11991011989911198992

=

1198731minus1

sum

1198961=0

1198732minus1

sum

1198962=0

11990911989611198962

ℎ⟨1198991minus1198961⟩1198731

⟨1198992minus1198962⟩1198732

equiv 119910(119894)

11989911198992

(mod 119901119897119894

119894)

(1198991= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1)

(23)

then

11991011989911198992

equiv

119904

sum

119894=1

1198721015840

119894119872119894119910(119894)

11989911198992

(mod119872)

(1198991= 0 1 119873

1minus 1 119899

2= 0 1 119873

2minus 1)

(24)

where 119872 = 119901119897119894

1198941198721198941198721015840

119894119872119894equiv 1 (mod 119901

119897119894

119894) 119894 = 1 119904

Mathematical Problems in Engineering 5

Proof Because the congruence equation (8) is a 2-dimen-sional NTT mod119872 hence

1205721198731 equiv 1 (mod119872) 120573

1198732 equiv 1 (mod 119872)

1205721198731 equiv 1 (mod 119901

119894) 120572

119895equiv 1 (mod 119901

119894) 1 le 119895 lt 119873

1

1205731198732 equiv 1 (mod 119901

119894) 120573

ℎequiv (mod 119901

119894) 1 le ℎ lt 119873

2

119894 = 1 2 119904

(25)

so

1205721198731 equiv 1 (mod 119901

119897119894

119894) 120573

1198732 equiv 1 (mod 119901

119897119894

119894)

1205721198731

119894equiv 1205721198731 equiv 1 (mod 119901

119894) 120572

119895

119894equiv 1 (mod 119901

119894)

1 le 119895 lt 1198731

1205731198732

119894equiv 1205731198732 equiv 1 (mod 119901

119894) 120573

119894equiv 1 (mod 119901

119894)

1 le ℎ lt 1198732

119894 = 1 119904

(26)

Hence the congruence equation (22) has a total of 119904 2-dimensional NTTs mod 119901

119897119894

119894 119894 = 1 119904 From CRT and the

congruence equation (23) we deduce that the congruenceequation (24) holds

3 Two-Dimensional Overlap-Save Method

Select two positive integers 1198731015840 and 1198721015840 so that 1198731015840 + 119897

2minus 1 =

119873 lt 1198971and 119872

1015840+ 1198982minus 1 = 119872 lt 119898

1 either 119873 or 119872 is given

by an integer power of 2 that is 119873 = 21198891 and 119872 = 2

1198892 where

1198891and 119889

2are two positive integers

Assuming that the input sequence 11990911989911198992

(1198991

=

0 1 1198971

minus 1 1198992

= 0 1 1198981

minus 1) is divided intomany small sections which are termed submatrices

1199091198991+V111987310158401198992+V211987210158401198991=119873minus1 119899

2=119872minus1

1198991=0 1198992=0

(V1= 0 1 V

2= 0 1 )

(27)

The consecutive matrix is overlapped by the previous oneAs a simple example four blocks chosen from the dividedinput matrices are overlapped and are graphically shown inFigure 1 Parameters V

1and V

2can be considered as shift

parameters because changing either V1or V2will select dif-

ferent submatrix For the first submatrix shown in Figure 1(a)we select V

1= 0 and V

2= 0 Second submatrix (V

1= 0 and

V2= 1) is displayed in Figure 1(b)Third one with parameters

of V1

= 1 and V2

= 0 is given in Figure 1(c) Fourth matrixshown in Figure 1(d) has parameters V

1= 1 and V

2= 1 The

procedure of the overlapping is also graphically illustrated inFigure 1

For the operation of circular convolution it is necessaryto have two sequences with the same length Taking (7) for

example the sequences 11990911989911198992

and ℎ11989911198992

are of the same lengthof1198731times1198732 Since the input sequence has already divided into

submatrices of119873times119872 by (27) the filter sequence has to be oflength119873times119872Therefore119873minus119897

2augmenting zeros are required

to be added to the row and119872minus1198982zeros to the column of the

filter sequence ℎ11989911198992

As a result the sequence ℎ11989911198992

becomes

ℎ1015840

11989911198992

=ℎ11989911198992

if 1198991= 0 1 119897

2minus 1 119899

2= 0 1 119898

2minus 1

0 if 1198972le 1198991lt 119873 or 119898

2le 1198992lt 119872

(28)

where 1198991= 0 1 119873 minus 1 and 119899

2= 0 1 119872 minus 1

The following form shows how a sequence ℎ101584011989911198992

is yieldedby adding augmenting zeros to the filter sequence ℎ

11989911198992

ℎ 997904rArr ℎ1015840 =

0 (29)

For each of the divided submatrices we can give V1and V

2

and compute the circular convolution of two 2D sequences1199091198991+V111987310158401198992+V21198721015840 and ℎ

1015840

11989911198992

(1198991

= 0 1 119873 minus 1 1198992

=

0 1 119872 minus 1) by

11991011990511199052

=

119873minus1

sum

1198991=0

119872minus1

sum

1198992=0

ℎ1015840

11989911198992

119909⟨1199051minus1198991⟩119873+V11198731015840⟨1199052minus1198992⟩119872+V21198721015840

1199051= 0 1 119873 minus 1 119905

2= 0 1 119872 minus 1

(30)

From (28) we deduce that

11991011990511199052

=

1198972minus1

sum

1198991=0

1198982minus1

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩119873+V11198731015840⟨1199052minus1198992⟩119872+V21198721015840 (31)

The result of (31) is that of circular convolution As we willsee below there exists an important connection between thecircular convolution and the linear one In fact since 119899

1=

0 1 1198972minus 1 and 119899

2= 0 1 119898

2minus 1 we can choose 119905

1=

1198972minus1 119873minus1 and 119905

2= 1198982minus1 119872minus1 in (31) this makes

119873 gt 1199051minus 1198991

gt 0 and 119872 gt 1199052minus 1198992

gt 0 in (31) Thus theremainder can exactly be equal to 119905

1minus 1198991and 1199052minus 1198992 Then

the circular convolution of (31) becomes

11991011990511199052

=

1198972minus1

sum

1198991=0

1198982minus1

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩119873+V11198731015840⟨1199052minus1198992⟩119872+V21198721015840

=

1198972minus1

sum

1198991=0

1198982minus1

sum

1198992=0

ℎ11989911198992

1199091199051minus1198991+V111987310158401199052minus1198992+V21198721015840

= 1199101199051+V111987310158401199052+V21198721015840

(32)

In order to clearly understand the procedure of obtainingthe components of linear convolution from the circularconvolution equation (31) a graphic description of it can befound in Figure 2 We show a dashed rectangle with size of119873 by 119872 in Figure 2(a) to represent the circular convolutionwhich is described in (31) and a darkened rectangle with sizeof1198731015840 by119872

1015840 to indicate the linear convolution stated in (32)

6 Mathematical Problems in Engineering

2N

m

n

2M

M

N1 = 0 2 = 0

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(a)

m

n

2N

2M

M

N1 = 1 2 = 0

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(b)

m

n

2N

2M

M

N

1 = 0 2 = 1

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(c)

m

n

2N

2M

M

N

1 = 1 2 = 1l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(d)

Figure 1 Four divided input submatrices are overlapped using the 2D overlap-save method (a) the first submatrix with parameters V1

=

0 V2= 0 is located on the top-left corner (b) the second one (V

1= 1 V

2= 0) overlaps by the first submatrix and the size of the overlapping

between them is119873 times1198982minus1 (c) the third divided input submatrix has parameters of V

1= 0 V

2= 1 It is overlapped by the first submatrix

and the size of the overlapping between them is 1198972minus 1 times 119872 (d) the fourth one with V

1= 1 V

2= 1 is overlapped by the first submatrix

and the size of the overlapping between them is 1198972minus 1 times 119898

2minus 1

m

n

2N

2M

M

N

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(a)

m

n

2N

2M

M

N

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(b)

Figure 2 Two consecutive output submatrices (a) the first block of V1= 0 and V

2= 0 and (b) the second block of V

1= 1 and V

2= 1

Mathematical Problems in Engineering 7

Obviously if the first 1198972minus 1 data in rows and the first 119898

2minus 1

data in columns are discarded from the dashed rectangle thedarkened rectangle can be obtained In the following we willexplain how to obtain the result of (4)

The output of the whole equation (4) can be representedin the following matrix

119884 = (

11991000

sdot sdot sdot sdot sdot sdot 11991001198981minus1

1199101198971minus10

sdot sdot sdot sdot sdot sdot 1199101198971minus11198981minus1

) (33)

which is an 1198971times 1198981matrix

So (32) gives a1198731015840times1198721015840 submatrix of matrix 119884 (note that

1198731015840= 119873 minus 119897

2+ 1 and that 1198721015840 = 119872 minus 119898

2+ 1)

(

1199101198972minus1+V111987310158401198982minus1+V21198721015840 sdot sdot sdot sdot sdot sdot 119910

1198972minus1+V11198731015840119872minus1+V

21198721015840

119910119873minus1+V

111987310158401198982minus1+V21198721015840 sdot sdot sdot sdot sdot sdot 119910

119873minus1+V11198731015840119872minus1+V

21198721015840

) (34)

Next to obtain the whole result we need to compute the cir-cular convolution of two 2D sequences 119909

1198991+(V1+1)119873

10158401198992+(V2+1)119872

1015840

and ℎ1015840

11989911198992

(1198991

= 0 1 119873 minus 1 1198992

= 0 1 119872 minus 1) Withthe same reasoning as above a consecutive submatrix of thematrix (34) is evinced as follows

(

119910119873+V11198731015840119872+V

21198721015840 sdot sdot sdot sdot sdot sdot 119910

119873+V11198731015840119872+119872

1015840minus1+V21198721015840

119910119873+119873

1015840minus1+V11198731015840119872+V

21198721015840 sdot sdot sdot sdot sdot sdot 119910

119873+1198731015840minus1+V11198731015840119872+119872

1015840minus1+V21198721015840

)

(35)

The corresponding graphic description is indicated inFigure 2(b) We will darken the rectangle in Figure 2(b) toexpress the submatrix (35) and the dashed one on its upper-left-corner to be the graphic description of the submatrix(34)

Clearly if (V1 V2) = (V10158401 V10158402) then (119905

1+ V11198731015840 1199052

+

V21198721015840) = (1199051015840

1+ V101584011198731015840 1199051015840

2+ V101584021198721015840) where 119897

2minus 1 le 119905

1 1199051015840

1le

119873 minus 1 1198982minus 1 le 119905

2and 1199051015840

2le 119872 minus 1 Let [119909] represent

the largest integer that is less than or equal to the realnumber 119909 therefore when V

1= 0 1 [(119897

1minus 119873)119873

1015840] and

V2

= 0 1 [(1198981minus 119872)119872

1015840] we will obtain all 1198731015840 times 119872

1015840

submatrices of thematrix119884 If 1198971= 11990411198731015840+119873 and119898

1= 11990421198721015840+

119872 then [(1198971minus 119873)119873

1015840] = (1198971minus 119873)119873

1015840 and [(1198981minus 119872)119872

1015840] =

(1198981minus119872)119872

1015840 The input matrix 11990911989911198992

will be divided with noremainder Figure 3 displays a series of small rectangles Eachrectangle stands for one1198731015840times119872

1015840 submatrixThe entirematrix119884 can be obtained by combining them

In Figure 3 there is a white Γ-type area indicating thatthere are no output data Two calculation methods canbe applied to obtain the data The first way is by using adirect method because only a few computations are neededAlternatively we can compute the data of Γ-type area with theoverlap-savemethod proposed above if1198731015840 = 119897

2minus1 and119872

1015840=

1198982minus 1 The detail of it is presented in the Technical Report

[18] The entire result is completed and is demonstrated inFigure 4 graphically

The two-dimensional overlap-save method is summa-rized as follows

m

n

Figure 3 All 1198731015840

times 1198721015840 submatrices of the output except the

boundary of Γ-type area

m

n

Figure 4 The full result of (4) computed by 2D overlap-savemethod where 119897

1= 11990411198731015840+ 119873 119898

1= 11990421198721015840+ 119872 and 119873

1015840+ 1198972minus 1 =

119873 lt 1198971and 119872

1015840+ 1198982minus 1 = 119872 lt 119898

1

(i) Select two positive integers 1198731015840 and 119872

1015840 so that 1198731015840 +1198972minus 1 = 119873 lt 119897

1and 119872

1015840+ 1198982minus 1 = 119872 lt 119898

1 Either

119873 or119872 is given by an integer power of 2 for using anFFT that is 119873 = 2

1198891 and 119872 = 2

1198892 where 119889

1and 119889

2

are two positive integers

(ii) Let ℎ101584011989911198992

satisfy (28)

(iii) Compute the circular convolution of two sequences1199091198991+V111987310158401198992+V21198721015840 and ℎ

1015840

11989911198992

(1198991

= 0 1 119873 minus 1 1198992

=

0 1 119872 minus 1) When 1199051

= 1198972minus 1 119873 minus 1 119905

2=

1198982minus 1 119872 minus 1 and V

1= 0 1 [(119897

1minus 119873)119873

1015840]

V2= 0 1 [(119898

1minus 119872)119872

1015840] we obtain all 1198731015840 times 119872

1015840

submatrices of the matrix of 119884 whose form is as (34)

8 Mathematical Problems in Engineering

If 1198971

= 11990411198731015840+ 119873 and 119898

1= 11990421198721015840+ 119872 then [(119897

1minus

119873)1198731015840] = (1198971minus 119873)119873

1015840 and [(1198981minus 119872)119872

1015840] = (119898

1minus

119872)1198721015840 The input matrix 119909

11989911198992

will be divided withno remainder

(iv) For 1199051= 0 1 119897

2minus 2 1199052= 0 1 119898

1minus 1 and 119905

1=

0 1 1198971minus 1 119905

2= 0 1 119898

2minus 2 compute 119910

11990511199052

byusing the direct method

If 1198731015840 = 1198972minus 1 and 119872

1015840= 1198982minus 1 we will add zeros

to the sequence 11990911989911198992

so that the 2D sequences are oflengths 119897

1+ 1198731015840 and 119898

1+ 1198721015840 Then we will compute

11991011989911198992

(1199051

= 0 1 1198972minus 2 1199052

= 0 1 1198981minus 1 and

1199051= 0 1 119897

1minus 1 1199052= 0 1 119898

2minus 2) by using an

overlap-save method The detail of it is presented inthe Technical Report [18]

We will introduce the way of using FNTT and 2Doverlap-save method with two examples One is numericalcomputation and the other is an experiment of extracting thecontour of a Chinese handwritten character

4 Comparison of the Numbersof Multiplication

Let119873 = 1198731015840+ 1198972minus 1 lt 119897

1119872 = 119872

1015840+1198982minus 1 lt 119898

11198731015840 = 119897

2minus 1

1198721015840= 1198982minus 1 1198972= 2119906+ 1 119898

2= 21199061015840

+ 1 and 1198971= 11990411198731015840+ 119873

1198981= 11990421198721015840+ 119872 Suppose that 119886

1and 1198862satisfy 2

1198861minus1

lt 1198971+

1198972minus 1 le 2

1198861 = 119873

1and 1198861198862minus1

lt 1198981+1198982minus 1 le 2

1198862 = 119873

2 Let 119871

1

1198712 and 119871

3denote the numbers of multiplication necessary

for computing the convolution (4) by using direct methodFNTT or FFT to calculate (4) (using Proposition 1) and2D overlap-save method respectively In [18] we comparedthe number of multiplications necessary for computing theconvolution (4) of two 2D sequences 119909

11989911198992

(1198991= 0 1 119897

1minus

1 1198992

= 0 1 1198981minus 1) and ℎ

11989911198992

(1198991

= 0 1 1198972minus 1

1198992= 0 1 119898

2minus 1) by three different methods

We proved the following results

(1) If 1198972lt 1198971 1198982lt 1198981 then

1198711=

11989721198982(1198972+ 1) (119898

2+ 1)

4+ (1198981minus 1198982)1198982

1198972(1198972+ 1)

2

+ (1198971minus 1198972) 1198972

1198982(1198982+ 1)

2+ (1198971minus 1198972) (1198981minus 1198982) 11989721198982

(36)

Also if 1198971= 1198981= 119897 1198972= 1198982= 1198971015840 then

1198711= (

1198971015840(2119897 minus 119897

1015840+ 1)

2)

2

(37)

(2) Consider

1198712= 21198861+1198862minus1

(31198861+ 31198862+ 2) (38)

(3) If 1198971= 1198981= 2119906+ℎ 1198972= 1198982= 2119906+ 1 119873 = 119872 = 2

119906+1and 119873

1015840= 1198721015840= 2119906 where 119906 ge 3 ℎ ge 2 then

1198711= ((2119906+ 1)2119906minus1

(2ℎ+1

minus 1))2

1198712= 22119906+2ℎ+1

(6119906 + 6ℎ + 8)

1198713= 2(2

119906+ℎ)2

(6119906 + 8)

(39)

In this section wewill suppose that1198731015840 = 1198972minus1 119872

1015840= 1198982minus

1 Let 119873 = 1198731015840+ 1198972minus 1 lt 119897

1 119872 = 119872

1015840+ 1198982minus 1 lt 119898

1 and

1198971= 11990411198731015840+119873 119898

1= 11990421198721015840+119872 For 119905

1= 0 1 119897

2minus 2 119905

2=

0 1 1198981minus 1 and 119905

1= 0 1 119897

1minus 1 119905

2= 0 1 119898

2minus 2

we computer 11991011990511199052

by using the direct methodWe have the following proposition

Proposition 6 If 1198972lt 1198971 1198982lt 1198981 then

119871 =11989721198982

4((1198972minus 1) (119898

2minus 1) + 2 (119897

2minus 1)

times (1198981minus 1198982+ 1) + 2 (119898

2minus 1) (119897

1minus 1198972+ 1))

(40)

where 119871 denotes the number of multiplication necessary forcomputing119910

11989911198992

by using the directmethod 1199051= 0 1 119897

2minus2

1199052= 0 1 119898

1minus1 and 119905

1= 0 1 119897

1minus1 1199052= 0 1 119898

2minus

2Also if 119897

1= 1198981= 119897 and 119897

2= 1198982= 1198971015840 then

119871 =

11989710158402

(1198971015840minus 1)

4(4119897 minus 3119897

1015840+ 3) (41)

Proof Let I II and III denote the number of multiplicationnecessary for computing the 119860 119861 and 119862 by direct methodrespectively where

119860 = (

11991000

sdot sdot sdot 11991001198982minus2

1199101198972minus20

sdot sdot sdot 1199101198972minus21198982minus2

)

119861 = (

11991001198982minus1

sdot sdot sdot 11991001198981minus1

1199101198972minus21198982minus1

sdot sdot sdot 1199101198972minus21198981minus1

)

119862 = (

1199101198972minus10

sdot sdot sdot 1199101198972minus11198982minus2

1199101198972minus10

sdot sdot sdot 1199101198972minus11198982minus2

)

(42)

Mathematical Problems in Engineering 9

Then

119868 = (1 + 2 + sdot sdot sdot + (1198982minus 1)) (1 + 2 + sdot sdot sdot + (119897

2minus 1))

=11989721198982(1198972minus 1) (119898

2minus 1)

4

119868119868 = 1198982(1 + 2 + sdot sdot sdot + (119897

2minus 1)) (119898

1minus 1 minus (119898

2minus 2))

=11989721198982(1198972minus 1) (119898

1minus 1198982+ 1)

2

119868119868119868 = 1198972(1 + 2 + sdot sdot sdot + (119898

2minus 1)) (119897

1minus 1 minus (119897

2minus 2))

=11989721198982(1198982minus 1) (119897

1minus 1198972+ 1)

2

(43)

So

119871 = 119868 + 119868119868 + 119868119868119868

=11989721198982

4((1198972minus 1) (119898

2minus 1) + 2 (119897

2minus 1) (119898

1minus 1198982+ 1)

+2 (1198982minus 1) (119897

1minus 1198972+ 1))

(44)

Clearly if 1198971= 1198981= 119897 and 119897

2= 1198982= 1198971015840 then (41) holds This

completes the proof

Proposition 7 If 1198971

= 1198981

= 2119906+ℎ 1198972

= 1198982

= 2119906+ 1 119873 =

119872 = 2119906+2 and119873

1015840= 1198721015840= 3sdot2

119906 where 119906 ge 3 ℎ equiv 0 (mod 2)ℎ ge 4 then

1198714= (2119906+ 1)222(119906minus1)

(2ℎ+2

minus 3)

+ (4(2ℎminus2

minus 1)

3+ 1)

2

22(119906+2)

(3119906 + 7)

(45)

where 1198714denotes the number of multiplication necessary for

computing (4) by using 2D overlap-save method

Proof Because 1198731015840

= 1198972minus 1 1198721015840 = 119898

2minus 1 1198971= 1198981= 2119906+ℎ and

1198972= 1198982= 2119906+ 1 by (41) we have

119871 = (2119906+ 1)2sdot 2119906minus2

(2119906+ℎ+2

minus 3 (2119906+ 1) + 3)

= (2119906+ 1)222(119906minus1)

(2ℎ+2

minus 3)

(46)

Compute the cyclic convolution of two sequences1199091198991+V111987310158401198992+V21198721015840 and ℎ

1015840

11989911198992

(1198991

= 0 1 2119906+2

minus 11198992

= 0 1 2119906+2

minus 1) that is compute matrix (35) byusing FNNT It is well known that using FNTT to calculatethe (35) requires

119873119872(3

2log119873119872 + 1) = 2

2(119906+2)(3119906 + 7) (47)

where 119873 = 119872 = 2119906+2

When 119873 = 119872 = 2119906+2 1198731015840 = 119872

1015840= 3 sdot 2

119906 119906 ge 3 ℎ equiv

0 (mod 2) and ℎ ge 4 then

[1198971minus 119873

1198731015840] = [

1198981minus 119872

1198721015840] = [

2119906+ℎ

minus 2119906+2

3 sdot 2119906]

= [

4 (2ℎminus2

minus 1)

3] =

4 (2ℎminus2

minus 1)

3

(48)

where 4(2ℎminus2

minus 1)3 is a positive integerSo the input matrix 119909

11989911198992

will be divided with noremainder When V

1= 0 1 [(119897

1minus 119873)119873

1015840] and V

2=

0 1 [(1198981minus119872)119872

1015840] we obtain all matrices as (35) Thus

1198714= (2119906+ 1)222(119906minus1)

(2ℎ+2

minus 3)

+ (4(2ℎminus2

minus 1)

3+ 1)

2

22(119906+2)

(3119906 + 7)

(49)

equal to (45) holds This completes the proof

Example 8 Suppose that 119906 = ℎ = 4 that is 1198971= 1198981= 256

1198972= 1198982= 17 119873 = 119872 = 64 and 119873

1015840= 1198721015840= 48 then

1198714= 3073856 (50)

If 1198971= 1198981= 256 119897

2= 1198982= 17 119873 = 119872 = 32 and 119873

1015840= 1198721015840=

16 then

1198713= 4194304 (51)

This example shows that 1198714lt 1198713in some particular cases

5 Experiments

The theoretic description of the 2D overlap-save method hasbeen provided in the preceding section This section furtherexamines how such a technique will be performed and howit will be applied to the wavelet transform Particularly wewill use image processing as an exampleThe experiment willfocus on the application of the 2D overlap-savemethod to thedyadic wavelet transform extracting the contours of Chinesehandwriting

51 Numerical Computation Let ℎ11989911198992

denote a digital filterand let a two-dimensional sequence

(ℎ11989911198992

) = (

1 0 1

1 1 0

0 1 1

) (52)

be the coefficients of the filter A two-dimensional sequence

(11990911989911198992

) =

((((

(

1 3 2 minus3 0 2 1 1

3 1 0 minus1 2 minus2 minus1 0

0 minus1 1 1 3 2 0 minus1

2 3 minus1 1 0 1 1 0

3 minus2 1 0 minus1 1 1 1

minus1 0 2 3 1 1 0 1

1 minus1 0 1 0 1 minus1 0

minus1 0 1 1 0 1 0 1

))))

)

(53)

10 Mathematical Problems in Engineering

represents the input of the filter In this example because 1198971=

1198981= 8 and 119897

2= 1198982= 3 the length of input matrix is 8 times 8

and that of the filter is 3 times 3Using the overlap-save method to calculate the output of

the filter

11991011989911198992

=

2

sum

1198961=0

2

sum

1198962=0

ℎ11989611198962

1199091198991minus11989611198992minus1198962

0le1198991minus1198961lt8

0le1198992minus1198962lt8

1198991= 0 1 2 3 4 5 6 7 119899

2= 0 1 2 3 4 5 6 7

(54)

means that the elements of the matrix

119884 = (

11991000

11991001

sdot sdot sdot 11991007

11991010

11991011

sdot sdot sdot 11991017

11991070

11991071

sdot sdot sdot 11991077

) (55)

need to be computedThe solution is given belowSince 119897

1= 1198981= 8 1198972= 1198982= 3 by selecting 119873

1015840= 1198972minus 1 =

2 and 1198721015840= 1198982minus 1 = 2 we have 119873 = 119872 = 4 In order to

use the FNTT the input matrix is divided into 9 submatricesof size 4times 4 Each consecutive submatrix is partly overlappedwith the size of 2 times 2 pixels In addition zeros of size 1 times 1

are added to the filtering sequence to ensure that its lengthis equivalent to that of the submatrix Therefore the filteringsequence ℎ

11989911198992

is extended to ℎ1015840

11989911198992

that is

ℎ1015840

11989911198992

= ℎ11989911198992

if 1198991= 0 1 2 119899

2= 0 1 2

0 if 1198991= 3 or 119899

2= 3

(56)

where 1198991= 0 1 2 3 119899

2= 0 1 2 3

Next we compute the circular convolution of the twosequences 119909

1198991+2V11198992+2V2

and ℎ1015840

11989911198992

(1198991

= 0 1 2 3 1198992

=

0 1 2 3)

11991011990511199052

=

3

sum

1198991=0

3

sum

1198992=0

ℎ1015840

11989911198992

119909⟨1199051minus1198991⟩4+2V1⟨1199052minus1198992⟩4+2V2

=

2

sum

1198991=0

2

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩4+2V1⟨1199052minus1198992⟩4+2V2

(57)

where 1199051= 0 1 2 3 119905

2= 0 1 2 3

When 1199051= 2 3 119905

2= 2 3 we arrive at the following result

11991011990511199052

=

2

sum

1198991=0

2

sum

1198992=0

ℎ11989911198992

1199091199051minus1198991+2V11199052minus1198992+2V2

= 1199101199051+2V11199052+2V2

(58)

After choosing all the parameters of V1

= 0 1 2 V2

=

0 1 2 ([(1198971minus 119873)119873

1015840] = [(119898

1minus 119872)119872

1015840] = [(8 minus 4)2] = 2)

all 2 times 2 submatrices of the matrix 119884 defined in (34) will beobtained as follows

(11991022

11991023

11991032

11991033

)(11991024

11991025

11991034

11991035

)(11991026

11991027

11991036

11991037

)

(11991042

11991043

11991052

11991053

)(11991044

11991045

11991054

11991055

)(11991046

11991047

11991056

11991057

)

(11991062

11991063

11991072

11991073

)(11991064

11991065

11991074

11991075

)(11991066

11991067

11991076

11991077

)

(59)

For 11991011990511199052

(1199051

= 0 1 1199052

= 0 1 2 3 4 5 6 7 1199051

=

0 1 2 3 4 5 6 7 1199052

= 0 1) we can compute it by usingan overlap-save method The detail of it is presented in theTechnical Report [18]

The fast number theoretic transform (FNTT) is nowapplied to the implementation of the circular convolution

11991011990511199052

=

3

sum

1198991=0

3

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩4⟨1199052minus1198992⟩4

1199051= 0 1 2 3 119905

2= 0 1 2 3

(60)

The computation is performed in the following five stepsshown in Figure 5

Step 1 (choosing 119872) Since

1003816100381610038161003816100381611991011990511199052

10038161003816100381610038161003816le

1003816100381610038161003816100381611990911989911198992

10038161003816100381610038161003816max

3

sum

1198961=0

3

sum

1198962=0

10038161003816100381610038161003816ℎ11989611198962

10038161003816100381610038161003816= 3 times 6 = 18 (61)

we can select119898 = 257 = 28+ 1 so that 18 lt 2572 where 257

is a prime Clearly 164 equiv 1 (mod257) and 16119895

equiv 1 (mod257) for 1 le 119895 le 3

Thus

11988311989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

11990911989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(62)

is a 2D number theoretic transform It has the followinginverse transform

11990911989911198992

equiv 4minus1

sdot 4minus1

3

sum

1198961=0

3

sum

1198962=0

11988311989611198962(minus16)11989911198961(minus16)11989921198962(mod 257)

1198991= 0 1 2 3 119899

2= 0 1 2 3

(63)

where 4minus1 denotes an integer so that (4minus1) sdot 4 equiv 1 (mod 257)

Mathematical Problems in Engineering 11

linear convolutionof the output matrixof the output matrix

cyclic convolutionCalculate the

of the filtering matrix

Calculate the

Calculate the numbertheoretic transformof the input matrix

Choose M

theoretic transformCalculate the number

Figure 5 Five steps of applying FNTT to calculate the output of (54)

Step 2 (calculating the number theoretic transform of inputmatrix by the FNTT) For computational convenience hereone writes

11988001198962

equiv

3

sum

1198992=0

11990901198992

1611989921198962 119880

11198962

equiv

3

sum

1198992=0

11990911198992

1611989921198962(mod 257)

11988021198962

equiv

3

sum

1198992=0

11990921198992

1611989921198962 119880

31198962

equiv

3

sum

1198992=0

11990931198992

1611989921198962(mod 257)

1198962= 0 1 2 3

(64)

Then (62) becomes

11988311989610

equiv

3

sum

1198991=0

11988011989910

1611989911198961 119883

11989611

equiv

3

sum

1198991=0

11988011989911

1611989911198961(mod 257)

11988311989612

equiv

3

sum

1198991=0

11988011989912

1611989911198961 119883

11989613

equiv

3

sum

1198991=0

11988011989913

1611989911198961(mod 257)

1198961= 0 1 2 3

(65)

Use the FNTT to calculate (64) and (65)So

(

11988000

11988001

11988002

11988003

11988010

11988011

11988012

11988013

11988020

11988021

11988022

11988023

11988030

11988031

11988032

11988033

)

equiv (

3 95 3 minus97

3 35 3 minus29

1 minus33 1 31

5 35 minus3 minus29

) (mod 257)

119883 = (

11988300

11988301

11988302

11988303

11988310

11988311

11988312

11988313

11988320

11988321

11988322

11988323

11988330

11988331

11988332

11988333

)

equiv (

12 132 4 minus124

minus30 128 98 minus128

minus4 minus8 4 minus8

34 128 minus94 minus128

) (mod 257)

(66)

Step 3 (calculating the number theoretic transformof the filterby the FNTT) The FNTT of the filter ℎ

11989911198992

is written as

11986711989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

ℎ1015840

11989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(67)

Similarly we have

119867 = (

11986700

11986701

11986702

11986703

11986710

11986711

11986712

11986713

11986720

11986721

11986722

11986723

11986730

11986731

11986732

11986733

)

equiv (

6 32 2 minus32

32 0 2 34

2 minus2 2 minus2

minus32 minus30 2 0

) (mod 257)

(68)

Step 4 (compute the number theoretic transformof the outputof the filter) From the preceding three steps we can computethe circular convolution of the filter by defining the productof 119883 and 119867 as

119884 = (

11988400

11988401

11988402

11988403

11988410

11988411

11988412

11988413

11988420

11988421

11988422

11988423

11988430

11988431

11988432

11988433

)

equiv 119883 ⊙ 119867 = (

11988300

11986700

11988301

11986701

11988302

11986702

11988303

11986703

11988310

11986710

11988311

11986711

11988312

11986712

11988313

11986713

11988320

11986720

11988321

11986721

11988322

11986722

11988323

11986723

11988330

11986730

11988331

11986731

11988332

11986732

11988333

11986733

)

equiv (

72 112 8 113

68 0 minus61 17

minus8 16 8 16

minus60 15 69 0

) (mod 257)

(69)

where

11988411989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

11991011989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(70)

12 Mathematical Problems in Engineering

Table 1 Filtering coefficients 12059521198951

119896119897 (119895 = 2) 120595(119903) are a quadratic spline wavelet

119897119896 119896 = 0 119896 = 1 119896 = 2 119896 = 3

119897 = 0 minus00838140026 minus00472041145 minus00129809398 minus00012592132119897 = 1 minus01416904181 minus00758706033 minus00196341425 minus00012698699119897 = 2 minus00651057437 minus00327749476 minus00063385521 minus00000750836119897 = 3 minus00088690016 minus00030044997 minus00001088651

(a) (b)

Figure 6 A 2-dimensional image of an aircraft was processed with 2D overlap-save method (a) Original Chinese handwriting and (b) thedivided up subimages of the character

and the 11991011989911198992

(1198991

= 0 1 2 3 1198992

= 0 1 2 3) is the circularconvolution of (60)

Step 5 (calculate the output of the linear convolution) From(63) we deduce the inverse transform of (70)

11991011989911198992

equiv 4minus1

sdot 4minus1

3

sum

1198961=0

3

sum

1198962=0

11988411989611198962(minus16)11989911198961

sdot (minus16)11989921198962(mod 257)

1198991= 0 1 2 3 119899

2= 0 1 2 3

(71)

Using FNTT to calculate (71) we have

(

11991000

11991001

11991002

11991003

11991010

11991011

11991012

11991013

11991020

11991021

11991022

11991023

11991030

11991031

11991032

11991033

) equiv (

8 6 4 0

1 7 13 1

2 2 6 4

1 5 5 7

) (mod 257)

(72)

Then the linear convolution in (58) is obtained

(11991022

11991023

11991032

11991033

) = (11991022

11991023

11991032

11991033

) = (6 4

5 7) (73)

52 Application to Image Processing The proposed methodcan be applied to many fields such as image processingand pattern recognition An example of the application to

the image processing is illustrated in Figure 6 The originalimage shown in Figure 6(a) is a 2-dimensional image of anaircraft with a size of 256 times 256 pixels that is 119897

1= 1198981

=

256 Our task is to extract its contours The discrete wavelettransform with scale 119904 = 2

119895 where 119895 = 2 was applied and thespline wavelet described in (1) of size 17 times 17 was chosenthat is 119897

2= 1198982

= 17 We use the filtering coefficientstabulated in Table 1 Using the 2D overlap-save method thisoriginal image was divided into 25 sections with each onehaving the dimension of 64 times 64 pixels that is we select119873 = 119872 = 64 1198731015840 = 119872

1015840= 48 [(119897

1minus 119873)119873

1015840] = [(119898

1minus

119872)1198721015840] = 4 (See Example 8 in Section 4) Figure 6(b)

shows these subimages The overlapped part can be explicitlyobserved in each subimage

To facilitate the presentation of the 2D overlap-savemethod the procedure of it is diagonally displayed inFigure 7 where a series of the divided subimages are illus-tratedThe image in Figure 6(a) was equivalently divided into25 sections by applying (27) In Figure 7(a) we represent 5subimages of V

0= 0 V

1= 0 V

0= 1 V

1= 1 V

0= 2 V

1= 2

and V0

= 3 V1

= 3 and V0

= 4 V1

= 4 consecutively Thelower-right corner of each subimage is repeated in the upper-left corner of its consecutive subimage Four subimages aredisplayed in Figure 7(b) and the parameters of V

0= 0 V1= 1

V0

= 1 V1

= 2 V0

= 2 V1

= 3 and V0

= 3 V1

= 4 werechosen In Figure 7(c) we selected 3 subimages of V

0= 0

V1

= 2 V0

= 1 V1

= 3 and V0

= 2 V1

= 4 There are3 subimages of V

0= 0 V

1= 3 and V

0= 1 V

1= 4 in

Figure 7(d) Figure 7(e) displays subimages of V0= 0 V

1= 4

Mathematical Problems in Engineering 13

(a) (b) (c)

(d) (e) (f)

(g) (h) (i)

Figure 7 A 2-dimensional image of an aircraft is dividing into separated small subimages the parameters of V0and V

1are chosen as follows

(a) V0= 0 V

1= 0 V

0= 1 V

1= 1 V

0= 2 V

1= 2 and V

0= 3 V

1= 3 and V

0= 4 and V

1= 4 (b) V

0= 0 V

1= 1 V

0= 1 V

1= 2 V

0= 2 V

1= 3 and

V0= 3 and V

1= 4 (c) V

0= 0 V

1= 2 V

0= 1 V

1= 3 and V

0= 2 and V

1= 4 (d) V

0= 0 V

1= 3 and V

0= 1 and V

1= 4 (e) V

0= 0 and V

1= 4 (f)

V0= 1 V

1= 0 V

0= 2 V

1= 1 V

0= 3 V

1= 2 and V

0= 4 and V

1= 3 (g) V

0= 2 V

1= 0 V

0= 3 V

1= 1 and V

0= 4 and V

1= 2 (h) V

0= 3 V

1= 0

and V0= 4 and V

1= 1 and (i) V

0= 4 and V

1= 0

In Figure 7(f) V0= 1 V

1= 0 V

0= 2 V

1= 1 V

0= 3 V

1= 2

and V0= 4 V1= 3were chosen In Figure 7(g) the parameters

were decided upon V0= 2 V

1= 0 V

0= 3 V

1= 1 and V

0= 4

V1= 2 Two subimages are shown in Figure 7(h) by selecting

V0= 3 V

1= 0 and V

0= 4 V

1= 1 There is one subimage of

V0= 4 V

1= 0 in Figure 7(i)

We select a 2D NTT

11988311989611198962

equiv

63

sum

1198991=0

63

sum

1198992=0

11990911989911198992

211989911198961211989921198962 (mod 2

32+ 1) (74)

14 Mathematical Problems in Engineering

(a) (b)

(c) (d)

Figure 8 The linear outputs of 2D overlap-save method (a) the outputs of the linear convolution of each subimages (b) the left border andthe upper border of the outputs of the image of aircraft (c) the combined outputs of linear convolution except Γ-type border and (d) theentire contour extracted using 2D overlap-save method under wavelet transform

which has inverse transform

11990911989911198992

equiv 64minus1

64minus1

63

sum

1198961=0

63

sum

1198962=0

11988311989611198962

(minus231)11989911198961

times (minus231)11989921198962

(mod 232

+ 1)

1198991= 0 1 63 119899

2= 0 1 63

(75)

where 64minus1 denotes integer so that (64minus1)64 equiv 1 (mod 2

32+

1) and |11990911989911198992

| le 255The FNTT was applied to calculate the circular convo-

lution of each subimage After applying (31) to each of thesubblocks a series of segments of the contours were obtained

By using (32) we can gradually reach the final result of thelinear convolution Figure 8(a) illustrates those pixels whichsatisfy (35) where 119897

2= 1198982= 17 119873 = 119872 = 64 1198731015840 = 119872

1015840=

48 and V1 V2

= 0 1 2 3 4 Combining them together thecontours of the whole character were obtained and displayedin Figure 8(c) which excludes the Γ-type border Next the

Γ-type border was computed by direct method Figure 8(b)shows the result Combining this result with that shown inFigure 8(c) the entire contours of the Chinese handwritingwere combined Figure 8(d) represents the entire contour

6 Conclusions

A novel approach to reduce the computation complexityof the wavelet transform has been presented in this paperTwo key techniques have been applied in this new methodnamely fast number theoretic transform (FNTT) and two-dimensional overlap-save technique In the fast numbertheoretic transform the linear convolution is replaced bythe circular convolution It can speed up the computationof 2D discrete wavelet transform Directly calculating thefast number theoretic transform to the whole input sequencemay meet two difficulties namely a big modulo obstructsthe effective implementation of the fast number theoretictransform and a long input sequence slows the computation

Mathematical Problems in Engineering 15

of the fast number theoretic transform down To fight withsuch deficiencies a new technique which is referred to as 2Doverlap-save method has been developed Experiments havebeen conducted The fast number theoretic transform and2D overlap-method have been used to implement the dyadicwavelet transform and applied to contour extraction in imageprocessing and pattern recognition

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Acknowledgments

This work was supported by the Research GrantsMYRG205(Y1-L4)-FST11-TYY and MYRG187(Y1-L3)-FST11-TYY and Chair Prof Grants RDG009FST-TYY ofUniversity of Macau as well as Macau FDC Grants T-100-2012-A3 and 026ndash2013-A This research project was alsosupported by the National Natural Science Foundation ofChina 61273244

References

[1] P L Combettes and J-C Pesquet ldquoWavelet-constrained imagerestorationrdquo International Journal of Wavelets Multiresolutionand Information Processing vol 2 no 4 pp 371ndash389 2004

[2] M Ehler and K Koch ldquoThe construction of multiwavelet bi-frames and applications to variational image denoisingrdquo Inter-national Journal of Wavelets Multiresolution and InformationProcessing vol 8 no 3 pp 431ndash455 2010

[3] P Jain and S N Merchant ldquoWavelet-based multiresolutionhistogram for fast image retrievalrdquo International Journal ofWavelets Multiresolution and Information Processing vol 2 no1 pp 59ndash73 2004

[4] S Mallat and W L Hwang ldquoSingularity detection and pro-cessing with waveletsrdquo Institute of Electrical and ElectronicsEngineers Transactions on InformationTheory vol 38 no 2 pp617ndash643 1992

[5] B U Shankar S K Meher and A Ghosh ldquoNeuro-waveletclassifier formultispectral remote sensing imagesrdquo InternationalJournal of Wavelets Multiresolution and Information Processingvol 5 no 4 pp 589ndash611 2007

[6] S Shi Y Zhang and Y Hu ldquoA wavelet-based image edgedetection and estimationmethod with adaptive scale selectionrdquoInternational Journal of Wavelets Multiresolution and Informa-tion Processing vol 8 no 3 pp 385ndash405 2010

[7] Y Y Tang Wavelets Theory Approach to Pattern RecognitionWorld Scientific Singapor 2009

[8] Q M Tieng and W Boles ldquoWavelet-based affine invariantrepresentation a tool for recognizing planar objects in 3Dspacerdquo IEEE Transactions on Pattern Analysis and MachineIntelligence vol 19 no 8 pp 921ndash925 1997

[9] P Wunsch and A F Laine ldquoWavelet descriptors for mul-tiresolution recognition of handprinted charactersrdquo PatternRecognition vol 28 no 8 pp 1237ndash1249 1995

[10] H Yin and H Liu ldquoA Bregman iterative regularization methodfor wavelet-based image deblurringrdquo International Journal of

Wavelets Multiresolution and Information Processing vol 8 no3 pp 485ndash499 2010

[11] X You and Y Y Tang ldquoWavelet-based approach to characterskeletonrdquo IEEE Transactions on Image Processing vol 16 no 5pp 1220ndash1231 2007

[12] T Zhang Q Fan and Q Gao ldquoWavelet characterization ofHardy space ℎ

1 and its application in variational image decom-positionrdquo International Journal of Wavelets Multiresolution andInformation Processing vol 8 no 1 pp 71ndash87 2010

[13] Y Y Tang L Y Li Feng and J Liu ldquoScale-independent waveletalgorithm for detecting step-structure edgesrdquo Tech Rep IEEETransactions on InformationTheory Brisbane Australia 1998

[14] S G Mallat ldquoMultiresolution approximations and waveletorthonormal bases of 119871

2(R)rdquo Transactions of the American

Mathematical Society vol 315 no 1 pp 69ndash87 1989[15] J H McClellan and C M Rader Number Theory in Digital Sig-

nal Processing Prentice Hall Signal Processing Series PrenticeHall Englewood Cliffs NJ USA 1979

[16] X Ran and K J R Liu ldquoFast algorithms for 2-D circularconvolutions and number theoretic transforms based on poly-nomial transforms over finite ringsrdquo IEEE Transactions onSignal Processing vol 43 no 3 pp 569ndash578 1995

[17] Q Sun ldquoSome results in the application of the number theoryto digital signal processing and public-key systemsrdquo in NumberTheory and Its Applications in China vol 77 of ContemporaryMathematics pp 107ndash112 American Mathematical SocietyProvidence RI USA 1988

[18] Y Y Tang Q Sun L H Yang and L Feng ldquoAn overlap-save method for the calculation of the two-dimensional digitalconvolutionrdquo Tech Rep Department of Computer ScienceHong Kong Baptist University 1998

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 5: Research Article Implementation of 2D Discrete Wavelet ...downloads.hindawi.com/journals/mpe/2014/532979.pdfResearch Article Implementation of 2D Discrete Wavelet Transform by Number

Mathematical Problems in Engineering 5

Proof Because the congruence equation (8) is a 2-dimen-sional NTT mod119872 hence

1205721198731 equiv 1 (mod119872) 120573

1198732 equiv 1 (mod 119872)

1205721198731 equiv 1 (mod 119901

119894) 120572

119895equiv 1 (mod 119901

119894) 1 le 119895 lt 119873

1

1205731198732 equiv 1 (mod 119901

119894) 120573

ℎequiv (mod 119901

119894) 1 le ℎ lt 119873

2

119894 = 1 2 119904

(25)

so

1205721198731 equiv 1 (mod 119901

119897119894

119894) 120573

1198732 equiv 1 (mod 119901

119897119894

119894)

1205721198731

119894equiv 1205721198731 equiv 1 (mod 119901

119894) 120572

119895

119894equiv 1 (mod 119901

119894)

1 le 119895 lt 1198731

1205731198732

119894equiv 1205731198732 equiv 1 (mod 119901

119894) 120573

119894equiv 1 (mod 119901

119894)

1 le ℎ lt 1198732

119894 = 1 119904

(26)

Hence the congruence equation (22) has a total of 119904 2-dimensional NTTs mod 119901

119897119894

119894 119894 = 1 119904 From CRT and the

congruence equation (23) we deduce that the congruenceequation (24) holds

3 Two-Dimensional Overlap-Save Method

Select two positive integers 1198731015840 and 1198721015840 so that 1198731015840 + 119897

2minus 1 =

119873 lt 1198971and 119872

1015840+ 1198982minus 1 = 119872 lt 119898

1 either 119873 or 119872 is given

by an integer power of 2 that is 119873 = 21198891 and 119872 = 2

1198892 where

1198891and 119889

2are two positive integers

Assuming that the input sequence 11990911989911198992

(1198991

=

0 1 1198971

minus 1 1198992

= 0 1 1198981

minus 1) is divided intomany small sections which are termed submatrices

1199091198991+V111987310158401198992+V211987210158401198991=119873minus1 119899

2=119872minus1

1198991=0 1198992=0

(V1= 0 1 V

2= 0 1 )

(27)

The consecutive matrix is overlapped by the previous oneAs a simple example four blocks chosen from the dividedinput matrices are overlapped and are graphically shown inFigure 1 Parameters V

1and V

2can be considered as shift

parameters because changing either V1or V2will select dif-

ferent submatrix For the first submatrix shown in Figure 1(a)we select V

1= 0 and V

2= 0 Second submatrix (V

1= 0 and

V2= 1) is displayed in Figure 1(b)Third one with parameters

of V1

= 1 and V2

= 0 is given in Figure 1(c) Fourth matrixshown in Figure 1(d) has parameters V

1= 1 and V

2= 1 The

procedure of the overlapping is also graphically illustrated inFigure 1

For the operation of circular convolution it is necessaryto have two sequences with the same length Taking (7) for

example the sequences 11990911989911198992

and ℎ11989911198992

are of the same lengthof1198731times1198732 Since the input sequence has already divided into

submatrices of119873times119872 by (27) the filter sequence has to be oflength119873times119872Therefore119873minus119897

2augmenting zeros are required

to be added to the row and119872minus1198982zeros to the column of the

filter sequence ℎ11989911198992

As a result the sequence ℎ11989911198992

becomes

ℎ1015840

11989911198992

=ℎ11989911198992

if 1198991= 0 1 119897

2minus 1 119899

2= 0 1 119898

2minus 1

0 if 1198972le 1198991lt 119873 or 119898

2le 1198992lt 119872

(28)

where 1198991= 0 1 119873 minus 1 and 119899

2= 0 1 119872 minus 1

The following form shows how a sequence ℎ101584011989911198992

is yieldedby adding augmenting zeros to the filter sequence ℎ

11989911198992

ℎ 997904rArr ℎ1015840 =

0 (29)

For each of the divided submatrices we can give V1and V

2

and compute the circular convolution of two 2D sequences1199091198991+V111987310158401198992+V21198721015840 and ℎ

1015840

11989911198992

(1198991

= 0 1 119873 minus 1 1198992

=

0 1 119872 minus 1) by

11991011990511199052

=

119873minus1

sum

1198991=0

119872minus1

sum

1198992=0

ℎ1015840

11989911198992

119909⟨1199051minus1198991⟩119873+V11198731015840⟨1199052minus1198992⟩119872+V21198721015840

1199051= 0 1 119873 minus 1 119905

2= 0 1 119872 minus 1

(30)

From (28) we deduce that

11991011990511199052

=

1198972minus1

sum

1198991=0

1198982minus1

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩119873+V11198731015840⟨1199052minus1198992⟩119872+V21198721015840 (31)

The result of (31) is that of circular convolution As we willsee below there exists an important connection between thecircular convolution and the linear one In fact since 119899

1=

0 1 1198972minus 1 and 119899

2= 0 1 119898

2minus 1 we can choose 119905

1=

1198972minus1 119873minus1 and 119905

2= 1198982minus1 119872minus1 in (31) this makes

119873 gt 1199051minus 1198991

gt 0 and 119872 gt 1199052minus 1198992

gt 0 in (31) Thus theremainder can exactly be equal to 119905

1minus 1198991and 1199052minus 1198992 Then

the circular convolution of (31) becomes

11991011990511199052

=

1198972minus1

sum

1198991=0

1198982minus1

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩119873+V11198731015840⟨1199052minus1198992⟩119872+V21198721015840

=

1198972minus1

sum

1198991=0

1198982minus1

sum

1198992=0

ℎ11989911198992

1199091199051minus1198991+V111987310158401199052minus1198992+V21198721015840

= 1199101199051+V111987310158401199052+V21198721015840

(32)

In order to clearly understand the procedure of obtainingthe components of linear convolution from the circularconvolution equation (31) a graphic description of it can befound in Figure 2 We show a dashed rectangle with size of119873 by 119872 in Figure 2(a) to represent the circular convolutionwhich is described in (31) and a darkened rectangle with sizeof1198731015840 by119872

1015840 to indicate the linear convolution stated in (32)

6 Mathematical Problems in Engineering

2N

m

n

2M

M

N1 = 0 2 = 0

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(a)

m

n

2N

2M

M

N1 = 1 2 = 0

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(b)

m

n

2N

2M

M

N

1 = 0 2 = 1

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(c)

m

n

2N

2M

M

N

1 = 1 2 = 1l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(d)

Figure 1 Four divided input submatrices are overlapped using the 2D overlap-save method (a) the first submatrix with parameters V1

=

0 V2= 0 is located on the top-left corner (b) the second one (V

1= 1 V

2= 0) overlaps by the first submatrix and the size of the overlapping

between them is119873 times1198982minus1 (c) the third divided input submatrix has parameters of V

1= 0 V

2= 1 It is overlapped by the first submatrix

and the size of the overlapping between them is 1198972minus 1 times 119872 (d) the fourth one with V

1= 1 V

2= 1 is overlapped by the first submatrix

and the size of the overlapping between them is 1198972minus 1 times 119898

2minus 1

m

n

2N

2M

M

N

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(a)

m

n

2N

2M

M

N

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(b)

Figure 2 Two consecutive output submatrices (a) the first block of V1= 0 and V

2= 0 and (b) the second block of V

1= 1 and V

2= 1

Mathematical Problems in Engineering 7

Obviously if the first 1198972minus 1 data in rows and the first 119898

2minus 1

data in columns are discarded from the dashed rectangle thedarkened rectangle can be obtained In the following we willexplain how to obtain the result of (4)

The output of the whole equation (4) can be representedin the following matrix

119884 = (

11991000

sdot sdot sdot sdot sdot sdot 11991001198981minus1

1199101198971minus10

sdot sdot sdot sdot sdot sdot 1199101198971minus11198981minus1

) (33)

which is an 1198971times 1198981matrix

So (32) gives a1198731015840times1198721015840 submatrix of matrix 119884 (note that

1198731015840= 119873 minus 119897

2+ 1 and that 1198721015840 = 119872 minus 119898

2+ 1)

(

1199101198972minus1+V111987310158401198982minus1+V21198721015840 sdot sdot sdot sdot sdot sdot 119910

1198972minus1+V11198731015840119872minus1+V

21198721015840

119910119873minus1+V

111987310158401198982minus1+V21198721015840 sdot sdot sdot sdot sdot sdot 119910

119873minus1+V11198731015840119872minus1+V

21198721015840

) (34)

Next to obtain the whole result we need to compute the cir-cular convolution of two 2D sequences 119909

1198991+(V1+1)119873

10158401198992+(V2+1)119872

1015840

and ℎ1015840

11989911198992

(1198991

= 0 1 119873 minus 1 1198992

= 0 1 119872 minus 1) Withthe same reasoning as above a consecutive submatrix of thematrix (34) is evinced as follows

(

119910119873+V11198731015840119872+V

21198721015840 sdot sdot sdot sdot sdot sdot 119910

119873+V11198731015840119872+119872

1015840minus1+V21198721015840

119910119873+119873

1015840minus1+V11198731015840119872+V

21198721015840 sdot sdot sdot sdot sdot sdot 119910

119873+1198731015840minus1+V11198731015840119872+119872

1015840minus1+V21198721015840

)

(35)

The corresponding graphic description is indicated inFigure 2(b) We will darken the rectangle in Figure 2(b) toexpress the submatrix (35) and the dashed one on its upper-left-corner to be the graphic description of the submatrix(34)

Clearly if (V1 V2) = (V10158401 V10158402) then (119905

1+ V11198731015840 1199052

+

V21198721015840) = (1199051015840

1+ V101584011198731015840 1199051015840

2+ V101584021198721015840) where 119897

2minus 1 le 119905

1 1199051015840

1le

119873 minus 1 1198982minus 1 le 119905

2and 1199051015840

2le 119872 minus 1 Let [119909] represent

the largest integer that is less than or equal to the realnumber 119909 therefore when V

1= 0 1 [(119897

1minus 119873)119873

1015840] and

V2

= 0 1 [(1198981minus 119872)119872

1015840] we will obtain all 1198731015840 times 119872

1015840

submatrices of thematrix119884 If 1198971= 11990411198731015840+119873 and119898

1= 11990421198721015840+

119872 then [(1198971minus 119873)119873

1015840] = (1198971minus 119873)119873

1015840 and [(1198981minus 119872)119872

1015840] =

(1198981minus119872)119872

1015840 The input matrix 11990911989911198992

will be divided with noremainder Figure 3 displays a series of small rectangles Eachrectangle stands for one1198731015840times119872

1015840 submatrixThe entirematrix119884 can be obtained by combining them

In Figure 3 there is a white Γ-type area indicating thatthere are no output data Two calculation methods canbe applied to obtain the data The first way is by using adirect method because only a few computations are neededAlternatively we can compute the data of Γ-type area with theoverlap-savemethod proposed above if1198731015840 = 119897

2minus1 and119872

1015840=

1198982minus 1 The detail of it is presented in the Technical Report

[18] The entire result is completed and is demonstrated inFigure 4 graphically

The two-dimensional overlap-save method is summa-rized as follows

m

n

Figure 3 All 1198731015840

times 1198721015840 submatrices of the output except the

boundary of Γ-type area

m

n

Figure 4 The full result of (4) computed by 2D overlap-savemethod where 119897

1= 11990411198731015840+ 119873 119898

1= 11990421198721015840+ 119872 and 119873

1015840+ 1198972minus 1 =

119873 lt 1198971and 119872

1015840+ 1198982minus 1 = 119872 lt 119898

1

(i) Select two positive integers 1198731015840 and 119872

1015840 so that 1198731015840 +1198972minus 1 = 119873 lt 119897

1and 119872

1015840+ 1198982minus 1 = 119872 lt 119898

1 Either

119873 or119872 is given by an integer power of 2 for using anFFT that is 119873 = 2

1198891 and 119872 = 2

1198892 where 119889

1and 119889

2

are two positive integers

(ii) Let ℎ101584011989911198992

satisfy (28)

(iii) Compute the circular convolution of two sequences1199091198991+V111987310158401198992+V21198721015840 and ℎ

1015840

11989911198992

(1198991

= 0 1 119873 minus 1 1198992

=

0 1 119872 minus 1) When 1199051

= 1198972minus 1 119873 minus 1 119905

2=

1198982minus 1 119872 minus 1 and V

1= 0 1 [(119897

1minus 119873)119873

1015840]

V2= 0 1 [(119898

1minus 119872)119872

1015840] we obtain all 1198731015840 times 119872

1015840

submatrices of the matrix of 119884 whose form is as (34)

8 Mathematical Problems in Engineering

If 1198971

= 11990411198731015840+ 119873 and 119898

1= 11990421198721015840+ 119872 then [(119897

1minus

119873)1198731015840] = (1198971minus 119873)119873

1015840 and [(1198981minus 119872)119872

1015840] = (119898

1minus

119872)1198721015840 The input matrix 119909

11989911198992

will be divided withno remainder

(iv) For 1199051= 0 1 119897

2minus 2 1199052= 0 1 119898

1minus 1 and 119905

1=

0 1 1198971minus 1 119905

2= 0 1 119898

2minus 2 compute 119910

11990511199052

byusing the direct method

If 1198731015840 = 1198972minus 1 and 119872

1015840= 1198982minus 1 we will add zeros

to the sequence 11990911989911198992

so that the 2D sequences are oflengths 119897

1+ 1198731015840 and 119898

1+ 1198721015840 Then we will compute

11991011989911198992

(1199051

= 0 1 1198972minus 2 1199052

= 0 1 1198981minus 1 and

1199051= 0 1 119897

1minus 1 1199052= 0 1 119898

2minus 2) by using an

overlap-save method The detail of it is presented inthe Technical Report [18]

We will introduce the way of using FNTT and 2Doverlap-save method with two examples One is numericalcomputation and the other is an experiment of extracting thecontour of a Chinese handwritten character

4 Comparison of the Numbersof Multiplication

Let119873 = 1198731015840+ 1198972minus 1 lt 119897

1119872 = 119872

1015840+1198982minus 1 lt 119898

11198731015840 = 119897

2minus 1

1198721015840= 1198982minus 1 1198972= 2119906+ 1 119898

2= 21199061015840

+ 1 and 1198971= 11990411198731015840+ 119873

1198981= 11990421198721015840+ 119872 Suppose that 119886

1and 1198862satisfy 2

1198861minus1

lt 1198971+

1198972minus 1 le 2

1198861 = 119873

1and 1198861198862minus1

lt 1198981+1198982minus 1 le 2

1198862 = 119873

2 Let 119871

1

1198712 and 119871

3denote the numbers of multiplication necessary

for computing the convolution (4) by using direct methodFNTT or FFT to calculate (4) (using Proposition 1) and2D overlap-save method respectively In [18] we comparedthe number of multiplications necessary for computing theconvolution (4) of two 2D sequences 119909

11989911198992

(1198991= 0 1 119897

1minus

1 1198992

= 0 1 1198981minus 1) and ℎ

11989911198992

(1198991

= 0 1 1198972minus 1

1198992= 0 1 119898

2minus 1) by three different methods

We proved the following results

(1) If 1198972lt 1198971 1198982lt 1198981 then

1198711=

11989721198982(1198972+ 1) (119898

2+ 1)

4+ (1198981minus 1198982)1198982

1198972(1198972+ 1)

2

+ (1198971minus 1198972) 1198972

1198982(1198982+ 1)

2+ (1198971minus 1198972) (1198981minus 1198982) 11989721198982

(36)

Also if 1198971= 1198981= 119897 1198972= 1198982= 1198971015840 then

1198711= (

1198971015840(2119897 minus 119897

1015840+ 1)

2)

2

(37)

(2) Consider

1198712= 21198861+1198862minus1

(31198861+ 31198862+ 2) (38)

(3) If 1198971= 1198981= 2119906+ℎ 1198972= 1198982= 2119906+ 1 119873 = 119872 = 2

119906+1and 119873

1015840= 1198721015840= 2119906 where 119906 ge 3 ℎ ge 2 then

1198711= ((2119906+ 1)2119906minus1

(2ℎ+1

minus 1))2

1198712= 22119906+2ℎ+1

(6119906 + 6ℎ + 8)

1198713= 2(2

119906+ℎ)2

(6119906 + 8)

(39)

In this section wewill suppose that1198731015840 = 1198972minus1 119872

1015840= 1198982minus

1 Let 119873 = 1198731015840+ 1198972minus 1 lt 119897

1 119872 = 119872

1015840+ 1198982minus 1 lt 119898

1 and

1198971= 11990411198731015840+119873 119898

1= 11990421198721015840+119872 For 119905

1= 0 1 119897

2minus 2 119905

2=

0 1 1198981minus 1 and 119905

1= 0 1 119897

1minus 1 119905

2= 0 1 119898

2minus 2

we computer 11991011990511199052

by using the direct methodWe have the following proposition

Proposition 6 If 1198972lt 1198971 1198982lt 1198981 then

119871 =11989721198982

4((1198972minus 1) (119898

2minus 1) + 2 (119897

2minus 1)

times (1198981minus 1198982+ 1) + 2 (119898

2minus 1) (119897

1minus 1198972+ 1))

(40)

where 119871 denotes the number of multiplication necessary forcomputing119910

11989911198992

by using the directmethod 1199051= 0 1 119897

2minus2

1199052= 0 1 119898

1minus1 and 119905

1= 0 1 119897

1minus1 1199052= 0 1 119898

2minus

2Also if 119897

1= 1198981= 119897 and 119897

2= 1198982= 1198971015840 then

119871 =

11989710158402

(1198971015840minus 1)

4(4119897 minus 3119897

1015840+ 3) (41)

Proof Let I II and III denote the number of multiplicationnecessary for computing the 119860 119861 and 119862 by direct methodrespectively where

119860 = (

11991000

sdot sdot sdot 11991001198982minus2

1199101198972minus20

sdot sdot sdot 1199101198972minus21198982minus2

)

119861 = (

11991001198982minus1

sdot sdot sdot 11991001198981minus1

1199101198972minus21198982minus1

sdot sdot sdot 1199101198972minus21198981minus1

)

119862 = (

1199101198972minus10

sdot sdot sdot 1199101198972minus11198982minus2

1199101198972minus10

sdot sdot sdot 1199101198972minus11198982minus2

)

(42)

Mathematical Problems in Engineering 9

Then

119868 = (1 + 2 + sdot sdot sdot + (1198982minus 1)) (1 + 2 + sdot sdot sdot + (119897

2minus 1))

=11989721198982(1198972minus 1) (119898

2minus 1)

4

119868119868 = 1198982(1 + 2 + sdot sdot sdot + (119897

2minus 1)) (119898

1minus 1 minus (119898

2minus 2))

=11989721198982(1198972minus 1) (119898

1minus 1198982+ 1)

2

119868119868119868 = 1198972(1 + 2 + sdot sdot sdot + (119898

2minus 1)) (119897

1minus 1 minus (119897

2minus 2))

=11989721198982(1198982minus 1) (119897

1minus 1198972+ 1)

2

(43)

So

119871 = 119868 + 119868119868 + 119868119868119868

=11989721198982

4((1198972minus 1) (119898

2minus 1) + 2 (119897

2minus 1) (119898

1minus 1198982+ 1)

+2 (1198982minus 1) (119897

1minus 1198972+ 1))

(44)

Clearly if 1198971= 1198981= 119897 and 119897

2= 1198982= 1198971015840 then (41) holds This

completes the proof

Proposition 7 If 1198971

= 1198981

= 2119906+ℎ 1198972

= 1198982

= 2119906+ 1 119873 =

119872 = 2119906+2 and119873

1015840= 1198721015840= 3sdot2

119906 where 119906 ge 3 ℎ equiv 0 (mod 2)ℎ ge 4 then

1198714= (2119906+ 1)222(119906minus1)

(2ℎ+2

minus 3)

+ (4(2ℎminus2

minus 1)

3+ 1)

2

22(119906+2)

(3119906 + 7)

(45)

where 1198714denotes the number of multiplication necessary for

computing (4) by using 2D overlap-save method

Proof Because 1198731015840

= 1198972minus 1 1198721015840 = 119898

2minus 1 1198971= 1198981= 2119906+ℎ and

1198972= 1198982= 2119906+ 1 by (41) we have

119871 = (2119906+ 1)2sdot 2119906minus2

(2119906+ℎ+2

minus 3 (2119906+ 1) + 3)

= (2119906+ 1)222(119906minus1)

(2ℎ+2

minus 3)

(46)

Compute the cyclic convolution of two sequences1199091198991+V111987310158401198992+V21198721015840 and ℎ

1015840

11989911198992

(1198991

= 0 1 2119906+2

minus 11198992

= 0 1 2119906+2

minus 1) that is compute matrix (35) byusing FNNT It is well known that using FNTT to calculatethe (35) requires

119873119872(3

2log119873119872 + 1) = 2

2(119906+2)(3119906 + 7) (47)

where 119873 = 119872 = 2119906+2

When 119873 = 119872 = 2119906+2 1198731015840 = 119872

1015840= 3 sdot 2

119906 119906 ge 3 ℎ equiv

0 (mod 2) and ℎ ge 4 then

[1198971minus 119873

1198731015840] = [

1198981minus 119872

1198721015840] = [

2119906+ℎ

minus 2119906+2

3 sdot 2119906]

= [

4 (2ℎminus2

minus 1)

3] =

4 (2ℎminus2

minus 1)

3

(48)

where 4(2ℎminus2

minus 1)3 is a positive integerSo the input matrix 119909

11989911198992

will be divided with noremainder When V

1= 0 1 [(119897

1minus 119873)119873

1015840] and V

2=

0 1 [(1198981minus119872)119872

1015840] we obtain all matrices as (35) Thus

1198714= (2119906+ 1)222(119906minus1)

(2ℎ+2

minus 3)

+ (4(2ℎminus2

minus 1)

3+ 1)

2

22(119906+2)

(3119906 + 7)

(49)

equal to (45) holds This completes the proof

Example 8 Suppose that 119906 = ℎ = 4 that is 1198971= 1198981= 256

1198972= 1198982= 17 119873 = 119872 = 64 and 119873

1015840= 1198721015840= 48 then

1198714= 3073856 (50)

If 1198971= 1198981= 256 119897

2= 1198982= 17 119873 = 119872 = 32 and 119873

1015840= 1198721015840=

16 then

1198713= 4194304 (51)

This example shows that 1198714lt 1198713in some particular cases

5 Experiments

The theoretic description of the 2D overlap-save method hasbeen provided in the preceding section This section furtherexamines how such a technique will be performed and howit will be applied to the wavelet transform Particularly wewill use image processing as an exampleThe experiment willfocus on the application of the 2D overlap-savemethod to thedyadic wavelet transform extracting the contours of Chinesehandwriting

51 Numerical Computation Let ℎ11989911198992

denote a digital filterand let a two-dimensional sequence

(ℎ11989911198992

) = (

1 0 1

1 1 0

0 1 1

) (52)

be the coefficients of the filter A two-dimensional sequence

(11990911989911198992

) =

((((

(

1 3 2 minus3 0 2 1 1

3 1 0 minus1 2 minus2 minus1 0

0 minus1 1 1 3 2 0 minus1

2 3 minus1 1 0 1 1 0

3 minus2 1 0 minus1 1 1 1

minus1 0 2 3 1 1 0 1

1 minus1 0 1 0 1 minus1 0

minus1 0 1 1 0 1 0 1

))))

)

(53)

10 Mathematical Problems in Engineering

represents the input of the filter In this example because 1198971=

1198981= 8 and 119897

2= 1198982= 3 the length of input matrix is 8 times 8

and that of the filter is 3 times 3Using the overlap-save method to calculate the output of

the filter

11991011989911198992

=

2

sum

1198961=0

2

sum

1198962=0

ℎ11989611198962

1199091198991minus11989611198992minus1198962

0le1198991minus1198961lt8

0le1198992minus1198962lt8

1198991= 0 1 2 3 4 5 6 7 119899

2= 0 1 2 3 4 5 6 7

(54)

means that the elements of the matrix

119884 = (

11991000

11991001

sdot sdot sdot 11991007

11991010

11991011

sdot sdot sdot 11991017

11991070

11991071

sdot sdot sdot 11991077

) (55)

need to be computedThe solution is given belowSince 119897

1= 1198981= 8 1198972= 1198982= 3 by selecting 119873

1015840= 1198972minus 1 =

2 and 1198721015840= 1198982minus 1 = 2 we have 119873 = 119872 = 4 In order to

use the FNTT the input matrix is divided into 9 submatricesof size 4times 4 Each consecutive submatrix is partly overlappedwith the size of 2 times 2 pixels In addition zeros of size 1 times 1

are added to the filtering sequence to ensure that its lengthis equivalent to that of the submatrix Therefore the filteringsequence ℎ

11989911198992

is extended to ℎ1015840

11989911198992

that is

ℎ1015840

11989911198992

= ℎ11989911198992

if 1198991= 0 1 2 119899

2= 0 1 2

0 if 1198991= 3 or 119899

2= 3

(56)

where 1198991= 0 1 2 3 119899

2= 0 1 2 3

Next we compute the circular convolution of the twosequences 119909

1198991+2V11198992+2V2

and ℎ1015840

11989911198992

(1198991

= 0 1 2 3 1198992

=

0 1 2 3)

11991011990511199052

=

3

sum

1198991=0

3

sum

1198992=0

ℎ1015840

11989911198992

119909⟨1199051minus1198991⟩4+2V1⟨1199052minus1198992⟩4+2V2

=

2

sum

1198991=0

2

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩4+2V1⟨1199052minus1198992⟩4+2V2

(57)

where 1199051= 0 1 2 3 119905

2= 0 1 2 3

When 1199051= 2 3 119905

2= 2 3 we arrive at the following result

11991011990511199052

=

2

sum

1198991=0

2

sum

1198992=0

ℎ11989911198992

1199091199051minus1198991+2V11199052minus1198992+2V2

= 1199101199051+2V11199052+2V2

(58)

After choosing all the parameters of V1

= 0 1 2 V2

=

0 1 2 ([(1198971minus 119873)119873

1015840] = [(119898

1minus 119872)119872

1015840] = [(8 minus 4)2] = 2)

all 2 times 2 submatrices of the matrix 119884 defined in (34) will beobtained as follows

(11991022

11991023

11991032

11991033

)(11991024

11991025

11991034

11991035

)(11991026

11991027

11991036

11991037

)

(11991042

11991043

11991052

11991053

)(11991044

11991045

11991054

11991055

)(11991046

11991047

11991056

11991057

)

(11991062

11991063

11991072

11991073

)(11991064

11991065

11991074

11991075

)(11991066

11991067

11991076

11991077

)

(59)

For 11991011990511199052

(1199051

= 0 1 1199052

= 0 1 2 3 4 5 6 7 1199051

=

0 1 2 3 4 5 6 7 1199052

= 0 1) we can compute it by usingan overlap-save method The detail of it is presented in theTechnical Report [18]

The fast number theoretic transform (FNTT) is nowapplied to the implementation of the circular convolution

11991011990511199052

=

3

sum

1198991=0

3

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩4⟨1199052minus1198992⟩4

1199051= 0 1 2 3 119905

2= 0 1 2 3

(60)

The computation is performed in the following five stepsshown in Figure 5

Step 1 (choosing 119872) Since

1003816100381610038161003816100381611991011990511199052

10038161003816100381610038161003816le

1003816100381610038161003816100381611990911989911198992

10038161003816100381610038161003816max

3

sum

1198961=0

3

sum

1198962=0

10038161003816100381610038161003816ℎ11989611198962

10038161003816100381610038161003816= 3 times 6 = 18 (61)

we can select119898 = 257 = 28+ 1 so that 18 lt 2572 where 257

is a prime Clearly 164 equiv 1 (mod257) and 16119895

equiv 1 (mod257) for 1 le 119895 le 3

Thus

11988311989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

11990911989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(62)

is a 2D number theoretic transform It has the followinginverse transform

11990911989911198992

equiv 4minus1

sdot 4minus1

3

sum

1198961=0

3

sum

1198962=0

11988311989611198962(minus16)11989911198961(minus16)11989921198962(mod 257)

1198991= 0 1 2 3 119899

2= 0 1 2 3

(63)

where 4minus1 denotes an integer so that (4minus1) sdot 4 equiv 1 (mod 257)

Mathematical Problems in Engineering 11

linear convolutionof the output matrixof the output matrix

cyclic convolutionCalculate the

of the filtering matrix

Calculate the

Calculate the numbertheoretic transformof the input matrix

Choose M

theoretic transformCalculate the number

Figure 5 Five steps of applying FNTT to calculate the output of (54)

Step 2 (calculating the number theoretic transform of inputmatrix by the FNTT) For computational convenience hereone writes

11988001198962

equiv

3

sum

1198992=0

11990901198992

1611989921198962 119880

11198962

equiv

3

sum

1198992=0

11990911198992

1611989921198962(mod 257)

11988021198962

equiv

3

sum

1198992=0

11990921198992

1611989921198962 119880

31198962

equiv

3

sum

1198992=0

11990931198992

1611989921198962(mod 257)

1198962= 0 1 2 3

(64)

Then (62) becomes

11988311989610

equiv

3

sum

1198991=0

11988011989910

1611989911198961 119883

11989611

equiv

3

sum

1198991=0

11988011989911

1611989911198961(mod 257)

11988311989612

equiv

3

sum

1198991=0

11988011989912

1611989911198961 119883

11989613

equiv

3

sum

1198991=0

11988011989913

1611989911198961(mod 257)

1198961= 0 1 2 3

(65)

Use the FNTT to calculate (64) and (65)So

(

11988000

11988001

11988002

11988003

11988010

11988011

11988012

11988013

11988020

11988021

11988022

11988023

11988030

11988031

11988032

11988033

)

equiv (

3 95 3 minus97

3 35 3 minus29

1 minus33 1 31

5 35 minus3 minus29

) (mod 257)

119883 = (

11988300

11988301

11988302

11988303

11988310

11988311

11988312

11988313

11988320

11988321

11988322

11988323

11988330

11988331

11988332

11988333

)

equiv (

12 132 4 minus124

minus30 128 98 minus128

minus4 minus8 4 minus8

34 128 minus94 minus128

) (mod 257)

(66)

Step 3 (calculating the number theoretic transformof the filterby the FNTT) The FNTT of the filter ℎ

11989911198992

is written as

11986711989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

ℎ1015840

11989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(67)

Similarly we have

119867 = (

11986700

11986701

11986702

11986703

11986710

11986711

11986712

11986713

11986720

11986721

11986722

11986723

11986730

11986731

11986732

11986733

)

equiv (

6 32 2 minus32

32 0 2 34

2 minus2 2 minus2

minus32 minus30 2 0

) (mod 257)

(68)

Step 4 (compute the number theoretic transformof the outputof the filter) From the preceding three steps we can computethe circular convolution of the filter by defining the productof 119883 and 119867 as

119884 = (

11988400

11988401

11988402

11988403

11988410

11988411

11988412

11988413

11988420

11988421

11988422

11988423

11988430

11988431

11988432

11988433

)

equiv 119883 ⊙ 119867 = (

11988300

11986700

11988301

11986701

11988302

11986702

11988303

11986703

11988310

11986710

11988311

11986711

11988312

11986712

11988313

11986713

11988320

11986720

11988321

11986721

11988322

11986722

11988323

11986723

11988330

11986730

11988331

11986731

11988332

11986732

11988333

11986733

)

equiv (

72 112 8 113

68 0 minus61 17

minus8 16 8 16

minus60 15 69 0

) (mod 257)

(69)

where

11988411989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

11991011989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(70)

12 Mathematical Problems in Engineering

Table 1 Filtering coefficients 12059521198951

119896119897 (119895 = 2) 120595(119903) are a quadratic spline wavelet

119897119896 119896 = 0 119896 = 1 119896 = 2 119896 = 3

119897 = 0 minus00838140026 minus00472041145 minus00129809398 minus00012592132119897 = 1 minus01416904181 minus00758706033 minus00196341425 minus00012698699119897 = 2 minus00651057437 minus00327749476 minus00063385521 minus00000750836119897 = 3 minus00088690016 minus00030044997 minus00001088651

(a) (b)

Figure 6 A 2-dimensional image of an aircraft was processed with 2D overlap-save method (a) Original Chinese handwriting and (b) thedivided up subimages of the character

and the 11991011989911198992

(1198991

= 0 1 2 3 1198992

= 0 1 2 3) is the circularconvolution of (60)

Step 5 (calculate the output of the linear convolution) From(63) we deduce the inverse transform of (70)

11991011989911198992

equiv 4minus1

sdot 4minus1

3

sum

1198961=0

3

sum

1198962=0

11988411989611198962(minus16)11989911198961

sdot (minus16)11989921198962(mod 257)

1198991= 0 1 2 3 119899

2= 0 1 2 3

(71)

Using FNTT to calculate (71) we have

(

11991000

11991001

11991002

11991003

11991010

11991011

11991012

11991013

11991020

11991021

11991022

11991023

11991030

11991031

11991032

11991033

) equiv (

8 6 4 0

1 7 13 1

2 2 6 4

1 5 5 7

) (mod 257)

(72)

Then the linear convolution in (58) is obtained

(11991022

11991023

11991032

11991033

) = (11991022

11991023

11991032

11991033

) = (6 4

5 7) (73)

52 Application to Image Processing The proposed methodcan be applied to many fields such as image processingand pattern recognition An example of the application to

the image processing is illustrated in Figure 6 The originalimage shown in Figure 6(a) is a 2-dimensional image of anaircraft with a size of 256 times 256 pixels that is 119897

1= 1198981

=

256 Our task is to extract its contours The discrete wavelettransform with scale 119904 = 2

119895 where 119895 = 2 was applied and thespline wavelet described in (1) of size 17 times 17 was chosenthat is 119897

2= 1198982

= 17 We use the filtering coefficientstabulated in Table 1 Using the 2D overlap-save method thisoriginal image was divided into 25 sections with each onehaving the dimension of 64 times 64 pixels that is we select119873 = 119872 = 64 1198731015840 = 119872

1015840= 48 [(119897

1minus 119873)119873

1015840] = [(119898

1minus

119872)1198721015840] = 4 (See Example 8 in Section 4) Figure 6(b)

shows these subimages The overlapped part can be explicitlyobserved in each subimage

To facilitate the presentation of the 2D overlap-savemethod the procedure of it is diagonally displayed inFigure 7 where a series of the divided subimages are illus-tratedThe image in Figure 6(a) was equivalently divided into25 sections by applying (27) In Figure 7(a) we represent 5subimages of V

0= 0 V

1= 0 V

0= 1 V

1= 1 V

0= 2 V

1= 2

and V0

= 3 V1

= 3 and V0

= 4 V1

= 4 consecutively Thelower-right corner of each subimage is repeated in the upper-left corner of its consecutive subimage Four subimages aredisplayed in Figure 7(b) and the parameters of V

0= 0 V1= 1

V0

= 1 V1

= 2 V0

= 2 V1

= 3 and V0

= 3 V1

= 4 werechosen In Figure 7(c) we selected 3 subimages of V

0= 0

V1

= 2 V0

= 1 V1

= 3 and V0

= 2 V1

= 4 There are3 subimages of V

0= 0 V

1= 3 and V

0= 1 V

1= 4 in

Figure 7(d) Figure 7(e) displays subimages of V0= 0 V

1= 4

Mathematical Problems in Engineering 13

(a) (b) (c)

(d) (e) (f)

(g) (h) (i)

Figure 7 A 2-dimensional image of an aircraft is dividing into separated small subimages the parameters of V0and V

1are chosen as follows

(a) V0= 0 V

1= 0 V

0= 1 V

1= 1 V

0= 2 V

1= 2 and V

0= 3 V

1= 3 and V

0= 4 and V

1= 4 (b) V

0= 0 V

1= 1 V

0= 1 V

1= 2 V

0= 2 V

1= 3 and

V0= 3 and V

1= 4 (c) V

0= 0 V

1= 2 V

0= 1 V

1= 3 and V

0= 2 and V

1= 4 (d) V

0= 0 V

1= 3 and V

0= 1 and V

1= 4 (e) V

0= 0 and V

1= 4 (f)

V0= 1 V

1= 0 V

0= 2 V

1= 1 V

0= 3 V

1= 2 and V

0= 4 and V

1= 3 (g) V

0= 2 V

1= 0 V

0= 3 V

1= 1 and V

0= 4 and V

1= 2 (h) V

0= 3 V

1= 0

and V0= 4 and V

1= 1 and (i) V

0= 4 and V

1= 0

In Figure 7(f) V0= 1 V

1= 0 V

0= 2 V

1= 1 V

0= 3 V

1= 2

and V0= 4 V1= 3were chosen In Figure 7(g) the parameters

were decided upon V0= 2 V

1= 0 V

0= 3 V

1= 1 and V

0= 4

V1= 2 Two subimages are shown in Figure 7(h) by selecting

V0= 3 V

1= 0 and V

0= 4 V

1= 1 There is one subimage of

V0= 4 V

1= 0 in Figure 7(i)

We select a 2D NTT

11988311989611198962

equiv

63

sum

1198991=0

63

sum

1198992=0

11990911989911198992

211989911198961211989921198962 (mod 2

32+ 1) (74)

14 Mathematical Problems in Engineering

(a) (b)

(c) (d)

Figure 8 The linear outputs of 2D overlap-save method (a) the outputs of the linear convolution of each subimages (b) the left border andthe upper border of the outputs of the image of aircraft (c) the combined outputs of linear convolution except Γ-type border and (d) theentire contour extracted using 2D overlap-save method under wavelet transform

which has inverse transform

11990911989911198992

equiv 64minus1

64minus1

63

sum

1198961=0

63

sum

1198962=0

11988311989611198962

(minus231)11989911198961

times (minus231)11989921198962

(mod 232

+ 1)

1198991= 0 1 63 119899

2= 0 1 63

(75)

where 64minus1 denotes integer so that (64minus1)64 equiv 1 (mod 2

32+

1) and |11990911989911198992

| le 255The FNTT was applied to calculate the circular convo-

lution of each subimage After applying (31) to each of thesubblocks a series of segments of the contours were obtained

By using (32) we can gradually reach the final result of thelinear convolution Figure 8(a) illustrates those pixels whichsatisfy (35) where 119897

2= 1198982= 17 119873 = 119872 = 64 1198731015840 = 119872

1015840=

48 and V1 V2

= 0 1 2 3 4 Combining them together thecontours of the whole character were obtained and displayedin Figure 8(c) which excludes the Γ-type border Next the

Γ-type border was computed by direct method Figure 8(b)shows the result Combining this result with that shown inFigure 8(c) the entire contours of the Chinese handwritingwere combined Figure 8(d) represents the entire contour

6 Conclusions

A novel approach to reduce the computation complexityof the wavelet transform has been presented in this paperTwo key techniques have been applied in this new methodnamely fast number theoretic transform (FNTT) and two-dimensional overlap-save technique In the fast numbertheoretic transform the linear convolution is replaced bythe circular convolution It can speed up the computationof 2D discrete wavelet transform Directly calculating thefast number theoretic transform to the whole input sequencemay meet two difficulties namely a big modulo obstructsthe effective implementation of the fast number theoretictransform and a long input sequence slows the computation

Mathematical Problems in Engineering 15

of the fast number theoretic transform down To fight withsuch deficiencies a new technique which is referred to as 2Doverlap-save method has been developed Experiments havebeen conducted The fast number theoretic transform and2D overlap-method have been used to implement the dyadicwavelet transform and applied to contour extraction in imageprocessing and pattern recognition

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Acknowledgments

This work was supported by the Research GrantsMYRG205(Y1-L4)-FST11-TYY and MYRG187(Y1-L3)-FST11-TYY and Chair Prof Grants RDG009FST-TYY ofUniversity of Macau as well as Macau FDC Grants T-100-2012-A3 and 026ndash2013-A This research project was alsosupported by the National Natural Science Foundation ofChina 61273244

References

[1] P L Combettes and J-C Pesquet ldquoWavelet-constrained imagerestorationrdquo International Journal of Wavelets Multiresolutionand Information Processing vol 2 no 4 pp 371ndash389 2004

[2] M Ehler and K Koch ldquoThe construction of multiwavelet bi-frames and applications to variational image denoisingrdquo Inter-national Journal of Wavelets Multiresolution and InformationProcessing vol 8 no 3 pp 431ndash455 2010

[3] P Jain and S N Merchant ldquoWavelet-based multiresolutionhistogram for fast image retrievalrdquo International Journal ofWavelets Multiresolution and Information Processing vol 2 no1 pp 59ndash73 2004

[4] S Mallat and W L Hwang ldquoSingularity detection and pro-cessing with waveletsrdquo Institute of Electrical and ElectronicsEngineers Transactions on InformationTheory vol 38 no 2 pp617ndash643 1992

[5] B U Shankar S K Meher and A Ghosh ldquoNeuro-waveletclassifier formultispectral remote sensing imagesrdquo InternationalJournal of Wavelets Multiresolution and Information Processingvol 5 no 4 pp 589ndash611 2007

[6] S Shi Y Zhang and Y Hu ldquoA wavelet-based image edgedetection and estimationmethod with adaptive scale selectionrdquoInternational Journal of Wavelets Multiresolution and Informa-tion Processing vol 8 no 3 pp 385ndash405 2010

[7] Y Y Tang Wavelets Theory Approach to Pattern RecognitionWorld Scientific Singapor 2009

[8] Q M Tieng and W Boles ldquoWavelet-based affine invariantrepresentation a tool for recognizing planar objects in 3Dspacerdquo IEEE Transactions on Pattern Analysis and MachineIntelligence vol 19 no 8 pp 921ndash925 1997

[9] P Wunsch and A F Laine ldquoWavelet descriptors for mul-tiresolution recognition of handprinted charactersrdquo PatternRecognition vol 28 no 8 pp 1237ndash1249 1995

[10] H Yin and H Liu ldquoA Bregman iterative regularization methodfor wavelet-based image deblurringrdquo International Journal of

Wavelets Multiresolution and Information Processing vol 8 no3 pp 485ndash499 2010

[11] X You and Y Y Tang ldquoWavelet-based approach to characterskeletonrdquo IEEE Transactions on Image Processing vol 16 no 5pp 1220ndash1231 2007

[12] T Zhang Q Fan and Q Gao ldquoWavelet characterization ofHardy space ℎ

1 and its application in variational image decom-positionrdquo International Journal of Wavelets Multiresolution andInformation Processing vol 8 no 1 pp 71ndash87 2010

[13] Y Y Tang L Y Li Feng and J Liu ldquoScale-independent waveletalgorithm for detecting step-structure edgesrdquo Tech Rep IEEETransactions on InformationTheory Brisbane Australia 1998

[14] S G Mallat ldquoMultiresolution approximations and waveletorthonormal bases of 119871

2(R)rdquo Transactions of the American

Mathematical Society vol 315 no 1 pp 69ndash87 1989[15] J H McClellan and C M Rader Number Theory in Digital Sig-

nal Processing Prentice Hall Signal Processing Series PrenticeHall Englewood Cliffs NJ USA 1979

[16] X Ran and K J R Liu ldquoFast algorithms for 2-D circularconvolutions and number theoretic transforms based on poly-nomial transforms over finite ringsrdquo IEEE Transactions onSignal Processing vol 43 no 3 pp 569ndash578 1995

[17] Q Sun ldquoSome results in the application of the number theoryto digital signal processing and public-key systemsrdquo in NumberTheory and Its Applications in China vol 77 of ContemporaryMathematics pp 107ndash112 American Mathematical SocietyProvidence RI USA 1988

[18] Y Y Tang Q Sun L H Yang and L Feng ldquoAn overlap-save method for the calculation of the two-dimensional digitalconvolutionrdquo Tech Rep Department of Computer ScienceHong Kong Baptist University 1998

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 6: Research Article Implementation of 2D Discrete Wavelet ...downloads.hindawi.com/journals/mpe/2014/532979.pdfResearch Article Implementation of 2D Discrete Wavelet Transform by Number

6 Mathematical Problems in Engineering

2N

m

n

2M

M

N1 = 0 2 = 0

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(a)

m

n

2N

2M

M

N1 = 1 2 = 0

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(b)

m

n

2N

2M

M

N

1 = 0 2 = 1

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(c)

m

n

2N

2M

M

N

1 = 1 2 = 1l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(d)

Figure 1 Four divided input submatrices are overlapped using the 2D overlap-save method (a) the first submatrix with parameters V1

=

0 V2= 0 is located on the top-left corner (b) the second one (V

1= 1 V

2= 0) overlaps by the first submatrix and the size of the overlapping

between them is119873 times1198982minus1 (c) the third divided input submatrix has parameters of V

1= 0 V

2= 1 It is overlapped by the first submatrix

and the size of the overlapping between them is 1198972minus 1 times 119872 (d) the fourth one with V

1= 1 V

2= 1 is overlapped by the first submatrix

and the size of the overlapping between them is 1198972minus 1 times 119898

2minus 1

m

n

2N

2M

M

N

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(a)

m

n

2N

2M

M

N

l2 minus 1

m2 minus 1M

998400

N998400

2N998400

2M998400

(b)

Figure 2 Two consecutive output submatrices (a) the first block of V1= 0 and V

2= 0 and (b) the second block of V

1= 1 and V

2= 1

Mathematical Problems in Engineering 7

Obviously if the first 1198972minus 1 data in rows and the first 119898

2minus 1

data in columns are discarded from the dashed rectangle thedarkened rectangle can be obtained In the following we willexplain how to obtain the result of (4)

The output of the whole equation (4) can be representedin the following matrix

119884 = (

11991000

sdot sdot sdot sdot sdot sdot 11991001198981minus1

1199101198971minus10

sdot sdot sdot sdot sdot sdot 1199101198971minus11198981minus1

) (33)

which is an 1198971times 1198981matrix

So (32) gives a1198731015840times1198721015840 submatrix of matrix 119884 (note that

1198731015840= 119873 minus 119897

2+ 1 and that 1198721015840 = 119872 minus 119898

2+ 1)

(

1199101198972minus1+V111987310158401198982minus1+V21198721015840 sdot sdot sdot sdot sdot sdot 119910

1198972minus1+V11198731015840119872minus1+V

21198721015840

119910119873minus1+V

111987310158401198982minus1+V21198721015840 sdot sdot sdot sdot sdot sdot 119910

119873minus1+V11198731015840119872minus1+V

21198721015840

) (34)

Next to obtain the whole result we need to compute the cir-cular convolution of two 2D sequences 119909

1198991+(V1+1)119873

10158401198992+(V2+1)119872

1015840

and ℎ1015840

11989911198992

(1198991

= 0 1 119873 minus 1 1198992

= 0 1 119872 minus 1) Withthe same reasoning as above a consecutive submatrix of thematrix (34) is evinced as follows

(

119910119873+V11198731015840119872+V

21198721015840 sdot sdot sdot sdot sdot sdot 119910

119873+V11198731015840119872+119872

1015840minus1+V21198721015840

119910119873+119873

1015840minus1+V11198731015840119872+V

21198721015840 sdot sdot sdot sdot sdot sdot 119910

119873+1198731015840minus1+V11198731015840119872+119872

1015840minus1+V21198721015840

)

(35)

The corresponding graphic description is indicated inFigure 2(b) We will darken the rectangle in Figure 2(b) toexpress the submatrix (35) and the dashed one on its upper-left-corner to be the graphic description of the submatrix(34)

Clearly if (V1 V2) = (V10158401 V10158402) then (119905

1+ V11198731015840 1199052

+

V21198721015840) = (1199051015840

1+ V101584011198731015840 1199051015840

2+ V101584021198721015840) where 119897

2minus 1 le 119905

1 1199051015840

1le

119873 minus 1 1198982minus 1 le 119905

2and 1199051015840

2le 119872 minus 1 Let [119909] represent

the largest integer that is less than or equal to the realnumber 119909 therefore when V

1= 0 1 [(119897

1minus 119873)119873

1015840] and

V2

= 0 1 [(1198981minus 119872)119872

1015840] we will obtain all 1198731015840 times 119872

1015840

submatrices of thematrix119884 If 1198971= 11990411198731015840+119873 and119898

1= 11990421198721015840+

119872 then [(1198971minus 119873)119873

1015840] = (1198971minus 119873)119873

1015840 and [(1198981minus 119872)119872

1015840] =

(1198981minus119872)119872

1015840 The input matrix 11990911989911198992

will be divided with noremainder Figure 3 displays a series of small rectangles Eachrectangle stands for one1198731015840times119872

1015840 submatrixThe entirematrix119884 can be obtained by combining them

In Figure 3 there is a white Γ-type area indicating thatthere are no output data Two calculation methods canbe applied to obtain the data The first way is by using adirect method because only a few computations are neededAlternatively we can compute the data of Γ-type area with theoverlap-savemethod proposed above if1198731015840 = 119897

2minus1 and119872

1015840=

1198982minus 1 The detail of it is presented in the Technical Report

[18] The entire result is completed and is demonstrated inFigure 4 graphically

The two-dimensional overlap-save method is summa-rized as follows

m

n

Figure 3 All 1198731015840

times 1198721015840 submatrices of the output except the

boundary of Γ-type area

m

n

Figure 4 The full result of (4) computed by 2D overlap-savemethod where 119897

1= 11990411198731015840+ 119873 119898

1= 11990421198721015840+ 119872 and 119873

1015840+ 1198972minus 1 =

119873 lt 1198971and 119872

1015840+ 1198982minus 1 = 119872 lt 119898

1

(i) Select two positive integers 1198731015840 and 119872

1015840 so that 1198731015840 +1198972minus 1 = 119873 lt 119897

1and 119872

1015840+ 1198982minus 1 = 119872 lt 119898

1 Either

119873 or119872 is given by an integer power of 2 for using anFFT that is 119873 = 2

1198891 and 119872 = 2

1198892 where 119889

1and 119889

2

are two positive integers

(ii) Let ℎ101584011989911198992

satisfy (28)

(iii) Compute the circular convolution of two sequences1199091198991+V111987310158401198992+V21198721015840 and ℎ

1015840

11989911198992

(1198991

= 0 1 119873 minus 1 1198992

=

0 1 119872 minus 1) When 1199051

= 1198972minus 1 119873 minus 1 119905

2=

1198982minus 1 119872 minus 1 and V

1= 0 1 [(119897

1minus 119873)119873

1015840]

V2= 0 1 [(119898

1minus 119872)119872

1015840] we obtain all 1198731015840 times 119872

1015840

submatrices of the matrix of 119884 whose form is as (34)

8 Mathematical Problems in Engineering

If 1198971

= 11990411198731015840+ 119873 and 119898

1= 11990421198721015840+ 119872 then [(119897

1minus

119873)1198731015840] = (1198971minus 119873)119873

1015840 and [(1198981minus 119872)119872

1015840] = (119898

1minus

119872)1198721015840 The input matrix 119909

11989911198992

will be divided withno remainder

(iv) For 1199051= 0 1 119897

2minus 2 1199052= 0 1 119898

1minus 1 and 119905

1=

0 1 1198971minus 1 119905

2= 0 1 119898

2minus 2 compute 119910

11990511199052

byusing the direct method

If 1198731015840 = 1198972minus 1 and 119872

1015840= 1198982minus 1 we will add zeros

to the sequence 11990911989911198992

so that the 2D sequences are oflengths 119897

1+ 1198731015840 and 119898

1+ 1198721015840 Then we will compute

11991011989911198992

(1199051

= 0 1 1198972minus 2 1199052

= 0 1 1198981minus 1 and

1199051= 0 1 119897

1minus 1 1199052= 0 1 119898

2minus 2) by using an

overlap-save method The detail of it is presented inthe Technical Report [18]

We will introduce the way of using FNTT and 2Doverlap-save method with two examples One is numericalcomputation and the other is an experiment of extracting thecontour of a Chinese handwritten character

4 Comparison of the Numbersof Multiplication

Let119873 = 1198731015840+ 1198972minus 1 lt 119897

1119872 = 119872

1015840+1198982minus 1 lt 119898

11198731015840 = 119897

2minus 1

1198721015840= 1198982minus 1 1198972= 2119906+ 1 119898

2= 21199061015840

+ 1 and 1198971= 11990411198731015840+ 119873

1198981= 11990421198721015840+ 119872 Suppose that 119886

1and 1198862satisfy 2

1198861minus1

lt 1198971+

1198972minus 1 le 2

1198861 = 119873

1and 1198861198862minus1

lt 1198981+1198982minus 1 le 2

1198862 = 119873

2 Let 119871

1

1198712 and 119871

3denote the numbers of multiplication necessary

for computing the convolution (4) by using direct methodFNTT or FFT to calculate (4) (using Proposition 1) and2D overlap-save method respectively In [18] we comparedthe number of multiplications necessary for computing theconvolution (4) of two 2D sequences 119909

11989911198992

(1198991= 0 1 119897

1minus

1 1198992

= 0 1 1198981minus 1) and ℎ

11989911198992

(1198991

= 0 1 1198972minus 1

1198992= 0 1 119898

2minus 1) by three different methods

We proved the following results

(1) If 1198972lt 1198971 1198982lt 1198981 then

1198711=

11989721198982(1198972+ 1) (119898

2+ 1)

4+ (1198981minus 1198982)1198982

1198972(1198972+ 1)

2

+ (1198971minus 1198972) 1198972

1198982(1198982+ 1)

2+ (1198971minus 1198972) (1198981minus 1198982) 11989721198982

(36)

Also if 1198971= 1198981= 119897 1198972= 1198982= 1198971015840 then

1198711= (

1198971015840(2119897 minus 119897

1015840+ 1)

2)

2

(37)

(2) Consider

1198712= 21198861+1198862minus1

(31198861+ 31198862+ 2) (38)

(3) If 1198971= 1198981= 2119906+ℎ 1198972= 1198982= 2119906+ 1 119873 = 119872 = 2

119906+1and 119873

1015840= 1198721015840= 2119906 where 119906 ge 3 ℎ ge 2 then

1198711= ((2119906+ 1)2119906minus1

(2ℎ+1

minus 1))2

1198712= 22119906+2ℎ+1

(6119906 + 6ℎ + 8)

1198713= 2(2

119906+ℎ)2

(6119906 + 8)

(39)

In this section wewill suppose that1198731015840 = 1198972minus1 119872

1015840= 1198982minus

1 Let 119873 = 1198731015840+ 1198972minus 1 lt 119897

1 119872 = 119872

1015840+ 1198982minus 1 lt 119898

1 and

1198971= 11990411198731015840+119873 119898

1= 11990421198721015840+119872 For 119905

1= 0 1 119897

2minus 2 119905

2=

0 1 1198981minus 1 and 119905

1= 0 1 119897

1minus 1 119905

2= 0 1 119898

2minus 2

we computer 11991011990511199052

by using the direct methodWe have the following proposition

Proposition 6 If 1198972lt 1198971 1198982lt 1198981 then

119871 =11989721198982

4((1198972minus 1) (119898

2minus 1) + 2 (119897

2minus 1)

times (1198981minus 1198982+ 1) + 2 (119898

2minus 1) (119897

1minus 1198972+ 1))

(40)

where 119871 denotes the number of multiplication necessary forcomputing119910

11989911198992

by using the directmethod 1199051= 0 1 119897

2minus2

1199052= 0 1 119898

1minus1 and 119905

1= 0 1 119897

1minus1 1199052= 0 1 119898

2minus

2Also if 119897

1= 1198981= 119897 and 119897

2= 1198982= 1198971015840 then

119871 =

11989710158402

(1198971015840minus 1)

4(4119897 minus 3119897

1015840+ 3) (41)

Proof Let I II and III denote the number of multiplicationnecessary for computing the 119860 119861 and 119862 by direct methodrespectively where

119860 = (

11991000

sdot sdot sdot 11991001198982minus2

1199101198972minus20

sdot sdot sdot 1199101198972minus21198982minus2

)

119861 = (

11991001198982minus1

sdot sdot sdot 11991001198981minus1

1199101198972minus21198982minus1

sdot sdot sdot 1199101198972minus21198981minus1

)

119862 = (

1199101198972minus10

sdot sdot sdot 1199101198972minus11198982minus2

1199101198972minus10

sdot sdot sdot 1199101198972minus11198982minus2

)

(42)

Mathematical Problems in Engineering 9

Then

119868 = (1 + 2 + sdot sdot sdot + (1198982minus 1)) (1 + 2 + sdot sdot sdot + (119897

2minus 1))

=11989721198982(1198972minus 1) (119898

2minus 1)

4

119868119868 = 1198982(1 + 2 + sdot sdot sdot + (119897

2minus 1)) (119898

1minus 1 minus (119898

2minus 2))

=11989721198982(1198972minus 1) (119898

1minus 1198982+ 1)

2

119868119868119868 = 1198972(1 + 2 + sdot sdot sdot + (119898

2minus 1)) (119897

1minus 1 minus (119897

2minus 2))

=11989721198982(1198982minus 1) (119897

1minus 1198972+ 1)

2

(43)

So

119871 = 119868 + 119868119868 + 119868119868119868

=11989721198982

4((1198972minus 1) (119898

2minus 1) + 2 (119897

2minus 1) (119898

1minus 1198982+ 1)

+2 (1198982minus 1) (119897

1minus 1198972+ 1))

(44)

Clearly if 1198971= 1198981= 119897 and 119897

2= 1198982= 1198971015840 then (41) holds This

completes the proof

Proposition 7 If 1198971

= 1198981

= 2119906+ℎ 1198972

= 1198982

= 2119906+ 1 119873 =

119872 = 2119906+2 and119873

1015840= 1198721015840= 3sdot2

119906 where 119906 ge 3 ℎ equiv 0 (mod 2)ℎ ge 4 then

1198714= (2119906+ 1)222(119906minus1)

(2ℎ+2

minus 3)

+ (4(2ℎminus2

minus 1)

3+ 1)

2

22(119906+2)

(3119906 + 7)

(45)

where 1198714denotes the number of multiplication necessary for

computing (4) by using 2D overlap-save method

Proof Because 1198731015840

= 1198972minus 1 1198721015840 = 119898

2minus 1 1198971= 1198981= 2119906+ℎ and

1198972= 1198982= 2119906+ 1 by (41) we have

119871 = (2119906+ 1)2sdot 2119906minus2

(2119906+ℎ+2

minus 3 (2119906+ 1) + 3)

= (2119906+ 1)222(119906minus1)

(2ℎ+2

minus 3)

(46)

Compute the cyclic convolution of two sequences1199091198991+V111987310158401198992+V21198721015840 and ℎ

1015840

11989911198992

(1198991

= 0 1 2119906+2

minus 11198992

= 0 1 2119906+2

minus 1) that is compute matrix (35) byusing FNNT It is well known that using FNTT to calculatethe (35) requires

119873119872(3

2log119873119872 + 1) = 2

2(119906+2)(3119906 + 7) (47)

where 119873 = 119872 = 2119906+2

When 119873 = 119872 = 2119906+2 1198731015840 = 119872

1015840= 3 sdot 2

119906 119906 ge 3 ℎ equiv

0 (mod 2) and ℎ ge 4 then

[1198971minus 119873

1198731015840] = [

1198981minus 119872

1198721015840] = [

2119906+ℎ

minus 2119906+2

3 sdot 2119906]

= [

4 (2ℎminus2

minus 1)

3] =

4 (2ℎminus2

minus 1)

3

(48)

where 4(2ℎminus2

minus 1)3 is a positive integerSo the input matrix 119909

11989911198992

will be divided with noremainder When V

1= 0 1 [(119897

1minus 119873)119873

1015840] and V

2=

0 1 [(1198981minus119872)119872

1015840] we obtain all matrices as (35) Thus

1198714= (2119906+ 1)222(119906minus1)

(2ℎ+2

minus 3)

+ (4(2ℎminus2

minus 1)

3+ 1)

2

22(119906+2)

(3119906 + 7)

(49)

equal to (45) holds This completes the proof

Example 8 Suppose that 119906 = ℎ = 4 that is 1198971= 1198981= 256

1198972= 1198982= 17 119873 = 119872 = 64 and 119873

1015840= 1198721015840= 48 then

1198714= 3073856 (50)

If 1198971= 1198981= 256 119897

2= 1198982= 17 119873 = 119872 = 32 and 119873

1015840= 1198721015840=

16 then

1198713= 4194304 (51)

This example shows that 1198714lt 1198713in some particular cases

5 Experiments

The theoretic description of the 2D overlap-save method hasbeen provided in the preceding section This section furtherexamines how such a technique will be performed and howit will be applied to the wavelet transform Particularly wewill use image processing as an exampleThe experiment willfocus on the application of the 2D overlap-savemethod to thedyadic wavelet transform extracting the contours of Chinesehandwriting

51 Numerical Computation Let ℎ11989911198992

denote a digital filterand let a two-dimensional sequence

(ℎ11989911198992

) = (

1 0 1

1 1 0

0 1 1

) (52)

be the coefficients of the filter A two-dimensional sequence

(11990911989911198992

) =

((((

(

1 3 2 minus3 0 2 1 1

3 1 0 minus1 2 minus2 minus1 0

0 minus1 1 1 3 2 0 minus1

2 3 minus1 1 0 1 1 0

3 minus2 1 0 minus1 1 1 1

minus1 0 2 3 1 1 0 1

1 minus1 0 1 0 1 minus1 0

minus1 0 1 1 0 1 0 1

))))

)

(53)

10 Mathematical Problems in Engineering

represents the input of the filter In this example because 1198971=

1198981= 8 and 119897

2= 1198982= 3 the length of input matrix is 8 times 8

and that of the filter is 3 times 3Using the overlap-save method to calculate the output of

the filter

11991011989911198992

=

2

sum

1198961=0

2

sum

1198962=0

ℎ11989611198962

1199091198991minus11989611198992minus1198962

0le1198991minus1198961lt8

0le1198992minus1198962lt8

1198991= 0 1 2 3 4 5 6 7 119899

2= 0 1 2 3 4 5 6 7

(54)

means that the elements of the matrix

119884 = (

11991000

11991001

sdot sdot sdot 11991007

11991010

11991011

sdot sdot sdot 11991017

11991070

11991071

sdot sdot sdot 11991077

) (55)

need to be computedThe solution is given belowSince 119897

1= 1198981= 8 1198972= 1198982= 3 by selecting 119873

1015840= 1198972minus 1 =

2 and 1198721015840= 1198982minus 1 = 2 we have 119873 = 119872 = 4 In order to

use the FNTT the input matrix is divided into 9 submatricesof size 4times 4 Each consecutive submatrix is partly overlappedwith the size of 2 times 2 pixels In addition zeros of size 1 times 1

are added to the filtering sequence to ensure that its lengthis equivalent to that of the submatrix Therefore the filteringsequence ℎ

11989911198992

is extended to ℎ1015840

11989911198992

that is

ℎ1015840

11989911198992

= ℎ11989911198992

if 1198991= 0 1 2 119899

2= 0 1 2

0 if 1198991= 3 or 119899

2= 3

(56)

where 1198991= 0 1 2 3 119899

2= 0 1 2 3

Next we compute the circular convolution of the twosequences 119909

1198991+2V11198992+2V2

and ℎ1015840

11989911198992

(1198991

= 0 1 2 3 1198992

=

0 1 2 3)

11991011990511199052

=

3

sum

1198991=0

3

sum

1198992=0

ℎ1015840

11989911198992

119909⟨1199051minus1198991⟩4+2V1⟨1199052minus1198992⟩4+2V2

=

2

sum

1198991=0

2

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩4+2V1⟨1199052minus1198992⟩4+2V2

(57)

where 1199051= 0 1 2 3 119905

2= 0 1 2 3

When 1199051= 2 3 119905

2= 2 3 we arrive at the following result

11991011990511199052

=

2

sum

1198991=0

2

sum

1198992=0

ℎ11989911198992

1199091199051minus1198991+2V11199052minus1198992+2V2

= 1199101199051+2V11199052+2V2

(58)

After choosing all the parameters of V1

= 0 1 2 V2

=

0 1 2 ([(1198971minus 119873)119873

1015840] = [(119898

1minus 119872)119872

1015840] = [(8 minus 4)2] = 2)

all 2 times 2 submatrices of the matrix 119884 defined in (34) will beobtained as follows

(11991022

11991023

11991032

11991033

)(11991024

11991025

11991034

11991035

)(11991026

11991027

11991036

11991037

)

(11991042

11991043

11991052

11991053

)(11991044

11991045

11991054

11991055

)(11991046

11991047

11991056

11991057

)

(11991062

11991063

11991072

11991073

)(11991064

11991065

11991074

11991075

)(11991066

11991067

11991076

11991077

)

(59)

For 11991011990511199052

(1199051

= 0 1 1199052

= 0 1 2 3 4 5 6 7 1199051

=

0 1 2 3 4 5 6 7 1199052

= 0 1) we can compute it by usingan overlap-save method The detail of it is presented in theTechnical Report [18]

The fast number theoretic transform (FNTT) is nowapplied to the implementation of the circular convolution

11991011990511199052

=

3

sum

1198991=0

3

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩4⟨1199052minus1198992⟩4

1199051= 0 1 2 3 119905

2= 0 1 2 3

(60)

The computation is performed in the following five stepsshown in Figure 5

Step 1 (choosing 119872) Since

1003816100381610038161003816100381611991011990511199052

10038161003816100381610038161003816le

1003816100381610038161003816100381611990911989911198992

10038161003816100381610038161003816max

3

sum

1198961=0

3

sum

1198962=0

10038161003816100381610038161003816ℎ11989611198962

10038161003816100381610038161003816= 3 times 6 = 18 (61)

we can select119898 = 257 = 28+ 1 so that 18 lt 2572 where 257

is a prime Clearly 164 equiv 1 (mod257) and 16119895

equiv 1 (mod257) for 1 le 119895 le 3

Thus

11988311989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

11990911989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(62)

is a 2D number theoretic transform It has the followinginverse transform

11990911989911198992

equiv 4minus1

sdot 4minus1

3

sum

1198961=0

3

sum

1198962=0

11988311989611198962(minus16)11989911198961(minus16)11989921198962(mod 257)

1198991= 0 1 2 3 119899

2= 0 1 2 3

(63)

where 4minus1 denotes an integer so that (4minus1) sdot 4 equiv 1 (mod 257)

Mathematical Problems in Engineering 11

linear convolutionof the output matrixof the output matrix

cyclic convolutionCalculate the

of the filtering matrix

Calculate the

Calculate the numbertheoretic transformof the input matrix

Choose M

theoretic transformCalculate the number

Figure 5 Five steps of applying FNTT to calculate the output of (54)

Step 2 (calculating the number theoretic transform of inputmatrix by the FNTT) For computational convenience hereone writes

11988001198962

equiv

3

sum

1198992=0

11990901198992

1611989921198962 119880

11198962

equiv

3

sum

1198992=0

11990911198992

1611989921198962(mod 257)

11988021198962

equiv

3

sum

1198992=0

11990921198992

1611989921198962 119880

31198962

equiv

3

sum

1198992=0

11990931198992

1611989921198962(mod 257)

1198962= 0 1 2 3

(64)

Then (62) becomes

11988311989610

equiv

3

sum

1198991=0

11988011989910

1611989911198961 119883

11989611

equiv

3

sum

1198991=0

11988011989911

1611989911198961(mod 257)

11988311989612

equiv

3

sum

1198991=0

11988011989912

1611989911198961 119883

11989613

equiv

3

sum

1198991=0

11988011989913

1611989911198961(mod 257)

1198961= 0 1 2 3

(65)

Use the FNTT to calculate (64) and (65)So

(

11988000

11988001

11988002

11988003

11988010

11988011

11988012

11988013

11988020

11988021

11988022

11988023

11988030

11988031

11988032

11988033

)

equiv (

3 95 3 minus97

3 35 3 minus29

1 minus33 1 31

5 35 minus3 minus29

) (mod 257)

119883 = (

11988300

11988301

11988302

11988303

11988310

11988311

11988312

11988313

11988320

11988321

11988322

11988323

11988330

11988331

11988332

11988333

)

equiv (

12 132 4 minus124

minus30 128 98 minus128

minus4 minus8 4 minus8

34 128 minus94 minus128

) (mod 257)

(66)

Step 3 (calculating the number theoretic transformof the filterby the FNTT) The FNTT of the filter ℎ

11989911198992

is written as

11986711989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

ℎ1015840

11989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(67)

Similarly we have

119867 = (

11986700

11986701

11986702

11986703

11986710

11986711

11986712

11986713

11986720

11986721

11986722

11986723

11986730

11986731

11986732

11986733

)

equiv (

6 32 2 minus32

32 0 2 34

2 minus2 2 minus2

minus32 minus30 2 0

) (mod 257)

(68)

Step 4 (compute the number theoretic transformof the outputof the filter) From the preceding three steps we can computethe circular convolution of the filter by defining the productof 119883 and 119867 as

119884 = (

11988400

11988401

11988402

11988403

11988410

11988411

11988412

11988413

11988420

11988421

11988422

11988423

11988430

11988431

11988432

11988433

)

equiv 119883 ⊙ 119867 = (

11988300

11986700

11988301

11986701

11988302

11986702

11988303

11986703

11988310

11986710

11988311

11986711

11988312

11986712

11988313

11986713

11988320

11986720

11988321

11986721

11988322

11986722

11988323

11986723

11988330

11986730

11988331

11986731

11988332

11986732

11988333

11986733

)

equiv (

72 112 8 113

68 0 minus61 17

minus8 16 8 16

minus60 15 69 0

) (mod 257)

(69)

where

11988411989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

11991011989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(70)

12 Mathematical Problems in Engineering

Table 1 Filtering coefficients 12059521198951

119896119897 (119895 = 2) 120595(119903) are a quadratic spline wavelet

119897119896 119896 = 0 119896 = 1 119896 = 2 119896 = 3

119897 = 0 minus00838140026 minus00472041145 minus00129809398 minus00012592132119897 = 1 minus01416904181 minus00758706033 minus00196341425 minus00012698699119897 = 2 minus00651057437 minus00327749476 minus00063385521 minus00000750836119897 = 3 minus00088690016 minus00030044997 minus00001088651

(a) (b)

Figure 6 A 2-dimensional image of an aircraft was processed with 2D overlap-save method (a) Original Chinese handwriting and (b) thedivided up subimages of the character

and the 11991011989911198992

(1198991

= 0 1 2 3 1198992

= 0 1 2 3) is the circularconvolution of (60)

Step 5 (calculate the output of the linear convolution) From(63) we deduce the inverse transform of (70)

11991011989911198992

equiv 4minus1

sdot 4minus1

3

sum

1198961=0

3

sum

1198962=0

11988411989611198962(minus16)11989911198961

sdot (minus16)11989921198962(mod 257)

1198991= 0 1 2 3 119899

2= 0 1 2 3

(71)

Using FNTT to calculate (71) we have

(

11991000

11991001

11991002

11991003

11991010

11991011

11991012

11991013

11991020

11991021

11991022

11991023

11991030

11991031

11991032

11991033

) equiv (

8 6 4 0

1 7 13 1

2 2 6 4

1 5 5 7

) (mod 257)

(72)

Then the linear convolution in (58) is obtained

(11991022

11991023

11991032

11991033

) = (11991022

11991023

11991032

11991033

) = (6 4

5 7) (73)

52 Application to Image Processing The proposed methodcan be applied to many fields such as image processingand pattern recognition An example of the application to

the image processing is illustrated in Figure 6 The originalimage shown in Figure 6(a) is a 2-dimensional image of anaircraft with a size of 256 times 256 pixels that is 119897

1= 1198981

=

256 Our task is to extract its contours The discrete wavelettransform with scale 119904 = 2

119895 where 119895 = 2 was applied and thespline wavelet described in (1) of size 17 times 17 was chosenthat is 119897

2= 1198982

= 17 We use the filtering coefficientstabulated in Table 1 Using the 2D overlap-save method thisoriginal image was divided into 25 sections with each onehaving the dimension of 64 times 64 pixels that is we select119873 = 119872 = 64 1198731015840 = 119872

1015840= 48 [(119897

1minus 119873)119873

1015840] = [(119898

1minus

119872)1198721015840] = 4 (See Example 8 in Section 4) Figure 6(b)

shows these subimages The overlapped part can be explicitlyobserved in each subimage

To facilitate the presentation of the 2D overlap-savemethod the procedure of it is diagonally displayed inFigure 7 where a series of the divided subimages are illus-tratedThe image in Figure 6(a) was equivalently divided into25 sections by applying (27) In Figure 7(a) we represent 5subimages of V

0= 0 V

1= 0 V

0= 1 V

1= 1 V

0= 2 V

1= 2

and V0

= 3 V1

= 3 and V0

= 4 V1

= 4 consecutively Thelower-right corner of each subimage is repeated in the upper-left corner of its consecutive subimage Four subimages aredisplayed in Figure 7(b) and the parameters of V

0= 0 V1= 1

V0

= 1 V1

= 2 V0

= 2 V1

= 3 and V0

= 3 V1

= 4 werechosen In Figure 7(c) we selected 3 subimages of V

0= 0

V1

= 2 V0

= 1 V1

= 3 and V0

= 2 V1

= 4 There are3 subimages of V

0= 0 V

1= 3 and V

0= 1 V

1= 4 in

Figure 7(d) Figure 7(e) displays subimages of V0= 0 V

1= 4

Mathematical Problems in Engineering 13

(a) (b) (c)

(d) (e) (f)

(g) (h) (i)

Figure 7 A 2-dimensional image of an aircraft is dividing into separated small subimages the parameters of V0and V

1are chosen as follows

(a) V0= 0 V

1= 0 V

0= 1 V

1= 1 V

0= 2 V

1= 2 and V

0= 3 V

1= 3 and V

0= 4 and V

1= 4 (b) V

0= 0 V

1= 1 V

0= 1 V

1= 2 V

0= 2 V

1= 3 and

V0= 3 and V

1= 4 (c) V

0= 0 V

1= 2 V

0= 1 V

1= 3 and V

0= 2 and V

1= 4 (d) V

0= 0 V

1= 3 and V

0= 1 and V

1= 4 (e) V

0= 0 and V

1= 4 (f)

V0= 1 V

1= 0 V

0= 2 V

1= 1 V

0= 3 V

1= 2 and V

0= 4 and V

1= 3 (g) V

0= 2 V

1= 0 V

0= 3 V

1= 1 and V

0= 4 and V

1= 2 (h) V

0= 3 V

1= 0

and V0= 4 and V

1= 1 and (i) V

0= 4 and V

1= 0

In Figure 7(f) V0= 1 V

1= 0 V

0= 2 V

1= 1 V

0= 3 V

1= 2

and V0= 4 V1= 3were chosen In Figure 7(g) the parameters

were decided upon V0= 2 V

1= 0 V

0= 3 V

1= 1 and V

0= 4

V1= 2 Two subimages are shown in Figure 7(h) by selecting

V0= 3 V

1= 0 and V

0= 4 V

1= 1 There is one subimage of

V0= 4 V

1= 0 in Figure 7(i)

We select a 2D NTT

11988311989611198962

equiv

63

sum

1198991=0

63

sum

1198992=0

11990911989911198992

211989911198961211989921198962 (mod 2

32+ 1) (74)

14 Mathematical Problems in Engineering

(a) (b)

(c) (d)

Figure 8 The linear outputs of 2D overlap-save method (a) the outputs of the linear convolution of each subimages (b) the left border andthe upper border of the outputs of the image of aircraft (c) the combined outputs of linear convolution except Γ-type border and (d) theentire contour extracted using 2D overlap-save method under wavelet transform

which has inverse transform

11990911989911198992

equiv 64minus1

64minus1

63

sum

1198961=0

63

sum

1198962=0

11988311989611198962

(minus231)11989911198961

times (minus231)11989921198962

(mod 232

+ 1)

1198991= 0 1 63 119899

2= 0 1 63

(75)

where 64minus1 denotes integer so that (64minus1)64 equiv 1 (mod 2

32+

1) and |11990911989911198992

| le 255The FNTT was applied to calculate the circular convo-

lution of each subimage After applying (31) to each of thesubblocks a series of segments of the contours were obtained

By using (32) we can gradually reach the final result of thelinear convolution Figure 8(a) illustrates those pixels whichsatisfy (35) where 119897

2= 1198982= 17 119873 = 119872 = 64 1198731015840 = 119872

1015840=

48 and V1 V2

= 0 1 2 3 4 Combining them together thecontours of the whole character were obtained and displayedin Figure 8(c) which excludes the Γ-type border Next the

Γ-type border was computed by direct method Figure 8(b)shows the result Combining this result with that shown inFigure 8(c) the entire contours of the Chinese handwritingwere combined Figure 8(d) represents the entire contour

6 Conclusions

A novel approach to reduce the computation complexityof the wavelet transform has been presented in this paperTwo key techniques have been applied in this new methodnamely fast number theoretic transform (FNTT) and two-dimensional overlap-save technique In the fast numbertheoretic transform the linear convolution is replaced bythe circular convolution It can speed up the computationof 2D discrete wavelet transform Directly calculating thefast number theoretic transform to the whole input sequencemay meet two difficulties namely a big modulo obstructsthe effective implementation of the fast number theoretictransform and a long input sequence slows the computation

Mathematical Problems in Engineering 15

of the fast number theoretic transform down To fight withsuch deficiencies a new technique which is referred to as 2Doverlap-save method has been developed Experiments havebeen conducted The fast number theoretic transform and2D overlap-method have been used to implement the dyadicwavelet transform and applied to contour extraction in imageprocessing and pattern recognition

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Acknowledgments

This work was supported by the Research GrantsMYRG205(Y1-L4)-FST11-TYY and MYRG187(Y1-L3)-FST11-TYY and Chair Prof Grants RDG009FST-TYY ofUniversity of Macau as well as Macau FDC Grants T-100-2012-A3 and 026ndash2013-A This research project was alsosupported by the National Natural Science Foundation ofChina 61273244

References

[1] P L Combettes and J-C Pesquet ldquoWavelet-constrained imagerestorationrdquo International Journal of Wavelets Multiresolutionand Information Processing vol 2 no 4 pp 371ndash389 2004

[2] M Ehler and K Koch ldquoThe construction of multiwavelet bi-frames and applications to variational image denoisingrdquo Inter-national Journal of Wavelets Multiresolution and InformationProcessing vol 8 no 3 pp 431ndash455 2010

[3] P Jain and S N Merchant ldquoWavelet-based multiresolutionhistogram for fast image retrievalrdquo International Journal ofWavelets Multiresolution and Information Processing vol 2 no1 pp 59ndash73 2004

[4] S Mallat and W L Hwang ldquoSingularity detection and pro-cessing with waveletsrdquo Institute of Electrical and ElectronicsEngineers Transactions on InformationTheory vol 38 no 2 pp617ndash643 1992

[5] B U Shankar S K Meher and A Ghosh ldquoNeuro-waveletclassifier formultispectral remote sensing imagesrdquo InternationalJournal of Wavelets Multiresolution and Information Processingvol 5 no 4 pp 589ndash611 2007

[6] S Shi Y Zhang and Y Hu ldquoA wavelet-based image edgedetection and estimationmethod with adaptive scale selectionrdquoInternational Journal of Wavelets Multiresolution and Informa-tion Processing vol 8 no 3 pp 385ndash405 2010

[7] Y Y Tang Wavelets Theory Approach to Pattern RecognitionWorld Scientific Singapor 2009

[8] Q M Tieng and W Boles ldquoWavelet-based affine invariantrepresentation a tool for recognizing planar objects in 3Dspacerdquo IEEE Transactions on Pattern Analysis and MachineIntelligence vol 19 no 8 pp 921ndash925 1997

[9] P Wunsch and A F Laine ldquoWavelet descriptors for mul-tiresolution recognition of handprinted charactersrdquo PatternRecognition vol 28 no 8 pp 1237ndash1249 1995

[10] H Yin and H Liu ldquoA Bregman iterative regularization methodfor wavelet-based image deblurringrdquo International Journal of

Wavelets Multiresolution and Information Processing vol 8 no3 pp 485ndash499 2010

[11] X You and Y Y Tang ldquoWavelet-based approach to characterskeletonrdquo IEEE Transactions on Image Processing vol 16 no 5pp 1220ndash1231 2007

[12] T Zhang Q Fan and Q Gao ldquoWavelet characterization ofHardy space ℎ

1 and its application in variational image decom-positionrdquo International Journal of Wavelets Multiresolution andInformation Processing vol 8 no 1 pp 71ndash87 2010

[13] Y Y Tang L Y Li Feng and J Liu ldquoScale-independent waveletalgorithm for detecting step-structure edgesrdquo Tech Rep IEEETransactions on InformationTheory Brisbane Australia 1998

[14] S G Mallat ldquoMultiresolution approximations and waveletorthonormal bases of 119871

2(R)rdquo Transactions of the American

Mathematical Society vol 315 no 1 pp 69ndash87 1989[15] J H McClellan and C M Rader Number Theory in Digital Sig-

nal Processing Prentice Hall Signal Processing Series PrenticeHall Englewood Cliffs NJ USA 1979

[16] X Ran and K J R Liu ldquoFast algorithms for 2-D circularconvolutions and number theoretic transforms based on poly-nomial transforms over finite ringsrdquo IEEE Transactions onSignal Processing vol 43 no 3 pp 569ndash578 1995

[17] Q Sun ldquoSome results in the application of the number theoryto digital signal processing and public-key systemsrdquo in NumberTheory and Its Applications in China vol 77 of ContemporaryMathematics pp 107ndash112 American Mathematical SocietyProvidence RI USA 1988

[18] Y Y Tang Q Sun L H Yang and L Feng ldquoAn overlap-save method for the calculation of the two-dimensional digitalconvolutionrdquo Tech Rep Department of Computer ScienceHong Kong Baptist University 1998

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 7: Research Article Implementation of 2D Discrete Wavelet ...downloads.hindawi.com/journals/mpe/2014/532979.pdfResearch Article Implementation of 2D Discrete Wavelet Transform by Number

Mathematical Problems in Engineering 7

Obviously if the first 1198972minus 1 data in rows and the first 119898

2minus 1

data in columns are discarded from the dashed rectangle thedarkened rectangle can be obtained In the following we willexplain how to obtain the result of (4)

The output of the whole equation (4) can be representedin the following matrix

119884 = (

11991000

sdot sdot sdot sdot sdot sdot 11991001198981minus1

1199101198971minus10

sdot sdot sdot sdot sdot sdot 1199101198971minus11198981minus1

) (33)

which is an 1198971times 1198981matrix

So (32) gives a1198731015840times1198721015840 submatrix of matrix 119884 (note that

1198731015840= 119873 minus 119897

2+ 1 and that 1198721015840 = 119872 minus 119898

2+ 1)

(

1199101198972minus1+V111987310158401198982minus1+V21198721015840 sdot sdot sdot sdot sdot sdot 119910

1198972minus1+V11198731015840119872minus1+V

21198721015840

119910119873minus1+V

111987310158401198982minus1+V21198721015840 sdot sdot sdot sdot sdot sdot 119910

119873minus1+V11198731015840119872minus1+V

21198721015840

) (34)

Next to obtain the whole result we need to compute the cir-cular convolution of two 2D sequences 119909

1198991+(V1+1)119873

10158401198992+(V2+1)119872

1015840

and ℎ1015840

11989911198992

(1198991

= 0 1 119873 minus 1 1198992

= 0 1 119872 minus 1) Withthe same reasoning as above a consecutive submatrix of thematrix (34) is evinced as follows

(

119910119873+V11198731015840119872+V

21198721015840 sdot sdot sdot sdot sdot sdot 119910

119873+V11198731015840119872+119872

1015840minus1+V21198721015840

119910119873+119873

1015840minus1+V11198731015840119872+V

21198721015840 sdot sdot sdot sdot sdot sdot 119910

119873+1198731015840minus1+V11198731015840119872+119872

1015840minus1+V21198721015840

)

(35)

The corresponding graphic description is indicated inFigure 2(b) We will darken the rectangle in Figure 2(b) toexpress the submatrix (35) and the dashed one on its upper-left-corner to be the graphic description of the submatrix(34)

Clearly if (V1 V2) = (V10158401 V10158402) then (119905

1+ V11198731015840 1199052

+

V21198721015840) = (1199051015840

1+ V101584011198731015840 1199051015840

2+ V101584021198721015840) where 119897

2minus 1 le 119905

1 1199051015840

1le

119873 minus 1 1198982minus 1 le 119905

2and 1199051015840

2le 119872 minus 1 Let [119909] represent

the largest integer that is less than or equal to the realnumber 119909 therefore when V

1= 0 1 [(119897

1minus 119873)119873

1015840] and

V2

= 0 1 [(1198981minus 119872)119872

1015840] we will obtain all 1198731015840 times 119872

1015840

submatrices of thematrix119884 If 1198971= 11990411198731015840+119873 and119898

1= 11990421198721015840+

119872 then [(1198971minus 119873)119873

1015840] = (1198971minus 119873)119873

1015840 and [(1198981minus 119872)119872

1015840] =

(1198981minus119872)119872

1015840 The input matrix 11990911989911198992

will be divided with noremainder Figure 3 displays a series of small rectangles Eachrectangle stands for one1198731015840times119872

1015840 submatrixThe entirematrix119884 can be obtained by combining them

In Figure 3 there is a white Γ-type area indicating thatthere are no output data Two calculation methods canbe applied to obtain the data The first way is by using adirect method because only a few computations are neededAlternatively we can compute the data of Γ-type area with theoverlap-savemethod proposed above if1198731015840 = 119897

2minus1 and119872

1015840=

1198982minus 1 The detail of it is presented in the Technical Report

[18] The entire result is completed and is demonstrated inFigure 4 graphically

The two-dimensional overlap-save method is summa-rized as follows

m

n

Figure 3 All 1198731015840

times 1198721015840 submatrices of the output except the

boundary of Γ-type area

m

n

Figure 4 The full result of (4) computed by 2D overlap-savemethod where 119897

1= 11990411198731015840+ 119873 119898

1= 11990421198721015840+ 119872 and 119873

1015840+ 1198972minus 1 =

119873 lt 1198971and 119872

1015840+ 1198982minus 1 = 119872 lt 119898

1

(i) Select two positive integers 1198731015840 and 119872

1015840 so that 1198731015840 +1198972minus 1 = 119873 lt 119897

1and 119872

1015840+ 1198982minus 1 = 119872 lt 119898

1 Either

119873 or119872 is given by an integer power of 2 for using anFFT that is 119873 = 2

1198891 and 119872 = 2

1198892 where 119889

1and 119889

2

are two positive integers

(ii) Let ℎ101584011989911198992

satisfy (28)

(iii) Compute the circular convolution of two sequences1199091198991+V111987310158401198992+V21198721015840 and ℎ

1015840

11989911198992

(1198991

= 0 1 119873 minus 1 1198992

=

0 1 119872 minus 1) When 1199051

= 1198972minus 1 119873 minus 1 119905

2=

1198982minus 1 119872 minus 1 and V

1= 0 1 [(119897

1minus 119873)119873

1015840]

V2= 0 1 [(119898

1minus 119872)119872

1015840] we obtain all 1198731015840 times 119872

1015840

submatrices of the matrix of 119884 whose form is as (34)

8 Mathematical Problems in Engineering

If 1198971

= 11990411198731015840+ 119873 and 119898

1= 11990421198721015840+ 119872 then [(119897

1minus

119873)1198731015840] = (1198971minus 119873)119873

1015840 and [(1198981minus 119872)119872

1015840] = (119898

1minus

119872)1198721015840 The input matrix 119909

11989911198992

will be divided withno remainder

(iv) For 1199051= 0 1 119897

2minus 2 1199052= 0 1 119898

1minus 1 and 119905

1=

0 1 1198971minus 1 119905

2= 0 1 119898

2minus 2 compute 119910

11990511199052

byusing the direct method

If 1198731015840 = 1198972minus 1 and 119872

1015840= 1198982minus 1 we will add zeros

to the sequence 11990911989911198992

so that the 2D sequences are oflengths 119897

1+ 1198731015840 and 119898

1+ 1198721015840 Then we will compute

11991011989911198992

(1199051

= 0 1 1198972minus 2 1199052

= 0 1 1198981minus 1 and

1199051= 0 1 119897

1minus 1 1199052= 0 1 119898

2minus 2) by using an

overlap-save method The detail of it is presented inthe Technical Report [18]

We will introduce the way of using FNTT and 2Doverlap-save method with two examples One is numericalcomputation and the other is an experiment of extracting thecontour of a Chinese handwritten character

4 Comparison of the Numbersof Multiplication

Let119873 = 1198731015840+ 1198972minus 1 lt 119897

1119872 = 119872

1015840+1198982minus 1 lt 119898

11198731015840 = 119897

2minus 1

1198721015840= 1198982minus 1 1198972= 2119906+ 1 119898

2= 21199061015840

+ 1 and 1198971= 11990411198731015840+ 119873

1198981= 11990421198721015840+ 119872 Suppose that 119886

1and 1198862satisfy 2

1198861minus1

lt 1198971+

1198972minus 1 le 2

1198861 = 119873

1and 1198861198862minus1

lt 1198981+1198982minus 1 le 2

1198862 = 119873

2 Let 119871

1

1198712 and 119871

3denote the numbers of multiplication necessary

for computing the convolution (4) by using direct methodFNTT or FFT to calculate (4) (using Proposition 1) and2D overlap-save method respectively In [18] we comparedthe number of multiplications necessary for computing theconvolution (4) of two 2D sequences 119909

11989911198992

(1198991= 0 1 119897

1minus

1 1198992

= 0 1 1198981minus 1) and ℎ

11989911198992

(1198991

= 0 1 1198972minus 1

1198992= 0 1 119898

2minus 1) by three different methods

We proved the following results

(1) If 1198972lt 1198971 1198982lt 1198981 then

1198711=

11989721198982(1198972+ 1) (119898

2+ 1)

4+ (1198981minus 1198982)1198982

1198972(1198972+ 1)

2

+ (1198971minus 1198972) 1198972

1198982(1198982+ 1)

2+ (1198971minus 1198972) (1198981minus 1198982) 11989721198982

(36)

Also if 1198971= 1198981= 119897 1198972= 1198982= 1198971015840 then

1198711= (

1198971015840(2119897 minus 119897

1015840+ 1)

2)

2

(37)

(2) Consider

1198712= 21198861+1198862minus1

(31198861+ 31198862+ 2) (38)

(3) If 1198971= 1198981= 2119906+ℎ 1198972= 1198982= 2119906+ 1 119873 = 119872 = 2

119906+1and 119873

1015840= 1198721015840= 2119906 where 119906 ge 3 ℎ ge 2 then

1198711= ((2119906+ 1)2119906minus1

(2ℎ+1

minus 1))2

1198712= 22119906+2ℎ+1

(6119906 + 6ℎ + 8)

1198713= 2(2

119906+ℎ)2

(6119906 + 8)

(39)

In this section wewill suppose that1198731015840 = 1198972minus1 119872

1015840= 1198982minus

1 Let 119873 = 1198731015840+ 1198972minus 1 lt 119897

1 119872 = 119872

1015840+ 1198982minus 1 lt 119898

1 and

1198971= 11990411198731015840+119873 119898

1= 11990421198721015840+119872 For 119905

1= 0 1 119897

2minus 2 119905

2=

0 1 1198981minus 1 and 119905

1= 0 1 119897

1minus 1 119905

2= 0 1 119898

2minus 2

we computer 11991011990511199052

by using the direct methodWe have the following proposition

Proposition 6 If 1198972lt 1198971 1198982lt 1198981 then

119871 =11989721198982

4((1198972minus 1) (119898

2minus 1) + 2 (119897

2minus 1)

times (1198981minus 1198982+ 1) + 2 (119898

2minus 1) (119897

1minus 1198972+ 1))

(40)

where 119871 denotes the number of multiplication necessary forcomputing119910

11989911198992

by using the directmethod 1199051= 0 1 119897

2minus2

1199052= 0 1 119898

1minus1 and 119905

1= 0 1 119897

1minus1 1199052= 0 1 119898

2minus

2Also if 119897

1= 1198981= 119897 and 119897

2= 1198982= 1198971015840 then

119871 =

11989710158402

(1198971015840minus 1)

4(4119897 minus 3119897

1015840+ 3) (41)

Proof Let I II and III denote the number of multiplicationnecessary for computing the 119860 119861 and 119862 by direct methodrespectively where

119860 = (

11991000

sdot sdot sdot 11991001198982minus2

1199101198972minus20

sdot sdot sdot 1199101198972minus21198982minus2

)

119861 = (

11991001198982minus1

sdot sdot sdot 11991001198981minus1

1199101198972minus21198982minus1

sdot sdot sdot 1199101198972minus21198981minus1

)

119862 = (

1199101198972minus10

sdot sdot sdot 1199101198972minus11198982minus2

1199101198972minus10

sdot sdot sdot 1199101198972minus11198982minus2

)

(42)

Mathematical Problems in Engineering 9

Then

119868 = (1 + 2 + sdot sdot sdot + (1198982minus 1)) (1 + 2 + sdot sdot sdot + (119897

2minus 1))

=11989721198982(1198972minus 1) (119898

2minus 1)

4

119868119868 = 1198982(1 + 2 + sdot sdot sdot + (119897

2minus 1)) (119898

1minus 1 minus (119898

2minus 2))

=11989721198982(1198972minus 1) (119898

1minus 1198982+ 1)

2

119868119868119868 = 1198972(1 + 2 + sdot sdot sdot + (119898

2minus 1)) (119897

1minus 1 minus (119897

2minus 2))

=11989721198982(1198982minus 1) (119897

1minus 1198972+ 1)

2

(43)

So

119871 = 119868 + 119868119868 + 119868119868119868

=11989721198982

4((1198972minus 1) (119898

2minus 1) + 2 (119897

2minus 1) (119898

1minus 1198982+ 1)

+2 (1198982minus 1) (119897

1minus 1198972+ 1))

(44)

Clearly if 1198971= 1198981= 119897 and 119897

2= 1198982= 1198971015840 then (41) holds This

completes the proof

Proposition 7 If 1198971

= 1198981

= 2119906+ℎ 1198972

= 1198982

= 2119906+ 1 119873 =

119872 = 2119906+2 and119873

1015840= 1198721015840= 3sdot2

119906 where 119906 ge 3 ℎ equiv 0 (mod 2)ℎ ge 4 then

1198714= (2119906+ 1)222(119906minus1)

(2ℎ+2

minus 3)

+ (4(2ℎminus2

minus 1)

3+ 1)

2

22(119906+2)

(3119906 + 7)

(45)

where 1198714denotes the number of multiplication necessary for

computing (4) by using 2D overlap-save method

Proof Because 1198731015840

= 1198972minus 1 1198721015840 = 119898

2minus 1 1198971= 1198981= 2119906+ℎ and

1198972= 1198982= 2119906+ 1 by (41) we have

119871 = (2119906+ 1)2sdot 2119906minus2

(2119906+ℎ+2

minus 3 (2119906+ 1) + 3)

= (2119906+ 1)222(119906minus1)

(2ℎ+2

minus 3)

(46)

Compute the cyclic convolution of two sequences1199091198991+V111987310158401198992+V21198721015840 and ℎ

1015840

11989911198992

(1198991

= 0 1 2119906+2

minus 11198992

= 0 1 2119906+2

minus 1) that is compute matrix (35) byusing FNNT It is well known that using FNTT to calculatethe (35) requires

119873119872(3

2log119873119872 + 1) = 2

2(119906+2)(3119906 + 7) (47)

where 119873 = 119872 = 2119906+2

When 119873 = 119872 = 2119906+2 1198731015840 = 119872

1015840= 3 sdot 2

119906 119906 ge 3 ℎ equiv

0 (mod 2) and ℎ ge 4 then

[1198971minus 119873

1198731015840] = [

1198981minus 119872

1198721015840] = [

2119906+ℎ

minus 2119906+2

3 sdot 2119906]

= [

4 (2ℎminus2

minus 1)

3] =

4 (2ℎminus2

minus 1)

3

(48)

where 4(2ℎminus2

minus 1)3 is a positive integerSo the input matrix 119909

11989911198992

will be divided with noremainder When V

1= 0 1 [(119897

1minus 119873)119873

1015840] and V

2=

0 1 [(1198981minus119872)119872

1015840] we obtain all matrices as (35) Thus

1198714= (2119906+ 1)222(119906minus1)

(2ℎ+2

minus 3)

+ (4(2ℎminus2

minus 1)

3+ 1)

2

22(119906+2)

(3119906 + 7)

(49)

equal to (45) holds This completes the proof

Example 8 Suppose that 119906 = ℎ = 4 that is 1198971= 1198981= 256

1198972= 1198982= 17 119873 = 119872 = 64 and 119873

1015840= 1198721015840= 48 then

1198714= 3073856 (50)

If 1198971= 1198981= 256 119897

2= 1198982= 17 119873 = 119872 = 32 and 119873

1015840= 1198721015840=

16 then

1198713= 4194304 (51)

This example shows that 1198714lt 1198713in some particular cases

5 Experiments

The theoretic description of the 2D overlap-save method hasbeen provided in the preceding section This section furtherexamines how such a technique will be performed and howit will be applied to the wavelet transform Particularly wewill use image processing as an exampleThe experiment willfocus on the application of the 2D overlap-savemethod to thedyadic wavelet transform extracting the contours of Chinesehandwriting

51 Numerical Computation Let ℎ11989911198992

denote a digital filterand let a two-dimensional sequence

(ℎ11989911198992

) = (

1 0 1

1 1 0

0 1 1

) (52)

be the coefficients of the filter A two-dimensional sequence

(11990911989911198992

) =

((((

(

1 3 2 minus3 0 2 1 1

3 1 0 minus1 2 minus2 minus1 0

0 minus1 1 1 3 2 0 minus1

2 3 minus1 1 0 1 1 0

3 minus2 1 0 minus1 1 1 1

minus1 0 2 3 1 1 0 1

1 minus1 0 1 0 1 minus1 0

minus1 0 1 1 0 1 0 1

))))

)

(53)

10 Mathematical Problems in Engineering

represents the input of the filter In this example because 1198971=

1198981= 8 and 119897

2= 1198982= 3 the length of input matrix is 8 times 8

and that of the filter is 3 times 3Using the overlap-save method to calculate the output of

the filter

11991011989911198992

=

2

sum

1198961=0

2

sum

1198962=0

ℎ11989611198962

1199091198991minus11989611198992minus1198962

0le1198991minus1198961lt8

0le1198992minus1198962lt8

1198991= 0 1 2 3 4 5 6 7 119899

2= 0 1 2 3 4 5 6 7

(54)

means that the elements of the matrix

119884 = (

11991000

11991001

sdot sdot sdot 11991007

11991010

11991011

sdot sdot sdot 11991017

11991070

11991071

sdot sdot sdot 11991077

) (55)

need to be computedThe solution is given belowSince 119897

1= 1198981= 8 1198972= 1198982= 3 by selecting 119873

1015840= 1198972minus 1 =

2 and 1198721015840= 1198982minus 1 = 2 we have 119873 = 119872 = 4 In order to

use the FNTT the input matrix is divided into 9 submatricesof size 4times 4 Each consecutive submatrix is partly overlappedwith the size of 2 times 2 pixels In addition zeros of size 1 times 1

are added to the filtering sequence to ensure that its lengthis equivalent to that of the submatrix Therefore the filteringsequence ℎ

11989911198992

is extended to ℎ1015840

11989911198992

that is

ℎ1015840

11989911198992

= ℎ11989911198992

if 1198991= 0 1 2 119899

2= 0 1 2

0 if 1198991= 3 or 119899

2= 3

(56)

where 1198991= 0 1 2 3 119899

2= 0 1 2 3

Next we compute the circular convolution of the twosequences 119909

1198991+2V11198992+2V2

and ℎ1015840

11989911198992

(1198991

= 0 1 2 3 1198992

=

0 1 2 3)

11991011990511199052

=

3

sum

1198991=0

3

sum

1198992=0

ℎ1015840

11989911198992

119909⟨1199051minus1198991⟩4+2V1⟨1199052minus1198992⟩4+2V2

=

2

sum

1198991=0

2

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩4+2V1⟨1199052minus1198992⟩4+2V2

(57)

where 1199051= 0 1 2 3 119905

2= 0 1 2 3

When 1199051= 2 3 119905

2= 2 3 we arrive at the following result

11991011990511199052

=

2

sum

1198991=0

2

sum

1198992=0

ℎ11989911198992

1199091199051minus1198991+2V11199052minus1198992+2V2

= 1199101199051+2V11199052+2V2

(58)

After choosing all the parameters of V1

= 0 1 2 V2

=

0 1 2 ([(1198971minus 119873)119873

1015840] = [(119898

1minus 119872)119872

1015840] = [(8 minus 4)2] = 2)

all 2 times 2 submatrices of the matrix 119884 defined in (34) will beobtained as follows

(11991022

11991023

11991032

11991033

)(11991024

11991025

11991034

11991035

)(11991026

11991027

11991036

11991037

)

(11991042

11991043

11991052

11991053

)(11991044

11991045

11991054

11991055

)(11991046

11991047

11991056

11991057

)

(11991062

11991063

11991072

11991073

)(11991064

11991065

11991074

11991075

)(11991066

11991067

11991076

11991077

)

(59)

For 11991011990511199052

(1199051

= 0 1 1199052

= 0 1 2 3 4 5 6 7 1199051

=

0 1 2 3 4 5 6 7 1199052

= 0 1) we can compute it by usingan overlap-save method The detail of it is presented in theTechnical Report [18]

The fast number theoretic transform (FNTT) is nowapplied to the implementation of the circular convolution

11991011990511199052

=

3

sum

1198991=0

3

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩4⟨1199052minus1198992⟩4

1199051= 0 1 2 3 119905

2= 0 1 2 3

(60)

The computation is performed in the following five stepsshown in Figure 5

Step 1 (choosing 119872) Since

1003816100381610038161003816100381611991011990511199052

10038161003816100381610038161003816le

1003816100381610038161003816100381611990911989911198992

10038161003816100381610038161003816max

3

sum

1198961=0

3

sum

1198962=0

10038161003816100381610038161003816ℎ11989611198962

10038161003816100381610038161003816= 3 times 6 = 18 (61)

we can select119898 = 257 = 28+ 1 so that 18 lt 2572 where 257

is a prime Clearly 164 equiv 1 (mod257) and 16119895

equiv 1 (mod257) for 1 le 119895 le 3

Thus

11988311989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

11990911989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(62)

is a 2D number theoretic transform It has the followinginverse transform

11990911989911198992

equiv 4minus1

sdot 4minus1

3

sum

1198961=0

3

sum

1198962=0

11988311989611198962(minus16)11989911198961(minus16)11989921198962(mod 257)

1198991= 0 1 2 3 119899

2= 0 1 2 3

(63)

where 4minus1 denotes an integer so that (4minus1) sdot 4 equiv 1 (mod 257)

Mathematical Problems in Engineering 11

linear convolutionof the output matrixof the output matrix

cyclic convolutionCalculate the

of the filtering matrix

Calculate the

Calculate the numbertheoretic transformof the input matrix

Choose M

theoretic transformCalculate the number

Figure 5 Five steps of applying FNTT to calculate the output of (54)

Step 2 (calculating the number theoretic transform of inputmatrix by the FNTT) For computational convenience hereone writes

11988001198962

equiv

3

sum

1198992=0

11990901198992

1611989921198962 119880

11198962

equiv

3

sum

1198992=0

11990911198992

1611989921198962(mod 257)

11988021198962

equiv

3

sum

1198992=0

11990921198992

1611989921198962 119880

31198962

equiv

3

sum

1198992=0

11990931198992

1611989921198962(mod 257)

1198962= 0 1 2 3

(64)

Then (62) becomes

11988311989610

equiv

3

sum

1198991=0

11988011989910

1611989911198961 119883

11989611

equiv

3

sum

1198991=0

11988011989911

1611989911198961(mod 257)

11988311989612

equiv

3

sum

1198991=0

11988011989912

1611989911198961 119883

11989613

equiv

3

sum

1198991=0

11988011989913

1611989911198961(mod 257)

1198961= 0 1 2 3

(65)

Use the FNTT to calculate (64) and (65)So

(

11988000

11988001

11988002

11988003

11988010

11988011

11988012

11988013

11988020

11988021

11988022

11988023

11988030

11988031

11988032

11988033

)

equiv (

3 95 3 minus97

3 35 3 minus29

1 minus33 1 31

5 35 minus3 minus29

) (mod 257)

119883 = (

11988300

11988301

11988302

11988303

11988310

11988311

11988312

11988313

11988320

11988321

11988322

11988323

11988330

11988331

11988332

11988333

)

equiv (

12 132 4 minus124

minus30 128 98 minus128

minus4 minus8 4 minus8

34 128 minus94 minus128

) (mod 257)

(66)

Step 3 (calculating the number theoretic transformof the filterby the FNTT) The FNTT of the filter ℎ

11989911198992

is written as

11986711989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

ℎ1015840

11989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(67)

Similarly we have

119867 = (

11986700

11986701

11986702

11986703

11986710

11986711

11986712

11986713

11986720

11986721

11986722

11986723

11986730

11986731

11986732

11986733

)

equiv (

6 32 2 minus32

32 0 2 34

2 minus2 2 minus2

minus32 minus30 2 0

) (mod 257)

(68)

Step 4 (compute the number theoretic transformof the outputof the filter) From the preceding three steps we can computethe circular convolution of the filter by defining the productof 119883 and 119867 as

119884 = (

11988400

11988401

11988402

11988403

11988410

11988411

11988412

11988413

11988420

11988421

11988422

11988423

11988430

11988431

11988432

11988433

)

equiv 119883 ⊙ 119867 = (

11988300

11986700

11988301

11986701

11988302

11986702

11988303

11986703

11988310

11986710

11988311

11986711

11988312

11986712

11988313

11986713

11988320

11986720

11988321

11986721

11988322

11986722

11988323

11986723

11988330

11986730

11988331

11986731

11988332

11986732

11988333

11986733

)

equiv (

72 112 8 113

68 0 minus61 17

minus8 16 8 16

minus60 15 69 0

) (mod 257)

(69)

where

11988411989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

11991011989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(70)

12 Mathematical Problems in Engineering

Table 1 Filtering coefficients 12059521198951

119896119897 (119895 = 2) 120595(119903) are a quadratic spline wavelet

119897119896 119896 = 0 119896 = 1 119896 = 2 119896 = 3

119897 = 0 minus00838140026 minus00472041145 minus00129809398 minus00012592132119897 = 1 minus01416904181 minus00758706033 minus00196341425 minus00012698699119897 = 2 minus00651057437 minus00327749476 minus00063385521 minus00000750836119897 = 3 minus00088690016 minus00030044997 minus00001088651

(a) (b)

Figure 6 A 2-dimensional image of an aircraft was processed with 2D overlap-save method (a) Original Chinese handwriting and (b) thedivided up subimages of the character

and the 11991011989911198992

(1198991

= 0 1 2 3 1198992

= 0 1 2 3) is the circularconvolution of (60)

Step 5 (calculate the output of the linear convolution) From(63) we deduce the inverse transform of (70)

11991011989911198992

equiv 4minus1

sdot 4minus1

3

sum

1198961=0

3

sum

1198962=0

11988411989611198962(minus16)11989911198961

sdot (minus16)11989921198962(mod 257)

1198991= 0 1 2 3 119899

2= 0 1 2 3

(71)

Using FNTT to calculate (71) we have

(

11991000

11991001

11991002

11991003

11991010

11991011

11991012

11991013

11991020

11991021

11991022

11991023

11991030

11991031

11991032

11991033

) equiv (

8 6 4 0

1 7 13 1

2 2 6 4

1 5 5 7

) (mod 257)

(72)

Then the linear convolution in (58) is obtained

(11991022

11991023

11991032

11991033

) = (11991022

11991023

11991032

11991033

) = (6 4

5 7) (73)

52 Application to Image Processing The proposed methodcan be applied to many fields such as image processingand pattern recognition An example of the application to

the image processing is illustrated in Figure 6 The originalimage shown in Figure 6(a) is a 2-dimensional image of anaircraft with a size of 256 times 256 pixels that is 119897

1= 1198981

=

256 Our task is to extract its contours The discrete wavelettransform with scale 119904 = 2

119895 where 119895 = 2 was applied and thespline wavelet described in (1) of size 17 times 17 was chosenthat is 119897

2= 1198982

= 17 We use the filtering coefficientstabulated in Table 1 Using the 2D overlap-save method thisoriginal image was divided into 25 sections with each onehaving the dimension of 64 times 64 pixels that is we select119873 = 119872 = 64 1198731015840 = 119872

1015840= 48 [(119897

1minus 119873)119873

1015840] = [(119898

1minus

119872)1198721015840] = 4 (See Example 8 in Section 4) Figure 6(b)

shows these subimages The overlapped part can be explicitlyobserved in each subimage

To facilitate the presentation of the 2D overlap-savemethod the procedure of it is diagonally displayed inFigure 7 where a series of the divided subimages are illus-tratedThe image in Figure 6(a) was equivalently divided into25 sections by applying (27) In Figure 7(a) we represent 5subimages of V

0= 0 V

1= 0 V

0= 1 V

1= 1 V

0= 2 V

1= 2

and V0

= 3 V1

= 3 and V0

= 4 V1

= 4 consecutively Thelower-right corner of each subimage is repeated in the upper-left corner of its consecutive subimage Four subimages aredisplayed in Figure 7(b) and the parameters of V

0= 0 V1= 1

V0

= 1 V1

= 2 V0

= 2 V1

= 3 and V0

= 3 V1

= 4 werechosen In Figure 7(c) we selected 3 subimages of V

0= 0

V1

= 2 V0

= 1 V1

= 3 and V0

= 2 V1

= 4 There are3 subimages of V

0= 0 V

1= 3 and V

0= 1 V

1= 4 in

Figure 7(d) Figure 7(e) displays subimages of V0= 0 V

1= 4

Mathematical Problems in Engineering 13

(a) (b) (c)

(d) (e) (f)

(g) (h) (i)

Figure 7 A 2-dimensional image of an aircraft is dividing into separated small subimages the parameters of V0and V

1are chosen as follows

(a) V0= 0 V

1= 0 V

0= 1 V

1= 1 V

0= 2 V

1= 2 and V

0= 3 V

1= 3 and V

0= 4 and V

1= 4 (b) V

0= 0 V

1= 1 V

0= 1 V

1= 2 V

0= 2 V

1= 3 and

V0= 3 and V

1= 4 (c) V

0= 0 V

1= 2 V

0= 1 V

1= 3 and V

0= 2 and V

1= 4 (d) V

0= 0 V

1= 3 and V

0= 1 and V

1= 4 (e) V

0= 0 and V

1= 4 (f)

V0= 1 V

1= 0 V

0= 2 V

1= 1 V

0= 3 V

1= 2 and V

0= 4 and V

1= 3 (g) V

0= 2 V

1= 0 V

0= 3 V

1= 1 and V

0= 4 and V

1= 2 (h) V

0= 3 V

1= 0

and V0= 4 and V

1= 1 and (i) V

0= 4 and V

1= 0

In Figure 7(f) V0= 1 V

1= 0 V

0= 2 V

1= 1 V

0= 3 V

1= 2

and V0= 4 V1= 3were chosen In Figure 7(g) the parameters

were decided upon V0= 2 V

1= 0 V

0= 3 V

1= 1 and V

0= 4

V1= 2 Two subimages are shown in Figure 7(h) by selecting

V0= 3 V

1= 0 and V

0= 4 V

1= 1 There is one subimage of

V0= 4 V

1= 0 in Figure 7(i)

We select a 2D NTT

11988311989611198962

equiv

63

sum

1198991=0

63

sum

1198992=0

11990911989911198992

211989911198961211989921198962 (mod 2

32+ 1) (74)

14 Mathematical Problems in Engineering

(a) (b)

(c) (d)

Figure 8 The linear outputs of 2D overlap-save method (a) the outputs of the linear convolution of each subimages (b) the left border andthe upper border of the outputs of the image of aircraft (c) the combined outputs of linear convolution except Γ-type border and (d) theentire contour extracted using 2D overlap-save method under wavelet transform

which has inverse transform

11990911989911198992

equiv 64minus1

64minus1

63

sum

1198961=0

63

sum

1198962=0

11988311989611198962

(minus231)11989911198961

times (minus231)11989921198962

(mod 232

+ 1)

1198991= 0 1 63 119899

2= 0 1 63

(75)

where 64minus1 denotes integer so that (64minus1)64 equiv 1 (mod 2

32+

1) and |11990911989911198992

| le 255The FNTT was applied to calculate the circular convo-

lution of each subimage After applying (31) to each of thesubblocks a series of segments of the contours were obtained

By using (32) we can gradually reach the final result of thelinear convolution Figure 8(a) illustrates those pixels whichsatisfy (35) where 119897

2= 1198982= 17 119873 = 119872 = 64 1198731015840 = 119872

1015840=

48 and V1 V2

= 0 1 2 3 4 Combining them together thecontours of the whole character were obtained and displayedin Figure 8(c) which excludes the Γ-type border Next the

Γ-type border was computed by direct method Figure 8(b)shows the result Combining this result with that shown inFigure 8(c) the entire contours of the Chinese handwritingwere combined Figure 8(d) represents the entire contour

6 Conclusions

A novel approach to reduce the computation complexityof the wavelet transform has been presented in this paperTwo key techniques have been applied in this new methodnamely fast number theoretic transform (FNTT) and two-dimensional overlap-save technique In the fast numbertheoretic transform the linear convolution is replaced bythe circular convolution It can speed up the computationof 2D discrete wavelet transform Directly calculating thefast number theoretic transform to the whole input sequencemay meet two difficulties namely a big modulo obstructsthe effective implementation of the fast number theoretictransform and a long input sequence slows the computation

Mathematical Problems in Engineering 15

of the fast number theoretic transform down To fight withsuch deficiencies a new technique which is referred to as 2Doverlap-save method has been developed Experiments havebeen conducted The fast number theoretic transform and2D overlap-method have been used to implement the dyadicwavelet transform and applied to contour extraction in imageprocessing and pattern recognition

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Acknowledgments

This work was supported by the Research GrantsMYRG205(Y1-L4)-FST11-TYY and MYRG187(Y1-L3)-FST11-TYY and Chair Prof Grants RDG009FST-TYY ofUniversity of Macau as well as Macau FDC Grants T-100-2012-A3 and 026ndash2013-A This research project was alsosupported by the National Natural Science Foundation ofChina 61273244

References

[1] P L Combettes and J-C Pesquet ldquoWavelet-constrained imagerestorationrdquo International Journal of Wavelets Multiresolutionand Information Processing vol 2 no 4 pp 371ndash389 2004

[2] M Ehler and K Koch ldquoThe construction of multiwavelet bi-frames and applications to variational image denoisingrdquo Inter-national Journal of Wavelets Multiresolution and InformationProcessing vol 8 no 3 pp 431ndash455 2010

[3] P Jain and S N Merchant ldquoWavelet-based multiresolutionhistogram for fast image retrievalrdquo International Journal ofWavelets Multiresolution and Information Processing vol 2 no1 pp 59ndash73 2004

[4] S Mallat and W L Hwang ldquoSingularity detection and pro-cessing with waveletsrdquo Institute of Electrical and ElectronicsEngineers Transactions on InformationTheory vol 38 no 2 pp617ndash643 1992

[5] B U Shankar S K Meher and A Ghosh ldquoNeuro-waveletclassifier formultispectral remote sensing imagesrdquo InternationalJournal of Wavelets Multiresolution and Information Processingvol 5 no 4 pp 589ndash611 2007

[6] S Shi Y Zhang and Y Hu ldquoA wavelet-based image edgedetection and estimationmethod with adaptive scale selectionrdquoInternational Journal of Wavelets Multiresolution and Informa-tion Processing vol 8 no 3 pp 385ndash405 2010

[7] Y Y Tang Wavelets Theory Approach to Pattern RecognitionWorld Scientific Singapor 2009

[8] Q M Tieng and W Boles ldquoWavelet-based affine invariantrepresentation a tool for recognizing planar objects in 3Dspacerdquo IEEE Transactions on Pattern Analysis and MachineIntelligence vol 19 no 8 pp 921ndash925 1997

[9] P Wunsch and A F Laine ldquoWavelet descriptors for mul-tiresolution recognition of handprinted charactersrdquo PatternRecognition vol 28 no 8 pp 1237ndash1249 1995

[10] H Yin and H Liu ldquoA Bregman iterative regularization methodfor wavelet-based image deblurringrdquo International Journal of

Wavelets Multiresolution and Information Processing vol 8 no3 pp 485ndash499 2010

[11] X You and Y Y Tang ldquoWavelet-based approach to characterskeletonrdquo IEEE Transactions on Image Processing vol 16 no 5pp 1220ndash1231 2007

[12] T Zhang Q Fan and Q Gao ldquoWavelet characterization ofHardy space ℎ

1 and its application in variational image decom-positionrdquo International Journal of Wavelets Multiresolution andInformation Processing vol 8 no 1 pp 71ndash87 2010

[13] Y Y Tang L Y Li Feng and J Liu ldquoScale-independent waveletalgorithm for detecting step-structure edgesrdquo Tech Rep IEEETransactions on InformationTheory Brisbane Australia 1998

[14] S G Mallat ldquoMultiresolution approximations and waveletorthonormal bases of 119871

2(R)rdquo Transactions of the American

Mathematical Society vol 315 no 1 pp 69ndash87 1989[15] J H McClellan and C M Rader Number Theory in Digital Sig-

nal Processing Prentice Hall Signal Processing Series PrenticeHall Englewood Cliffs NJ USA 1979

[16] X Ran and K J R Liu ldquoFast algorithms for 2-D circularconvolutions and number theoretic transforms based on poly-nomial transforms over finite ringsrdquo IEEE Transactions onSignal Processing vol 43 no 3 pp 569ndash578 1995

[17] Q Sun ldquoSome results in the application of the number theoryto digital signal processing and public-key systemsrdquo in NumberTheory and Its Applications in China vol 77 of ContemporaryMathematics pp 107ndash112 American Mathematical SocietyProvidence RI USA 1988

[18] Y Y Tang Q Sun L H Yang and L Feng ldquoAn overlap-save method for the calculation of the two-dimensional digitalconvolutionrdquo Tech Rep Department of Computer ScienceHong Kong Baptist University 1998

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 8: Research Article Implementation of 2D Discrete Wavelet ...downloads.hindawi.com/journals/mpe/2014/532979.pdfResearch Article Implementation of 2D Discrete Wavelet Transform by Number

8 Mathematical Problems in Engineering

If 1198971

= 11990411198731015840+ 119873 and 119898

1= 11990421198721015840+ 119872 then [(119897

1minus

119873)1198731015840] = (1198971minus 119873)119873

1015840 and [(1198981minus 119872)119872

1015840] = (119898

1minus

119872)1198721015840 The input matrix 119909

11989911198992

will be divided withno remainder

(iv) For 1199051= 0 1 119897

2minus 2 1199052= 0 1 119898

1minus 1 and 119905

1=

0 1 1198971minus 1 119905

2= 0 1 119898

2minus 2 compute 119910

11990511199052

byusing the direct method

If 1198731015840 = 1198972minus 1 and 119872

1015840= 1198982minus 1 we will add zeros

to the sequence 11990911989911198992

so that the 2D sequences are oflengths 119897

1+ 1198731015840 and 119898

1+ 1198721015840 Then we will compute

11991011989911198992

(1199051

= 0 1 1198972minus 2 1199052

= 0 1 1198981minus 1 and

1199051= 0 1 119897

1minus 1 1199052= 0 1 119898

2minus 2) by using an

overlap-save method The detail of it is presented inthe Technical Report [18]

We will introduce the way of using FNTT and 2Doverlap-save method with two examples One is numericalcomputation and the other is an experiment of extracting thecontour of a Chinese handwritten character

4 Comparison of the Numbersof Multiplication

Let119873 = 1198731015840+ 1198972minus 1 lt 119897

1119872 = 119872

1015840+1198982minus 1 lt 119898

11198731015840 = 119897

2minus 1

1198721015840= 1198982minus 1 1198972= 2119906+ 1 119898

2= 21199061015840

+ 1 and 1198971= 11990411198731015840+ 119873

1198981= 11990421198721015840+ 119872 Suppose that 119886

1and 1198862satisfy 2

1198861minus1

lt 1198971+

1198972minus 1 le 2

1198861 = 119873

1and 1198861198862minus1

lt 1198981+1198982minus 1 le 2

1198862 = 119873

2 Let 119871

1

1198712 and 119871

3denote the numbers of multiplication necessary

for computing the convolution (4) by using direct methodFNTT or FFT to calculate (4) (using Proposition 1) and2D overlap-save method respectively In [18] we comparedthe number of multiplications necessary for computing theconvolution (4) of two 2D sequences 119909

11989911198992

(1198991= 0 1 119897

1minus

1 1198992

= 0 1 1198981minus 1) and ℎ

11989911198992

(1198991

= 0 1 1198972minus 1

1198992= 0 1 119898

2minus 1) by three different methods

We proved the following results

(1) If 1198972lt 1198971 1198982lt 1198981 then

1198711=

11989721198982(1198972+ 1) (119898

2+ 1)

4+ (1198981minus 1198982)1198982

1198972(1198972+ 1)

2

+ (1198971minus 1198972) 1198972

1198982(1198982+ 1)

2+ (1198971minus 1198972) (1198981minus 1198982) 11989721198982

(36)

Also if 1198971= 1198981= 119897 1198972= 1198982= 1198971015840 then

1198711= (

1198971015840(2119897 minus 119897

1015840+ 1)

2)

2

(37)

(2) Consider

1198712= 21198861+1198862minus1

(31198861+ 31198862+ 2) (38)

(3) If 1198971= 1198981= 2119906+ℎ 1198972= 1198982= 2119906+ 1 119873 = 119872 = 2

119906+1and 119873

1015840= 1198721015840= 2119906 where 119906 ge 3 ℎ ge 2 then

1198711= ((2119906+ 1)2119906minus1

(2ℎ+1

minus 1))2

1198712= 22119906+2ℎ+1

(6119906 + 6ℎ + 8)

1198713= 2(2

119906+ℎ)2

(6119906 + 8)

(39)

In this section wewill suppose that1198731015840 = 1198972minus1 119872

1015840= 1198982minus

1 Let 119873 = 1198731015840+ 1198972minus 1 lt 119897

1 119872 = 119872

1015840+ 1198982minus 1 lt 119898

1 and

1198971= 11990411198731015840+119873 119898

1= 11990421198721015840+119872 For 119905

1= 0 1 119897

2minus 2 119905

2=

0 1 1198981minus 1 and 119905

1= 0 1 119897

1minus 1 119905

2= 0 1 119898

2minus 2

we computer 11991011990511199052

by using the direct methodWe have the following proposition

Proposition 6 If 1198972lt 1198971 1198982lt 1198981 then

119871 =11989721198982

4((1198972minus 1) (119898

2minus 1) + 2 (119897

2minus 1)

times (1198981minus 1198982+ 1) + 2 (119898

2minus 1) (119897

1minus 1198972+ 1))

(40)

where 119871 denotes the number of multiplication necessary forcomputing119910

11989911198992

by using the directmethod 1199051= 0 1 119897

2minus2

1199052= 0 1 119898

1minus1 and 119905

1= 0 1 119897

1minus1 1199052= 0 1 119898

2minus

2Also if 119897

1= 1198981= 119897 and 119897

2= 1198982= 1198971015840 then

119871 =

11989710158402

(1198971015840minus 1)

4(4119897 minus 3119897

1015840+ 3) (41)

Proof Let I II and III denote the number of multiplicationnecessary for computing the 119860 119861 and 119862 by direct methodrespectively where

119860 = (

11991000

sdot sdot sdot 11991001198982minus2

1199101198972minus20

sdot sdot sdot 1199101198972minus21198982minus2

)

119861 = (

11991001198982minus1

sdot sdot sdot 11991001198981minus1

1199101198972minus21198982minus1

sdot sdot sdot 1199101198972minus21198981minus1

)

119862 = (

1199101198972minus10

sdot sdot sdot 1199101198972minus11198982minus2

1199101198972minus10

sdot sdot sdot 1199101198972minus11198982minus2

)

(42)

Mathematical Problems in Engineering 9

Then

119868 = (1 + 2 + sdot sdot sdot + (1198982minus 1)) (1 + 2 + sdot sdot sdot + (119897

2minus 1))

=11989721198982(1198972minus 1) (119898

2minus 1)

4

119868119868 = 1198982(1 + 2 + sdot sdot sdot + (119897

2minus 1)) (119898

1minus 1 minus (119898

2minus 2))

=11989721198982(1198972minus 1) (119898

1minus 1198982+ 1)

2

119868119868119868 = 1198972(1 + 2 + sdot sdot sdot + (119898

2minus 1)) (119897

1minus 1 minus (119897

2minus 2))

=11989721198982(1198982minus 1) (119897

1minus 1198972+ 1)

2

(43)

So

119871 = 119868 + 119868119868 + 119868119868119868

=11989721198982

4((1198972minus 1) (119898

2minus 1) + 2 (119897

2minus 1) (119898

1minus 1198982+ 1)

+2 (1198982minus 1) (119897

1minus 1198972+ 1))

(44)

Clearly if 1198971= 1198981= 119897 and 119897

2= 1198982= 1198971015840 then (41) holds This

completes the proof

Proposition 7 If 1198971

= 1198981

= 2119906+ℎ 1198972

= 1198982

= 2119906+ 1 119873 =

119872 = 2119906+2 and119873

1015840= 1198721015840= 3sdot2

119906 where 119906 ge 3 ℎ equiv 0 (mod 2)ℎ ge 4 then

1198714= (2119906+ 1)222(119906minus1)

(2ℎ+2

minus 3)

+ (4(2ℎminus2

minus 1)

3+ 1)

2

22(119906+2)

(3119906 + 7)

(45)

where 1198714denotes the number of multiplication necessary for

computing (4) by using 2D overlap-save method

Proof Because 1198731015840

= 1198972minus 1 1198721015840 = 119898

2minus 1 1198971= 1198981= 2119906+ℎ and

1198972= 1198982= 2119906+ 1 by (41) we have

119871 = (2119906+ 1)2sdot 2119906minus2

(2119906+ℎ+2

minus 3 (2119906+ 1) + 3)

= (2119906+ 1)222(119906minus1)

(2ℎ+2

minus 3)

(46)

Compute the cyclic convolution of two sequences1199091198991+V111987310158401198992+V21198721015840 and ℎ

1015840

11989911198992

(1198991

= 0 1 2119906+2

minus 11198992

= 0 1 2119906+2

minus 1) that is compute matrix (35) byusing FNNT It is well known that using FNTT to calculatethe (35) requires

119873119872(3

2log119873119872 + 1) = 2

2(119906+2)(3119906 + 7) (47)

where 119873 = 119872 = 2119906+2

When 119873 = 119872 = 2119906+2 1198731015840 = 119872

1015840= 3 sdot 2

119906 119906 ge 3 ℎ equiv

0 (mod 2) and ℎ ge 4 then

[1198971minus 119873

1198731015840] = [

1198981minus 119872

1198721015840] = [

2119906+ℎ

minus 2119906+2

3 sdot 2119906]

= [

4 (2ℎminus2

minus 1)

3] =

4 (2ℎminus2

minus 1)

3

(48)

where 4(2ℎminus2

minus 1)3 is a positive integerSo the input matrix 119909

11989911198992

will be divided with noremainder When V

1= 0 1 [(119897

1minus 119873)119873

1015840] and V

2=

0 1 [(1198981minus119872)119872

1015840] we obtain all matrices as (35) Thus

1198714= (2119906+ 1)222(119906minus1)

(2ℎ+2

minus 3)

+ (4(2ℎminus2

minus 1)

3+ 1)

2

22(119906+2)

(3119906 + 7)

(49)

equal to (45) holds This completes the proof

Example 8 Suppose that 119906 = ℎ = 4 that is 1198971= 1198981= 256

1198972= 1198982= 17 119873 = 119872 = 64 and 119873

1015840= 1198721015840= 48 then

1198714= 3073856 (50)

If 1198971= 1198981= 256 119897

2= 1198982= 17 119873 = 119872 = 32 and 119873

1015840= 1198721015840=

16 then

1198713= 4194304 (51)

This example shows that 1198714lt 1198713in some particular cases

5 Experiments

The theoretic description of the 2D overlap-save method hasbeen provided in the preceding section This section furtherexamines how such a technique will be performed and howit will be applied to the wavelet transform Particularly wewill use image processing as an exampleThe experiment willfocus on the application of the 2D overlap-savemethod to thedyadic wavelet transform extracting the contours of Chinesehandwriting

51 Numerical Computation Let ℎ11989911198992

denote a digital filterand let a two-dimensional sequence

(ℎ11989911198992

) = (

1 0 1

1 1 0

0 1 1

) (52)

be the coefficients of the filter A two-dimensional sequence

(11990911989911198992

) =

((((

(

1 3 2 minus3 0 2 1 1

3 1 0 minus1 2 minus2 minus1 0

0 minus1 1 1 3 2 0 minus1

2 3 minus1 1 0 1 1 0

3 minus2 1 0 minus1 1 1 1

minus1 0 2 3 1 1 0 1

1 minus1 0 1 0 1 minus1 0

minus1 0 1 1 0 1 0 1

))))

)

(53)

10 Mathematical Problems in Engineering

represents the input of the filter In this example because 1198971=

1198981= 8 and 119897

2= 1198982= 3 the length of input matrix is 8 times 8

and that of the filter is 3 times 3Using the overlap-save method to calculate the output of

the filter

11991011989911198992

=

2

sum

1198961=0

2

sum

1198962=0

ℎ11989611198962

1199091198991minus11989611198992minus1198962

0le1198991minus1198961lt8

0le1198992minus1198962lt8

1198991= 0 1 2 3 4 5 6 7 119899

2= 0 1 2 3 4 5 6 7

(54)

means that the elements of the matrix

119884 = (

11991000

11991001

sdot sdot sdot 11991007

11991010

11991011

sdot sdot sdot 11991017

11991070

11991071

sdot sdot sdot 11991077

) (55)

need to be computedThe solution is given belowSince 119897

1= 1198981= 8 1198972= 1198982= 3 by selecting 119873

1015840= 1198972minus 1 =

2 and 1198721015840= 1198982minus 1 = 2 we have 119873 = 119872 = 4 In order to

use the FNTT the input matrix is divided into 9 submatricesof size 4times 4 Each consecutive submatrix is partly overlappedwith the size of 2 times 2 pixels In addition zeros of size 1 times 1

are added to the filtering sequence to ensure that its lengthis equivalent to that of the submatrix Therefore the filteringsequence ℎ

11989911198992

is extended to ℎ1015840

11989911198992

that is

ℎ1015840

11989911198992

= ℎ11989911198992

if 1198991= 0 1 2 119899

2= 0 1 2

0 if 1198991= 3 or 119899

2= 3

(56)

where 1198991= 0 1 2 3 119899

2= 0 1 2 3

Next we compute the circular convolution of the twosequences 119909

1198991+2V11198992+2V2

and ℎ1015840

11989911198992

(1198991

= 0 1 2 3 1198992

=

0 1 2 3)

11991011990511199052

=

3

sum

1198991=0

3

sum

1198992=0

ℎ1015840

11989911198992

119909⟨1199051minus1198991⟩4+2V1⟨1199052minus1198992⟩4+2V2

=

2

sum

1198991=0

2

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩4+2V1⟨1199052minus1198992⟩4+2V2

(57)

where 1199051= 0 1 2 3 119905

2= 0 1 2 3

When 1199051= 2 3 119905

2= 2 3 we arrive at the following result

11991011990511199052

=

2

sum

1198991=0

2

sum

1198992=0

ℎ11989911198992

1199091199051minus1198991+2V11199052minus1198992+2V2

= 1199101199051+2V11199052+2V2

(58)

After choosing all the parameters of V1

= 0 1 2 V2

=

0 1 2 ([(1198971minus 119873)119873

1015840] = [(119898

1minus 119872)119872

1015840] = [(8 minus 4)2] = 2)

all 2 times 2 submatrices of the matrix 119884 defined in (34) will beobtained as follows

(11991022

11991023

11991032

11991033

)(11991024

11991025

11991034

11991035

)(11991026

11991027

11991036

11991037

)

(11991042

11991043

11991052

11991053

)(11991044

11991045

11991054

11991055

)(11991046

11991047

11991056

11991057

)

(11991062

11991063

11991072

11991073

)(11991064

11991065

11991074

11991075

)(11991066

11991067

11991076

11991077

)

(59)

For 11991011990511199052

(1199051

= 0 1 1199052

= 0 1 2 3 4 5 6 7 1199051

=

0 1 2 3 4 5 6 7 1199052

= 0 1) we can compute it by usingan overlap-save method The detail of it is presented in theTechnical Report [18]

The fast number theoretic transform (FNTT) is nowapplied to the implementation of the circular convolution

11991011990511199052

=

3

sum

1198991=0

3

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩4⟨1199052minus1198992⟩4

1199051= 0 1 2 3 119905

2= 0 1 2 3

(60)

The computation is performed in the following five stepsshown in Figure 5

Step 1 (choosing 119872) Since

1003816100381610038161003816100381611991011990511199052

10038161003816100381610038161003816le

1003816100381610038161003816100381611990911989911198992

10038161003816100381610038161003816max

3

sum

1198961=0

3

sum

1198962=0

10038161003816100381610038161003816ℎ11989611198962

10038161003816100381610038161003816= 3 times 6 = 18 (61)

we can select119898 = 257 = 28+ 1 so that 18 lt 2572 where 257

is a prime Clearly 164 equiv 1 (mod257) and 16119895

equiv 1 (mod257) for 1 le 119895 le 3

Thus

11988311989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

11990911989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(62)

is a 2D number theoretic transform It has the followinginverse transform

11990911989911198992

equiv 4minus1

sdot 4minus1

3

sum

1198961=0

3

sum

1198962=0

11988311989611198962(minus16)11989911198961(minus16)11989921198962(mod 257)

1198991= 0 1 2 3 119899

2= 0 1 2 3

(63)

where 4minus1 denotes an integer so that (4minus1) sdot 4 equiv 1 (mod 257)

Mathematical Problems in Engineering 11

linear convolutionof the output matrixof the output matrix

cyclic convolutionCalculate the

of the filtering matrix

Calculate the

Calculate the numbertheoretic transformof the input matrix

Choose M

theoretic transformCalculate the number

Figure 5 Five steps of applying FNTT to calculate the output of (54)

Step 2 (calculating the number theoretic transform of inputmatrix by the FNTT) For computational convenience hereone writes

11988001198962

equiv

3

sum

1198992=0

11990901198992

1611989921198962 119880

11198962

equiv

3

sum

1198992=0

11990911198992

1611989921198962(mod 257)

11988021198962

equiv

3

sum

1198992=0

11990921198992

1611989921198962 119880

31198962

equiv

3

sum

1198992=0

11990931198992

1611989921198962(mod 257)

1198962= 0 1 2 3

(64)

Then (62) becomes

11988311989610

equiv

3

sum

1198991=0

11988011989910

1611989911198961 119883

11989611

equiv

3

sum

1198991=0

11988011989911

1611989911198961(mod 257)

11988311989612

equiv

3

sum

1198991=0

11988011989912

1611989911198961 119883

11989613

equiv

3

sum

1198991=0

11988011989913

1611989911198961(mod 257)

1198961= 0 1 2 3

(65)

Use the FNTT to calculate (64) and (65)So

(

11988000

11988001

11988002

11988003

11988010

11988011

11988012

11988013

11988020

11988021

11988022

11988023

11988030

11988031

11988032

11988033

)

equiv (

3 95 3 minus97

3 35 3 minus29

1 minus33 1 31

5 35 minus3 minus29

) (mod 257)

119883 = (

11988300

11988301

11988302

11988303

11988310

11988311

11988312

11988313

11988320

11988321

11988322

11988323

11988330

11988331

11988332

11988333

)

equiv (

12 132 4 minus124

minus30 128 98 minus128

minus4 minus8 4 minus8

34 128 minus94 minus128

) (mod 257)

(66)

Step 3 (calculating the number theoretic transformof the filterby the FNTT) The FNTT of the filter ℎ

11989911198992

is written as

11986711989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

ℎ1015840

11989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(67)

Similarly we have

119867 = (

11986700

11986701

11986702

11986703

11986710

11986711

11986712

11986713

11986720

11986721

11986722

11986723

11986730

11986731

11986732

11986733

)

equiv (

6 32 2 minus32

32 0 2 34

2 minus2 2 minus2

minus32 minus30 2 0

) (mod 257)

(68)

Step 4 (compute the number theoretic transformof the outputof the filter) From the preceding three steps we can computethe circular convolution of the filter by defining the productof 119883 and 119867 as

119884 = (

11988400

11988401

11988402

11988403

11988410

11988411

11988412

11988413

11988420

11988421

11988422

11988423

11988430

11988431

11988432

11988433

)

equiv 119883 ⊙ 119867 = (

11988300

11986700

11988301

11986701

11988302

11986702

11988303

11986703

11988310

11986710

11988311

11986711

11988312

11986712

11988313

11986713

11988320

11986720

11988321

11986721

11988322

11986722

11988323

11986723

11988330

11986730

11988331

11986731

11988332

11986732

11988333

11986733

)

equiv (

72 112 8 113

68 0 minus61 17

minus8 16 8 16

minus60 15 69 0

) (mod 257)

(69)

where

11988411989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

11991011989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(70)

12 Mathematical Problems in Engineering

Table 1 Filtering coefficients 12059521198951

119896119897 (119895 = 2) 120595(119903) are a quadratic spline wavelet

119897119896 119896 = 0 119896 = 1 119896 = 2 119896 = 3

119897 = 0 minus00838140026 minus00472041145 minus00129809398 minus00012592132119897 = 1 minus01416904181 minus00758706033 minus00196341425 minus00012698699119897 = 2 minus00651057437 minus00327749476 minus00063385521 minus00000750836119897 = 3 minus00088690016 minus00030044997 minus00001088651

(a) (b)

Figure 6 A 2-dimensional image of an aircraft was processed with 2D overlap-save method (a) Original Chinese handwriting and (b) thedivided up subimages of the character

and the 11991011989911198992

(1198991

= 0 1 2 3 1198992

= 0 1 2 3) is the circularconvolution of (60)

Step 5 (calculate the output of the linear convolution) From(63) we deduce the inverse transform of (70)

11991011989911198992

equiv 4minus1

sdot 4minus1

3

sum

1198961=0

3

sum

1198962=0

11988411989611198962(minus16)11989911198961

sdot (minus16)11989921198962(mod 257)

1198991= 0 1 2 3 119899

2= 0 1 2 3

(71)

Using FNTT to calculate (71) we have

(

11991000

11991001

11991002

11991003

11991010

11991011

11991012

11991013

11991020

11991021

11991022

11991023

11991030

11991031

11991032

11991033

) equiv (

8 6 4 0

1 7 13 1

2 2 6 4

1 5 5 7

) (mod 257)

(72)

Then the linear convolution in (58) is obtained

(11991022

11991023

11991032

11991033

) = (11991022

11991023

11991032

11991033

) = (6 4

5 7) (73)

52 Application to Image Processing The proposed methodcan be applied to many fields such as image processingand pattern recognition An example of the application to

the image processing is illustrated in Figure 6 The originalimage shown in Figure 6(a) is a 2-dimensional image of anaircraft with a size of 256 times 256 pixels that is 119897

1= 1198981

=

256 Our task is to extract its contours The discrete wavelettransform with scale 119904 = 2

119895 where 119895 = 2 was applied and thespline wavelet described in (1) of size 17 times 17 was chosenthat is 119897

2= 1198982

= 17 We use the filtering coefficientstabulated in Table 1 Using the 2D overlap-save method thisoriginal image was divided into 25 sections with each onehaving the dimension of 64 times 64 pixels that is we select119873 = 119872 = 64 1198731015840 = 119872

1015840= 48 [(119897

1minus 119873)119873

1015840] = [(119898

1minus

119872)1198721015840] = 4 (See Example 8 in Section 4) Figure 6(b)

shows these subimages The overlapped part can be explicitlyobserved in each subimage

To facilitate the presentation of the 2D overlap-savemethod the procedure of it is diagonally displayed inFigure 7 where a series of the divided subimages are illus-tratedThe image in Figure 6(a) was equivalently divided into25 sections by applying (27) In Figure 7(a) we represent 5subimages of V

0= 0 V

1= 0 V

0= 1 V

1= 1 V

0= 2 V

1= 2

and V0

= 3 V1

= 3 and V0

= 4 V1

= 4 consecutively Thelower-right corner of each subimage is repeated in the upper-left corner of its consecutive subimage Four subimages aredisplayed in Figure 7(b) and the parameters of V

0= 0 V1= 1

V0

= 1 V1

= 2 V0

= 2 V1

= 3 and V0

= 3 V1

= 4 werechosen In Figure 7(c) we selected 3 subimages of V

0= 0

V1

= 2 V0

= 1 V1

= 3 and V0

= 2 V1

= 4 There are3 subimages of V

0= 0 V

1= 3 and V

0= 1 V

1= 4 in

Figure 7(d) Figure 7(e) displays subimages of V0= 0 V

1= 4

Mathematical Problems in Engineering 13

(a) (b) (c)

(d) (e) (f)

(g) (h) (i)

Figure 7 A 2-dimensional image of an aircraft is dividing into separated small subimages the parameters of V0and V

1are chosen as follows

(a) V0= 0 V

1= 0 V

0= 1 V

1= 1 V

0= 2 V

1= 2 and V

0= 3 V

1= 3 and V

0= 4 and V

1= 4 (b) V

0= 0 V

1= 1 V

0= 1 V

1= 2 V

0= 2 V

1= 3 and

V0= 3 and V

1= 4 (c) V

0= 0 V

1= 2 V

0= 1 V

1= 3 and V

0= 2 and V

1= 4 (d) V

0= 0 V

1= 3 and V

0= 1 and V

1= 4 (e) V

0= 0 and V

1= 4 (f)

V0= 1 V

1= 0 V

0= 2 V

1= 1 V

0= 3 V

1= 2 and V

0= 4 and V

1= 3 (g) V

0= 2 V

1= 0 V

0= 3 V

1= 1 and V

0= 4 and V

1= 2 (h) V

0= 3 V

1= 0

and V0= 4 and V

1= 1 and (i) V

0= 4 and V

1= 0

In Figure 7(f) V0= 1 V

1= 0 V

0= 2 V

1= 1 V

0= 3 V

1= 2

and V0= 4 V1= 3were chosen In Figure 7(g) the parameters

were decided upon V0= 2 V

1= 0 V

0= 3 V

1= 1 and V

0= 4

V1= 2 Two subimages are shown in Figure 7(h) by selecting

V0= 3 V

1= 0 and V

0= 4 V

1= 1 There is one subimage of

V0= 4 V

1= 0 in Figure 7(i)

We select a 2D NTT

11988311989611198962

equiv

63

sum

1198991=0

63

sum

1198992=0

11990911989911198992

211989911198961211989921198962 (mod 2

32+ 1) (74)

14 Mathematical Problems in Engineering

(a) (b)

(c) (d)

Figure 8 The linear outputs of 2D overlap-save method (a) the outputs of the linear convolution of each subimages (b) the left border andthe upper border of the outputs of the image of aircraft (c) the combined outputs of linear convolution except Γ-type border and (d) theentire contour extracted using 2D overlap-save method under wavelet transform

which has inverse transform

11990911989911198992

equiv 64minus1

64minus1

63

sum

1198961=0

63

sum

1198962=0

11988311989611198962

(minus231)11989911198961

times (minus231)11989921198962

(mod 232

+ 1)

1198991= 0 1 63 119899

2= 0 1 63

(75)

where 64minus1 denotes integer so that (64minus1)64 equiv 1 (mod 2

32+

1) and |11990911989911198992

| le 255The FNTT was applied to calculate the circular convo-

lution of each subimage After applying (31) to each of thesubblocks a series of segments of the contours were obtained

By using (32) we can gradually reach the final result of thelinear convolution Figure 8(a) illustrates those pixels whichsatisfy (35) where 119897

2= 1198982= 17 119873 = 119872 = 64 1198731015840 = 119872

1015840=

48 and V1 V2

= 0 1 2 3 4 Combining them together thecontours of the whole character were obtained and displayedin Figure 8(c) which excludes the Γ-type border Next the

Γ-type border was computed by direct method Figure 8(b)shows the result Combining this result with that shown inFigure 8(c) the entire contours of the Chinese handwritingwere combined Figure 8(d) represents the entire contour

6 Conclusions

A novel approach to reduce the computation complexityof the wavelet transform has been presented in this paperTwo key techniques have been applied in this new methodnamely fast number theoretic transform (FNTT) and two-dimensional overlap-save technique In the fast numbertheoretic transform the linear convolution is replaced bythe circular convolution It can speed up the computationof 2D discrete wavelet transform Directly calculating thefast number theoretic transform to the whole input sequencemay meet two difficulties namely a big modulo obstructsthe effective implementation of the fast number theoretictransform and a long input sequence slows the computation

Mathematical Problems in Engineering 15

of the fast number theoretic transform down To fight withsuch deficiencies a new technique which is referred to as 2Doverlap-save method has been developed Experiments havebeen conducted The fast number theoretic transform and2D overlap-method have been used to implement the dyadicwavelet transform and applied to contour extraction in imageprocessing and pattern recognition

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Acknowledgments

This work was supported by the Research GrantsMYRG205(Y1-L4)-FST11-TYY and MYRG187(Y1-L3)-FST11-TYY and Chair Prof Grants RDG009FST-TYY ofUniversity of Macau as well as Macau FDC Grants T-100-2012-A3 and 026ndash2013-A This research project was alsosupported by the National Natural Science Foundation ofChina 61273244

References

[1] P L Combettes and J-C Pesquet ldquoWavelet-constrained imagerestorationrdquo International Journal of Wavelets Multiresolutionand Information Processing vol 2 no 4 pp 371ndash389 2004

[2] M Ehler and K Koch ldquoThe construction of multiwavelet bi-frames and applications to variational image denoisingrdquo Inter-national Journal of Wavelets Multiresolution and InformationProcessing vol 8 no 3 pp 431ndash455 2010

[3] P Jain and S N Merchant ldquoWavelet-based multiresolutionhistogram for fast image retrievalrdquo International Journal ofWavelets Multiresolution and Information Processing vol 2 no1 pp 59ndash73 2004

[4] S Mallat and W L Hwang ldquoSingularity detection and pro-cessing with waveletsrdquo Institute of Electrical and ElectronicsEngineers Transactions on InformationTheory vol 38 no 2 pp617ndash643 1992

[5] B U Shankar S K Meher and A Ghosh ldquoNeuro-waveletclassifier formultispectral remote sensing imagesrdquo InternationalJournal of Wavelets Multiresolution and Information Processingvol 5 no 4 pp 589ndash611 2007

[6] S Shi Y Zhang and Y Hu ldquoA wavelet-based image edgedetection and estimationmethod with adaptive scale selectionrdquoInternational Journal of Wavelets Multiresolution and Informa-tion Processing vol 8 no 3 pp 385ndash405 2010

[7] Y Y Tang Wavelets Theory Approach to Pattern RecognitionWorld Scientific Singapor 2009

[8] Q M Tieng and W Boles ldquoWavelet-based affine invariantrepresentation a tool for recognizing planar objects in 3Dspacerdquo IEEE Transactions on Pattern Analysis and MachineIntelligence vol 19 no 8 pp 921ndash925 1997

[9] P Wunsch and A F Laine ldquoWavelet descriptors for mul-tiresolution recognition of handprinted charactersrdquo PatternRecognition vol 28 no 8 pp 1237ndash1249 1995

[10] H Yin and H Liu ldquoA Bregman iterative regularization methodfor wavelet-based image deblurringrdquo International Journal of

Wavelets Multiresolution and Information Processing vol 8 no3 pp 485ndash499 2010

[11] X You and Y Y Tang ldquoWavelet-based approach to characterskeletonrdquo IEEE Transactions on Image Processing vol 16 no 5pp 1220ndash1231 2007

[12] T Zhang Q Fan and Q Gao ldquoWavelet characterization ofHardy space ℎ

1 and its application in variational image decom-positionrdquo International Journal of Wavelets Multiresolution andInformation Processing vol 8 no 1 pp 71ndash87 2010

[13] Y Y Tang L Y Li Feng and J Liu ldquoScale-independent waveletalgorithm for detecting step-structure edgesrdquo Tech Rep IEEETransactions on InformationTheory Brisbane Australia 1998

[14] S G Mallat ldquoMultiresolution approximations and waveletorthonormal bases of 119871

2(R)rdquo Transactions of the American

Mathematical Society vol 315 no 1 pp 69ndash87 1989[15] J H McClellan and C M Rader Number Theory in Digital Sig-

nal Processing Prentice Hall Signal Processing Series PrenticeHall Englewood Cliffs NJ USA 1979

[16] X Ran and K J R Liu ldquoFast algorithms for 2-D circularconvolutions and number theoretic transforms based on poly-nomial transforms over finite ringsrdquo IEEE Transactions onSignal Processing vol 43 no 3 pp 569ndash578 1995

[17] Q Sun ldquoSome results in the application of the number theoryto digital signal processing and public-key systemsrdquo in NumberTheory and Its Applications in China vol 77 of ContemporaryMathematics pp 107ndash112 American Mathematical SocietyProvidence RI USA 1988

[18] Y Y Tang Q Sun L H Yang and L Feng ldquoAn overlap-save method for the calculation of the two-dimensional digitalconvolutionrdquo Tech Rep Department of Computer ScienceHong Kong Baptist University 1998

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 9: Research Article Implementation of 2D Discrete Wavelet ...downloads.hindawi.com/journals/mpe/2014/532979.pdfResearch Article Implementation of 2D Discrete Wavelet Transform by Number

Mathematical Problems in Engineering 9

Then

119868 = (1 + 2 + sdot sdot sdot + (1198982minus 1)) (1 + 2 + sdot sdot sdot + (119897

2minus 1))

=11989721198982(1198972minus 1) (119898

2minus 1)

4

119868119868 = 1198982(1 + 2 + sdot sdot sdot + (119897

2minus 1)) (119898

1minus 1 minus (119898

2minus 2))

=11989721198982(1198972minus 1) (119898

1minus 1198982+ 1)

2

119868119868119868 = 1198972(1 + 2 + sdot sdot sdot + (119898

2minus 1)) (119897

1minus 1 minus (119897

2minus 2))

=11989721198982(1198982minus 1) (119897

1minus 1198972+ 1)

2

(43)

So

119871 = 119868 + 119868119868 + 119868119868119868

=11989721198982

4((1198972minus 1) (119898

2minus 1) + 2 (119897

2minus 1) (119898

1minus 1198982+ 1)

+2 (1198982minus 1) (119897

1minus 1198972+ 1))

(44)

Clearly if 1198971= 1198981= 119897 and 119897

2= 1198982= 1198971015840 then (41) holds This

completes the proof

Proposition 7 If 1198971

= 1198981

= 2119906+ℎ 1198972

= 1198982

= 2119906+ 1 119873 =

119872 = 2119906+2 and119873

1015840= 1198721015840= 3sdot2

119906 where 119906 ge 3 ℎ equiv 0 (mod 2)ℎ ge 4 then

1198714= (2119906+ 1)222(119906minus1)

(2ℎ+2

minus 3)

+ (4(2ℎminus2

minus 1)

3+ 1)

2

22(119906+2)

(3119906 + 7)

(45)

where 1198714denotes the number of multiplication necessary for

computing (4) by using 2D overlap-save method

Proof Because 1198731015840

= 1198972minus 1 1198721015840 = 119898

2minus 1 1198971= 1198981= 2119906+ℎ and

1198972= 1198982= 2119906+ 1 by (41) we have

119871 = (2119906+ 1)2sdot 2119906minus2

(2119906+ℎ+2

minus 3 (2119906+ 1) + 3)

= (2119906+ 1)222(119906minus1)

(2ℎ+2

minus 3)

(46)

Compute the cyclic convolution of two sequences1199091198991+V111987310158401198992+V21198721015840 and ℎ

1015840

11989911198992

(1198991

= 0 1 2119906+2

minus 11198992

= 0 1 2119906+2

minus 1) that is compute matrix (35) byusing FNNT It is well known that using FNTT to calculatethe (35) requires

119873119872(3

2log119873119872 + 1) = 2

2(119906+2)(3119906 + 7) (47)

where 119873 = 119872 = 2119906+2

When 119873 = 119872 = 2119906+2 1198731015840 = 119872

1015840= 3 sdot 2

119906 119906 ge 3 ℎ equiv

0 (mod 2) and ℎ ge 4 then

[1198971minus 119873

1198731015840] = [

1198981minus 119872

1198721015840] = [

2119906+ℎ

minus 2119906+2

3 sdot 2119906]

= [

4 (2ℎminus2

minus 1)

3] =

4 (2ℎminus2

minus 1)

3

(48)

where 4(2ℎminus2

minus 1)3 is a positive integerSo the input matrix 119909

11989911198992

will be divided with noremainder When V

1= 0 1 [(119897

1minus 119873)119873

1015840] and V

2=

0 1 [(1198981minus119872)119872

1015840] we obtain all matrices as (35) Thus

1198714= (2119906+ 1)222(119906minus1)

(2ℎ+2

minus 3)

+ (4(2ℎminus2

minus 1)

3+ 1)

2

22(119906+2)

(3119906 + 7)

(49)

equal to (45) holds This completes the proof

Example 8 Suppose that 119906 = ℎ = 4 that is 1198971= 1198981= 256

1198972= 1198982= 17 119873 = 119872 = 64 and 119873

1015840= 1198721015840= 48 then

1198714= 3073856 (50)

If 1198971= 1198981= 256 119897

2= 1198982= 17 119873 = 119872 = 32 and 119873

1015840= 1198721015840=

16 then

1198713= 4194304 (51)

This example shows that 1198714lt 1198713in some particular cases

5 Experiments

The theoretic description of the 2D overlap-save method hasbeen provided in the preceding section This section furtherexamines how such a technique will be performed and howit will be applied to the wavelet transform Particularly wewill use image processing as an exampleThe experiment willfocus on the application of the 2D overlap-savemethod to thedyadic wavelet transform extracting the contours of Chinesehandwriting

51 Numerical Computation Let ℎ11989911198992

denote a digital filterand let a two-dimensional sequence

(ℎ11989911198992

) = (

1 0 1

1 1 0

0 1 1

) (52)

be the coefficients of the filter A two-dimensional sequence

(11990911989911198992

) =

((((

(

1 3 2 minus3 0 2 1 1

3 1 0 minus1 2 minus2 minus1 0

0 minus1 1 1 3 2 0 minus1

2 3 minus1 1 0 1 1 0

3 minus2 1 0 minus1 1 1 1

minus1 0 2 3 1 1 0 1

1 minus1 0 1 0 1 minus1 0

minus1 0 1 1 0 1 0 1

))))

)

(53)

10 Mathematical Problems in Engineering

represents the input of the filter In this example because 1198971=

1198981= 8 and 119897

2= 1198982= 3 the length of input matrix is 8 times 8

and that of the filter is 3 times 3Using the overlap-save method to calculate the output of

the filter

11991011989911198992

=

2

sum

1198961=0

2

sum

1198962=0

ℎ11989611198962

1199091198991minus11989611198992minus1198962

0le1198991minus1198961lt8

0le1198992minus1198962lt8

1198991= 0 1 2 3 4 5 6 7 119899

2= 0 1 2 3 4 5 6 7

(54)

means that the elements of the matrix

119884 = (

11991000

11991001

sdot sdot sdot 11991007

11991010

11991011

sdot sdot sdot 11991017

11991070

11991071

sdot sdot sdot 11991077

) (55)

need to be computedThe solution is given belowSince 119897

1= 1198981= 8 1198972= 1198982= 3 by selecting 119873

1015840= 1198972minus 1 =

2 and 1198721015840= 1198982minus 1 = 2 we have 119873 = 119872 = 4 In order to

use the FNTT the input matrix is divided into 9 submatricesof size 4times 4 Each consecutive submatrix is partly overlappedwith the size of 2 times 2 pixels In addition zeros of size 1 times 1

are added to the filtering sequence to ensure that its lengthis equivalent to that of the submatrix Therefore the filteringsequence ℎ

11989911198992

is extended to ℎ1015840

11989911198992

that is

ℎ1015840

11989911198992

= ℎ11989911198992

if 1198991= 0 1 2 119899

2= 0 1 2

0 if 1198991= 3 or 119899

2= 3

(56)

where 1198991= 0 1 2 3 119899

2= 0 1 2 3

Next we compute the circular convolution of the twosequences 119909

1198991+2V11198992+2V2

and ℎ1015840

11989911198992

(1198991

= 0 1 2 3 1198992

=

0 1 2 3)

11991011990511199052

=

3

sum

1198991=0

3

sum

1198992=0

ℎ1015840

11989911198992

119909⟨1199051minus1198991⟩4+2V1⟨1199052minus1198992⟩4+2V2

=

2

sum

1198991=0

2

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩4+2V1⟨1199052minus1198992⟩4+2V2

(57)

where 1199051= 0 1 2 3 119905

2= 0 1 2 3

When 1199051= 2 3 119905

2= 2 3 we arrive at the following result

11991011990511199052

=

2

sum

1198991=0

2

sum

1198992=0

ℎ11989911198992

1199091199051minus1198991+2V11199052minus1198992+2V2

= 1199101199051+2V11199052+2V2

(58)

After choosing all the parameters of V1

= 0 1 2 V2

=

0 1 2 ([(1198971minus 119873)119873

1015840] = [(119898

1minus 119872)119872

1015840] = [(8 minus 4)2] = 2)

all 2 times 2 submatrices of the matrix 119884 defined in (34) will beobtained as follows

(11991022

11991023

11991032

11991033

)(11991024

11991025

11991034

11991035

)(11991026

11991027

11991036

11991037

)

(11991042

11991043

11991052

11991053

)(11991044

11991045

11991054

11991055

)(11991046

11991047

11991056

11991057

)

(11991062

11991063

11991072

11991073

)(11991064

11991065

11991074

11991075

)(11991066

11991067

11991076

11991077

)

(59)

For 11991011990511199052

(1199051

= 0 1 1199052

= 0 1 2 3 4 5 6 7 1199051

=

0 1 2 3 4 5 6 7 1199052

= 0 1) we can compute it by usingan overlap-save method The detail of it is presented in theTechnical Report [18]

The fast number theoretic transform (FNTT) is nowapplied to the implementation of the circular convolution

11991011990511199052

=

3

sum

1198991=0

3

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩4⟨1199052minus1198992⟩4

1199051= 0 1 2 3 119905

2= 0 1 2 3

(60)

The computation is performed in the following five stepsshown in Figure 5

Step 1 (choosing 119872) Since

1003816100381610038161003816100381611991011990511199052

10038161003816100381610038161003816le

1003816100381610038161003816100381611990911989911198992

10038161003816100381610038161003816max

3

sum

1198961=0

3

sum

1198962=0

10038161003816100381610038161003816ℎ11989611198962

10038161003816100381610038161003816= 3 times 6 = 18 (61)

we can select119898 = 257 = 28+ 1 so that 18 lt 2572 where 257

is a prime Clearly 164 equiv 1 (mod257) and 16119895

equiv 1 (mod257) for 1 le 119895 le 3

Thus

11988311989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

11990911989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(62)

is a 2D number theoretic transform It has the followinginverse transform

11990911989911198992

equiv 4minus1

sdot 4minus1

3

sum

1198961=0

3

sum

1198962=0

11988311989611198962(minus16)11989911198961(minus16)11989921198962(mod 257)

1198991= 0 1 2 3 119899

2= 0 1 2 3

(63)

where 4minus1 denotes an integer so that (4minus1) sdot 4 equiv 1 (mod 257)

Mathematical Problems in Engineering 11

linear convolutionof the output matrixof the output matrix

cyclic convolutionCalculate the

of the filtering matrix

Calculate the

Calculate the numbertheoretic transformof the input matrix

Choose M

theoretic transformCalculate the number

Figure 5 Five steps of applying FNTT to calculate the output of (54)

Step 2 (calculating the number theoretic transform of inputmatrix by the FNTT) For computational convenience hereone writes

11988001198962

equiv

3

sum

1198992=0

11990901198992

1611989921198962 119880

11198962

equiv

3

sum

1198992=0

11990911198992

1611989921198962(mod 257)

11988021198962

equiv

3

sum

1198992=0

11990921198992

1611989921198962 119880

31198962

equiv

3

sum

1198992=0

11990931198992

1611989921198962(mod 257)

1198962= 0 1 2 3

(64)

Then (62) becomes

11988311989610

equiv

3

sum

1198991=0

11988011989910

1611989911198961 119883

11989611

equiv

3

sum

1198991=0

11988011989911

1611989911198961(mod 257)

11988311989612

equiv

3

sum

1198991=0

11988011989912

1611989911198961 119883

11989613

equiv

3

sum

1198991=0

11988011989913

1611989911198961(mod 257)

1198961= 0 1 2 3

(65)

Use the FNTT to calculate (64) and (65)So

(

11988000

11988001

11988002

11988003

11988010

11988011

11988012

11988013

11988020

11988021

11988022

11988023

11988030

11988031

11988032

11988033

)

equiv (

3 95 3 minus97

3 35 3 minus29

1 minus33 1 31

5 35 minus3 minus29

) (mod 257)

119883 = (

11988300

11988301

11988302

11988303

11988310

11988311

11988312

11988313

11988320

11988321

11988322

11988323

11988330

11988331

11988332

11988333

)

equiv (

12 132 4 minus124

minus30 128 98 minus128

minus4 minus8 4 minus8

34 128 minus94 minus128

) (mod 257)

(66)

Step 3 (calculating the number theoretic transformof the filterby the FNTT) The FNTT of the filter ℎ

11989911198992

is written as

11986711989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

ℎ1015840

11989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(67)

Similarly we have

119867 = (

11986700

11986701

11986702

11986703

11986710

11986711

11986712

11986713

11986720

11986721

11986722

11986723

11986730

11986731

11986732

11986733

)

equiv (

6 32 2 minus32

32 0 2 34

2 minus2 2 minus2

minus32 minus30 2 0

) (mod 257)

(68)

Step 4 (compute the number theoretic transformof the outputof the filter) From the preceding three steps we can computethe circular convolution of the filter by defining the productof 119883 and 119867 as

119884 = (

11988400

11988401

11988402

11988403

11988410

11988411

11988412

11988413

11988420

11988421

11988422

11988423

11988430

11988431

11988432

11988433

)

equiv 119883 ⊙ 119867 = (

11988300

11986700

11988301

11986701

11988302

11986702

11988303

11986703

11988310

11986710

11988311

11986711

11988312

11986712

11988313

11986713

11988320

11986720

11988321

11986721

11988322

11986722

11988323

11986723

11988330

11986730

11988331

11986731

11988332

11986732

11988333

11986733

)

equiv (

72 112 8 113

68 0 minus61 17

minus8 16 8 16

minus60 15 69 0

) (mod 257)

(69)

where

11988411989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

11991011989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(70)

12 Mathematical Problems in Engineering

Table 1 Filtering coefficients 12059521198951

119896119897 (119895 = 2) 120595(119903) are a quadratic spline wavelet

119897119896 119896 = 0 119896 = 1 119896 = 2 119896 = 3

119897 = 0 minus00838140026 minus00472041145 minus00129809398 minus00012592132119897 = 1 minus01416904181 minus00758706033 minus00196341425 minus00012698699119897 = 2 minus00651057437 minus00327749476 minus00063385521 minus00000750836119897 = 3 minus00088690016 minus00030044997 minus00001088651

(a) (b)

Figure 6 A 2-dimensional image of an aircraft was processed with 2D overlap-save method (a) Original Chinese handwriting and (b) thedivided up subimages of the character

and the 11991011989911198992

(1198991

= 0 1 2 3 1198992

= 0 1 2 3) is the circularconvolution of (60)

Step 5 (calculate the output of the linear convolution) From(63) we deduce the inverse transform of (70)

11991011989911198992

equiv 4minus1

sdot 4minus1

3

sum

1198961=0

3

sum

1198962=0

11988411989611198962(minus16)11989911198961

sdot (minus16)11989921198962(mod 257)

1198991= 0 1 2 3 119899

2= 0 1 2 3

(71)

Using FNTT to calculate (71) we have

(

11991000

11991001

11991002

11991003

11991010

11991011

11991012

11991013

11991020

11991021

11991022

11991023

11991030

11991031

11991032

11991033

) equiv (

8 6 4 0

1 7 13 1

2 2 6 4

1 5 5 7

) (mod 257)

(72)

Then the linear convolution in (58) is obtained

(11991022

11991023

11991032

11991033

) = (11991022

11991023

11991032

11991033

) = (6 4

5 7) (73)

52 Application to Image Processing The proposed methodcan be applied to many fields such as image processingand pattern recognition An example of the application to

the image processing is illustrated in Figure 6 The originalimage shown in Figure 6(a) is a 2-dimensional image of anaircraft with a size of 256 times 256 pixels that is 119897

1= 1198981

=

256 Our task is to extract its contours The discrete wavelettransform with scale 119904 = 2

119895 where 119895 = 2 was applied and thespline wavelet described in (1) of size 17 times 17 was chosenthat is 119897

2= 1198982

= 17 We use the filtering coefficientstabulated in Table 1 Using the 2D overlap-save method thisoriginal image was divided into 25 sections with each onehaving the dimension of 64 times 64 pixels that is we select119873 = 119872 = 64 1198731015840 = 119872

1015840= 48 [(119897

1minus 119873)119873

1015840] = [(119898

1minus

119872)1198721015840] = 4 (See Example 8 in Section 4) Figure 6(b)

shows these subimages The overlapped part can be explicitlyobserved in each subimage

To facilitate the presentation of the 2D overlap-savemethod the procedure of it is diagonally displayed inFigure 7 where a series of the divided subimages are illus-tratedThe image in Figure 6(a) was equivalently divided into25 sections by applying (27) In Figure 7(a) we represent 5subimages of V

0= 0 V

1= 0 V

0= 1 V

1= 1 V

0= 2 V

1= 2

and V0

= 3 V1

= 3 and V0

= 4 V1

= 4 consecutively Thelower-right corner of each subimage is repeated in the upper-left corner of its consecutive subimage Four subimages aredisplayed in Figure 7(b) and the parameters of V

0= 0 V1= 1

V0

= 1 V1

= 2 V0

= 2 V1

= 3 and V0

= 3 V1

= 4 werechosen In Figure 7(c) we selected 3 subimages of V

0= 0

V1

= 2 V0

= 1 V1

= 3 and V0

= 2 V1

= 4 There are3 subimages of V

0= 0 V

1= 3 and V

0= 1 V

1= 4 in

Figure 7(d) Figure 7(e) displays subimages of V0= 0 V

1= 4

Mathematical Problems in Engineering 13

(a) (b) (c)

(d) (e) (f)

(g) (h) (i)

Figure 7 A 2-dimensional image of an aircraft is dividing into separated small subimages the parameters of V0and V

1are chosen as follows

(a) V0= 0 V

1= 0 V

0= 1 V

1= 1 V

0= 2 V

1= 2 and V

0= 3 V

1= 3 and V

0= 4 and V

1= 4 (b) V

0= 0 V

1= 1 V

0= 1 V

1= 2 V

0= 2 V

1= 3 and

V0= 3 and V

1= 4 (c) V

0= 0 V

1= 2 V

0= 1 V

1= 3 and V

0= 2 and V

1= 4 (d) V

0= 0 V

1= 3 and V

0= 1 and V

1= 4 (e) V

0= 0 and V

1= 4 (f)

V0= 1 V

1= 0 V

0= 2 V

1= 1 V

0= 3 V

1= 2 and V

0= 4 and V

1= 3 (g) V

0= 2 V

1= 0 V

0= 3 V

1= 1 and V

0= 4 and V

1= 2 (h) V

0= 3 V

1= 0

and V0= 4 and V

1= 1 and (i) V

0= 4 and V

1= 0

In Figure 7(f) V0= 1 V

1= 0 V

0= 2 V

1= 1 V

0= 3 V

1= 2

and V0= 4 V1= 3were chosen In Figure 7(g) the parameters

were decided upon V0= 2 V

1= 0 V

0= 3 V

1= 1 and V

0= 4

V1= 2 Two subimages are shown in Figure 7(h) by selecting

V0= 3 V

1= 0 and V

0= 4 V

1= 1 There is one subimage of

V0= 4 V

1= 0 in Figure 7(i)

We select a 2D NTT

11988311989611198962

equiv

63

sum

1198991=0

63

sum

1198992=0

11990911989911198992

211989911198961211989921198962 (mod 2

32+ 1) (74)

14 Mathematical Problems in Engineering

(a) (b)

(c) (d)

Figure 8 The linear outputs of 2D overlap-save method (a) the outputs of the linear convolution of each subimages (b) the left border andthe upper border of the outputs of the image of aircraft (c) the combined outputs of linear convolution except Γ-type border and (d) theentire contour extracted using 2D overlap-save method under wavelet transform

which has inverse transform

11990911989911198992

equiv 64minus1

64minus1

63

sum

1198961=0

63

sum

1198962=0

11988311989611198962

(minus231)11989911198961

times (minus231)11989921198962

(mod 232

+ 1)

1198991= 0 1 63 119899

2= 0 1 63

(75)

where 64minus1 denotes integer so that (64minus1)64 equiv 1 (mod 2

32+

1) and |11990911989911198992

| le 255The FNTT was applied to calculate the circular convo-

lution of each subimage After applying (31) to each of thesubblocks a series of segments of the contours were obtained

By using (32) we can gradually reach the final result of thelinear convolution Figure 8(a) illustrates those pixels whichsatisfy (35) where 119897

2= 1198982= 17 119873 = 119872 = 64 1198731015840 = 119872

1015840=

48 and V1 V2

= 0 1 2 3 4 Combining them together thecontours of the whole character were obtained and displayedin Figure 8(c) which excludes the Γ-type border Next the

Γ-type border was computed by direct method Figure 8(b)shows the result Combining this result with that shown inFigure 8(c) the entire contours of the Chinese handwritingwere combined Figure 8(d) represents the entire contour

6 Conclusions

A novel approach to reduce the computation complexityof the wavelet transform has been presented in this paperTwo key techniques have been applied in this new methodnamely fast number theoretic transform (FNTT) and two-dimensional overlap-save technique In the fast numbertheoretic transform the linear convolution is replaced bythe circular convolution It can speed up the computationof 2D discrete wavelet transform Directly calculating thefast number theoretic transform to the whole input sequencemay meet two difficulties namely a big modulo obstructsthe effective implementation of the fast number theoretictransform and a long input sequence slows the computation

Mathematical Problems in Engineering 15

of the fast number theoretic transform down To fight withsuch deficiencies a new technique which is referred to as 2Doverlap-save method has been developed Experiments havebeen conducted The fast number theoretic transform and2D overlap-method have been used to implement the dyadicwavelet transform and applied to contour extraction in imageprocessing and pattern recognition

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Acknowledgments

This work was supported by the Research GrantsMYRG205(Y1-L4)-FST11-TYY and MYRG187(Y1-L3)-FST11-TYY and Chair Prof Grants RDG009FST-TYY ofUniversity of Macau as well as Macau FDC Grants T-100-2012-A3 and 026ndash2013-A This research project was alsosupported by the National Natural Science Foundation ofChina 61273244

References

[1] P L Combettes and J-C Pesquet ldquoWavelet-constrained imagerestorationrdquo International Journal of Wavelets Multiresolutionand Information Processing vol 2 no 4 pp 371ndash389 2004

[2] M Ehler and K Koch ldquoThe construction of multiwavelet bi-frames and applications to variational image denoisingrdquo Inter-national Journal of Wavelets Multiresolution and InformationProcessing vol 8 no 3 pp 431ndash455 2010

[3] P Jain and S N Merchant ldquoWavelet-based multiresolutionhistogram for fast image retrievalrdquo International Journal ofWavelets Multiresolution and Information Processing vol 2 no1 pp 59ndash73 2004

[4] S Mallat and W L Hwang ldquoSingularity detection and pro-cessing with waveletsrdquo Institute of Electrical and ElectronicsEngineers Transactions on InformationTheory vol 38 no 2 pp617ndash643 1992

[5] B U Shankar S K Meher and A Ghosh ldquoNeuro-waveletclassifier formultispectral remote sensing imagesrdquo InternationalJournal of Wavelets Multiresolution and Information Processingvol 5 no 4 pp 589ndash611 2007

[6] S Shi Y Zhang and Y Hu ldquoA wavelet-based image edgedetection and estimationmethod with adaptive scale selectionrdquoInternational Journal of Wavelets Multiresolution and Informa-tion Processing vol 8 no 3 pp 385ndash405 2010

[7] Y Y Tang Wavelets Theory Approach to Pattern RecognitionWorld Scientific Singapor 2009

[8] Q M Tieng and W Boles ldquoWavelet-based affine invariantrepresentation a tool for recognizing planar objects in 3Dspacerdquo IEEE Transactions on Pattern Analysis and MachineIntelligence vol 19 no 8 pp 921ndash925 1997

[9] P Wunsch and A F Laine ldquoWavelet descriptors for mul-tiresolution recognition of handprinted charactersrdquo PatternRecognition vol 28 no 8 pp 1237ndash1249 1995

[10] H Yin and H Liu ldquoA Bregman iterative regularization methodfor wavelet-based image deblurringrdquo International Journal of

Wavelets Multiresolution and Information Processing vol 8 no3 pp 485ndash499 2010

[11] X You and Y Y Tang ldquoWavelet-based approach to characterskeletonrdquo IEEE Transactions on Image Processing vol 16 no 5pp 1220ndash1231 2007

[12] T Zhang Q Fan and Q Gao ldquoWavelet characterization ofHardy space ℎ

1 and its application in variational image decom-positionrdquo International Journal of Wavelets Multiresolution andInformation Processing vol 8 no 1 pp 71ndash87 2010

[13] Y Y Tang L Y Li Feng and J Liu ldquoScale-independent waveletalgorithm for detecting step-structure edgesrdquo Tech Rep IEEETransactions on InformationTheory Brisbane Australia 1998

[14] S G Mallat ldquoMultiresolution approximations and waveletorthonormal bases of 119871

2(R)rdquo Transactions of the American

Mathematical Society vol 315 no 1 pp 69ndash87 1989[15] J H McClellan and C M Rader Number Theory in Digital Sig-

nal Processing Prentice Hall Signal Processing Series PrenticeHall Englewood Cliffs NJ USA 1979

[16] X Ran and K J R Liu ldquoFast algorithms for 2-D circularconvolutions and number theoretic transforms based on poly-nomial transforms over finite ringsrdquo IEEE Transactions onSignal Processing vol 43 no 3 pp 569ndash578 1995

[17] Q Sun ldquoSome results in the application of the number theoryto digital signal processing and public-key systemsrdquo in NumberTheory and Its Applications in China vol 77 of ContemporaryMathematics pp 107ndash112 American Mathematical SocietyProvidence RI USA 1988

[18] Y Y Tang Q Sun L H Yang and L Feng ldquoAn overlap-save method for the calculation of the two-dimensional digitalconvolutionrdquo Tech Rep Department of Computer ScienceHong Kong Baptist University 1998

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 10: Research Article Implementation of 2D Discrete Wavelet ...downloads.hindawi.com/journals/mpe/2014/532979.pdfResearch Article Implementation of 2D Discrete Wavelet Transform by Number

10 Mathematical Problems in Engineering

represents the input of the filter In this example because 1198971=

1198981= 8 and 119897

2= 1198982= 3 the length of input matrix is 8 times 8

and that of the filter is 3 times 3Using the overlap-save method to calculate the output of

the filter

11991011989911198992

=

2

sum

1198961=0

2

sum

1198962=0

ℎ11989611198962

1199091198991minus11989611198992minus1198962

0le1198991minus1198961lt8

0le1198992minus1198962lt8

1198991= 0 1 2 3 4 5 6 7 119899

2= 0 1 2 3 4 5 6 7

(54)

means that the elements of the matrix

119884 = (

11991000

11991001

sdot sdot sdot 11991007

11991010

11991011

sdot sdot sdot 11991017

11991070

11991071

sdot sdot sdot 11991077

) (55)

need to be computedThe solution is given belowSince 119897

1= 1198981= 8 1198972= 1198982= 3 by selecting 119873

1015840= 1198972minus 1 =

2 and 1198721015840= 1198982minus 1 = 2 we have 119873 = 119872 = 4 In order to

use the FNTT the input matrix is divided into 9 submatricesof size 4times 4 Each consecutive submatrix is partly overlappedwith the size of 2 times 2 pixels In addition zeros of size 1 times 1

are added to the filtering sequence to ensure that its lengthis equivalent to that of the submatrix Therefore the filteringsequence ℎ

11989911198992

is extended to ℎ1015840

11989911198992

that is

ℎ1015840

11989911198992

= ℎ11989911198992

if 1198991= 0 1 2 119899

2= 0 1 2

0 if 1198991= 3 or 119899

2= 3

(56)

where 1198991= 0 1 2 3 119899

2= 0 1 2 3

Next we compute the circular convolution of the twosequences 119909

1198991+2V11198992+2V2

and ℎ1015840

11989911198992

(1198991

= 0 1 2 3 1198992

=

0 1 2 3)

11991011990511199052

=

3

sum

1198991=0

3

sum

1198992=0

ℎ1015840

11989911198992

119909⟨1199051minus1198991⟩4+2V1⟨1199052minus1198992⟩4+2V2

=

2

sum

1198991=0

2

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩4+2V1⟨1199052minus1198992⟩4+2V2

(57)

where 1199051= 0 1 2 3 119905

2= 0 1 2 3

When 1199051= 2 3 119905

2= 2 3 we arrive at the following result

11991011990511199052

=

2

sum

1198991=0

2

sum

1198992=0

ℎ11989911198992

1199091199051minus1198991+2V11199052minus1198992+2V2

= 1199101199051+2V11199052+2V2

(58)

After choosing all the parameters of V1

= 0 1 2 V2

=

0 1 2 ([(1198971minus 119873)119873

1015840] = [(119898

1minus 119872)119872

1015840] = [(8 minus 4)2] = 2)

all 2 times 2 submatrices of the matrix 119884 defined in (34) will beobtained as follows

(11991022

11991023

11991032

11991033

)(11991024

11991025

11991034

11991035

)(11991026

11991027

11991036

11991037

)

(11991042

11991043

11991052

11991053

)(11991044

11991045

11991054

11991055

)(11991046

11991047

11991056

11991057

)

(11991062

11991063

11991072

11991073

)(11991064

11991065

11991074

11991075

)(11991066

11991067

11991076

11991077

)

(59)

For 11991011990511199052

(1199051

= 0 1 1199052

= 0 1 2 3 4 5 6 7 1199051

=

0 1 2 3 4 5 6 7 1199052

= 0 1) we can compute it by usingan overlap-save method The detail of it is presented in theTechnical Report [18]

The fast number theoretic transform (FNTT) is nowapplied to the implementation of the circular convolution

11991011990511199052

=

3

sum

1198991=0

3

sum

1198992=0

ℎ11989911198992

119909⟨1199051minus1198991⟩4⟨1199052minus1198992⟩4

1199051= 0 1 2 3 119905

2= 0 1 2 3

(60)

The computation is performed in the following five stepsshown in Figure 5

Step 1 (choosing 119872) Since

1003816100381610038161003816100381611991011990511199052

10038161003816100381610038161003816le

1003816100381610038161003816100381611990911989911198992

10038161003816100381610038161003816max

3

sum

1198961=0

3

sum

1198962=0

10038161003816100381610038161003816ℎ11989611198962

10038161003816100381610038161003816= 3 times 6 = 18 (61)

we can select119898 = 257 = 28+ 1 so that 18 lt 2572 where 257

is a prime Clearly 164 equiv 1 (mod257) and 16119895

equiv 1 (mod257) for 1 le 119895 le 3

Thus

11988311989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

11990911989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(62)

is a 2D number theoretic transform It has the followinginverse transform

11990911989911198992

equiv 4minus1

sdot 4minus1

3

sum

1198961=0

3

sum

1198962=0

11988311989611198962(minus16)11989911198961(minus16)11989921198962(mod 257)

1198991= 0 1 2 3 119899

2= 0 1 2 3

(63)

where 4minus1 denotes an integer so that (4minus1) sdot 4 equiv 1 (mod 257)

Mathematical Problems in Engineering 11

linear convolutionof the output matrixof the output matrix

cyclic convolutionCalculate the

of the filtering matrix

Calculate the

Calculate the numbertheoretic transformof the input matrix

Choose M

theoretic transformCalculate the number

Figure 5 Five steps of applying FNTT to calculate the output of (54)

Step 2 (calculating the number theoretic transform of inputmatrix by the FNTT) For computational convenience hereone writes

11988001198962

equiv

3

sum

1198992=0

11990901198992

1611989921198962 119880

11198962

equiv

3

sum

1198992=0

11990911198992

1611989921198962(mod 257)

11988021198962

equiv

3

sum

1198992=0

11990921198992

1611989921198962 119880

31198962

equiv

3

sum

1198992=0

11990931198992

1611989921198962(mod 257)

1198962= 0 1 2 3

(64)

Then (62) becomes

11988311989610

equiv

3

sum

1198991=0

11988011989910

1611989911198961 119883

11989611

equiv

3

sum

1198991=0

11988011989911

1611989911198961(mod 257)

11988311989612

equiv

3

sum

1198991=0

11988011989912

1611989911198961 119883

11989613

equiv

3

sum

1198991=0

11988011989913

1611989911198961(mod 257)

1198961= 0 1 2 3

(65)

Use the FNTT to calculate (64) and (65)So

(

11988000

11988001

11988002

11988003

11988010

11988011

11988012

11988013

11988020

11988021

11988022

11988023

11988030

11988031

11988032

11988033

)

equiv (

3 95 3 minus97

3 35 3 minus29

1 minus33 1 31

5 35 minus3 minus29

) (mod 257)

119883 = (

11988300

11988301

11988302

11988303

11988310

11988311

11988312

11988313

11988320

11988321

11988322

11988323

11988330

11988331

11988332

11988333

)

equiv (

12 132 4 minus124

minus30 128 98 minus128

minus4 minus8 4 minus8

34 128 minus94 minus128

) (mod 257)

(66)

Step 3 (calculating the number theoretic transformof the filterby the FNTT) The FNTT of the filter ℎ

11989911198992

is written as

11986711989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

ℎ1015840

11989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(67)

Similarly we have

119867 = (

11986700

11986701

11986702

11986703

11986710

11986711

11986712

11986713

11986720

11986721

11986722

11986723

11986730

11986731

11986732

11986733

)

equiv (

6 32 2 minus32

32 0 2 34

2 minus2 2 minus2

minus32 minus30 2 0

) (mod 257)

(68)

Step 4 (compute the number theoretic transformof the outputof the filter) From the preceding three steps we can computethe circular convolution of the filter by defining the productof 119883 and 119867 as

119884 = (

11988400

11988401

11988402

11988403

11988410

11988411

11988412

11988413

11988420

11988421

11988422

11988423

11988430

11988431

11988432

11988433

)

equiv 119883 ⊙ 119867 = (

11988300

11986700

11988301

11986701

11988302

11986702

11988303

11986703

11988310

11986710

11988311

11986711

11988312

11986712

11988313

11986713

11988320

11986720

11988321

11986721

11988322

11986722

11988323

11986723

11988330

11986730

11988331

11986731

11988332

11986732

11988333

11986733

)

equiv (

72 112 8 113

68 0 minus61 17

minus8 16 8 16

minus60 15 69 0

) (mod 257)

(69)

where

11988411989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

11991011989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(70)

12 Mathematical Problems in Engineering

Table 1 Filtering coefficients 12059521198951

119896119897 (119895 = 2) 120595(119903) are a quadratic spline wavelet

119897119896 119896 = 0 119896 = 1 119896 = 2 119896 = 3

119897 = 0 minus00838140026 minus00472041145 minus00129809398 minus00012592132119897 = 1 minus01416904181 minus00758706033 minus00196341425 minus00012698699119897 = 2 minus00651057437 minus00327749476 minus00063385521 minus00000750836119897 = 3 minus00088690016 minus00030044997 minus00001088651

(a) (b)

Figure 6 A 2-dimensional image of an aircraft was processed with 2D overlap-save method (a) Original Chinese handwriting and (b) thedivided up subimages of the character

and the 11991011989911198992

(1198991

= 0 1 2 3 1198992

= 0 1 2 3) is the circularconvolution of (60)

Step 5 (calculate the output of the linear convolution) From(63) we deduce the inverse transform of (70)

11991011989911198992

equiv 4minus1

sdot 4minus1

3

sum

1198961=0

3

sum

1198962=0

11988411989611198962(minus16)11989911198961

sdot (minus16)11989921198962(mod 257)

1198991= 0 1 2 3 119899

2= 0 1 2 3

(71)

Using FNTT to calculate (71) we have

(

11991000

11991001

11991002

11991003

11991010

11991011

11991012

11991013

11991020

11991021

11991022

11991023

11991030

11991031

11991032

11991033

) equiv (

8 6 4 0

1 7 13 1

2 2 6 4

1 5 5 7

) (mod 257)

(72)

Then the linear convolution in (58) is obtained

(11991022

11991023

11991032

11991033

) = (11991022

11991023

11991032

11991033

) = (6 4

5 7) (73)

52 Application to Image Processing The proposed methodcan be applied to many fields such as image processingand pattern recognition An example of the application to

the image processing is illustrated in Figure 6 The originalimage shown in Figure 6(a) is a 2-dimensional image of anaircraft with a size of 256 times 256 pixels that is 119897

1= 1198981

=

256 Our task is to extract its contours The discrete wavelettransform with scale 119904 = 2

119895 where 119895 = 2 was applied and thespline wavelet described in (1) of size 17 times 17 was chosenthat is 119897

2= 1198982

= 17 We use the filtering coefficientstabulated in Table 1 Using the 2D overlap-save method thisoriginal image was divided into 25 sections with each onehaving the dimension of 64 times 64 pixels that is we select119873 = 119872 = 64 1198731015840 = 119872

1015840= 48 [(119897

1minus 119873)119873

1015840] = [(119898

1minus

119872)1198721015840] = 4 (See Example 8 in Section 4) Figure 6(b)

shows these subimages The overlapped part can be explicitlyobserved in each subimage

To facilitate the presentation of the 2D overlap-savemethod the procedure of it is diagonally displayed inFigure 7 where a series of the divided subimages are illus-tratedThe image in Figure 6(a) was equivalently divided into25 sections by applying (27) In Figure 7(a) we represent 5subimages of V

0= 0 V

1= 0 V

0= 1 V

1= 1 V

0= 2 V

1= 2

and V0

= 3 V1

= 3 and V0

= 4 V1

= 4 consecutively Thelower-right corner of each subimage is repeated in the upper-left corner of its consecutive subimage Four subimages aredisplayed in Figure 7(b) and the parameters of V

0= 0 V1= 1

V0

= 1 V1

= 2 V0

= 2 V1

= 3 and V0

= 3 V1

= 4 werechosen In Figure 7(c) we selected 3 subimages of V

0= 0

V1

= 2 V0

= 1 V1

= 3 and V0

= 2 V1

= 4 There are3 subimages of V

0= 0 V

1= 3 and V

0= 1 V

1= 4 in

Figure 7(d) Figure 7(e) displays subimages of V0= 0 V

1= 4

Mathematical Problems in Engineering 13

(a) (b) (c)

(d) (e) (f)

(g) (h) (i)

Figure 7 A 2-dimensional image of an aircraft is dividing into separated small subimages the parameters of V0and V

1are chosen as follows

(a) V0= 0 V

1= 0 V

0= 1 V

1= 1 V

0= 2 V

1= 2 and V

0= 3 V

1= 3 and V

0= 4 and V

1= 4 (b) V

0= 0 V

1= 1 V

0= 1 V

1= 2 V

0= 2 V

1= 3 and

V0= 3 and V

1= 4 (c) V

0= 0 V

1= 2 V

0= 1 V

1= 3 and V

0= 2 and V

1= 4 (d) V

0= 0 V

1= 3 and V

0= 1 and V

1= 4 (e) V

0= 0 and V

1= 4 (f)

V0= 1 V

1= 0 V

0= 2 V

1= 1 V

0= 3 V

1= 2 and V

0= 4 and V

1= 3 (g) V

0= 2 V

1= 0 V

0= 3 V

1= 1 and V

0= 4 and V

1= 2 (h) V

0= 3 V

1= 0

and V0= 4 and V

1= 1 and (i) V

0= 4 and V

1= 0

In Figure 7(f) V0= 1 V

1= 0 V

0= 2 V

1= 1 V

0= 3 V

1= 2

and V0= 4 V1= 3were chosen In Figure 7(g) the parameters

were decided upon V0= 2 V

1= 0 V

0= 3 V

1= 1 and V

0= 4

V1= 2 Two subimages are shown in Figure 7(h) by selecting

V0= 3 V

1= 0 and V

0= 4 V

1= 1 There is one subimage of

V0= 4 V

1= 0 in Figure 7(i)

We select a 2D NTT

11988311989611198962

equiv

63

sum

1198991=0

63

sum

1198992=0

11990911989911198992

211989911198961211989921198962 (mod 2

32+ 1) (74)

14 Mathematical Problems in Engineering

(a) (b)

(c) (d)

Figure 8 The linear outputs of 2D overlap-save method (a) the outputs of the linear convolution of each subimages (b) the left border andthe upper border of the outputs of the image of aircraft (c) the combined outputs of linear convolution except Γ-type border and (d) theentire contour extracted using 2D overlap-save method under wavelet transform

which has inverse transform

11990911989911198992

equiv 64minus1

64minus1

63

sum

1198961=0

63

sum

1198962=0

11988311989611198962

(minus231)11989911198961

times (minus231)11989921198962

(mod 232

+ 1)

1198991= 0 1 63 119899

2= 0 1 63

(75)

where 64minus1 denotes integer so that (64minus1)64 equiv 1 (mod 2

32+

1) and |11990911989911198992

| le 255The FNTT was applied to calculate the circular convo-

lution of each subimage After applying (31) to each of thesubblocks a series of segments of the contours were obtained

By using (32) we can gradually reach the final result of thelinear convolution Figure 8(a) illustrates those pixels whichsatisfy (35) where 119897

2= 1198982= 17 119873 = 119872 = 64 1198731015840 = 119872

1015840=

48 and V1 V2

= 0 1 2 3 4 Combining them together thecontours of the whole character were obtained and displayedin Figure 8(c) which excludes the Γ-type border Next the

Γ-type border was computed by direct method Figure 8(b)shows the result Combining this result with that shown inFigure 8(c) the entire contours of the Chinese handwritingwere combined Figure 8(d) represents the entire contour

6 Conclusions

A novel approach to reduce the computation complexityof the wavelet transform has been presented in this paperTwo key techniques have been applied in this new methodnamely fast number theoretic transform (FNTT) and two-dimensional overlap-save technique In the fast numbertheoretic transform the linear convolution is replaced bythe circular convolution It can speed up the computationof 2D discrete wavelet transform Directly calculating thefast number theoretic transform to the whole input sequencemay meet two difficulties namely a big modulo obstructsthe effective implementation of the fast number theoretictransform and a long input sequence slows the computation

Mathematical Problems in Engineering 15

of the fast number theoretic transform down To fight withsuch deficiencies a new technique which is referred to as 2Doverlap-save method has been developed Experiments havebeen conducted The fast number theoretic transform and2D overlap-method have been used to implement the dyadicwavelet transform and applied to contour extraction in imageprocessing and pattern recognition

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Acknowledgments

This work was supported by the Research GrantsMYRG205(Y1-L4)-FST11-TYY and MYRG187(Y1-L3)-FST11-TYY and Chair Prof Grants RDG009FST-TYY ofUniversity of Macau as well as Macau FDC Grants T-100-2012-A3 and 026ndash2013-A This research project was alsosupported by the National Natural Science Foundation ofChina 61273244

References

[1] P L Combettes and J-C Pesquet ldquoWavelet-constrained imagerestorationrdquo International Journal of Wavelets Multiresolutionand Information Processing vol 2 no 4 pp 371ndash389 2004

[2] M Ehler and K Koch ldquoThe construction of multiwavelet bi-frames and applications to variational image denoisingrdquo Inter-national Journal of Wavelets Multiresolution and InformationProcessing vol 8 no 3 pp 431ndash455 2010

[3] P Jain and S N Merchant ldquoWavelet-based multiresolutionhistogram for fast image retrievalrdquo International Journal ofWavelets Multiresolution and Information Processing vol 2 no1 pp 59ndash73 2004

[4] S Mallat and W L Hwang ldquoSingularity detection and pro-cessing with waveletsrdquo Institute of Electrical and ElectronicsEngineers Transactions on InformationTheory vol 38 no 2 pp617ndash643 1992

[5] B U Shankar S K Meher and A Ghosh ldquoNeuro-waveletclassifier formultispectral remote sensing imagesrdquo InternationalJournal of Wavelets Multiresolution and Information Processingvol 5 no 4 pp 589ndash611 2007

[6] S Shi Y Zhang and Y Hu ldquoA wavelet-based image edgedetection and estimationmethod with adaptive scale selectionrdquoInternational Journal of Wavelets Multiresolution and Informa-tion Processing vol 8 no 3 pp 385ndash405 2010

[7] Y Y Tang Wavelets Theory Approach to Pattern RecognitionWorld Scientific Singapor 2009

[8] Q M Tieng and W Boles ldquoWavelet-based affine invariantrepresentation a tool for recognizing planar objects in 3Dspacerdquo IEEE Transactions on Pattern Analysis and MachineIntelligence vol 19 no 8 pp 921ndash925 1997

[9] P Wunsch and A F Laine ldquoWavelet descriptors for mul-tiresolution recognition of handprinted charactersrdquo PatternRecognition vol 28 no 8 pp 1237ndash1249 1995

[10] H Yin and H Liu ldquoA Bregman iterative regularization methodfor wavelet-based image deblurringrdquo International Journal of

Wavelets Multiresolution and Information Processing vol 8 no3 pp 485ndash499 2010

[11] X You and Y Y Tang ldquoWavelet-based approach to characterskeletonrdquo IEEE Transactions on Image Processing vol 16 no 5pp 1220ndash1231 2007

[12] T Zhang Q Fan and Q Gao ldquoWavelet characterization ofHardy space ℎ

1 and its application in variational image decom-positionrdquo International Journal of Wavelets Multiresolution andInformation Processing vol 8 no 1 pp 71ndash87 2010

[13] Y Y Tang L Y Li Feng and J Liu ldquoScale-independent waveletalgorithm for detecting step-structure edgesrdquo Tech Rep IEEETransactions on InformationTheory Brisbane Australia 1998

[14] S G Mallat ldquoMultiresolution approximations and waveletorthonormal bases of 119871

2(R)rdquo Transactions of the American

Mathematical Society vol 315 no 1 pp 69ndash87 1989[15] J H McClellan and C M Rader Number Theory in Digital Sig-

nal Processing Prentice Hall Signal Processing Series PrenticeHall Englewood Cliffs NJ USA 1979

[16] X Ran and K J R Liu ldquoFast algorithms for 2-D circularconvolutions and number theoretic transforms based on poly-nomial transforms over finite ringsrdquo IEEE Transactions onSignal Processing vol 43 no 3 pp 569ndash578 1995

[17] Q Sun ldquoSome results in the application of the number theoryto digital signal processing and public-key systemsrdquo in NumberTheory and Its Applications in China vol 77 of ContemporaryMathematics pp 107ndash112 American Mathematical SocietyProvidence RI USA 1988

[18] Y Y Tang Q Sun L H Yang and L Feng ldquoAn overlap-save method for the calculation of the two-dimensional digitalconvolutionrdquo Tech Rep Department of Computer ScienceHong Kong Baptist University 1998

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 11: Research Article Implementation of 2D Discrete Wavelet ...downloads.hindawi.com/journals/mpe/2014/532979.pdfResearch Article Implementation of 2D Discrete Wavelet Transform by Number

Mathematical Problems in Engineering 11

linear convolutionof the output matrixof the output matrix

cyclic convolutionCalculate the

of the filtering matrix

Calculate the

Calculate the numbertheoretic transformof the input matrix

Choose M

theoretic transformCalculate the number

Figure 5 Five steps of applying FNTT to calculate the output of (54)

Step 2 (calculating the number theoretic transform of inputmatrix by the FNTT) For computational convenience hereone writes

11988001198962

equiv

3

sum

1198992=0

11990901198992

1611989921198962 119880

11198962

equiv

3

sum

1198992=0

11990911198992

1611989921198962(mod 257)

11988021198962

equiv

3

sum

1198992=0

11990921198992

1611989921198962 119880

31198962

equiv

3

sum

1198992=0

11990931198992

1611989921198962(mod 257)

1198962= 0 1 2 3

(64)

Then (62) becomes

11988311989610

equiv

3

sum

1198991=0

11988011989910

1611989911198961 119883

11989611

equiv

3

sum

1198991=0

11988011989911

1611989911198961(mod 257)

11988311989612

equiv

3

sum

1198991=0

11988011989912

1611989911198961 119883

11989613

equiv

3

sum

1198991=0

11988011989913

1611989911198961(mod 257)

1198961= 0 1 2 3

(65)

Use the FNTT to calculate (64) and (65)So

(

11988000

11988001

11988002

11988003

11988010

11988011

11988012

11988013

11988020

11988021

11988022

11988023

11988030

11988031

11988032

11988033

)

equiv (

3 95 3 minus97

3 35 3 minus29

1 minus33 1 31

5 35 minus3 minus29

) (mod 257)

119883 = (

11988300

11988301

11988302

11988303

11988310

11988311

11988312

11988313

11988320

11988321

11988322

11988323

11988330

11988331

11988332

11988333

)

equiv (

12 132 4 minus124

minus30 128 98 minus128

minus4 minus8 4 minus8

34 128 minus94 minus128

) (mod 257)

(66)

Step 3 (calculating the number theoretic transformof the filterby the FNTT) The FNTT of the filter ℎ

11989911198992

is written as

11986711989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

ℎ1015840

11989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(67)

Similarly we have

119867 = (

11986700

11986701

11986702

11986703

11986710

11986711

11986712

11986713

11986720

11986721

11986722

11986723

11986730

11986731

11986732

11986733

)

equiv (

6 32 2 minus32

32 0 2 34

2 minus2 2 minus2

minus32 minus30 2 0

) (mod 257)

(68)

Step 4 (compute the number theoretic transformof the outputof the filter) From the preceding three steps we can computethe circular convolution of the filter by defining the productof 119883 and 119867 as

119884 = (

11988400

11988401

11988402

11988403

11988410

11988411

11988412

11988413

11988420

11988421

11988422

11988423

11988430

11988431

11988432

11988433

)

equiv 119883 ⊙ 119867 = (

11988300

11986700

11988301

11986701

11988302

11986702

11988303

11986703

11988310

11986710

11988311

11986711

11988312

11986712

11988313

11986713

11988320

11986720

11988321

11986721

11988322

11986722

11988323

11986723

11988330

11986730

11988331

11986731

11988332

11986732

11988333

11986733

)

equiv (

72 112 8 113

68 0 minus61 17

minus8 16 8 16

minus60 15 69 0

) (mod 257)

(69)

where

11988411989611198962

equiv

3

sum

1198991=0

3

sum

1198992=0

11991011989911198992

1611989911198961 sdot 1611989921198962(mod 257)

1198961= 0 1 2 3 119896

2= 0 1 2 3

(70)

12 Mathematical Problems in Engineering

Table 1 Filtering coefficients 12059521198951

119896119897 (119895 = 2) 120595(119903) are a quadratic spline wavelet

119897119896 119896 = 0 119896 = 1 119896 = 2 119896 = 3

119897 = 0 minus00838140026 minus00472041145 minus00129809398 minus00012592132119897 = 1 minus01416904181 minus00758706033 minus00196341425 minus00012698699119897 = 2 minus00651057437 minus00327749476 minus00063385521 minus00000750836119897 = 3 minus00088690016 minus00030044997 minus00001088651

(a) (b)

Figure 6 A 2-dimensional image of an aircraft was processed with 2D overlap-save method (a) Original Chinese handwriting and (b) thedivided up subimages of the character

and the 11991011989911198992

(1198991

= 0 1 2 3 1198992

= 0 1 2 3) is the circularconvolution of (60)

Step 5 (calculate the output of the linear convolution) From(63) we deduce the inverse transform of (70)

11991011989911198992

equiv 4minus1

sdot 4minus1

3

sum

1198961=0

3

sum

1198962=0

11988411989611198962(minus16)11989911198961

sdot (minus16)11989921198962(mod 257)

1198991= 0 1 2 3 119899

2= 0 1 2 3

(71)

Using FNTT to calculate (71) we have

(

11991000

11991001

11991002

11991003

11991010

11991011

11991012

11991013

11991020

11991021

11991022

11991023

11991030

11991031

11991032

11991033

) equiv (

8 6 4 0

1 7 13 1

2 2 6 4

1 5 5 7

) (mod 257)

(72)

Then the linear convolution in (58) is obtained

(11991022

11991023

11991032

11991033

) = (11991022

11991023

11991032

11991033

) = (6 4

5 7) (73)

52 Application to Image Processing The proposed methodcan be applied to many fields such as image processingand pattern recognition An example of the application to

the image processing is illustrated in Figure 6 The originalimage shown in Figure 6(a) is a 2-dimensional image of anaircraft with a size of 256 times 256 pixels that is 119897

1= 1198981

=

256 Our task is to extract its contours The discrete wavelettransform with scale 119904 = 2

119895 where 119895 = 2 was applied and thespline wavelet described in (1) of size 17 times 17 was chosenthat is 119897

2= 1198982

= 17 We use the filtering coefficientstabulated in Table 1 Using the 2D overlap-save method thisoriginal image was divided into 25 sections with each onehaving the dimension of 64 times 64 pixels that is we select119873 = 119872 = 64 1198731015840 = 119872

1015840= 48 [(119897

1minus 119873)119873

1015840] = [(119898

1minus

119872)1198721015840] = 4 (See Example 8 in Section 4) Figure 6(b)

shows these subimages The overlapped part can be explicitlyobserved in each subimage

To facilitate the presentation of the 2D overlap-savemethod the procedure of it is diagonally displayed inFigure 7 where a series of the divided subimages are illus-tratedThe image in Figure 6(a) was equivalently divided into25 sections by applying (27) In Figure 7(a) we represent 5subimages of V

0= 0 V

1= 0 V

0= 1 V

1= 1 V

0= 2 V

1= 2

and V0

= 3 V1

= 3 and V0

= 4 V1

= 4 consecutively Thelower-right corner of each subimage is repeated in the upper-left corner of its consecutive subimage Four subimages aredisplayed in Figure 7(b) and the parameters of V

0= 0 V1= 1

V0

= 1 V1

= 2 V0

= 2 V1

= 3 and V0

= 3 V1

= 4 werechosen In Figure 7(c) we selected 3 subimages of V

0= 0

V1

= 2 V0

= 1 V1

= 3 and V0

= 2 V1

= 4 There are3 subimages of V

0= 0 V

1= 3 and V

0= 1 V

1= 4 in

Figure 7(d) Figure 7(e) displays subimages of V0= 0 V

1= 4

Mathematical Problems in Engineering 13

(a) (b) (c)

(d) (e) (f)

(g) (h) (i)

Figure 7 A 2-dimensional image of an aircraft is dividing into separated small subimages the parameters of V0and V

1are chosen as follows

(a) V0= 0 V

1= 0 V

0= 1 V

1= 1 V

0= 2 V

1= 2 and V

0= 3 V

1= 3 and V

0= 4 and V

1= 4 (b) V

0= 0 V

1= 1 V

0= 1 V

1= 2 V

0= 2 V

1= 3 and

V0= 3 and V

1= 4 (c) V

0= 0 V

1= 2 V

0= 1 V

1= 3 and V

0= 2 and V

1= 4 (d) V

0= 0 V

1= 3 and V

0= 1 and V

1= 4 (e) V

0= 0 and V

1= 4 (f)

V0= 1 V

1= 0 V

0= 2 V

1= 1 V

0= 3 V

1= 2 and V

0= 4 and V

1= 3 (g) V

0= 2 V

1= 0 V

0= 3 V

1= 1 and V

0= 4 and V

1= 2 (h) V

0= 3 V

1= 0

and V0= 4 and V

1= 1 and (i) V

0= 4 and V

1= 0

In Figure 7(f) V0= 1 V

1= 0 V

0= 2 V

1= 1 V

0= 3 V

1= 2

and V0= 4 V1= 3were chosen In Figure 7(g) the parameters

were decided upon V0= 2 V

1= 0 V

0= 3 V

1= 1 and V

0= 4

V1= 2 Two subimages are shown in Figure 7(h) by selecting

V0= 3 V

1= 0 and V

0= 4 V

1= 1 There is one subimage of

V0= 4 V

1= 0 in Figure 7(i)

We select a 2D NTT

11988311989611198962

equiv

63

sum

1198991=0

63

sum

1198992=0

11990911989911198992

211989911198961211989921198962 (mod 2

32+ 1) (74)

14 Mathematical Problems in Engineering

(a) (b)

(c) (d)

Figure 8 The linear outputs of 2D overlap-save method (a) the outputs of the linear convolution of each subimages (b) the left border andthe upper border of the outputs of the image of aircraft (c) the combined outputs of linear convolution except Γ-type border and (d) theentire contour extracted using 2D overlap-save method under wavelet transform

which has inverse transform

11990911989911198992

equiv 64minus1

64minus1

63

sum

1198961=0

63

sum

1198962=0

11988311989611198962

(minus231)11989911198961

times (minus231)11989921198962

(mod 232

+ 1)

1198991= 0 1 63 119899

2= 0 1 63

(75)

where 64minus1 denotes integer so that (64minus1)64 equiv 1 (mod 2

32+

1) and |11990911989911198992

| le 255The FNTT was applied to calculate the circular convo-

lution of each subimage After applying (31) to each of thesubblocks a series of segments of the contours were obtained

By using (32) we can gradually reach the final result of thelinear convolution Figure 8(a) illustrates those pixels whichsatisfy (35) where 119897

2= 1198982= 17 119873 = 119872 = 64 1198731015840 = 119872

1015840=

48 and V1 V2

= 0 1 2 3 4 Combining them together thecontours of the whole character were obtained and displayedin Figure 8(c) which excludes the Γ-type border Next the

Γ-type border was computed by direct method Figure 8(b)shows the result Combining this result with that shown inFigure 8(c) the entire contours of the Chinese handwritingwere combined Figure 8(d) represents the entire contour

6 Conclusions

A novel approach to reduce the computation complexityof the wavelet transform has been presented in this paperTwo key techniques have been applied in this new methodnamely fast number theoretic transform (FNTT) and two-dimensional overlap-save technique In the fast numbertheoretic transform the linear convolution is replaced bythe circular convolution It can speed up the computationof 2D discrete wavelet transform Directly calculating thefast number theoretic transform to the whole input sequencemay meet two difficulties namely a big modulo obstructsthe effective implementation of the fast number theoretictransform and a long input sequence slows the computation

Mathematical Problems in Engineering 15

of the fast number theoretic transform down To fight withsuch deficiencies a new technique which is referred to as 2Doverlap-save method has been developed Experiments havebeen conducted The fast number theoretic transform and2D overlap-method have been used to implement the dyadicwavelet transform and applied to contour extraction in imageprocessing and pattern recognition

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Acknowledgments

This work was supported by the Research GrantsMYRG205(Y1-L4)-FST11-TYY and MYRG187(Y1-L3)-FST11-TYY and Chair Prof Grants RDG009FST-TYY ofUniversity of Macau as well as Macau FDC Grants T-100-2012-A3 and 026ndash2013-A This research project was alsosupported by the National Natural Science Foundation ofChina 61273244

References

[1] P L Combettes and J-C Pesquet ldquoWavelet-constrained imagerestorationrdquo International Journal of Wavelets Multiresolutionand Information Processing vol 2 no 4 pp 371ndash389 2004

[2] M Ehler and K Koch ldquoThe construction of multiwavelet bi-frames and applications to variational image denoisingrdquo Inter-national Journal of Wavelets Multiresolution and InformationProcessing vol 8 no 3 pp 431ndash455 2010

[3] P Jain and S N Merchant ldquoWavelet-based multiresolutionhistogram for fast image retrievalrdquo International Journal ofWavelets Multiresolution and Information Processing vol 2 no1 pp 59ndash73 2004

[4] S Mallat and W L Hwang ldquoSingularity detection and pro-cessing with waveletsrdquo Institute of Electrical and ElectronicsEngineers Transactions on InformationTheory vol 38 no 2 pp617ndash643 1992

[5] B U Shankar S K Meher and A Ghosh ldquoNeuro-waveletclassifier formultispectral remote sensing imagesrdquo InternationalJournal of Wavelets Multiresolution and Information Processingvol 5 no 4 pp 589ndash611 2007

[6] S Shi Y Zhang and Y Hu ldquoA wavelet-based image edgedetection and estimationmethod with adaptive scale selectionrdquoInternational Journal of Wavelets Multiresolution and Informa-tion Processing vol 8 no 3 pp 385ndash405 2010

[7] Y Y Tang Wavelets Theory Approach to Pattern RecognitionWorld Scientific Singapor 2009

[8] Q M Tieng and W Boles ldquoWavelet-based affine invariantrepresentation a tool for recognizing planar objects in 3Dspacerdquo IEEE Transactions on Pattern Analysis and MachineIntelligence vol 19 no 8 pp 921ndash925 1997

[9] P Wunsch and A F Laine ldquoWavelet descriptors for mul-tiresolution recognition of handprinted charactersrdquo PatternRecognition vol 28 no 8 pp 1237ndash1249 1995

[10] H Yin and H Liu ldquoA Bregman iterative regularization methodfor wavelet-based image deblurringrdquo International Journal of

Wavelets Multiresolution and Information Processing vol 8 no3 pp 485ndash499 2010

[11] X You and Y Y Tang ldquoWavelet-based approach to characterskeletonrdquo IEEE Transactions on Image Processing vol 16 no 5pp 1220ndash1231 2007

[12] T Zhang Q Fan and Q Gao ldquoWavelet characterization ofHardy space ℎ

1 and its application in variational image decom-positionrdquo International Journal of Wavelets Multiresolution andInformation Processing vol 8 no 1 pp 71ndash87 2010

[13] Y Y Tang L Y Li Feng and J Liu ldquoScale-independent waveletalgorithm for detecting step-structure edgesrdquo Tech Rep IEEETransactions on InformationTheory Brisbane Australia 1998

[14] S G Mallat ldquoMultiresolution approximations and waveletorthonormal bases of 119871

2(R)rdquo Transactions of the American

Mathematical Society vol 315 no 1 pp 69ndash87 1989[15] J H McClellan and C M Rader Number Theory in Digital Sig-

nal Processing Prentice Hall Signal Processing Series PrenticeHall Englewood Cliffs NJ USA 1979

[16] X Ran and K J R Liu ldquoFast algorithms for 2-D circularconvolutions and number theoretic transforms based on poly-nomial transforms over finite ringsrdquo IEEE Transactions onSignal Processing vol 43 no 3 pp 569ndash578 1995

[17] Q Sun ldquoSome results in the application of the number theoryto digital signal processing and public-key systemsrdquo in NumberTheory and Its Applications in China vol 77 of ContemporaryMathematics pp 107ndash112 American Mathematical SocietyProvidence RI USA 1988

[18] Y Y Tang Q Sun L H Yang and L Feng ldquoAn overlap-save method for the calculation of the two-dimensional digitalconvolutionrdquo Tech Rep Department of Computer ScienceHong Kong Baptist University 1998

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 12: Research Article Implementation of 2D Discrete Wavelet ...downloads.hindawi.com/journals/mpe/2014/532979.pdfResearch Article Implementation of 2D Discrete Wavelet Transform by Number

12 Mathematical Problems in Engineering

Table 1 Filtering coefficients 12059521198951

119896119897 (119895 = 2) 120595(119903) are a quadratic spline wavelet

119897119896 119896 = 0 119896 = 1 119896 = 2 119896 = 3

119897 = 0 minus00838140026 minus00472041145 minus00129809398 minus00012592132119897 = 1 minus01416904181 minus00758706033 minus00196341425 minus00012698699119897 = 2 minus00651057437 minus00327749476 minus00063385521 minus00000750836119897 = 3 minus00088690016 minus00030044997 minus00001088651

(a) (b)

Figure 6 A 2-dimensional image of an aircraft was processed with 2D overlap-save method (a) Original Chinese handwriting and (b) thedivided up subimages of the character

and the 11991011989911198992

(1198991

= 0 1 2 3 1198992

= 0 1 2 3) is the circularconvolution of (60)

Step 5 (calculate the output of the linear convolution) From(63) we deduce the inverse transform of (70)

11991011989911198992

equiv 4minus1

sdot 4minus1

3

sum

1198961=0

3

sum

1198962=0

11988411989611198962(minus16)11989911198961

sdot (minus16)11989921198962(mod 257)

1198991= 0 1 2 3 119899

2= 0 1 2 3

(71)

Using FNTT to calculate (71) we have

(

11991000

11991001

11991002

11991003

11991010

11991011

11991012

11991013

11991020

11991021

11991022

11991023

11991030

11991031

11991032

11991033

) equiv (

8 6 4 0

1 7 13 1

2 2 6 4

1 5 5 7

) (mod 257)

(72)

Then the linear convolution in (58) is obtained

(11991022

11991023

11991032

11991033

) = (11991022

11991023

11991032

11991033

) = (6 4

5 7) (73)

52 Application to Image Processing The proposed methodcan be applied to many fields such as image processingand pattern recognition An example of the application to

the image processing is illustrated in Figure 6 The originalimage shown in Figure 6(a) is a 2-dimensional image of anaircraft with a size of 256 times 256 pixels that is 119897

1= 1198981

=

256 Our task is to extract its contours The discrete wavelettransform with scale 119904 = 2

119895 where 119895 = 2 was applied and thespline wavelet described in (1) of size 17 times 17 was chosenthat is 119897

2= 1198982

= 17 We use the filtering coefficientstabulated in Table 1 Using the 2D overlap-save method thisoriginal image was divided into 25 sections with each onehaving the dimension of 64 times 64 pixels that is we select119873 = 119872 = 64 1198731015840 = 119872

1015840= 48 [(119897

1minus 119873)119873

1015840] = [(119898

1minus

119872)1198721015840] = 4 (See Example 8 in Section 4) Figure 6(b)

shows these subimages The overlapped part can be explicitlyobserved in each subimage

To facilitate the presentation of the 2D overlap-savemethod the procedure of it is diagonally displayed inFigure 7 where a series of the divided subimages are illus-tratedThe image in Figure 6(a) was equivalently divided into25 sections by applying (27) In Figure 7(a) we represent 5subimages of V

0= 0 V

1= 0 V

0= 1 V

1= 1 V

0= 2 V

1= 2

and V0

= 3 V1

= 3 and V0

= 4 V1

= 4 consecutively Thelower-right corner of each subimage is repeated in the upper-left corner of its consecutive subimage Four subimages aredisplayed in Figure 7(b) and the parameters of V

0= 0 V1= 1

V0

= 1 V1

= 2 V0

= 2 V1

= 3 and V0

= 3 V1

= 4 werechosen In Figure 7(c) we selected 3 subimages of V

0= 0

V1

= 2 V0

= 1 V1

= 3 and V0

= 2 V1

= 4 There are3 subimages of V

0= 0 V

1= 3 and V

0= 1 V

1= 4 in

Figure 7(d) Figure 7(e) displays subimages of V0= 0 V

1= 4

Mathematical Problems in Engineering 13

(a) (b) (c)

(d) (e) (f)

(g) (h) (i)

Figure 7 A 2-dimensional image of an aircraft is dividing into separated small subimages the parameters of V0and V

1are chosen as follows

(a) V0= 0 V

1= 0 V

0= 1 V

1= 1 V

0= 2 V

1= 2 and V

0= 3 V

1= 3 and V

0= 4 and V

1= 4 (b) V

0= 0 V

1= 1 V

0= 1 V

1= 2 V

0= 2 V

1= 3 and

V0= 3 and V

1= 4 (c) V

0= 0 V

1= 2 V

0= 1 V

1= 3 and V

0= 2 and V

1= 4 (d) V

0= 0 V

1= 3 and V

0= 1 and V

1= 4 (e) V

0= 0 and V

1= 4 (f)

V0= 1 V

1= 0 V

0= 2 V

1= 1 V

0= 3 V

1= 2 and V

0= 4 and V

1= 3 (g) V

0= 2 V

1= 0 V

0= 3 V

1= 1 and V

0= 4 and V

1= 2 (h) V

0= 3 V

1= 0

and V0= 4 and V

1= 1 and (i) V

0= 4 and V

1= 0

In Figure 7(f) V0= 1 V

1= 0 V

0= 2 V

1= 1 V

0= 3 V

1= 2

and V0= 4 V1= 3were chosen In Figure 7(g) the parameters

were decided upon V0= 2 V

1= 0 V

0= 3 V

1= 1 and V

0= 4

V1= 2 Two subimages are shown in Figure 7(h) by selecting

V0= 3 V

1= 0 and V

0= 4 V

1= 1 There is one subimage of

V0= 4 V

1= 0 in Figure 7(i)

We select a 2D NTT

11988311989611198962

equiv

63

sum

1198991=0

63

sum

1198992=0

11990911989911198992

211989911198961211989921198962 (mod 2

32+ 1) (74)

14 Mathematical Problems in Engineering

(a) (b)

(c) (d)

Figure 8 The linear outputs of 2D overlap-save method (a) the outputs of the linear convolution of each subimages (b) the left border andthe upper border of the outputs of the image of aircraft (c) the combined outputs of linear convolution except Γ-type border and (d) theentire contour extracted using 2D overlap-save method under wavelet transform

which has inverse transform

11990911989911198992

equiv 64minus1

64minus1

63

sum

1198961=0

63

sum

1198962=0

11988311989611198962

(minus231)11989911198961

times (minus231)11989921198962

(mod 232

+ 1)

1198991= 0 1 63 119899

2= 0 1 63

(75)

where 64minus1 denotes integer so that (64minus1)64 equiv 1 (mod 2

32+

1) and |11990911989911198992

| le 255The FNTT was applied to calculate the circular convo-

lution of each subimage After applying (31) to each of thesubblocks a series of segments of the contours were obtained

By using (32) we can gradually reach the final result of thelinear convolution Figure 8(a) illustrates those pixels whichsatisfy (35) where 119897

2= 1198982= 17 119873 = 119872 = 64 1198731015840 = 119872

1015840=

48 and V1 V2

= 0 1 2 3 4 Combining them together thecontours of the whole character were obtained and displayedin Figure 8(c) which excludes the Γ-type border Next the

Γ-type border was computed by direct method Figure 8(b)shows the result Combining this result with that shown inFigure 8(c) the entire contours of the Chinese handwritingwere combined Figure 8(d) represents the entire contour

6 Conclusions

A novel approach to reduce the computation complexityof the wavelet transform has been presented in this paperTwo key techniques have been applied in this new methodnamely fast number theoretic transform (FNTT) and two-dimensional overlap-save technique In the fast numbertheoretic transform the linear convolution is replaced bythe circular convolution It can speed up the computationof 2D discrete wavelet transform Directly calculating thefast number theoretic transform to the whole input sequencemay meet two difficulties namely a big modulo obstructsthe effective implementation of the fast number theoretictransform and a long input sequence slows the computation

Mathematical Problems in Engineering 15

of the fast number theoretic transform down To fight withsuch deficiencies a new technique which is referred to as 2Doverlap-save method has been developed Experiments havebeen conducted The fast number theoretic transform and2D overlap-method have been used to implement the dyadicwavelet transform and applied to contour extraction in imageprocessing and pattern recognition

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Acknowledgments

This work was supported by the Research GrantsMYRG205(Y1-L4)-FST11-TYY and MYRG187(Y1-L3)-FST11-TYY and Chair Prof Grants RDG009FST-TYY ofUniversity of Macau as well as Macau FDC Grants T-100-2012-A3 and 026ndash2013-A This research project was alsosupported by the National Natural Science Foundation ofChina 61273244

References

[1] P L Combettes and J-C Pesquet ldquoWavelet-constrained imagerestorationrdquo International Journal of Wavelets Multiresolutionand Information Processing vol 2 no 4 pp 371ndash389 2004

[2] M Ehler and K Koch ldquoThe construction of multiwavelet bi-frames and applications to variational image denoisingrdquo Inter-national Journal of Wavelets Multiresolution and InformationProcessing vol 8 no 3 pp 431ndash455 2010

[3] P Jain and S N Merchant ldquoWavelet-based multiresolutionhistogram for fast image retrievalrdquo International Journal ofWavelets Multiresolution and Information Processing vol 2 no1 pp 59ndash73 2004

[4] S Mallat and W L Hwang ldquoSingularity detection and pro-cessing with waveletsrdquo Institute of Electrical and ElectronicsEngineers Transactions on InformationTheory vol 38 no 2 pp617ndash643 1992

[5] B U Shankar S K Meher and A Ghosh ldquoNeuro-waveletclassifier formultispectral remote sensing imagesrdquo InternationalJournal of Wavelets Multiresolution and Information Processingvol 5 no 4 pp 589ndash611 2007

[6] S Shi Y Zhang and Y Hu ldquoA wavelet-based image edgedetection and estimationmethod with adaptive scale selectionrdquoInternational Journal of Wavelets Multiresolution and Informa-tion Processing vol 8 no 3 pp 385ndash405 2010

[7] Y Y Tang Wavelets Theory Approach to Pattern RecognitionWorld Scientific Singapor 2009

[8] Q M Tieng and W Boles ldquoWavelet-based affine invariantrepresentation a tool for recognizing planar objects in 3Dspacerdquo IEEE Transactions on Pattern Analysis and MachineIntelligence vol 19 no 8 pp 921ndash925 1997

[9] P Wunsch and A F Laine ldquoWavelet descriptors for mul-tiresolution recognition of handprinted charactersrdquo PatternRecognition vol 28 no 8 pp 1237ndash1249 1995

[10] H Yin and H Liu ldquoA Bregman iterative regularization methodfor wavelet-based image deblurringrdquo International Journal of

Wavelets Multiresolution and Information Processing vol 8 no3 pp 485ndash499 2010

[11] X You and Y Y Tang ldquoWavelet-based approach to characterskeletonrdquo IEEE Transactions on Image Processing vol 16 no 5pp 1220ndash1231 2007

[12] T Zhang Q Fan and Q Gao ldquoWavelet characterization ofHardy space ℎ

1 and its application in variational image decom-positionrdquo International Journal of Wavelets Multiresolution andInformation Processing vol 8 no 1 pp 71ndash87 2010

[13] Y Y Tang L Y Li Feng and J Liu ldquoScale-independent waveletalgorithm for detecting step-structure edgesrdquo Tech Rep IEEETransactions on InformationTheory Brisbane Australia 1998

[14] S G Mallat ldquoMultiresolution approximations and waveletorthonormal bases of 119871

2(R)rdquo Transactions of the American

Mathematical Society vol 315 no 1 pp 69ndash87 1989[15] J H McClellan and C M Rader Number Theory in Digital Sig-

nal Processing Prentice Hall Signal Processing Series PrenticeHall Englewood Cliffs NJ USA 1979

[16] X Ran and K J R Liu ldquoFast algorithms for 2-D circularconvolutions and number theoretic transforms based on poly-nomial transforms over finite ringsrdquo IEEE Transactions onSignal Processing vol 43 no 3 pp 569ndash578 1995

[17] Q Sun ldquoSome results in the application of the number theoryto digital signal processing and public-key systemsrdquo in NumberTheory and Its Applications in China vol 77 of ContemporaryMathematics pp 107ndash112 American Mathematical SocietyProvidence RI USA 1988

[18] Y Y Tang Q Sun L H Yang and L Feng ldquoAn overlap-save method for the calculation of the two-dimensional digitalconvolutionrdquo Tech Rep Department of Computer ScienceHong Kong Baptist University 1998

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 13: Research Article Implementation of 2D Discrete Wavelet ...downloads.hindawi.com/journals/mpe/2014/532979.pdfResearch Article Implementation of 2D Discrete Wavelet Transform by Number

Mathematical Problems in Engineering 13

(a) (b) (c)

(d) (e) (f)

(g) (h) (i)

Figure 7 A 2-dimensional image of an aircraft is dividing into separated small subimages the parameters of V0and V

1are chosen as follows

(a) V0= 0 V

1= 0 V

0= 1 V

1= 1 V

0= 2 V

1= 2 and V

0= 3 V

1= 3 and V

0= 4 and V

1= 4 (b) V

0= 0 V

1= 1 V

0= 1 V

1= 2 V

0= 2 V

1= 3 and

V0= 3 and V

1= 4 (c) V

0= 0 V

1= 2 V

0= 1 V

1= 3 and V

0= 2 and V

1= 4 (d) V

0= 0 V

1= 3 and V

0= 1 and V

1= 4 (e) V

0= 0 and V

1= 4 (f)

V0= 1 V

1= 0 V

0= 2 V

1= 1 V

0= 3 V

1= 2 and V

0= 4 and V

1= 3 (g) V

0= 2 V

1= 0 V

0= 3 V

1= 1 and V

0= 4 and V

1= 2 (h) V

0= 3 V

1= 0

and V0= 4 and V

1= 1 and (i) V

0= 4 and V

1= 0

In Figure 7(f) V0= 1 V

1= 0 V

0= 2 V

1= 1 V

0= 3 V

1= 2

and V0= 4 V1= 3were chosen In Figure 7(g) the parameters

were decided upon V0= 2 V

1= 0 V

0= 3 V

1= 1 and V

0= 4

V1= 2 Two subimages are shown in Figure 7(h) by selecting

V0= 3 V

1= 0 and V

0= 4 V

1= 1 There is one subimage of

V0= 4 V

1= 0 in Figure 7(i)

We select a 2D NTT

11988311989611198962

equiv

63

sum

1198991=0

63

sum

1198992=0

11990911989911198992

211989911198961211989921198962 (mod 2

32+ 1) (74)

14 Mathematical Problems in Engineering

(a) (b)

(c) (d)

Figure 8 The linear outputs of 2D overlap-save method (a) the outputs of the linear convolution of each subimages (b) the left border andthe upper border of the outputs of the image of aircraft (c) the combined outputs of linear convolution except Γ-type border and (d) theentire contour extracted using 2D overlap-save method under wavelet transform

which has inverse transform

11990911989911198992

equiv 64minus1

64minus1

63

sum

1198961=0

63

sum

1198962=0

11988311989611198962

(minus231)11989911198961

times (minus231)11989921198962

(mod 232

+ 1)

1198991= 0 1 63 119899

2= 0 1 63

(75)

where 64minus1 denotes integer so that (64minus1)64 equiv 1 (mod 2

32+

1) and |11990911989911198992

| le 255The FNTT was applied to calculate the circular convo-

lution of each subimage After applying (31) to each of thesubblocks a series of segments of the contours were obtained

By using (32) we can gradually reach the final result of thelinear convolution Figure 8(a) illustrates those pixels whichsatisfy (35) where 119897

2= 1198982= 17 119873 = 119872 = 64 1198731015840 = 119872

1015840=

48 and V1 V2

= 0 1 2 3 4 Combining them together thecontours of the whole character were obtained and displayedin Figure 8(c) which excludes the Γ-type border Next the

Γ-type border was computed by direct method Figure 8(b)shows the result Combining this result with that shown inFigure 8(c) the entire contours of the Chinese handwritingwere combined Figure 8(d) represents the entire contour

6 Conclusions

A novel approach to reduce the computation complexityof the wavelet transform has been presented in this paperTwo key techniques have been applied in this new methodnamely fast number theoretic transform (FNTT) and two-dimensional overlap-save technique In the fast numbertheoretic transform the linear convolution is replaced bythe circular convolution It can speed up the computationof 2D discrete wavelet transform Directly calculating thefast number theoretic transform to the whole input sequencemay meet two difficulties namely a big modulo obstructsthe effective implementation of the fast number theoretictransform and a long input sequence slows the computation

Mathematical Problems in Engineering 15

of the fast number theoretic transform down To fight withsuch deficiencies a new technique which is referred to as 2Doverlap-save method has been developed Experiments havebeen conducted The fast number theoretic transform and2D overlap-method have been used to implement the dyadicwavelet transform and applied to contour extraction in imageprocessing and pattern recognition

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Acknowledgments

This work was supported by the Research GrantsMYRG205(Y1-L4)-FST11-TYY and MYRG187(Y1-L3)-FST11-TYY and Chair Prof Grants RDG009FST-TYY ofUniversity of Macau as well as Macau FDC Grants T-100-2012-A3 and 026ndash2013-A This research project was alsosupported by the National Natural Science Foundation ofChina 61273244

References

[1] P L Combettes and J-C Pesquet ldquoWavelet-constrained imagerestorationrdquo International Journal of Wavelets Multiresolutionand Information Processing vol 2 no 4 pp 371ndash389 2004

[2] M Ehler and K Koch ldquoThe construction of multiwavelet bi-frames and applications to variational image denoisingrdquo Inter-national Journal of Wavelets Multiresolution and InformationProcessing vol 8 no 3 pp 431ndash455 2010

[3] P Jain and S N Merchant ldquoWavelet-based multiresolutionhistogram for fast image retrievalrdquo International Journal ofWavelets Multiresolution and Information Processing vol 2 no1 pp 59ndash73 2004

[4] S Mallat and W L Hwang ldquoSingularity detection and pro-cessing with waveletsrdquo Institute of Electrical and ElectronicsEngineers Transactions on InformationTheory vol 38 no 2 pp617ndash643 1992

[5] B U Shankar S K Meher and A Ghosh ldquoNeuro-waveletclassifier formultispectral remote sensing imagesrdquo InternationalJournal of Wavelets Multiresolution and Information Processingvol 5 no 4 pp 589ndash611 2007

[6] S Shi Y Zhang and Y Hu ldquoA wavelet-based image edgedetection and estimationmethod with adaptive scale selectionrdquoInternational Journal of Wavelets Multiresolution and Informa-tion Processing vol 8 no 3 pp 385ndash405 2010

[7] Y Y Tang Wavelets Theory Approach to Pattern RecognitionWorld Scientific Singapor 2009

[8] Q M Tieng and W Boles ldquoWavelet-based affine invariantrepresentation a tool for recognizing planar objects in 3Dspacerdquo IEEE Transactions on Pattern Analysis and MachineIntelligence vol 19 no 8 pp 921ndash925 1997

[9] P Wunsch and A F Laine ldquoWavelet descriptors for mul-tiresolution recognition of handprinted charactersrdquo PatternRecognition vol 28 no 8 pp 1237ndash1249 1995

[10] H Yin and H Liu ldquoA Bregman iterative regularization methodfor wavelet-based image deblurringrdquo International Journal of

Wavelets Multiresolution and Information Processing vol 8 no3 pp 485ndash499 2010

[11] X You and Y Y Tang ldquoWavelet-based approach to characterskeletonrdquo IEEE Transactions on Image Processing vol 16 no 5pp 1220ndash1231 2007

[12] T Zhang Q Fan and Q Gao ldquoWavelet characterization ofHardy space ℎ

1 and its application in variational image decom-positionrdquo International Journal of Wavelets Multiresolution andInformation Processing vol 8 no 1 pp 71ndash87 2010

[13] Y Y Tang L Y Li Feng and J Liu ldquoScale-independent waveletalgorithm for detecting step-structure edgesrdquo Tech Rep IEEETransactions on InformationTheory Brisbane Australia 1998

[14] S G Mallat ldquoMultiresolution approximations and waveletorthonormal bases of 119871

2(R)rdquo Transactions of the American

Mathematical Society vol 315 no 1 pp 69ndash87 1989[15] J H McClellan and C M Rader Number Theory in Digital Sig-

nal Processing Prentice Hall Signal Processing Series PrenticeHall Englewood Cliffs NJ USA 1979

[16] X Ran and K J R Liu ldquoFast algorithms for 2-D circularconvolutions and number theoretic transforms based on poly-nomial transforms over finite ringsrdquo IEEE Transactions onSignal Processing vol 43 no 3 pp 569ndash578 1995

[17] Q Sun ldquoSome results in the application of the number theoryto digital signal processing and public-key systemsrdquo in NumberTheory and Its Applications in China vol 77 of ContemporaryMathematics pp 107ndash112 American Mathematical SocietyProvidence RI USA 1988

[18] Y Y Tang Q Sun L H Yang and L Feng ldquoAn overlap-save method for the calculation of the two-dimensional digitalconvolutionrdquo Tech Rep Department of Computer ScienceHong Kong Baptist University 1998

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 14: Research Article Implementation of 2D Discrete Wavelet ...downloads.hindawi.com/journals/mpe/2014/532979.pdfResearch Article Implementation of 2D Discrete Wavelet Transform by Number

14 Mathematical Problems in Engineering

(a) (b)

(c) (d)

Figure 8 The linear outputs of 2D overlap-save method (a) the outputs of the linear convolution of each subimages (b) the left border andthe upper border of the outputs of the image of aircraft (c) the combined outputs of linear convolution except Γ-type border and (d) theentire contour extracted using 2D overlap-save method under wavelet transform

which has inverse transform

11990911989911198992

equiv 64minus1

64minus1

63

sum

1198961=0

63

sum

1198962=0

11988311989611198962

(minus231)11989911198961

times (minus231)11989921198962

(mod 232

+ 1)

1198991= 0 1 63 119899

2= 0 1 63

(75)

where 64minus1 denotes integer so that (64minus1)64 equiv 1 (mod 2

32+

1) and |11990911989911198992

| le 255The FNTT was applied to calculate the circular convo-

lution of each subimage After applying (31) to each of thesubblocks a series of segments of the contours were obtained

By using (32) we can gradually reach the final result of thelinear convolution Figure 8(a) illustrates those pixels whichsatisfy (35) where 119897

2= 1198982= 17 119873 = 119872 = 64 1198731015840 = 119872

1015840=

48 and V1 V2

= 0 1 2 3 4 Combining them together thecontours of the whole character were obtained and displayedin Figure 8(c) which excludes the Γ-type border Next the

Γ-type border was computed by direct method Figure 8(b)shows the result Combining this result with that shown inFigure 8(c) the entire contours of the Chinese handwritingwere combined Figure 8(d) represents the entire contour

6 Conclusions

A novel approach to reduce the computation complexityof the wavelet transform has been presented in this paperTwo key techniques have been applied in this new methodnamely fast number theoretic transform (FNTT) and two-dimensional overlap-save technique In the fast numbertheoretic transform the linear convolution is replaced bythe circular convolution It can speed up the computationof 2D discrete wavelet transform Directly calculating thefast number theoretic transform to the whole input sequencemay meet two difficulties namely a big modulo obstructsthe effective implementation of the fast number theoretictransform and a long input sequence slows the computation

Mathematical Problems in Engineering 15

of the fast number theoretic transform down To fight withsuch deficiencies a new technique which is referred to as 2Doverlap-save method has been developed Experiments havebeen conducted The fast number theoretic transform and2D overlap-method have been used to implement the dyadicwavelet transform and applied to contour extraction in imageprocessing and pattern recognition

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Acknowledgments

This work was supported by the Research GrantsMYRG205(Y1-L4)-FST11-TYY and MYRG187(Y1-L3)-FST11-TYY and Chair Prof Grants RDG009FST-TYY ofUniversity of Macau as well as Macau FDC Grants T-100-2012-A3 and 026ndash2013-A This research project was alsosupported by the National Natural Science Foundation ofChina 61273244

References

[1] P L Combettes and J-C Pesquet ldquoWavelet-constrained imagerestorationrdquo International Journal of Wavelets Multiresolutionand Information Processing vol 2 no 4 pp 371ndash389 2004

[2] M Ehler and K Koch ldquoThe construction of multiwavelet bi-frames and applications to variational image denoisingrdquo Inter-national Journal of Wavelets Multiresolution and InformationProcessing vol 8 no 3 pp 431ndash455 2010

[3] P Jain and S N Merchant ldquoWavelet-based multiresolutionhistogram for fast image retrievalrdquo International Journal ofWavelets Multiresolution and Information Processing vol 2 no1 pp 59ndash73 2004

[4] S Mallat and W L Hwang ldquoSingularity detection and pro-cessing with waveletsrdquo Institute of Electrical and ElectronicsEngineers Transactions on InformationTheory vol 38 no 2 pp617ndash643 1992

[5] B U Shankar S K Meher and A Ghosh ldquoNeuro-waveletclassifier formultispectral remote sensing imagesrdquo InternationalJournal of Wavelets Multiresolution and Information Processingvol 5 no 4 pp 589ndash611 2007

[6] S Shi Y Zhang and Y Hu ldquoA wavelet-based image edgedetection and estimationmethod with adaptive scale selectionrdquoInternational Journal of Wavelets Multiresolution and Informa-tion Processing vol 8 no 3 pp 385ndash405 2010

[7] Y Y Tang Wavelets Theory Approach to Pattern RecognitionWorld Scientific Singapor 2009

[8] Q M Tieng and W Boles ldquoWavelet-based affine invariantrepresentation a tool for recognizing planar objects in 3Dspacerdquo IEEE Transactions on Pattern Analysis and MachineIntelligence vol 19 no 8 pp 921ndash925 1997

[9] P Wunsch and A F Laine ldquoWavelet descriptors for mul-tiresolution recognition of handprinted charactersrdquo PatternRecognition vol 28 no 8 pp 1237ndash1249 1995

[10] H Yin and H Liu ldquoA Bregman iterative regularization methodfor wavelet-based image deblurringrdquo International Journal of

Wavelets Multiresolution and Information Processing vol 8 no3 pp 485ndash499 2010

[11] X You and Y Y Tang ldquoWavelet-based approach to characterskeletonrdquo IEEE Transactions on Image Processing vol 16 no 5pp 1220ndash1231 2007

[12] T Zhang Q Fan and Q Gao ldquoWavelet characterization ofHardy space ℎ

1 and its application in variational image decom-positionrdquo International Journal of Wavelets Multiresolution andInformation Processing vol 8 no 1 pp 71ndash87 2010

[13] Y Y Tang L Y Li Feng and J Liu ldquoScale-independent waveletalgorithm for detecting step-structure edgesrdquo Tech Rep IEEETransactions on InformationTheory Brisbane Australia 1998

[14] S G Mallat ldquoMultiresolution approximations and waveletorthonormal bases of 119871

2(R)rdquo Transactions of the American

Mathematical Society vol 315 no 1 pp 69ndash87 1989[15] J H McClellan and C M Rader Number Theory in Digital Sig-

nal Processing Prentice Hall Signal Processing Series PrenticeHall Englewood Cliffs NJ USA 1979

[16] X Ran and K J R Liu ldquoFast algorithms for 2-D circularconvolutions and number theoretic transforms based on poly-nomial transforms over finite ringsrdquo IEEE Transactions onSignal Processing vol 43 no 3 pp 569ndash578 1995

[17] Q Sun ldquoSome results in the application of the number theoryto digital signal processing and public-key systemsrdquo in NumberTheory and Its Applications in China vol 77 of ContemporaryMathematics pp 107ndash112 American Mathematical SocietyProvidence RI USA 1988

[18] Y Y Tang Q Sun L H Yang and L Feng ldquoAn overlap-save method for the calculation of the two-dimensional digitalconvolutionrdquo Tech Rep Department of Computer ScienceHong Kong Baptist University 1998

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 15: Research Article Implementation of 2D Discrete Wavelet ...downloads.hindawi.com/journals/mpe/2014/532979.pdfResearch Article Implementation of 2D Discrete Wavelet Transform by Number

Mathematical Problems in Engineering 15

of the fast number theoretic transform down To fight withsuch deficiencies a new technique which is referred to as 2Doverlap-save method has been developed Experiments havebeen conducted The fast number theoretic transform and2D overlap-method have been used to implement the dyadicwavelet transform and applied to contour extraction in imageprocessing and pattern recognition

Conflict of Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

Acknowledgments

This work was supported by the Research GrantsMYRG205(Y1-L4)-FST11-TYY and MYRG187(Y1-L3)-FST11-TYY and Chair Prof Grants RDG009FST-TYY ofUniversity of Macau as well as Macau FDC Grants T-100-2012-A3 and 026ndash2013-A This research project was alsosupported by the National Natural Science Foundation ofChina 61273244

References

[1] P L Combettes and J-C Pesquet ldquoWavelet-constrained imagerestorationrdquo International Journal of Wavelets Multiresolutionand Information Processing vol 2 no 4 pp 371ndash389 2004

[2] M Ehler and K Koch ldquoThe construction of multiwavelet bi-frames and applications to variational image denoisingrdquo Inter-national Journal of Wavelets Multiresolution and InformationProcessing vol 8 no 3 pp 431ndash455 2010

[3] P Jain and S N Merchant ldquoWavelet-based multiresolutionhistogram for fast image retrievalrdquo International Journal ofWavelets Multiresolution and Information Processing vol 2 no1 pp 59ndash73 2004

[4] S Mallat and W L Hwang ldquoSingularity detection and pro-cessing with waveletsrdquo Institute of Electrical and ElectronicsEngineers Transactions on InformationTheory vol 38 no 2 pp617ndash643 1992

[5] B U Shankar S K Meher and A Ghosh ldquoNeuro-waveletclassifier formultispectral remote sensing imagesrdquo InternationalJournal of Wavelets Multiresolution and Information Processingvol 5 no 4 pp 589ndash611 2007

[6] S Shi Y Zhang and Y Hu ldquoA wavelet-based image edgedetection and estimationmethod with adaptive scale selectionrdquoInternational Journal of Wavelets Multiresolution and Informa-tion Processing vol 8 no 3 pp 385ndash405 2010

[7] Y Y Tang Wavelets Theory Approach to Pattern RecognitionWorld Scientific Singapor 2009

[8] Q M Tieng and W Boles ldquoWavelet-based affine invariantrepresentation a tool for recognizing planar objects in 3Dspacerdquo IEEE Transactions on Pattern Analysis and MachineIntelligence vol 19 no 8 pp 921ndash925 1997

[9] P Wunsch and A F Laine ldquoWavelet descriptors for mul-tiresolution recognition of handprinted charactersrdquo PatternRecognition vol 28 no 8 pp 1237ndash1249 1995

[10] H Yin and H Liu ldquoA Bregman iterative regularization methodfor wavelet-based image deblurringrdquo International Journal of

Wavelets Multiresolution and Information Processing vol 8 no3 pp 485ndash499 2010

[11] X You and Y Y Tang ldquoWavelet-based approach to characterskeletonrdquo IEEE Transactions on Image Processing vol 16 no 5pp 1220ndash1231 2007

[12] T Zhang Q Fan and Q Gao ldquoWavelet characterization ofHardy space ℎ

1 and its application in variational image decom-positionrdquo International Journal of Wavelets Multiresolution andInformation Processing vol 8 no 1 pp 71ndash87 2010

[13] Y Y Tang L Y Li Feng and J Liu ldquoScale-independent waveletalgorithm for detecting step-structure edgesrdquo Tech Rep IEEETransactions on InformationTheory Brisbane Australia 1998

[14] S G Mallat ldquoMultiresolution approximations and waveletorthonormal bases of 119871

2(R)rdquo Transactions of the American

Mathematical Society vol 315 no 1 pp 69ndash87 1989[15] J H McClellan and C M Rader Number Theory in Digital Sig-

nal Processing Prentice Hall Signal Processing Series PrenticeHall Englewood Cliffs NJ USA 1979

[16] X Ran and K J R Liu ldquoFast algorithms for 2-D circularconvolutions and number theoretic transforms based on poly-nomial transforms over finite ringsrdquo IEEE Transactions onSignal Processing vol 43 no 3 pp 569ndash578 1995

[17] Q Sun ldquoSome results in the application of the number theoryto digital signal processing and public-key systemsrdquo in NumberTheory and Its Applications in China vol 77 of ContemporaryMathematics pp 107ndash112 American Mathematical SocietyProvidence RI USA 1988

[18] Y Y Tang Q Sun L H Yang and L Feng ldquoAn overlap-save method for the calculation of the two-dimensional digitalconvolutionrdquo Tech Rep Department of Computer ScienceHong Kong Baptist University 1998

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Page 16: Research Article Implementation of 2D Discrete Wavelet ...downloads.hindawi.com/journals/mpe/2014/532979.pdfResearch Article Implementation of 2D Discrete Wavelet Transform by Number

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of