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

^{1}

^{2}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Primary Definitions and Theorems

**Definition**

**1.**

**Circulant matrix**: An $N\times N$ circulant matrix $\mathbf{C}$ takes the form [20,21]

**Definition**

**2.**

**Discrete Fourier transform(DFT):**The sequence of N complex numbers ${[{x}_{0},{x}_{1},\cdots ,{x}_{N-1}]}^{\mathrm{T}}$ is transformed into an N-periodic sequence of complex numbers [22]

**Theorem**

**1.**

**Proof.**

**Definition**

**3.**

**Linear convolution [23]**: A time-invariant linear operator L can be represented as a linear convolution. To be specific, we denote by $\delta \left[n\right]$ the discrete Dirac

**Definition**

**4.**

**Causality and Stability [23]**: A discrete filter L is causal if $Lf\left[p\right]$ depends only on the values of $f\left[n\right]$ for $n\le p$. The convolution formula (14) implies that $h\left[n\right]=0$ if $n<0$.

**Proposition**

**1.**

**Proof.**

**Definition**

**5.**

**Circular convolution [19]**: The circular convolution of a signal ${\left\{x\left[k\right]\right\}}_{k=0}^{N-1}$ with a signal ${\left\{c\left[k\right]\right\}}_{k=0}^{N-1}$ is defined as a matrix vector multiplication as follows.

**Proposition**

**2.**

**Proof.**

**Theorem**

**2.**

**Proof.**

Algorithm 1: FFT-based fast method for linear convolution. |

Input:the signal, $f\left[k\right],k=0,1,\cdots ,n-\beta -1$ the signal, $h\left[k\right],k=0,1,\cdots ,\beta $ Output:the linear convolution of f and h, $g\left[k\right],k=0,1,\cdots ,n-1$ 1. Set $n=length\left(f\right)+length\left(h\right)-1;$ 2. Appending an array of zeros to the end of h to obtain $\tilde{h}$ so that the length of $\tilde{h}$ is n. 3. Appending an array of zeros to the end of f to obtain $\tilde{f}$ so that the length of $\tilde{f}$ is n 4. $g=ifft(fft(\tilde{h}).\ast fft(\tilde{f}))$ |

**Definition**

**6.**

