Next Article in Journal
Special Issue on Computational Intelligence and Nature-Inspired Algorithms for Real-World Data Analytics and Pattern Recognition
Previous Article in Journal
Effects of Random Values for Particle Swarm Optimization Algorithm
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Class of Algorithms for Continuous Wavelet Transform Based on the Circulant Matrix

1
Department of Mathematics, Jinggangshan University, Ji’an 343009, Jiangxi Province, China
2
Department of Mathematics, Tongji University, Shanghai 200092, China
*
Author to whom correspondence should be addressed.
Algorithms 2018, 11(3), 24; https://doi.org/10.3390/a11030024
Submission received: 20 November 2017 / Revised: 6 February 2018 / Accepted: 22 February 2018 / Published: 27 February 2018

Abstract

:
The Continuous Wavelet Transform (CWT) is an important mathematical tool in signal processing, which is a linear time-invariant operator with causality and stability for a fixed scale and real-life application. A novel and simple proof of the FFT-based fast method of linear convolution is presented by exploiting the structures of circulant matrix. After introducing Equivalent Condition of Time-domain and Frequency-domain Algorithms of CWT, a class of algorithms for continuous wavelet transform are proposed and analyzed in this paper, which can cover the algorithms in JLAB and WaveLab, as well as the other existing methods such as the c w t function in the toolbox of MATLAB. In this framework, two theoretical issues for the computation of CWT are analyzed. Firstly, edge effect is easily handled by using Equivalent Condition of Time-domain and Frequency-domain Algorithms of CWT and higher precision is expected. Secondly, due to the fact that linear convolution expands the support of the signal, which parts of the linear convolution are just the coefficients of CWT is analyzed by exploring the relationship of the filters of Frequency-domain and Time-domain algorithms, and some generalizations are given. Numerical experiments are presented to further demonstrate our analyses.

1. Introduction

