# A Scalogram-Based CNN Approach for Audio Classification in Construction Sites
## 3 The Continuous Wavelet Transform (CWT) and the Scalogram  
In order to overcome the trade-off between the time and frequency resolution in STFT, the Continuous Wavelet Transform (CWT) was introduced [23]. The CWT acts as a \"mathematical\" microscope in the sense that different parts of the signal may be examined by adjusting the focus. Given a stationary signal \(x(t)\), the CWT is defined as the product of \(x(t)\) with the following basis function family:  
\[\Psi_{\tau,a}(t)=|a|^{-1/2}\,\Psi\!\left(\frac{t-\tau}{a}\right)\!, \tag{1}\]  
where \(a\
eq 0\) is a scaling factor (also known as dilation parameter) and \(\tau\) is the time delay, i.e., \(\Psi_{\tau,a}(t)\) is a scaled and translated version of the mother wavelet function \(\Psi(t)\). Hence, the CWT of signal \(x(t)\) is formulated as:\[W_{x}(\tau,a)=|a|^{-1/2}\int_{-\infty}^{\infty}x(t)\Psi^{*}\bigg{(}\frac{t-\tau}{a} \bigg{)}dt, \tag{2}\]  
where \({}^{*}\) represents the complex conjugation operator. The delay parameter \(\tau\) provides the time position of the wavelet \(\Psi_{\tau,a}(t)\), while the scaling factor \(a\) rules its frequency content. For \(|a|<<1\), the wavelet \(\Psi_{\tau,a}(t)\) is a very concentrated and narrow version of the mother wavelet \(\Psi(t)\), with a frequency content mainly condensed at high frequencies. On the other hand, for \(|a|>>1\), the wavelet \(\Psi_{\tau,a}(t)\) is much more broadened and concentrated towards low frequencies. In the wavelet analysis, the similarity between the signal \(x(t)\) and the wavelet \(\Psi_{\tau,a}(t)\) is measured as \(\tau\) and \(a\) vary. Dilation by a factor \(1/a\) results in different enlargements of the signal with distinct resolutions. Specifically, the properties of the time-frequency resolution of the CWT are summarized as follows:  
1. The temporal resolution \(\Delta\tau\) varies inversely to the carrier frequency \(\omega_{0}\) of the wavelet \(\Psi_{\tau,a}(t)\); therefore, it can be made arbitrarily small at high frequencies. 2. The frequency resolution \(\Delta\omega\) varies linearly with the carrier frequency \(\omega_{0}\) of the wavelet \(\Psi_{\tau,a}(t)\); therefore, it can be made arbitrarily small at low frequencies. Hence, the CWT is well suited for the analysis of non-stationary signals containing high-frequency transients superimposed on long-lasting low-frequency components [23]. The CWT implements the signal analysis at various time scales. For this reason, the squared absolute value of the CWT is called a scalogram, and it is defined as:  
\[\mathcal{S}(\tau,a)\triangleq|W_{x}(\tau,a)|^{2}=\frac{1}{a}\bigg{|}\int_{- \infty}^{\infty}x(t)\Psi^{*}\bigg{(}\frac{t-\tau}{a}\bigg{)}dt\bigg{|}^{2}. \tag{3}\]  
The scalogram \(\mathcal{S}(\tau,a)\) provides a bi-dimensional graphical representation of the signal energy at the specific scale parameter \(a\) and time location \(\tau\). In general, the mother wavelet \(\Psi(t)\) can be any band-pass function [23]. The Haar wavelet is the simplest example of a wavelet, while the Daubechies one is a more sophisticated example. Both of these wavelets have a finite (and compact) support in time. The Daubechies wavelet has a longer length than the Haar wavelet and is therefore less localized than the latter. However, the Daubechies wavelet is continuous and has a better frequency resolution than the Haar one [23]. Other famous wavelet families are the Mexican Hat wavelet (which is proportional to the second derivative function of the Gaussian probability density function), the Bump wavelet, the generalized Morse wavelet, and the Morlet one, also known as the Gabor wavelet. This last wavelet is composed of a complex exponential multiplied by a Gaussian window, and it is very suitable for audio and vision applications since it is closely related to human perception. For this purpose, we remark that it is strongly related to the short-time analysis performed by the peripheral auditory system and to the mechanical spectral analysis performed by the basilar membrane in the human ear [48].