**Equivalent Condition of Linear Convolution and Circular Convolution:**Let $f,h,\tilde{f},\tilde{h}$ be defined in Theorem 2. The condition $length(\tilde{h})=length(\tilde{f})=length(f)+length(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\left(t\right)$ at a scale $a\in {R}^{+}$ and translational value $b\in R$ is expressed by the following integral [17]

**Theorem**

**3.**

**Proof.**

Algorithm 2: Time-domain fast algorithm for CWT. |

Input: the signal, $f\left[n\right],n=0,1,\cdots ,N-1$ mother wavelet, $\psi \left(t\right)$ scale, a T, where $[-T,T]$ is the support of $\psi \left(t\right)$. Output:wavelet coefficients, ${W}_{f}^{a}\left[i\right],i=0,1,\cdots ,N-1$1. Let $\tilde{f}={[{f}_{0},{f}_{1},\cdots ,{f}_{N-1},\stackrel{2aT}{\underbrace{0,\cdots ,0}}]}^{\mathrm{T}};$ 2. Let ${\tilde{\psi}}_{a}(t)=\frac{1}{a}\overline{\psi}(\frac{aT-t}{a})$, where the overline represents the operation of complex conjugate; 3. Let ${h}_{a}[n]={\tilde{\psi}}_{a}(n),n=0,1,\cdots ,2aT$; 4. Let ${\tilde{h}}_{a}={[{h}_{a}[0],{h}_{a}[1],\cdots ,{h}_{a}[2aT],\stackrel{N-1}{\underbrace{0,\cdots ,0}}]}^{\mathrm{T}};$ 5. $te{m}_{a}[i]=ifft(fft(\tilde{f}).\ast fft({\tilde{h}}_{a})),i=0,1,\cdots ,2aT+N-1$; 6. ${W}_{f}^{a}[i]=te{m}_{a}[aT+i],i=0,1,\cdots ,N-1$. |

#### 3.2. Frequency-Domain Algorithm for CWT

**Definition**

**8.**

**Equivalent Condition of Time-domain and Frequency-domain Algorithms of CWT:**$M=2aT+N$ in Equation (29) is called Equivalent Condition of Time-domain and Frequency-domain Algorithms of CWT.

**Remark**

**1.**

**Lemma**

**1.**

**Proof.**

**Theorem**

**4.**

**Proof.**

**Theorem**

**5.**

**Proof.**

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,\cdots ,N-1$ scale, a $\widehat{\psi}(\omega )$, the Fourier transform of the Morlet wavelet $\psi (t)$ T, where $[-T,T]$ is the support of $\psi (t)$. Output:wavelet coefficients, ${W}_{f}^{a}[i],i=0,1,\cdots ,N-1$ 1. Let $\tilde{f}={[{f}_{0},{f}_{1},\cdots ,{f}_{N-1},\stackrel{2aT}{\underbrace{0,\cdots ,0}}]}^{\mathrm{T}};$ 2. Define ${\phi}_{m}(\omega )={e}^{-imaT\omega}\overline{\widehat{\psi}}(a\omega ),m=0,1,2$, where the overline represents the operation of complex conjugate; 3. Let $M=2aT+N$; 4. If M is even, Let ${\widehat{\tilde{h}}}_{a}={[{\phi}_{m}(\frac{2\pi}{M}\xb70),{\phi}_{m}(\frac{2\pi}{M}\xb71),\cdots ,{\phi}_{m}(\frac{2\pi}{M}\xb7\frac{M}{2}),\stackrel{\frac{M}{2}-1}{\underbrace{0,\cdots ,0}}]}^{\mathrm{T}};$ 5. else ${\widehat{\tilde{h}}}_{a}={[{\phi}_{m}(\frac{2\pi}{M}\xb70),{\phi}_{m}(\frac{2\pi}{M}\xb71),\cdots ,{\phi}_{m}(\frac{2\pi}{M}\xb7\frac{M-1}{2}),\stackrel{\frac{M-1}{2}}{\underbrace{0,\cdots ,0}}]}^{\mathrm{T}};$ 6. end if 7. $te{m}_{a}[i]=ifft(fft(\tilde{f}).\ast ({\widehat{\tilde{h}}}_{a})),i=0,1,\cdots ,2aT+N-1$; 8. switch(m) case 0 ${W}_{f}^{a}[i]=te{m}_{a}[i],\phantom{\rule{2.em}{0ex}}i=0,1,\cdots ,N-1$; case 1 ${W}_{f}^{a}[i]=te{m}_{a}[i+aT],\phantom{\rule{2.em}{0ex}}i=0,1,\cdots ,N-1$; case 2 ${W}_{f}^{a}[i]=te{m}_{a}[i+2aT],\phantom{\rule{2.em}{0ex}}i=0,1,\cdots ,N-1$. |

**Remark**

**2.**

## 4. Numerical Experiments

**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\left(30\pi t\right)+{a}_{3}sin\left(60\pi t\right)+{a}_{1}sin\left(120\pi t\right)$; The latter half contains the 60 Hz sinusoidal signal with amplitude ${a}_{2}$, namely ${a}_{2}sin\left(120\pi t\right)$, 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 $awt$ function in Wavelab, where the shape parameter ${\sigma}^{2}=1$ and the center frequency $\eta =8$, manifests edge effects. Figure 1c without edge effects is computed by using the case 0 of Algorithm 3.

**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, $cwt$ 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 ${\sigma}^{2}=1,\eta =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 $cwt$ function of Matlab.

## 5. Conclusions

## Acknowledgments

## Author Contributions

## Conflicts of Interest

## References

- 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] - Daubechies, I.; Heil, C. Ten Lectures on Wavelets. Comput. Phys.
**1992**, 6, 1671. [Google Scholar] [CrossRef] - Gilles, J. Empirical Wavelet Transform. IEEE Trans. Signal Process.
**2013**, 61, 3999–4010. [Google Scholar] [CrossRef] - 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] - 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] - 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] - 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] - 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] - 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] - 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] - 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] - 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] - 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] - 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] - 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] - Unser, M. Fast Gabor-like windowed Fourier and continuous wavelet transforms. IEEE Signal Process. Lett.
**1994**, 1, 76–79. [Google Scholar] [CrossRef] - 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] - Torrence, C.; Compo, G.P. A Practical Guide to Wavelet Analysis. Bull. Am. Meteorol. Soc.
**1998**, 79, 61–78. [Google Scholar] [CrossRef] - Burrus, C.; Parks, T.W. DFT/FFT and Convolution Algorithms: Theory and Implementation; John Wiley & Sons Inc.: New York, NY, USA, 1991. [Google Scholar]
- Jin, X.Q. Preconditioning Techniques for Toeplitz Systems; Higher Education Press: Beijing, China, 2010. [Google Scholar]
- 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] - 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]
- Mallat, S.G. A Wavelet Tour of Signal Processing: The Sparse Way; Academic Press: New York, NY, USA, 2009. [Google Scholar]
- 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] - Jones, D.L.; Baraniuk, R.G. Efficient approximation of continuous wavelet transforms. Electron. Lett.
**1991**, 27, 748–750. [Google Scholar] [CrossRef] - 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 $awt$ function in Wavelab, where the shape parameter ${\sigma}^{2}=1$ and the center frequency $\eta =8$, manifests edge effects. (

**c**) without edge effects is computed with Algorithm 3.

**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 3.**This contour is computed by using Algorithm 2 with the Morlet wavelet parameter ${\sigma}^{2}=1,\eta =5$ for Data 2.

**Figure 4.**This contour is computed by using Zhao’s method with the Morlet wavelet parameter ${\sigma}^{2}=1,\phantom{\rule{3.33333pt}{0ex}}\eta =5$ for Data 2.

**Figure 5.**This contour is computed by using $CWT$ function in wavelet toolbox of Matlab with the Morlet wavelet parameter ${\sigma}^{2}=1,\eta =5$ for Data 2.

**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\in Z}\{{2}^{n}>N\}$, manifests edge effect.

**Figure 7.**This contour, computed with the case 0 of Algorithm 3 with $M=N+2aT$, manifests no edge effect.

Algorithm | N | CPU | Entropy | ${\mathit{Err}}_{1}$ | ${\mathit{Err}}_{2}$ | ${\mathit{Err}}_{3}$ | ${\mathit{Err}}_{4}$ |
---|---|---|---|---|---|---|---|

cwt | 1024 | 0.2468 | 8.7125 | $3.3605\times {10}^{-2}$ | $3.5635\times {10}^{-2}$ | −$1.4622\times {10}^{-2}$ | −$4.0837\times {10}^{-2}$ |

2048 | 0.2560 | 9.3815 | $3.3605\times {10}^{-2}$ | $3.5635\times {10}^{-2}$ | −$1.4622\times {10}^{-2}$ | −$4.0837\times {10}^{-2}$ | |

Zhao’s | 1024 | 0.0495 | 8.7068 | −$1.0144\times {10}^{-2}$ | $3.6888\times {10}^{-3}$ | −$1.6761\times {10}^{-2}$ | −$2.8041\times {10}^{-2}$ |

2048 | 0.0562 | 9.3762 | −$1.0144\times {10}^{-2}$ | $3.6888\times {10}^{-3}$ | −$1.6755\times {10}^{-2}$ | −$2.8041\times {10}^{-2}$ | |

Direct | 1024 | 0.4724 | 8.7097 | −$2.0333\times {10}^{-4}$ | −$1.8504\times {10}^{-15}$ | −$1.9882\times {10}^{-4}$ | $4.9072\times {10}^{-14}$ |

2048 | 0.8697 | 9.3784 | −$2.0333\times {10}^{-4}$ | −$7.0314\times {10}^{-15}$ | −$1.9767\times {10}^{-4}$ | −$9.6064\times {10}^{-11}$ | |

Overlap-Add | 1024 | 0.0291 | 8.7083 | −$2.0333\times {10}^{-4}$ | −$1.8504\times {10}^{-15}$ | −$1.9882\times {10}^{-4}$ | $4.8517\times {10}^{-14}$ |

2048 | 0.0359 | 9.3777 | −$2.0333\times {10}^{-4}$ | −$6.4763\times {10}^{-15}$ | −$1.9767\times {10}^{-4}$ | −$9.6065\times {10}^{-11}$ | |

Algorithm 2 | 1024 | 0.0204 | 8.7083 | −$2.0333\times {10}^{-4}$ | −$1.8504\times {10}^{-15}$ | −$1.9882\times {10}^{-4}$ | $4.8517\times {10}^{-14}$ |

2048 | 0.0291 | 9.3777 | −$2.0333\times {10}^{-4}$ | −$6.4763\times {10}^{-15}$ | −$1.9767\times {10}^{-4}$ | −$9.6065\times {10}^{-11}$ | |

Algorithm 3 | 1024 | 0.0155 | 8.7083 | −$2.0333\times {10}^{-4}$ | −$2.4055\times {10}^{-15}$ | −$1.9882\times {10}^{-4}$ | $4.7851\times {10}^{-14}$ |

2048 | 0.0223 | 9.3777 | −$2.0333\times {10}^{-4}$ | −$7.0314\times {10}^{-15}$ | −$1.9767\times {10}^{-4}$ | −$9.6065\times {10}^{-11}$ |

${\mathit{\sigma}}_{2}$ | $\mathit{\eta}$ | CWT | Zhao’s Method | Algorithm 2 | Algorithm 3 |
---|---|---|---|---|---|

1 | 5 | 9.5190 | 9.4150 | 9.4144 | 9.4534 |

1 | 6 | 9.5051 | 9.4044 | 9.4042 | 9.4332 |

1 | 7 | 9.4869 | 9.3897 | 9.3893 | 9.4117 |

1 | 8 | 9.4677 | 9.3713 | 9.3709 | 9.3892 |

1.5 | 5 | 9.5012 | 9.4030 | 9.4026 | 9.4304 |

1.5 | 6 | 9.4797 | 9.3832 | 9.3831 | 9.4037 |

1.5 | 7 | 9.4545 | 9.3601 | 9.3598 | 9.3762 |

1.5 | 8 | 9.4323 | 9.3377 | 9.3374 | 9.3513 |

© 2018 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## 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