10
28 IEEE TRANSACTIONS ON SIGNAL PROCESSING, VOL. 61, NO. 1, JANUARY 1, 2013 Fast FIR Algorithms for the Continuous Wavelet Transform From Constrained Least Squares George M. Leigh, Member, IEEE Abstract—New algorithms for the continuous wavelet transform are developed that are easy to apply, each consisting of a single- pass nite impulse response (FIR) lter, and several times faster than the fastest existing algorithms. The single-pass lter, named WT-FIR-1, is made possible by applying constraint equations to least-squares estimation of lter coefcients, which removes the need for separate low-pass and high-pass lters. Non-dyadic two- scale relations are developed and it is shown that lters based on them can work more efciently than dyadic ones. Example appli- cations to the Mexican hat wavelet are presented. Index Terms—Algorithm design and analysis, continuous wavelet transforms, nite impulse response lter, signal pro- cessing algorithms. I. INTRODUCTION A. Background W AVELET transforms have become indispensable tools in signal and image analysis over the last 25 years. Given a wavelet function , the wavelet transform of a signal is [1 p. 24] (1) where and are location and scale parameters respectively, and the bar denotes complex conjugate. Wavelet transforms are broadly classied into the continuous wavelet transform (CWT) [1 ch. 2], which offers great exibility in the choice of wavelet shape and the sequence of scales of analysis, and the discrete wavelet transform (DWT) [1 ch. 3–6], which is restrictive on shape and scale but provides simple for- mulas for reconstruction of a signal from its wavelet transform. The CWT for wavelets of general shape requires greater com- putational effort than the DWT. Fast algorithms, in which the number of arithmetic operations per wavelet coefcient depends on neither the length of the input signal nor the coarsest scale of analysis, exist for the CWT [2]–[5] but are slower and more Manuscript received May 13, 2011; revised March 20, 2012 and September 21, 2012; accepted September 24, 2012. Date of publication October 03, 2012; date of current version December 04, 2012. The associate editor coordinating the review of this manuscript and approving it for publication was Prof. Patrick Flandrin. This work was a part of the AMIRA International Project P843, sup- ported by the Australian Research Council and mining industry participants Anglo Platinum, AngloGold Ashanti, Barrick Gold, BHP Billiton, Codelco, Newcrest Mining, Newmont Mining, OZ Minerals, Peñoles, Rio Tinto, Teck Cominco, Vale, Vale Inco, Xstrata Copper, Datamine Group, Geotek, Golder Associates, ioGlobal, and Metso Minerals. The author was with the Julius Kruttschnitt Mineral Research Centre, Sus- tainable Minerals Institute, University of Queensland, Indooroopilly, Qld 4068, Australia. He is now with the Department of Agriculture, Fisheries and Forestry, St. Lucia, Queensland 4067, Australia (e-mail: [email protected]). Digital Object Identier 10.1109/TSP.2012.2222376 difcult to implement than corresponding algorithms [6], [7] for the DWT. Alternatives for the CWT based on the fast Fourier transform (FFT) [8] are widely used but become slower for long signals: a signal of length combined with the real-data FFT algorithm of [9] requires roughly arithmetic opera- tions per wavelet coefcient to perform the inverse FFT at each scale. This pure-FFT algorithm is not to be confused with the use of FFT to accelerate already-fast algorithms [2]. B. Two-Scale Relations Fast algorithms for both the CWT and DWT rely on scaling functions and two-scale relations [1, p. 78]. The wavelet func- tion is expressed as a convolution with a scaling function [10, Section II.C, slightly different notation] (2) while the two-scale relation provides the scaling function at scale 2 from the same function at scale 1 through another con- volution: (3) Equations (2) and (3) allow recursive computation of the wavelet transform using and as lter coefcients [1, p. 79]. The recursive equation, using (3), is (4) where and the wavelet transform at scale is given by (5) Computation begins with initialization at the nest scale and proceeds recursively through successively coarser scales using (4) and (5). Initialization is discussed in [11] and [12]. The DWT can be designed so that (2)–(5) work exactly and only a few of the lter coefcients and are nonzero [7]. For the CWT the equations are only approximate for most choices of and , and the lter coefcients have to be chosen both to satisfy (2) and (3) as closely as possible and to allow and to be neglected for large [3]. This problem is 1053-587X/$31.00 © 2012 British Crown Copyright

Fast FIR Algorithms for the Continuous Wavelet Transform From Constrained Least Squares

Embed Size (px)

Citation preview

Page 1: Fast FIR Algorithms for the Continuous Wavelet Transform From Constrained Least Squares

28 IEEE TRANSACTIONS ON SIGNAL PROCESSING, VOL. 61, NO. 1, JANUARY 1, 2013

Fast FIR Algorithms for the Continuous WaveletTransform From Constrained Least Squares

George M. Leigh, Member, IEEE

Abstract—New algorithms for the continuous wavelet transformare developed that are easy to apply, each consisting of a single-pass finite impulse response (FIR) filter, and several times fasterthan the fastest existing algorithms. The single-pass filter, namedWT-FIR-1, is made possible by applying constraint equations toleast-squares estimation of filter coefficients, which removes theneed for separate low-pass and high-pass filters. Non-dyadic two-scale relations are developed and it is shown that filters based onthem can work more efficiently than dyadic ones. Example appli-cations to the Mexican hat wavelet are presented.

Index Terms—Algorithm design and analysis, continuouswavelet transforms, finite impulse response filter, signal pro-cessing algorithms.

I. INTRODUCTIONA. Background

W AVELET transforms have become indispensable toolsin signal and image analysis over the last 25 years.

Given a wavelet function , the wavelet transform of asignal is [1 p. 24]

(1)

where and are location and scale parameters respectively,and the bar denotes complex conjugate.Wavelet transforms are broadly classified into the continuous

wavelet transform (CWT) [1 ch. 2], which offers great flexibilityin the choice of wavelet shape and the sequence of scales ofanalysis, and the discrete wavelet transform (DWT) [1 ch. 3–6],which is restrictive on shape and scale but provides simple for-mulas for reconstruction of a signal from its wavelet transform.The CWT for wavelets of general shape requires greater com-

putational effort than the DWT. Fast algorithms, in which thenumber of arithmetic operations per wavelet coefficient dependson neither the length of the input signal nor the coarsest scaleof analysis, exist for the CWT [2]–[5] but are slower and more

Manuscript received May 13, 2011; revised March 20, 2012 and September21, 2012; accepted September 24, 2012. Date of publication October 03, 2012;date of current version December 04, 2012. The associate editor coordinatingthe review of this manuscript and approving it for publication was Prof. PatrickFlandrin. This work was a part of the AMIRA International Project P843, sup-ported by the Australian Research Council and mining industry participantsAnglo Platinum, AngloGold Ashanti, Barrick Gold, BHP Billiton, Codelco,Newcrest Mining, Newmont Mining, OZ Minerals, Peñoles, Rio Tinto, TeckCominco, Vale, Vale Inco, Xstrata Copper, Datamine Group, Geotek, GolderAssociates, ioGlobal, and Metso Minerals.The author was with the Julius Kruttschnitt Mineral Research Centre, Sus-

tainable Minerals Institute, University of Queensland, Indooroopilly, Qld 4068,Australia. He is nowwith the Department of Agriculture, Fisheries and Forestry,St. Lucia, Queensland 4067, Australia (e-mail: [email protected]).Digital Object Identifier 10.1109/TSP.2012.2222376

difficult to implement than corresponding algorithms [6], [7] forthe DWT. Alternatives for the CWT based on the fast Fouriertransform (FFT) [8] are widely used but become slower for longsignals: a signal of length combined with the real-data FFTalgorithm of [9] requires roughly arithmetic opera-tions per wavelet coefficient to perform the inverse FFT at eachscale. This pure-FFT algorithm is not to be confused with theuse of FFT to accelerate already-fast algorithms [2].

B. Two-Scale Relations

Fast algorithms for both the CWT and DWT rely on scalingfunctions and two-scale relations [1, p. 78]. The wavelet func-tion is expressed as a convolution with a scaling function

[10, Section II.C, slightly different notation]

(2)

while the two-scale relation provides the scaling function atscale 2 from the same function at scale 1 through another con-volution:

(3)

Equations (2) and (3) allow recursive computation of thewavelet transform using and as filter coefficients [1, p.79]. The recursive equation, using (3), is

(4)

where

and the wavelet transform at scale is given by

(5)

Computation begins with initialization at the finest scaleand proceeds recursively through successively coarser scales

using (4) and (5). Initialization is discussed in [11] and [12].The DWT can be designed so that (2)–(5) work exactly and

only a few of the filter coefficients and are nonzero [7].For the CWT the equations are only approximate for mostchoices of and , and the filter coefficients have to be chosenboth to satisfy (2) and (3) as closely as possible and to allowand to be neglected for large [3]. This problem is

1053-587X/$31.00 © 2012 British Crown Copyright

Page 2: Fast FIR Algorithms for the Continuous Wavelet Transform From Constrained Least Squares

LEIGH: CWT FROM CONSTRAINED LEAST SQUARES 29

elucidated by taking Fourier transforms [1, p. 132, slightlydifferent notation]: (3) becomes

(6)

where the filter function is given by

(7)

and is therefore periodic with period . The problem is to sat-isfy (6) as closely as possible with the restrictions thatmust be periodic and that all but a few of the filter coefficientsmust be small enough to be neglected. A similar setup appliesto the Fourier-transformed version of (2). A least-squares ap-proach to solving this problem was undertaken in [3], whichretained an infinite number of filter coefficients but showed thatthey decayed as .

C. FIR Filters

When the filter coefficients and in (2)–(5) can be ne-glected for large , calculation of the wavelet transform con-sists of applying finite impulse response (FIR) filters. This typeof filter is very widely used in signal processing, and efficientimplementations of it have been intensively studied.Three types of FIR filter implementation of are commonly

used, depending on the length of the filter (i.e., the numberof nonzero filter coefficients): (a) direct implementation usingall the filter coefficients sequentially (e.g., direct use of for-mula (4)); (b) “divide and conquer” implementation [13]–[19],in which the filter and the input signal are first “decimated” intomultiple series (e.g., odd versus even indices); and (c) FFT-FIRimplementation, in which the input signal is divided into blocksof a certain length and each block undergoes FFT, multiplicationby the filter’s Fourier transform, and finally inverse-FFT; useof this last technique suddenly exploded in the mid-1960s [20].According to [19], the most efficient FIR implementation is di-rect for filter lengths 2, 3 and 5; divide-and-conquer for lengths4 and 6–60; and FFT-FIR for length 64 or more. In the case oftransforms applied over multiple scales, efficiency of FFT-FIRcan be improved by avoiding some of the forward-FFT steps[21].It is important to note that shorter FIR filters are always

preferable to longer ones, whatever implementation methodis used. An extra advantage of short FIR filters, in addition tocomputational efficiency, is that they allow transformations tobe carried out in real-time with only a relatively short lag. Thisadvantage continues to hold even at very large scales, becausethen the filters are applied to highly decimated series.

D. New Developments

This paper aims to make the CWT more accessible to prac-titioners by implementing it with short-length FIR filters that,although underlain by complex theory, are fast and easy to use.This method is given the name WT-FIR-1: the “1” refers to thecapability to use a single filter in place of the separate low-pass

and high-pass filters (4) and (5) when the wavelet is someorder of derivative of its scaling function . The new FIR fil-ters can be implemented by any of the three methods describedin Section I-C above.The major original contribution is to introduce constraint

equations to the least-squares approach of Muschietti and Tor-résani [3], in order to (a) explicitly limit the number of nonzerofilter coefficients, rather than rely on decay as , and (b)ensure regularity of adjusted scaling and wavelet functions thatapproximate and . The regularity constraint comesfrom theory of iterated two-scale relations due to Daubechiesand Lagarias [7], [22], [23]. The constraints used here focus onfast computation of the CWT with a given wavelet of generalshape, and allow arbitrarily high precision to be achieved bythe use of longer filters. Conceptually different constraints havebeen used in filter-bank design to ensure orthonormality similarto the DWT [24].Non-dyadic two-scale relations, where the ratio of one scale

to the previous scale is less than 2, are derived, and it is shownthat these can work more efficiently than dyadic relations (inwhich the scale doubles each time). Non-dyadic two-scale re-lations have been used previously in (a) rational filter banks[24]–[26], which are similar to but lack some of the propertiesof wavelet transforms; (b) -band wavelets which have scaleratios greater than 2 (see, e.g., [27]); (c) refinable functions [28];(d) few other CWT-related applications, e.g., [29]. Usual algo-rithms for the CWT for non-dyadic scales use dyadic two-scalerelations [5], [30] or pure-FFT implementation [31].This paper also contributes methodology for initialization of

the CWT, necessitated in part by the increased sensitivity of thesingle-pass filter technique to improper initialization.Section II provides extra detail of existing theory.

Sections III–VI respectively present the new elements:non-dyadic two-scale relations, the new algorithms, ini-tialization techniques and example applications. Sections VIIand VIII briefly discuss reconstruction of the original signal,and extensions to multidimensional wavelets.

II. PRELIMINARIES

A. Best Existing Fast Algorithm

Many existing fast algorithms approximate the wavelet func-tion using two scaling functions and from theDWT, both of which satisfy two-scale relations of the form (3)exactly. The wavelet is approximated by a linear combina-tion of translates of , with coefficients derived from innerproducts of with . Such algorithms are discussed inmore generality in [4].The fastest existing CWT algorithm for wavelets of general

shape appears to be that of Vrhel, Lee and Unser [5], in whichand are B-splines (see comparison in [32]). This algorithmis certainly faster than the pure-FFT algorithm for very longsignals, but may not always be for signals of moderate length.It uses two FIR filters and one infinite impulse response (IIR)filter which, although quite efficient, make it less convenientthan pure-FIR algorithms.

Page 3: Fast FIR Algorithms for the Continuous Wavelet Transform From Constrained Least Squares

30 IEEE TRANSACTIONS ON SIGNAL PROCESSING, VOL. 61, NO. 1, JANUARY 1, 2013

B. Vanishing Moments

The number of vanishing moments of is an importantparameter in wavelet analysis [1, pp. 241–247, 258–259]. It isdefined by for ,with this integral being nonzero for . A wavelet with

is commonly used to detect singularities such as edges,while higher values of provide analysis that is unaffected bypolynomial trends in the signal.Often the wavelet can be expressed as the th derivative of

its scaling function,

(8)

Then, by standard results on Fourier transforms of derivatives,the Fourier transform of

satisfies

(9)

In this paper we choose the constants of proportionality so that

(10)

The developments in Section IV assume that (8) holds, be-cause this produces faster algorithms which do not require thedual filter (5). The new methods can still be used for waveletsthat don’t satisfy (8), but they require dual filters and do nothave the same margin of superiority in speed over existing al-gorithms.Notable wavelets that do not meet the combination of condi-

tions (8), (10) and (3) include wavelets of Gabor or Morlet type[33], [34] that have been made highly frequency selective by theinsertion of a factor , with a large value of the mod-ulation parameter (e.g., greater than half the bandwidth of

). These wavelets are not well suited to two-scale relations,and practitioners who particularly want to use them are usu-ally better off to use pure-FFT implementation (see Section I).Alternatively, a high-order derivative of the Gaussian function

, which is well suited to two-scale relations and tothe algorithms developed in this paper, can be used instead.

III. NON-DYADIC TWO-SCALE RELATIONS

Scales are assumed to follow a geometric sequence withcommon ratio for some positive integercorresponds to dyadic scales, while larger values provide closerspacing of scales. This is the same scheme used in [5].We introduce different two-scale relations for use at scales

for : (3) becomes

(11)

Taking Fourier transforms, (11) becomes

(12)

where

(13)

As in the dyadic case, the filter functions are periodicwith period . In this scheme, (4) is altered to

(14)

If (8) holds, combining (9) with (12) yields

from which

(15)

Substituting (15) into (1) provides an analog of (14) whichapplies to directly and bypasses the need to calculate

:

(16)

To carry out the CWT, the user needs only a method of initial-ization (see Section V) and a table of filter coefficients (e.g.,Table III or V).If (8) does not hold, dual filter functions are required. The

two-scale relation (14) with a high-pass filter of the form (5)can be used; or, as discussed in Section I, (14) can be replacedby the dyadic version (4) with different high-pass filters foreach usage of (4).

IV. DESIGN OF THE WT-FIR-1 ALGORITHM

A. Theory

We define adjusted scaling functionsso that their Fourier transforms, denoted , satisfy the

two-scale relation (12) exactly. The filter functions in thisrelation will be defined shortly. Also define .The adjusted scaling functions produce adjusted wavelets

via (8) and (9).Defined in this way, the functions and are much

more than mere approximations to and , but aregenuine scaling functions and wavelets in their own right, withfinite numbers of filter coefficients and exact two-scale rela-tions. As a result, nonzero filter coefficients do not have to be ne-glected during computation, and approximation errors (exceptnumerical round-off) do not accumulate as the CWT scale be-comes coarser.We set the filter coefficients in (11) and (13) to be zero

for , where the filter half-length is chosen to makesufficiently close to . As stated above, a close ap-

proximation to is not required for to produce aCWT; the only pertinent question is whether the shape of

Page 4: Fast FIR Algorithms for the Continuous Wavelet Transform From Constrained Least Squares

LEIGH: CWT FROM CONSTRAINED LEAST SQUARES 31

meets the user’s needs. This property is shared by the construc-tions in [5], although not by [3]. Larger values of providecloser matches to but longer filters. Arbitrary precisioncan be achieved by a combination of large and substitu-tion of by for some potentially largefactor (see discussion at end of Section V).The nonzero are estimated by constrained minimization

of

(17)

where is the number of vanishing moments as in (9). Thisstrategy follows the approach of [3], but targets the Fouriertransform of the scaling function, , instead of the filter func-tion , and applies constraints to the minimization.The constraints come from (10) and the need for regularity

of the adjusted wavelets . For the former, we require foreach that

(18)

The regularity constraints are that must have a zero ofsome order at . Daubechies [7, Section 3.B], hasshown that iteration of the dyadic two-scale relation (6) con-verges to a well-defined scaling function whose Fouriertransform is

if contains a zero of order (denoted in [7]) at, and , where

. An extension to her argument shows that such it-eration also converges to a well-defined wavelet function with

Fourier transform given by (9) if. Often the supremum defining occurs at , in

which case suffices to ensure regularity of .The regularity of the back-transformed wavelet functionis fully established only for the DWT in [7], but later work [22],[23] suffices to prove it for the CWT (see [23, Theorem 3.1]).For the non-dyadic two-scale relations used here, the above

condition on the order of the zero at becomes

(19)

It is desirable to use the smallest possible values of in orderto free up the filter coefficients to fit the desired wavelet functionas closely as possible. It is clear from (19) that when non-dyadictwo-scale relations are used, the required number of zeros canbe spread out over the different “voices per octave” (scalesper doubling of scale), which reduces the filter-length penaltiesfor inclusion of the regularity constraints.In terms of the filter coefficients in (13), the constraint

(18) is, for ,

(20)

and the regularity constraints are, for and,

(21)

The last equation is found by differentiating times withrespect to and setting . It is also used in [23].

B. Evaluation of Filter Coefficients

Replacing by in (12) yields, for

(22)

Using (13) and (22), the quantity in (17) is

We ignore the dependence of on and differentiate (17)with respect to the real and imaginary parts of : for

and

(23)

where and are Lagrange multipliers that account for con-straints (20) and (21); the scaling by is for convenience.The left-hand side of (23) can be written as a sum of inverseFourier transforms to provide the following equation:

(24)

where and are the inverse Fourier transforms of

and respectively. This takesthe form of a linear system, except that the functions andthemselves depend on because does. To solve it, we caneither replace these functions by others which don’t depend on, or solve iteratively, using the previous values of in

and to solve for new values until the two converge. The lattermethod requires some functional form to be assumed for inorder to evaluate the inverse Fourier transforms.A straightforward way to solve (24) is to recall that

is designed to estimate , and then approximate andby their values when . These are functionsand respectively, whose Fourier transforms are

(25)

Then can be found by solving a linear system for each valueof . In many cases, expressions for and can befound analytically.Alternatively, a more precise, iterative method of solution

is outlined in the Appendix. In the examples presented in

Page 5: Fast FIR Algorithms for the Continuous Wavelet Transform From Constrained Least Squares

32 IEEE TRANSACTIONS ON SIGNAL PROCESSING, VOL. 61, NO. 1, JANUARY 1, 2013

Section VI, the approximation of and by andas above yields integrated squared errors and maximum

absolute errors that are both between 100% and 200% of thevalues for the precise method. These differences are smallrelative to the precision gained from extra filter coefficients.Therefore approximation by and is adequate forpractical purposes. We emphasize that lower accuracy in thesolution of (24) affects only the closeness of the adjustedwavelet to the desired wavelet , and does not propa-gate errors or affect the validity of as a wavelet in its ownright, because (20) and (21) are still satisfied exactly.

V. INITIALIZATION

Wavelet transform algorithms that rely on two-scale relationshave to be initialized at some fine scale to provide a startingpoint for the two-scale relations. Fortunately, at fine scales thewavelet is well localized in space or time, and usually initial-ization is not a computational burden: direct use of formula (1)involves only a few values of in calculating each atsmall values of .It is important to ensure that the values assigned at initializa-

tion do not later cause trouble during iteration of the two-scalerelations. It is also desirable to avoid spurious high frequenciesby interpolating the signal from its sampled values at in-teger points .Because of the single-pass nature of theWT-FIR-1 filters, it is

essential that the first moments in the version of used forinitialization must vanish. If initialization is carried out by di-rect use of (1), this means that the numerical sums representingthe integral must be evaluated to the limit of numerical preci-sion; small terms must not be neglected until their contributionsare numerically zero. An FFT version of (1) could be used if

has a simple closed form but does not; initializationcan take advantage of the spatial localization of at finescales to apply the FFT only over moderate-sized blocks of thesignal rather than the whole signal [2]. Alternatively, canbe approximated by, e.g., a cubic B-spline in which the firstmoments vanish and the th moment matches the th momentof .Interpolation of the signal for use in integration can be

handled by a reconstruction filter (see, e.g., [35]). For example,if is based on the Gaussian scaling function ,interpolation by a Gaussian reconstruction filter kernel makesthe integration straightforward.Related to initialization of the CWT is the matter of scales

below which two-scale relations cannot be made sufficientlyaccurate. The practitioner is welcome to choose any range ofscales of analysis, but very fine ones are not amenable to two-scale relations. The initialization scale, nominally , canbe changed to effectively by replacing by

for some factor (see examples below). Thistechnique has been used by previous researchers [3], [5]. How-ever, small values of reduce the accuracy achievable in atwo-scale relation (see increasing values of in Tables I andIV). As noted at the beginning of this section, accurate resultsfor small can be calculated rapidly without two-scale relations,by the same means as initialization.

Fig. 1. Fourier transforms of the Mexican hat wavelet, , and a low ac-

curacy (seven filter coefficients) adjusted wavelet, , which has an exactdyadic two-scale relation and a zero of order 3 at .

VI. EXAMPLE APPLICATIONS TO THE MEXICAN HAT WAVELET

A. Dyadic Scales

The Mexican hat, or Laplacian of Gaussian, wavelet has theform:

(26)

where is a scaling parameter whose value we can choose toobtain adequate CWT precision (see Sections IV.A and V).The Mexican hat wavelet has two vanishing moments; i.e.,

in (9). The scaling function is

The functions and in (25) can be found analytically:

Because the scales are dyadic, i.e., , we omit the subscript: there is only one filter function , one adjusted scalingfunction whose Fourier transform approximates

, and one adjusted wavelet derived from .The value , as recommended by (19), was used for this

wavelet, forcing to have a zero of order 3 at .For various values of providing different levels of preci-

sion, filter coefficients and Lagrange multipliersand were estimated from (24), with estimated

as in the Appendix. The scaling parameter was chosen by trialand error to minimize the integrated squared error (17).A low-accuracy approximation to the Mexican hat wavelet is

graphed in Fig. 1 in the frequency domain. This approximationuses only seven filter coefficients. The adjusted waveletsatisfies the two-scale relation (15) exactly. Even for this veryrough approximation, the only cause for concern is the bulge ofhigh frequency around .

Page 6: Fast FIR Algorithms for the Continuous Wavelet Transform From Constrained Least Squares

LEIGH: CWT FROM CONSTRAINED LEAST SQUARES 33

TABLE IACCURACY OF WT-FIR-1 ALGORITHMS FOR THE MEXICAN HAT WAVELETWITH DYADIC SCALES, AND COMPARISON WITH BEST EXISTING METHOD

TABLE IINUMBERS OF ARITHMETIC OPERATIONS FOR THE PURE-FFT

IMPLEMENTATION OF THE CWT

TABLE IIIFILTER COEFFICIENTS FOR THE MEXICAN HAT WAVELET, DYADIC SCALES

The accuracies of the WT-FIR-1 algorithms and the best ex-isting fast algorithms [5] are compared in Table I. The numbersof arithmetic operations can also be compared to those of thepure-FFT method discussed in Section I, listed in Table II; thesedepend on signal length rather than filter length. The principalmeasure of accuracy used is the integrated squared error (ISE),

Fig. 2. Difference between the Fourier transforms of the adjusted and trueMexican hat wavelet functions, for dyadic scales with 11 filter coefficients: (a)overview; (b) right-hand tail, showing two dyadically spaced series of peaks

and with exponentially decreasing sizes, confirming that the adjustedwavelet function is well behaved.

where , which does not depend on the scalingparameter : the inclusion of in the ISE in this way allowsISEs with different values of to be validly compared. By Par-seval’s theorem from Fourier analysis, it is also the integratedsquared error of estimation of the wavelet function

. Table I also lists the maximum absolute differ-

ence between and .The algorithm of [5] involves three separate filters: two FIR

filters and one infinite impulse response (IIR) filter. The numberof arithmetic operations listed in Table I takes this into account,and is larger than the corresponding value for a single FIR filterwith the same number of coefficients.It can be seen from Tables I and II that the WT-FIR-1 al-

gorithm is roughly three times as fast as that of [5], and (formoderate accuracy) between two and three times as fast as thepure-FFT method. The new algorithm is also simpler to applythan [5], consisting of a single FIR filter, and in most cases usessmaller values of the scaling parameter , which allow use ofthe two-scale relation at smaller scales.Filter coefficients for various levels of accuracy are listed for

reference in Table III.For the case of 11 filter coefficients, the difference between

the wavelet Fourier transform and its estimate isplotted in Fig. 2. For this difference oscil-lates with roughly constant amplitude, but outside that range thepeaks decrease rapidly, resulting in regularity of .

Page 7: Fast FIR Algorithms for the Continuous Wavelet Transform From Constrained Least Squares

34 IEEE TRANSACTIONS ON SIGNAL PROCESSING, VOL. 61, NO. 1, JANUARY 1, 2013

Fig. 3. Difference between the Fourier transforms of the adjusted and trueMexican hat wavelet functions, for dyadic scales with 11 filter coefficients,without the constraint (21) on the filter coefficients. In contrast to the good be-havior of Fig. 2, the peaks are now exponentially increasing.

Such regularity contrasts with that in Fig. 3, which plots thedifference when the constraint (21) is dropped, allowingto be nonzero. If the integrated squared error over any finiterange (here ) is minimized, the peaks increaseexponentially in magnitude. The integrated squared error over

is infinite. Thus the condition (21) is critical tocorrect calculation of filter coefficients.Filter coefficients in Table III decay fairly rapidly as the

index increases, before they become zero for . This isrelated to the decay of an infinite sequence of such coefficientsproven in [3]. Because the filters developed here are finite andshort, decay is not essential to stability of the algorithms.

B. Four Voices per Octave

At four voices per octave, the scale increases by a factor ofonly with each application of the two-scale rela-tion, providing finer resolution than the dyadic sequence.The function is the same as in Section VI.A above. Now

and is given by

There are four filter functions , and fourfunctions that approximate (see (13) and (17)).For regularity, (19) recommends three zeros per octave as a

safe number. Judging from plots similar to Figs. 2 and 3, how-ever, two zeros per octave sufficed in most cases: was set to1 for and 2, and zero for and 3, except at the lowestlevel of precision (first row of Table IV) when was set to1. For various filter half-lengths , the coef-ficients and Lagrange multipliers and (for

) were estimated from (24), with estimatedas in the Appendix. Numbers of filter coefficients used in theWT-FIR-1 algorithm and that of [5] are compared in Table IV.From Table IV it can be seen that the WT-FIR-1 algorithm is

again roughly three times as fast as that of [5]. As was also thecase in Section A above, the new method has smaller values of

TABLE IVACCURACY OF WT-FIR-1 ALGORITHMS FOR THE MEXICAN HAT WAVELET

WITH FOUR SCALES PER OCTAVE

TABLE VFILTER COEFFICIENTS FOR THE MEXICAN HAT WAVELET WITH FOUR SCALES

PER OCTAVE, AVERAGE SIX COEFFICIENTS PER SCALE

the scaling parameter , allowing use of two-scale relations atsmaller scales.Non-dyadic two-scale relations have provided extra speed.

Comparison of Table I with IV shows that, for similar accu-racy, non-dyadic two-scale relations save about one-third in thenumber of filter coefficients per scale. TheWT-FIR-1 algorithmis about three times faster than the pure-FFT method for accu-racies of practical interest (see Table II).Filter coefficients for the case of six coefficients per scale are

listed for reference in Table V.

VII. RECONSTRUCTION OF THE SIGNAL

If reconstruction of the original signal from its CWT is re-quired, it is convenient to use wavelet packets [36], which areversions of the CWT partially integrated over scale. The packetwavelet function is

Low frequencies are integrated into the function

Page 8: Fast FIR Algorithms for the Continuous Wavelet Transform From Constrained Least Squares

LEIGH: CWT FROM CONSTRAINED LEAST SQUARES 35

To facilitate the algorithms developed in this paper, the function

can be used as a scaling function, where as inSection III; is defined so that and

. Implementation of wavelet packets is then identicalto the raw CWT with and in place of and .

VIII. MULTIDIMENSIONAL WAVELETS

The WT-FIR-1 algorithms are well suited to some multidi-mensional wavelets. A feature of the new single-pass filters isthat in dimensions they are very nearly isotropic when thescaling function is isotropic, but they are also applicableto anisotropic wavelets whose Fourier transforms take the form

in which are the frequency coordinates corresponding toCartesian coordinates , and are all polynomials of degreeor less. The isotropic nature of the single-pass filters allows

them to be applied to rotated versions of the wavelet, with noneed for matching rotation of the filter.A simple example is provided by the two-dimensional deriva-

tive-of-Gaussian (DOG) wavelet

with dyadic scales. A 1-D single-pass filter can be derivedin the same way as in Section VI.A, but with ; or indeedthe filters from there (Table III) can be used unaltered becausethey apply to any wavelet based on the Gaussian scaling func-tion with derivatives up to order . In two dimensions thetwo-scale relation can be implemented by applying the filter inthe direction, and applying the same filter in the direction.If is rotated by an angle to become

the same filters can still be used for , i.e., applying the 1-Dfilter in the and directions, with no need to use a rotatedversion of the filter.The new algorithms can find application to the plethora of

extensions of the CWT, colloquially known as “X-lets” (see re-view in [37]). The application of isotropic filters to anisotropicX-lets can be pursued provided that the scaling functions of theX-lets remain isotropic. An X-let to which the isotropic filterapproach described above is not applicable is the curvelet trans-form [38], because it has parabolic scaling, expanding the lengthand width scales by different ratios, which results in anisotropicscaling functions. Curvelets can make use of the non-dyadictwo-scale relations of Section III to provide different two-scalerelations for length and width, but the filters would have to berotated to be aligned to the curvelet’s length and width ratherthan to Cartesian axes.

IX. CONCLUSION

The single-pass form of the WT-FIR-1 filters raises the ques-tion of how far they might be developed for use in the DWT.A point of interest is that, when single-pass filters are used, allthe information present in the wavelet transform over all scalesmust be contained in the wavelet transform at the finest scale,because the two-scale relations use no other source. Single-passfilters for the DWT would therefore have to involve redundancyof information, but it is still possible that computation of thesingle-pass DWT may be faster than the standard, non-redun-dant DWT that uses dual filters.The computations for this paper were performed in the soft-

ware [39]. The code, and Fortran code for computing theCWT, are available as supplemental material and from www.mathematicaldiscovery.net. Suggestions of additional waveletsfor which practitioners require filter coefficients (as in Tables IIIand V) are welcome on the latter site.

APPENDIXPRECISE EVALUATION OF FILTER COEFFICIENTS

A. Another Periodic Estimating Function

In this section we approximate using a periodicfunction with period , which matches the periodicityof in (22). For , we set

(27)

for some large integer , where

(28)

We also define and , so that (27) holds for, but (28) does not.

The coefficients in (27) are redefined each time (22) is ap-plied in updating . They are evaluated by a similarmethodto that for in Section IV.B. We choose to minimize theintegrated squared difference

subject to the constraint

(29)

which ensures that (18) is satisfied and gives rise to a Lagrangemultiplier denoted . With substantial labor, using (22), and(13) and (27), with replaced by , the following recursivelinear system is found which, in conjunction with (29), can besolved for and in terms of : For ,and

Page 9: Fast FIR Algorithms for the Continuous Wavelet Transform From Constrained Least Squares

36 IEEE TRANSACTIONS ON SIGNAL PROCESSING, VOL. 61, NO. 1, JANUARY 1, 2013

where and are defined by their Fourier transforms(25). Solution is iterated, starting again at after solvingfor , until convergence is achieved.The value was used for most of the applications in

Section VI, but had to be reduced, down to 6 in two cases, forsome of the larger values of because the linear system forwas very close to singular.

B. Equations for Filter Coefficients

We use the above approximation for . From (27), thefunction in (24) is:

Then (24), which is to be solved for , becomes, forand

ACKNOWLEDGMENT

Dr. Stephen Gay and two anonymous reviewers providedcomments on the style and structure of this paper, which sub-stantially improved its readability and breadth of reference torelated work.

REFERENCES[1] I. Daubechies, Ten Lectures on Wavelets. Philadelphia, PA: SIAM,

1992.[2] O. Rioul and P. Duhamel, “Fast algorithms for discrete and continuous

wavelet transforms,” IEEE Trans. Inf. Theory, vol. 38, pp. 569–586,Mar. 1992.

[3] M. A. Muschietti and B. Torrésani, “Pyramidal algorithms for Lit-tlewood-Paley decompositions,” SIAM J. Math. Anal., vol. 26, pp.925–943, Jul. 1995.

[4] P. Abry and A. Aldroubi, “Designing multiresolution analysis-typewavelets and their fast algorithms,” J. Fourier Anal. Appl., vol. 2, pp.135–159, Apr. 1995.

[5] M. J. Vrhel, C. Lee, and M. Unser, “Rapid computation of the contin-uous wavelet transform by oblique projections,” IEEE Trans. SignalProcess., vol. 45, pp. 891–900, Apr. 1997.

[6] S. G. Mallat, “A theory for multiresolution signal decomposition: Thewavelet representation,” IEEE Trans. Pattern Anal. Mach. Intell., vol.11, pp. 674–693, Jul. 1989.

[7] I. Daubechies, “Orthonormal bases of compactly supported wavelets,”Commun. Pure Appl. Math., vol. 41, pp. 909–996, Oct. 1988.

[8] D. L. Jones and R. G. Baraniuk, “Efficient approximation of continuouswavelet transforms,” Electron. Lett., vol. 27, pp. 748–750, Apr. 1991.

[9] S. G. Johnson and M. Frigo, “A modified split-radix FFT with fewerarithmetic operations,” IEEE Trans. Signal Process., vol. 55, pp.111–119, Jan. 2007.

[10] M. J. Shensa, “The discrete wavelet transform: Wedding the à trousand Mallat algorithms,” IEEE Trans. Signal Process., vol. 40, pp.2464–2482, Oct. 1992.

[11] P. Abry and P. Flandrin, “On the initialization of the discrete wavelettransform algorithm,” IEEE Signal Process. Lett., vol. 1, pp. 32–34,Feb. 1994.

[12] X.-P. Zhang, L.-S. Tian, and Y.-N. Peng, “From the wavelet seriesto the discrete wavelet transform—The initialization,” IEEE Trans.Signal Process., vol. 44, pp. 129–133, Jan. 1996.

[13] R. C. Agarwal and J. W. Cooley, “New algorithms for digital convolu-tion,” in Proc. IEEE Trans. Acoust., Speech Signal Process., Hartford,CT, Oct. 1977, pp. 392–410.

[14] K. Hayashi, K. Dhar, K. Sugahara, and K. Hirano, “Design ofhigh-speed digital filters suitable for multi-DSP implementation,”IEEE Trans. Circuits Syst., vol. 33, pp. 202–217, Feb. 1986.

[15] P. C. Balla, A. Antoniou, and S. D. Morgera, “Higher radix aperiodic-convolution algorithms,” IEEE Trans. Acoust., Speech Signal Process.,vol. 34, pp. 60–68, Feb. 1986.

[16] H. K. Kwan and M. T. Tsim, “High speed 1-D FIR digital filteringarchitectures using polynomial convolution,” in Proc. IEEE Int. Conf.Acoust., Speech, Signal Process., Dallas, Apr. 1987, pp. 1863–1866.

[17] M. Vetterli, “Running FIR and IIR filtering using multirate filterbanks,” IEEE Trans. Acoust., Speech, Signal Process., vol. 36, pp.730–738, May 1988.

[18] Z.-J. Mou and P. Duhamel, “A unified approach to the fast FIR filteringalgorithms,” in Proc. IEEE Int. Conf. Acoust., Speech, Signal Process.ICASSP-88, New York, Apr. 1988, pp. 1914–1917.

[19] Z.-J. Mou and P. Duhamel, “Short-length FIR filters and their use infast nonrecursive filtering,” IEEE Trans. Signal Process., vol. 39, pp.1322–1332, June 1991.

[20] W.M.Gentleman andG. Sande, “Fast Fourier transforms—For fun andprofit,” in Proc. AFIPS Spring Joint Computer Conf., San Francisco,CA, Nov. 1966, pp. 563–578.

[21] M. Vetterli and C. Herley, “Wavelets and filter banks: Relationshipsand new results,” in Proc. Int. Conf. Acoust., Speech, Signal Process.,Albuquerque, NM, Apr. 1990, pp. 1723–1726.

[22] I. Daubechies and J. C. Lagarias, “Two-scale difference equations. I.Existence and global regularity of solutions,” SIAM J. Math. Anal., vol.22, pp. 1388–1410, 1991.

[23] I. Daubechies and J. C. Lagarias, “Two-scale difference equations II.Local regularity, infinite products of matrices and fractals,” SIAM J.Math. Anal., vol. 23, pp. 1031–1079, 1992.

[24] T. Blu, “A new design algorithm for two-band orthonormal rationalfilter banks and orthonormal rational wavelets,” IEEE Trans. SignalProcess., vol. 46, pp. 1494–1504, Jun. 1998.

[25] J. Kovačević and M. Vetterli, “Perfect reconstruction filter banks withrational sampling factors,” IEEE Trans. Signal Process., vol. 41, pp.2047–2066, Jun. 1993.

[26] T. Blu, “Iterated filter banks with rational rate changes connection withdiscrete wavelet transforms,” IEEE Trans. Signal Process., vol. 41, pp.3232–3244, Dec. 1993.

[27] P. Steffen, P. N. Heller, R. A. Gopinath, and C. S. Burrus, “Theory ofregular -band wavelet bases,” IEEE Trans. Signal Process., vol. 41,pp. 3497–3511, Dec. 1993.

[28] X.-R. Dai, D.-J. Feng, and Y. Wang, “Refinable functions with non-integer dilations,” J. Function. Anal., vol. 250, pp. 1–20, Sep. 2007.

[29] J. M. Lewis and C. S. Burrus, “Approximate continuous wavelettransform with an application to noise reduction,” in Proc. IEEE Int.Conf. Acoust., Speech Signal Process., Seattle, WA, May 1998, pp.1533–1536.

[30] I. W. Selesnick, “A higher density discrete wavelet transform,” IEEETrans. Signal Process., vol. 54, pp. 3039–3048, Aug. 2006.

[31] I. Bayram and I. W. Selesnick, “Frequency-domain design of over-complete rational-dilation wavelet transforms,” IEEE Trans. SignalProcess., vol. 57, pp. 2957–2972, Aug. 2009.

[32] M. J. Vrhel, C. Lee, and M. Unser, “Comparison of algorithms for thefast computation of the continuous wavelet transform,” Proc. SPIE,vol. 2825, pp. 422–431, Oct. 1996.

[33] D. Gabor, “Theory of communication,” J. Inst. Elect. Eng., vol. 93, pp.429–457, Nov. 1946.

[34] J. Morlet, G. Arens, E. Fourgeau, and D. Giard, “Wave propagationand sampling theory; Part II, Sampling theory and complex waves,”Geophys., vol. 47, pp. 222–236, Feb. 1982.

[35] D. P.Mitchell and A. N. Netravali, “Reconstruction filters in computer-graphics,” in Proc. 15th Ann. Conf. Computer Graphics Interact. Tech.(SIGGRAPH), Atlanta, GA, Aug. 1988, pp. 221–228.

[36] M. Duval-Destin, M. A. Muschietti, and B. Torrésani, “Continuouswavelet decompositions, multiresolution, and contrast analysis,” SIAMJ. Math. Anal., vol. 24, pp. 739–755, May 1993.

Page 10: Fast FIR Algorithms for the Continuous Wavelet Transform From Constrained Least Squares

LEIGH: CWT FROM CONSTRAINED LEAST SQUARES 37

[37] L. Jacques, L. Duval, C. Chaux, and G. Peyré, “A panorama on mul-tiscale geometric representations, intertwining spatial, directional andfrequency selectivity,” Signal Process., vol. 91, pp. 2699–2730, Dec.2011.

[38] E. J. Candès and D. L. Donoho, “Curvelets, multiresolution represen-tation, and scaling laws,” Proc. SPIE, vol. 4119, pp. 1–12, Dec. 2000.

[39] R Core Team, R: A Language and Environment for Statistical Com-puting, R Foundation for Statistical Computing, 2012 [Online]. Avail-able: www.r-project.org

George M. Leigh (S’07–M’10) received the B.Sc.(Hons.) degree in mathematics in 1984 and the Ph.D.degree in mineral processing science in 2009, bothfrom the University of Queensland, Australia.He has worked as a mathematician since 1985,

specializing in applications to mineral processingand fisheries. Since 2009, he has been a memberof the Fisheries Resource Assessment team at theQueensland Department of Agriculture, Fisheriesand Forestry. His research interests include imageanalysis, stereology, statistics, and fish population

dynamics.