# A Class of Algorithms for Continuous Wavelet Transform Based on the Circulant Matrix
## 3 A Class of Algorithms for Continuous Wavelet Transform  
### Time-Domain Algorithm for CWT  
Definition 7: Continuous wavelet transform: The continuous wavelet transform of a function \(f(t)\) at a scale \(a\in R^{+}\) and translational value \(b\in R\) is expressed by the following integral [17]  
\[W_{f}(a,b):\stackrel{{\mathrm{def}}}{{=}}\int_{-\infty}^{+\infty} f(t)\frac{1}{a}\tilde{\psi}(\frac{t-b}{a})\mathrm{d}t \tag{21}\]  
where \(\psi(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 \(\psi(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]=\sum_{k=-\infty}^{+\infty}f(k)\frac{1}{a}\tilde{\psi}(\frac{k-m}{a }),\ \ \text{where}\ \ \ m\in\mathbb{Z}. \tag{22}\]  
Assume the sampled signal is \(\{f[i]\}_{i=0}^{N-1}\) and the support of the mother wavelet \(\psi(t)\) is \([-T,T]\). If define  
\[\tilde{\psi}_{a}(t):\stackrel{{\text{def}}}{{=}}\frac{1}{a} \tilde{\psi}(\frac{aT-t}{a}) \tag{23}\]  
then the support of \(\tilde{\psi}_{a}(t)\) is \([0,2 aT]\). Now, we can get the following result.  
Theorem 3.2: _Assume the length of \(f(t)\) is finite and the support of \(\psi(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] = \sum_{k=0}^{N-1}f(k)\tilde{\psi}_{a}(m\,+\,aT\,-\,k)\ \ =\ \ f\star\tilde{\psi}_{a}[m\,+\,aT],\text{where}\ \ \ m\ \ =\ \ 0,1,\cdots,N-1, \tag{24}\]  
_where we assume aT 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]=\tilde{\psi}_{a}(i),i\in\mathbb{Z} \tag{25}\]  
then the discrete filter \(\{h_{a}[i]\}_{i\in\mathbb{Z}}\) is causal and stable since \(h_{a}[i]=\tilde{\psi}_{a}(i)=0\) if \(i<0\) and \(h_{a}\in l^{2}(\mathbb{Z})\). Furthermore, Equation (24) can be written as  
\[W_{f}^{a}[m]=f\star h_{a}[m+aT],\ \ \text{where}\ \ \ m=0,1,\cdots,N-1. \tag{26}\]  
In brief, \(\{W_{f}^{a}[i]\}_{i=0}^{N-1}\) are just the \(\{f\star h_{a}[i]\}_{i=aT}^{aT+N-1}\) while \(\{f\star h_{a}[i]\}_{i=0}^{2 aT+N-1}\) can be implemented with linear convolution [17]. From Algorithm 1, we can get the algorithm of CWT (see Algorithm 2).  
```
Input: the signal, \(f[n],n=0,1,\cdots,N-1\) mother wavelet, \(\psi(t)\) scale, \(a\)\(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},\ldots,f_{N-1},\underbrace{0,2 aT}_{i=0}]^{\mathrm{T}}\);
2. Let \(\tilde{\psi}_{a}(t)=\frac{1}{a}\tilde{\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,2 aT\);
4. Let \(\tilde{h}_{a}=[h_{a}[0],h_{a}[1],\ldots,h_{a}[2 aT],\underbrace{0,N-1}_{i=0}]^{ \mathrm{T}}\);
5. \(tem_{a}[i]=ifft(fft(\tilde{f}).\astfft(\tilde{h}_{a})),i=0,1,\cdots,2 aT+N-1\);
6. \(W_{f}^{a}[i]=tem_{a}[aT+i],i=0,1,\cdots,N-1\).
```  
**Algorithm 2**Time-domain fast algorithm for CWT.