In recent years, different Time-frequency representations, such as, empirical mode decomposition [1], wavelet transform [2] and its variants, empirical wavelet transform [3,4], synchrosqueezed wavelet transforms [5], have been used for analyzing nonlinear and non-stationary signals. To name only a few, the method of fused empirical mode decomposition and wavelets is applied to detection-location of damage in a truss-type structure [6]; Wavelet transform is used for the pattern recognition for diagnosis, condition monitoring and fault detection [7,8,9]. It is also used to design an algorithm for Brain-computer interfacing [10], to detect the exact onset of chipping of the cutting tool from the workpiece profile [11], to determine the length of piles [12]; Synchrosqueezed wavelet transform is used for global and local health condition assessment of structures [13], for modal parameters identification of smart civil structures [14].
This paper gives priority to the computation of continuous wavelet transform (CWT) for Morlet-type wavelets. However, for this type of wavelets, it is not possible to use a multiresolution framework for the computation of CWT [15]. Michael Unser [16] used Exponentials or B-spline window to approximate Gabor window, which can achieve O ( N ) complexity per scale. Another kind of method for the computation of CWT with Morlet-type wavelets concerns directly discretizing the integral expression of Wavelet transform. These methods allow us to use arbitrary values for the scale variable, and require the explicit expression of wavelet function and cannot deal with those wavelets without analytic expressions such as Daubechies wavelets [17]. This kind of method include Time-domain methods [17] and Frequency-domain methods [18].
Frequency-domain methods for CWT are also widely used in the freewares such as JLAB (available online http://www.jmlilly.net), Wavelab (available online http://www-stat.stanford.edu/$\sim$wavelab), which can achieve satisfactory precision while the edge effect, defined in [18], may occur and the complexity of those methods is O ( N log ( N ) ) where N is the length of the signal.
The function c w t in wavelet toolbox of MATLAB, which has poorer precision than Frequency-domain methods mentioned above, is a representation of the Time-domain method [17]. For the details of the comparison of the different methods, we refer to [17].
The computation of linear convolution can be realized by using the circular convolution, while the computation of circular convolution can be computed by using the FFT-based fast method [19]. In this paper, a novel and simple method is given to prove the FFT-based fast method of linear convolution by exploiting the structures of circulant matrix. After introducing Equivalent Condition of Time-domain and Frequency-domain Algorithms of CWT, a class of algorithms for continuous wavelet transform are proposed and analyzed, which can cover the algorithms in JLAB and WaveLab, as well as the other existing methods such as the c w t function in the toolbox of MATLAB. In this framework, two theoretical issues for the computation of CWT are analyzed.
Firstly, by using Equivalent Condition of Time-domain and Frequency-domain Algorithms of CWT to design Frequency-domain Algorithm, the edge effect, defined in [18], can be avoided. To be specific, in [18], the time series is padded with sufficient zeroes to bring the total length N up to the next-higher power of two, thus limiting the edge effects and speeding up the Fourier transform. In fact, the same number of zeros is padded for all scales in [18], which may cause some troubles, for example, increasing the amount of data to process, and consequently the computational complexity. In this article, the time series (the data) is padded with 2 a T zeros while a is the scale. These two zero padding methods are compared in Remark 2 of this paper.
Secondly, due to the fact that linear convolution expands the support of the signal, which parts of the linear convolution are just the coefficients of CWT is analyzed by exploring the relationship of the filters of Frequency-domain and Time-domain algorithms (see Theorem 4), and some generalizations are given (see Theorem 5).
This paper is organized as follows. Section 2 gives some definitions and theorems concerning circulant matrix and linear convolution. Section 3 analyzes algorithms of continuous wavelet transform. Section 4 presents numerical experiments to demonstrate our results and finally, we end this paper with conclusions and discussions in Section 5.

2. Primary Definitions and Theorems

Definition 1.
Circulant matrix: An N × N circulant matrix C takes the form [20,21]
C = c 0 c N 1 c 2 c 1 c 1 c 0 c N 1 c 2 c 1 c 0 c N 2 c N 1 c N 1 c N 2 c 1 c 0
A circulant matrix is fully specified by one vector, c, which appears as the first column of C .
Definition 2.
Discrete Fourier transform(DFT): The sequence of N complex numbers [ x 0 , x 1 , , x N 1 ] T is transformed into an N-periodic sequence of complex numbers [22]
X k = n = 0 N 1 x n ω k n , k = 0 , 1 , , N 1 ,
where i = 1 , ω k = e 2 π k i N is the N-th root of unity.
Equation (2) can be written as
X 0 X 1 X N 1 = F N x 0 x 1 x N 1
where F N is a N × N matrix, defined as
F N ( k , j ) = ω k 1 ( j 1 ) , k , j = 1 , 2 , , N .
It is easy to verify that
F N 1 = 1 N F N
where “ ” means conjugate transposition. Then, the inverse discrete Fourier transform (IDFT) is given as
x 0 x 1 x N 1 = 1 N F N X 0 X 1 X N 1
Theorem 1.
References [20,21] The matrix C defined in (1) can be diagonalized by the DFT matrix F N , namely,
C = F N 1 d i a g ( F N c ) F N
where c is the first column of C , i.e., c = [ c 0 c 1 c N 1 ] T .
Proof. 
It is easy to verify that the normalized eigenvectors of C are given by
v j = 1 N ( 1 , ω j , ω j 2 , , ω j N 1 ) T , j = 0 , 1 , , N 1 ,
where ω j = e 2 π i j N with i = 1 is the N-th root of unity. The corresponding eigenvalues are then given by
λ j = c 0 + c N 1 ω j + c N 2 ω j 2 + + c 1 ω j N 1 = c 0 ω j 0 + c N 1 ω j N ω j ( N 1 ) + c N 2 ω j N ω j ( N 2 ) + + c 1 ω j N ω j 1 = k = 0 N 1 c k ω j k , j = 0 , 1 , , N 1 .
From (2), (3) and (9), we have
λ 0 λ N 1 = F N c 0 c N 1 = F N c
Using { v j } j = 0 N 1 defined in Equation (8) as column vectors to form a N × N matrix U N
U N = [ v 0 , v 1 , , v N 1 ] ,
then we have
C = U N λ 0 λ N 1 U N .
Furthermore, we have U N = 1 N F N , U N = N F N 1 from (4), (5) and (11). Then we have
C = F N 1 d i a g ( F N c ) F N
 ☐
Definition 3.
Linear convolution [23]: A time-invariant linear operator L can be represented as a linear convolution. To be specific, we denote by δ [ n ] the discrete Dirac
δ [ n ] = 1 i f n = 0 0 i f n 0 .
Any signal f [ n ] can be decomposed as a sum of shifted Diracs:
f [ n ] = p = + f [ p ] δ [ n p ] .
Let L δ [ n ] = h [ n ] be the discrete impulse response. Linearity and time invariance implies that
g [ n ] = L f [ n ] = p = f [ p ] h [ n p ] : = def f h [ n ] ,
where “ ” represents linear convolution.
Definition 4.
Causality and Stability [23]: A discrete filter L is causal if L f [ p ] depends only on the values of f [ n ] for n p . The convolution formula (14) implies that h [ n ] = 0 if n < 0 .
A discrete filter L is stable if any bounded input signal f [ n ] produces a bounded output signal L f [ n ] . One can verify that the filter is stable if and only if h l 1 ( Z ) .
Proposition 1.
Assume that the length of f and h are finite. To be specific, If f = [ f 0 , f 1 , , f n β 1 ] T , and h = [ h 0 , h 1 , , h β ] T , then the linear convolution of f and h defined in (14) can be written as
g = f h = H f
where H R n × ( n β ) , and
H = h 0 h 1 h 0 h β h 0 h 1 h β .
Proof. 
We refer the reader to [19] for details. ☐
Suppose we wish to compute the polynomial product c ( x ) = a ( x ) · b ( x ) , the ordinary product expression for the coefficients of c ( x ) involves a linear convolution.
Definition 5.
Circular convolution [19]: The circular convolution of a signal { x [ k ] } k = 0 N 1 with a signal { c [ k ] } k = 0 N 1 is defined as a matrix vector multiplication as follows.
y : = def x c = C · x [ 0 ] x [ 1 ] x [ N 1 ]
where C is defined in Equation (1), and “ ” represents circular convolution.
Proposition 2.
The computation of circular convolution can be realized by using FFT-based fast method. In other word, Equation (17) can be written as
y = F N 1 d i a g ( F N c ) F N x .
Proof. 
The matrix involved in (17) is a circulant matrix, thus (18) is obtained by using Theorem 1. ☐
The equivalent condition of circular convolution and linear convolution will be given in the following theorem.
Theorem 2.
Assume f = [ f 0 , f 1 , , f n β 1 ] T , h = [ h 0 , h 1 , , h β ] T , f ˜ = [ f 0 , f 1 , , f n β 1 , 0 , , 0 β ] T , h ˜ = [ h 0 , h 1 , , h β , 0 , , 0 n β 1 ] T , then linear convolution g = f h of f and h defined in (14) can be computed as circular convolution f ˜ h ˜ of f ˜ and h ˜ , namely,
g = f h = f ˜ h ˜ = F N 1 ( F N h ˜ . F N f ˜ ) .
where F N , F N 1 are defined by (4), (5) respectively; “ . ”means componentwise product of two vectors.
Proof. 
From Proposition (1), we get g = H f , where H R n × ( n β ) is defined in (16). Now extend H to a circulant matrix [21]
C = [ H , H ^ ] = h 0 h β h 1 h 1 h 0 h β h β h 0 h 1 h 0 h β h β 1 h 0 ,
thus the first column of C is h ˜ . Therefore,
g = H f = [ H , H ^ ] f ˜ = C f ˜ = f ˜ h ˜ = F N 1 ( F N h ˜ . F N f ˜ )
by using Definition 5 and Proposition 2. ☐
From Theorem 2, the algorithm of linear convolution of g = f h is given as follows (See Algorithm 1).
Algorithm 1: FFT-based fast method for linear convolution.
Input:
 the signal, f [ k ] , k = 0 , 1 , , n β 1
 the signal, h [ k ] , k = 0 , 1 , , β
Output:
 the linear convolution of f and h, g [ k ] , k = 0 , 1 , , n 1
 1. Set n = l e n g t h ( f ) + l e n g t h ( h ) 1 ;
 2. Appending an array of zeros to the end of h to obtain h ˜ so that the length of h ˜ is n.
 3. Appending an array of zeros to the end of f to obtain f ˜ so that the length of f ˜ is n
 4.  g = i f f t ( f f t ( h ˜ ) . f f t ( f ˜ ) )
Additionally, the asymptotic time complexity is O ( n l o g 2 ( n ) ) for Algorithm 1. Note the condition n = l e n g t h ( f ) + l e n g t h ( h ) 1 plays a pivotal role in the equivalence of linear convolution and circular convolution. This condition will also be used in the following part of this paper.
Definition 6.
Equivalent Condition of Linear Convolution and Circular Convolution: Let f , h , f ˜ , h ˜ be defined in Theorem 2. The condition l e n g t h ( h ˜ ) = l e n g t h ( f ˜ ) = l e n g t h ( f ) + l e n g t h ( h ) 1 is called Equivalent Condition of Linear Convolution and Circular Convolution.

3. A Class of Algorithms for Continuous Wavelet Transform

3.1. Time-Domain Algorithm for CWT

Definition 7.
Continuous wavelet transform: The continuous wavelet transform of a function f ( t ) at a scale a R + and translational value b R is expressed by the following integral [17]
W f ( a , b ) : = def + f ( t ) 1 a ψ ¯ ( t b a ) d t
where ψ ( t ) is a continuous function called the mother wavelet and the overline represents the operation of complex conjugate.
For real-life applications, the length of f ( t ) is finite and the support of ψ ( t ) is compact. Without loss of generality, assume the sampling rates of the signal and the wavelet are equal to 1, then Equation (21) can be written as
W f a [ m ] = k = + f ( k ) 1 a ψ ¯ ( k m a ) , w h e r e m Z .
Assume the sampled signal is { f [ i ] } i = 0 N 1 and the support of the mother wavelet ψ ( t ) is [ T , T ] . If define
ψ ˜ a ( t ) : = def 1 a ψ ¯ ( a T t a )
then the support of ψ ˜ a ( t ) is [ 0 , 2 a T ] . Now, we can get the following result.
Theorem 3.
Assume the length of f ( t ) is finite and the support of ψ ( t ) is compact, and the sampling rates of the signal and the wavelet are equal to 1, then CWT of { f [ i ] } i = 0 N 1 can be written as
W f a [ m ] = k = 0 N 1 f ( k ) ψ ˜ a ( m + a T k ) = f ψ ˜ a [ m + a T ] , w h e r e m = 0 , 1 , , N 1 ,
where we assume a T is an integer for the convenience of analysis. Furthermore, the corresponding filter is causal and stable.
Proof. 
By using Proposition 1 and Equations (23) and (24) is deduced from (22). Furthermore, define
h a [ i ] = ψ ˜ a ( i ) , i Z
then the discrete filter { h a [ i ] } i Z is causal and stable since h a [ i ] = ψ ˜ a ( i ) = 0 if i < 0 and h a l 2 ( Z ) . Furthermore, Equation (24) can be written as
W f a [ m ] = f h a [ m + a T ] , w h e r e m = 0 , 1 , , N 1 .
 ☐
In brief, { W f a [ i ] } i = 0 N 1 are just the { f h a [ i ] } i = a T a T + N 1 while { f h a [ i ] } i = 0 2 a T + N 1 can be implemented with linear convolution [17]. From Algorithm 1, we can get the algorithm of CWT (see Algorithm 2).
Algorithm 2: Time-domain fast algorithm for CWT.
Input:
 the signal, f [ n ] , n = 0 , 1 , , N 1
 mother wavelet, ψ ( t )
 scale, a
T, where [ T , T ] is the support of ψ ( t ) .
Output:wavelet coefficients, W f a [ i ] , i = 0 , 1 , , N 1
 1. Let f ˜ = [ f 0 , f 1 , , f N 1 , 0 , , 0 2 a T ] T ;
 2. Let ψ ˜ a ( t ) = 1 a ψ ¯ ( a T t a ) , where the overline represents the operation of complex conjugate;
 3. Let h a [ n ] = ψ ˜ a ( n ) , n = 0 , 1 , , 2 a T ;
 4. Let h ˜ a = [ h a [ 0 ] , h a [ 1 ] , , h a [ 2 a T ] , 0 , , 0 N 1 ] T ;
 5.  t e m a [ i ] = i f f t ( f f t ( f ˜ ) . f f t ( h ˜ a ) ) , i = 0 , 1 , , 2 a T + N 1 ;
 6.  W f a [ i ] = t e m a [ a T + i ] , i = 0 , 1 , , N 1 .

3.2. Frequency-Domain Algorithm for CWT

The algorithm can be further optimized by taking advantage of the analytic expression of ψ ^ ( ω ) , the Fourier transform of the mother wavelet ψ ( t ) . In fact, the wavelet transform defined in (21) can also be written as a frequency integration by applying the Fourier Parseval formula [23].
W f ( a , b ) = 1 2 π + f ^ ( ω ) ψ ^ ¯ ( a ω ) e i b ω d ω
Assume the sampled signal is { f [ n ] } n = 0 N 1 . Discretizing (27) and considering the periodic property of discrete Fourier transform yields
W f a [ n ] = 1 M k = M 2 + 1 M 2 f ^ ( 2 π M k ) ψ ^ ¯ ( 2 π M k a ) e i 2 π M k n = 1 M k = 0 M 1 f ^ ( 2 π M k ) ψ ^ ¯ ( 2 π M k a ) e i 2 π M k n , w h e r e n = 0 , 1 , , M 1 .
It is seen by comparing (28) and (18) that (28) represents a circular convolution. By considering Equivalent Condition of Linear Convolution and Circular Convolution, It is reasonable to let
M = 2 a T + N .
In this case, the values of { f ^ ( 2 π M k ) } k = 0 M 1 can be computed as the discrete Fourier transform of f ˜ = [ f 0 , f 1 , , f N 1 , 0 , , 0 M N ] T . As for the computation of { ψ ^ ¯ ( 2 π M k a ) } k = 0 M 1 , we can make use of the analytic expression of ψ ^ ( ω ) . For example, the Morlet wavelet is defined as [24]
ψ ( t ) : = def 2 π σ 2 e t 2 2 σ 2 e i η t ,
then
ψ ^ ¯ ( ω ) = ψ ^ ( ω ) = 2 e σ 2 ( ω η ) 2 2 ,
where σ 2 is shape parameter, and η is center frequency. Furthermore, the Morlet wavelet is approximately analytic and therefore ψ ^ ¯ ( 2 π M k a ) 0 for k < 0 . So
ψ ^ ¯ ( 2 π M k a ) 0 , f o r k > M 2 ,
by the periodic property of discrete Fourier transform. Equation (32) will be used to design algorithm of CWT (see the 4th–6th steps of Algorithms 3).
Definition 8.
Equivalent Condition of Time-domain and Frequency-domain Algorithms of CWT: M = 2 a T + N in Equation (29) is called Equivalent Condition of Time-domain and Frequency-domain Algorithms of CWT.
Remark 1.
In freeware such as Wavelab, the parameter M in Equation (29) takes value N, where N is the length of signal. In this case, { f ^ ( 2 π M k ) } k = 0 M 1 can be obtained as the discrete Fourier transform of the data. Furthermore, the length of the result of ifft is just N. However, the method will produce artificial periodicity, which is called edge effect by Torrence [18], in the wavelet coefficients if signal is not periodic. In order to limit the edge effect, in [18], the data is padded with sufficient zeros before doing the CWT, then the first N coefficients of the corresponding convolution are just the coefficients of the CWT. Nevertheless, the reason for this is not answered in previous papers in the author’s knowledge. Put another way. Why the last step of Algorithm 3 is dissimilar from the last step of Algorithm 2? The answer will be given in the following Theorem 4.
Lemma 1.
The filter used in Equation (27) is
ψ ˜ ˜ a ( t ) = 1 a ψ ¯ ( t a ) .
Proof. 
We refer the reader to [23] for details. ☐
Theorem 4.
The wavelet coefficients of the CWT of { f [ n ] } n = 0 N 1 is the first N coefficients of (28). While the length of the total coefficients of (28) is M.
Proof. 
The filter used in Theorem 3 is ψ ˜ a defined in (23); therefore, ψ ˜ ˜ a ( t a T ) = ψ ˜ a ( t ) . Define L ψ ˜ a = f ψ ˜ a , then L ψ ˜ ˜ a = f ψ ˜ ˜ a . Denote ψ ˜ ˜ = ψ ˜ ˜ a , ψ ˜ = ψ ˜ a , ψ ˜ ˜ a T = ψ ˜ ˜ ( t a T ) = ψ ˜ for the simplicity of notation for this moment. By the property of time-invariant of L,
L ψ ˜ [ n ] = L ψ ˜ ˜ a T [ n ] = L ψ ˜ ˜ [ n a T ] ;
therefore
L ψ ˜ [ n + a T ] = L ψ ˜ ˜ [ n ] .
That is to say
{ L ψ ˜ a [ n + a T ] } n = 0 N 1 = { L ψ ˜ ˜ a [ n ] } n = 0 N 1 .
From Theorem 3, { L ψ ˜ a [ n + a T ] } n = 0 N 1 is the wanted wavelet coefficients; therefore { L ψ ˜ ˜ a [ n ] } n = 0 N 1 = { f ψ ˜ ˜ a [ n ] } n = 0 N 1 is the wanted wavelet coefficients. ☐
Theorem 5.
Assume that (Without loss of generality, a T is assumed to be an integer.)
L m [ n ] = 1 M k = 0 M 1 f ^ ( 2 π M k ) ψ ^ ¯ ( 2 π M k a ) e i 2 π M k m a T e i 2 π M k n , n = 0 , 1 , , M 1 ; m = 0 , 1 , 2 ,
then
{ W f a [ n ] } n = 0 N 1 = { L 0 [ n ] } n = 0 N 1 = { L 1 [ n ] } n = a T a T + N 1 = { L 2 [ n ] } n = M N M 1 .
Proof. 
If m = 0 , Equation (34) is simply Equation (28), the conclusion is deduced from Theorem 4.
Since
F [ ψ ˜ a ] ( ω ) = + 1 a ψ ¯ ( a T t a ) e i t ω d t = e i a T ω ψ ^ ¯ ( a ω ) ,
thus L 1 [ n ] = f ψ ˜ a , the conclusion is deduced from Theorem 3. If define ψ a ( 3 ) = 1 a ψ ¯ ( 2 a T t a ) , the conclusion for the m = 2 case can also be proved in the same way. ☐
Now, Frequency-domain algorithm of CWT with Morlet wavelet as the mother wavelet is given as follows.
Algorithm 3: Frequency-domain fast algorithm for CWT (In real application, the case m = 0 is enough for the calculation of CWT).
Input:
 the signal, f [ n ] , n = 0 , 1 , , N 1
 scale, a
ψ ^ ( ω ) , the Fourier transform of the Morlet wavelet ψ ( t )
T, where [ T , T ] is the support of ψ ( t ) .
Output:
 wavelet coefficients, W f a [ i ] , i = 0 , 1 , , N 1
 1. Let f ˜ = [ f 0 , f 1 , , f N 1 , 0 , , 0 2 a T ] T ;
 2. Define φ m ( ω ) = e i m a T ω ψ ^ ¯ ( a ω ) , m = 0 , 1 , 2 , where the overline represents the operation of    complex conjugate;
 3. Let M = 2 a T + N ;
 4. If M is even, Let h ˜ ^ a = [ φ m ( 2 π M · 0 ) , φ m ( 2 π M · 1 ) , , φ m ( 2 π M · M 2 ) , 0 , , 0 M 2 1 ] T ;
 5. else h ˜ ^ a = [ φ m ( 2 π M · 0 ) , φ m ( 2 π M · 1 ) , , φ m ( 2 π M · M 1 2 ) , 0 , , 0 M 1 2 ] T ;
 6. end if
 7. t e m a [ i ] = i f f t ( f f t ( f ˜ ) . ( h ˜ ^ a ) ) , i = 0 , 1 , , 2 a T + N 1 ;
 8. switch(m)
              case 0       W f a [ i ] = t e m a [ i ] , i = 0 , 1 , , N 1 ;
              case 1       W f a [ i ] = t e m a [ i + a T ] , i = 0 , 1 , , N 1 ;
              case 2       W f a [ i ] = t e m a [ i + 2 a T ] , i = 0 , 1 , , N 1 .
Remark 2.
Note that the previous data preparation method takes M = 2 q , where q = min n Z { 2 n > N } [17,18]. However, this method may fail for some real life data. We propose M = N + 2 a T , Equivalent Condition of Time-domain and Frequency-domain Algorithms of CWT, then the edge effect, defined in [18], that may occur in JLAB, Wavelab and [25] can be avoided. See Figures 6 and 7 for details.

4. Numerical Experiments

The experiments are conducted on two types of data, one for synthetic data, another for real-life data. Entropy can be used to measure the sparsity of wavelet coefficients [17]. In order to define entropy, { | W f ( a i , b j ) | 2 } i , j are rearranged as { c k } k = 1 , , M , then are normalized to obtain:
d k = c k k = 1 M c k .
The wavelet entropy is calculated as
E n t r o p y = k = 1 M d k log d k ,
with the convention 0 log 0 = 0 by definition.
Experiments for Data 1: Data 1 is a synthetic signal with length N. The first half contains sinusoidal signal superimposition with three different frequencies, namely a 4 sin ( 30 π t ) + a 3 sin ( 60 π t ) + a 1 sin ( 120 π t ) ; The latter half contains the 60 Hz sinusoidal signal with amplitude a 2 , namely a 2 sin ( 120 π t ) , where a 4 = 1 , a 3 = 1.2 , a 1 = 1.4 , a 2 = 0.6 , and the sampling frequency is 400 Hz. Data 1 with length N = 1024 is presented in Figure 1a. Figure 1b, the absolute values of CWT coefficients of Figure 1a, computed with the a w t function in Wavelab, where the shape parameter σ 2 = 1 and the center frequency η = 8 , manifests edge effects. Figure 1c without edge effects is computed by using the case 0 of Algorithm 3.
Table 1 gives the computational results of Data 1 with wavelet parameter σ 2 = 1 , η = 8 by using different methods. “ c w t ” means the c w t function in wavelet toolbox of Matlab. “Zhao’s method” is an improved version of c w t [26]. ”Direct” means the computation method of linear convolution by using Equation (15). If the length of signal is far larger than the length of the filter, an “Overlap-add” procedure for the calculation of linear convolution is faster than Direct method and Algorithm 1 [23]. The “wavelet entropy” shown in Table 1 can measure the sparsity of wavelet coefficients [17]. “Err_i” means the relative error of a i and the corresponding maximum amplitude of CWT coefficients.
From Table 1, we know that the precision, wavelet entropy of “Direct”, Algorithms 2 and 3, “Overlap-add” are almost the same and are more optimal to c w t function in toolbox of Matlab. In fact, the precision of two methods in [17], “FFT based method” and the proposed method is almost the same. This phenomenon indicates some equivalence of these two methods. As a matter of fact, these two methods can be categorized as Algorithms 2 and 3 respectively.
Figure 2 is computed by using the case 1 of Algorithm 3. The wavelet coefficients of Figure 2b can exactly characterize the time-frequency local properties of data of Figure 1a. At the same time, Figure 2a,c fail to do so. In fact, it is known from the case 1 of Algorithm 3, the wavelet coefficients should be chosen as the middle part of the coefficients of the convolution. However, the wavelet coefficients of Figure 2a,c are respectively chosen as the first N and the last N part of the coefficients of the convolution.
Experiments for Data 2: Data 2 is the annual average temperature from 1 January 1951 to 31 December 2010 for No. 50978 weather station, Heilongjiang, China. Figure 3, Figure 4 and Figure 5, computed with different methods of CWT, namely, Algorithm 2, Zhao’s method, c w t function in wavelet toolbox of Matlab, are the contours of the real part of coefficients of CWT for Data 2. The Morlet wavelet parameters are σ 2 = 1 , η = 5 . The coefficients with negative values are plotted with a dotted, blue line, while the coefficients with positive values are plotted with a dashed, red line. It is obvious from these figures that the precision of Algorithm 2 is superior to that of Zhao’s method and c w t function of Matlab.
It is seen from Table 2 that the wavelet entropy for Algorithm 2 is the smallest of all the methods. Therefore, Algorithm 2 is the most suitable method for this temperature data.
Figure 6 and Figure 7 are calculated with different data preparation methods. To be specific, Figure 6 is computed with the frequency-domain method of CWT with data preparation method given in previously published papers, namely, M = 2 q , q = min n Z { 2 n > N } while Figure 7 is computed with the case 0 of Algorithm 3 with M = N + 2 a T . Note the different structures of contours in the upper edge of these two figures. The contour is not closed in the upper edge of Figure 6, which means that there will be a valley and a peak in the left and right part of this edge. So the edge effect is obvious in Figure 6.

5. Conclusions

The continuous wavelet transform of a signal with finite length for a fixed scale is considered as a linear time-invariant operator. Furthermore, the filter with causal and stability is constructed. The algorithm of linear convolution constitutes a unifying framework to the continuous wavelet transform methods previously published in [17]. The precision of these methods based on this framework is almost the same, no matter what method is used, and higher than other methods that use the approximation of wavelet, for example, the c w t function in wavelet toolbox of Matlab. The edge effect is also easily handled by using Equivalent Condition of Time-domain and Frequency-domain Algorithms of CWT.
The algorithms of CWT consist of two methods, time-domain method and frequency-domain method. For time-domain method, by constructing the causal filter ψ ˜ a ( t ) , we know the wavelet coefficients are just the middle part of the corresponding linear convolution. For frequency-domain method, by exploring the relationship of ψ ˜ a ( t ) and ψ ˜ ˜ a ( t ) , we know the wavelet coefficients are just the first N coefficients of the corresponding convolution. Furthermore, by constructing the different filters, the wavelet coefficients can be the first N coefficients, or the middle N coefficients, or the last N coefficients of the corresponding convolution for frequency-domain method.
There are three methods for the calculation of linear convolution. The first one is to directly implement the definition of linear convolution. The second one is known as the FFT-based method, for example, Algorithm 1. Lastly, if the length of the signal is far larger than the length of the filter, an overlap-add procedure for the calculation of linear convolution is faster than the previous two methods [23]. How to combine the Frequency-domain method and an overlap-add procedure for the computation of CWT is a question for future research.

Acknowledgments

The work is supported by the Natural Science Foundation of Jiangxi Province, China (Grant No. 20161BAB201017), the Technology Plan Project of Jiangxi Provincial Education Department (No. GJJ160758), and the Doctoral research startup project of Jinggangshan University(No. JZB11002).

Author Contributions

Hua Yi, Shi-You Xin and Jun-Feng Yin conceived and designed the experiments; Jun-Feng Yin wrote the introduction part of this paper; Shi-You Xin wrote the experimental part; Hua Yi wrote the rest parts of this paper.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Huang, N.E.; Shen, Z.; Long, S.R.; Wu, M.C.; Shih, H.H.; Zheng, Q.; Yen, N.C.; Chi, C.T.; Liu, H.H. The empirical mode decomposition and the Hilbert spectrum for nonlinear and non-stationary time series analysis. Proc. Math. Phys. Eng. Sci. 1998, 454, 903–995. [Google Scholar] [CrossRef]
  2. Daubechies, I.; Heil, C. Ten Lectures on Wavelets. Comput. Phys. 1992, 6, 1671. [Google Scholar] [CrossRef]
  3. Gilles, J. Empirical Wavelet Transform. IEEE Trans. Signal Process. 2013, 61, 3999–4010. [Google Scholar] [CrossRef]
  4. Amezquita-Sanchez, J.P.; Adeli, H. A new music-empirical wavelet transform methodology for time frequency analysis of noisy nonlinear and non-stationary signals. Digit. Signal Process. 2015, 45, 55–68. [Google Scholar] [CrossRef]
  5. Daubechies, I.; Lu, J.; Wu, H.T. Synchrosqueezed wavelet transforms: An empirical mode decomposition-like tool. Appl. Comput. Harmon. Anal. 2011, 30, 243–261. [Google Scholar] [CrossRef]
  6. Garcia-Perez, A.; Amezquita-Sanche, J.P.; Dominguez-Gonzale, A.; Sedaghat, R.; Osornio-Rio, R.; Romero-Troncos, R.J. Fused empirical mode decomposition and wavelets for locating combined damage in a truss-type structure through vibration analysis. J. Zhejiang Univ. Sci. A 2013, 14, 615–630. [Google Scholar] [CrossRef]
  7. Boashash, B.; Khan, N.A.; Ben-Jabeur, T. Time frequency features for pattern recognition using high-resolution TFDs: A tutorial review. Digit. Signal Process. 2015, 40, 1–30. [Google Scholar]
  8. Glowacz, A. DC Motor Fault Analysis with the Use of Acoustic Signals, Coiflet Wavelet Transform, and K-Nearest Neighbor Classifier. Arch. Acoust. 2015, 40, 321–327. [Google Scholar] [CrossRef]
  9. Chen, J.; Rostami, J.; Tse, P.W.; Wan, X. The Design of a Novel Mother Wavelet that is Tailor-made for Continuous Wavelet Transform in Extracting Defect-Related Features from Reflected Guided Wave Signals. Measurement 2017, 110, 176–191. [Google Scholar] [CrossRef]
  10. Chamanzar, A.; Shabany, M.; Malekmohammadi, A.; Mohammadinejad, S. Efficient Hardware Implementation of Real-Time Low-Power Movement Intention Detector System Using FFT and Adaptive Wavelet Transform. IEEE Trans. Biomed. Circuits Syst. 2017, 11, 585–596. [Google Scholar] [CrossRef] [PubMed]
  11. Lee, W.K.; Ratnam, M.M.; Ahmad, Z.A. Detection of chipping in ceramic cutting inserts from workpiece profile during turning using fast Fourier transform (FFT) and continuous wavelet transform (CWT). Precis. Eng. 2017, 47, 406–423. [Google Scholar] [CrossRef]
  12. Ni, S.H.; Li, J.L.; Yang, Y.Z.; Yang, Z.T. An improved approach to evaluating pile length using complex continuous wavelet transform analysis. Insight Non-Destr. Test. Cond. Monit. 2017, 59, 318–324. [Google Scholar] [CrossRef]
  13. Rafiei, M.H.; Adeli, H. A novel unsupervised deep learning model for global and local health condition assessment of structures. Eng. Struct. 2018, 156, 598–607. [Google Scholar] [CrossRef]
  14. Perez-Ramirez, C.A.; Amezquita-Sanchez, J.P.; Adeli, H.; Valtierra-Rodriguez, M.; Camarena-Martinez, D.; Romero-Troncoso, R.J. New methodology for modal parameters identification of smart civil structures using ambient vibrations and synchrosqueezed wavelet transform. Eng. Appl. Artif. Intell. 2016, 48, 1–12. [Google Scholar] [CrossRef]
  15. Leigh, G.M. Fast FIR Algorithms for the Continuous Wavelet Transform From Constrained Least Squares. IEEE Trans. Signal Process. 2012, 61, 28–37. [Google Scholar] [CrossRef]
  16. Unser, M. Fast Gabor-like windowed Fourier and continuous wavelet transforms. IEEE Signal Process. Lett. 1994, 1, 76–79. [Google Scholar] [CrossRef]
  17. Yi, H.; Chen, Z.; Cao, Y. High Precision Computation of Morlet Wavelet Transform for Multi-period Analysis of Climate Data. J. Inf. Comput. Sci. 2014, 11, 6369–6385. [Google Scholar] [CrossRef]
  18. Torrence, C.; Compo, G.P. A Practical Guide to Wavelet Analysis. Bull. Am. Meteorol. Soc. 1998, 79, 61–78. [Google Scholar] [CrossRef]
  19. Burrus, C.; Parks, T.W. DFT/FFT and Convolution Algorithms: Theory and Implementation; John Wiley & Sons Inc.: New York, NY, USA, 1991. [Google Scholar]
  20. Jin, X.Q. Preconditioning Techniques for Toeplitz Systems; Higher Education Press: Beijing, China, 2010. [Google Scholar]
  21. Nagy, J.G.; Plemmons, R.J.; Torgersen, T.C. Iterative image restoration using approximate inverse preconditioning. IEEE Trans. Image Process. 1996, 5, 1151–1162. [Google Scholar] [CrossRef] [PubMed]
  22. Proakis, J.G.; Manolakis, D.G. Digital Signal Processing: Principles, Algorithms, And Applications; Pearson Education: Delhi, India, 2007; Volume 23, pp. 392–394. [Google Scholar]
  23. Mallat, S.G. A Wavelet Tour of Signal Processing: The Sparse Way; Academic Press: New York, NY, USA, 2009. [Google Scholar]
  24. Yi, H.; Shu, H. The improvement of the Morlet wavelet for multi-period analysis of climate data. Comptes Rendus Geosci. 2012, 344, 483–497. [Google Scholar] [CrossRef]
  25. Jones, D.L.; Baraniuk, R.G. Efficient approximation of continuous wavelet transforms. Electron. Lett. 1991, 27, 748–750. [Google Scholar] [CrossRef]
  26. Zhao, Y.Y.; Yuan, X.; Wei, Y.H. Realization of Continuous Wavelet Transform of Sequences by MATLAB. J. Sichuan Univ. 2006, 43, 325–329. [Google Scholar]
Figure 1. (a) is Data 1 with N = 1024 . (b) the absolute values of CWT coefficients of (a), computed with the a w t function in Wavelab, where the shape parameter σ 2 = 1 and the center frequency η = 8 , manifests edge effects. (c) without edge effects is computed with Algorithm 3.
Figure 1. (a) is Data 1 with N = 1024 . (b) the absolute values of CWT coefficients of (a), computed with the a w t function in Wavelab, where the shape parameter σ 2 = 1 and the center frequency η = 8 , manifests edge effects. (c) without edge effects is computed with Algorithm 3.
Algorithms 11 00024 g001
Figure 2. Figure 2 is computed by using the case 1 of Algorithm 3. The wavelet coefficients of (b) can exactly characterize the time-frequency local properties of data of (a). At the same time, (a,c) fail to do so.
Figure 2. Figure 2 is computed by using the case 1 of Algorithm 3. The wavelet coefficients of (b) can exactly characterize the time-frequency local properties of data of (a). At the same time, (a,c) fail to do so.
Algorithms 11 00024 g002
Figure 3. This contour is computed by using Algorithm 2 with the Morlet wavelet parameter σ 2 = 1 , η = 5 for Data 2.
Figure 3. This contour is computed by using Algorithm 2 with the Morlet wavelet parameter σ 2 = 1 , η = 5 for Data 2.
Algorithms 11 00024 g003
Figure 4. This contour is computed by using Zhao’s method with the Morlet wavelet parameter σ 2 = 1 , η = 5 for Data 2.
Figure 4. This contour is computed by using Zhao’s method with the Morlet wavelet parameter σ 2 = 1 , η = 5 for Data 2.
Algorithms 11 00024 g004
Figure 5. This contour is computed by using C W T function in wavelet toolbox of Matlab with the Morlet wavelet parameter σ 2 = 1 , η = 5 for Data 2.
Figure 5. This contour is computed by using C W T function in wavelet toolbox of Matlab with the Morlet wavelet parameter σ 2 = 1 , η = 5 for Data 2.
Algorithms 11 00024 g005
Figure 6. This contour, computed with frequency-domain method of CWT with data preparation method given in previously published papers, namely, M = 2 q , q = min n Z { 2 n > N } , manifests edge effect.
Figure 6. This contour, computed with frequency-domain method of CWT with data preparation method given in previously published papers, namely, M = 2 q , q = min n Z { 2 n > N } , manifests edge effect.
Algorithms 11 00024 g006
Figure 7. This contour, computed with the case 0 of Algorithm 3 with M = N + 2 a T , manifests no edge effect.
Figure 7. This contour, computed with the case 0 of Algorithm 3 with M = N + 2 a T , manifests no edge effect.
Algorithms 11 00024 g007
Table 1. Comparisons between the different CWT methods for Data 1.
Table 1. Comparisons between the different CWT methods for Data 1.
AlgorithmNCPUEntropy Err 1 Err 2 Err 3 Err 4
cwt10240.24688.7125 3.3605 × 10 2 3.5635 × 10 2 1.4622 × 10 2 4.0837 × 10 2
20480.25609.3815 3.3605 × 10 2 3.5635 × 10 2 1.4622 × 10 2 4.0837 × 10 2
Zhao’s10240.04958.7068 1.0144 × 10 2 3.6888 × 10 3 1.6761 × 10 2 2.8041 × 10 2
20480.05629.3762 1.0144 × 10 2 3.6888 × 10 3 1.6755 × 10 2 2.8041 × 10 2
Direct10240.47248.7097 2.0333 × 10 4 1.8504 × 10 15 1.9882 × 10 4 4.9072 × 10 14
20480.86979.3784 2.0333 × 10 4 7.0314 × 10 15 1.9767 × 10 4 9.6064 × 10 11
Overlap-Add10240.02918.7083 2.0333 × 10 4 1.8504 × 10 15 1.9882 × 10 4 4.8517 × 10 14
20480.03599.3777 2.0333 × 10 4 6.4763 × 10 15 1.9767 × 10 4 9.6065 × 10 11
Algorithm 210240.02048.7083 2.0333 × 10 4 1.8504 × 10 15 1.9882 × 10 4 4.8517 × 10 14
20480.02919.3777 2.0333 × 10 4 6.4763 × 10 15 1.9767 × 10 4 9.6065 × 10 11
Algorithm 310240.01558.7083 2.0333 × 10 4 2.4055 × 10 15 1.9882 × 10 4 4.7851 × 10 14
20480.02239.3777 2.0333 × 10 4 7.0314 × 10 15 1.9767 × 10 4 9.6065 × 10 11
Table 2. The wavelet entropy corresponding to different wavelet transform methods.
Table 2. The wavelet entropy corresponding to different wavelet transform methods.
σ 2 η CWTZhao’s MethodAlgorithm 2Algorithm 3
159.51909.41509.41449.4534
169.50519.40449.40429.4332
179.48699.38979.38939.4117
189.46779.37139.37099.3892
1.559.50129.40309.40269.4304
1.569.47979.38329.38319.4037
1.579.45459.36019.35989.3762
1.589.43239.33779.33749.3513

Share and Cite

MDPI and ACS Style

Yi, H.; Xin, S.-Y.; Yin, J.-F. A Class of Algorithms for Continuous Wavelet Transform Based on the Circulant Matrix. Algorithms 2018, 11, 24. https://doi.org/10.3390/a11030024

AMA Style

Yi H, Xin S-Y, Yin J-F. A Class of Algorithms for Continuous Wavelet Transform Based on the Circulant Matrix. Algorithms. 2018; 11(3):24. https://doi.org/10.3390/a11030024

Chicago/Turabian Style

Yi, Hua, Shi-You Xin, and Jun-Feng Yin. 2018. "A Class of Algorithms for Continuous Wavelet Transform Based on the Circulant Matrix" Algorithms 11, no. 3: 24. https://doi.org/10.3390/a11030024

APA Style

Yi, H., Xin, S. -Y., & Yin, J. -F. (2018). A Class of Algorithms for Continuous Wavelet Transform Based on the Circulant Matrix. Algorithms, 11(3), 24. https://doi.org/10.3390/a11030024

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop