The Use of Continuous Wavelet Transform Based on the Fast Fourier Transform in the Analysis of Multi-channel Electrogastrography Recordings

This paper presents the analysis of multi-channel electrogastrographic (EGG) signals using the continuous wavelet transform based on the fast Fourier transform (CWTFT). The EGG analysis was based on the determination of the several signal parameters such as dominant frequency (DF), dominant power (DP) and index of normogastria (NI). The use of continuous wavelet transform (CWT) allows for better visible localization of the frequency components in the analyzed signals, than commonly used short-time Fourier transform (STFT). Such an analysis is possible by means of a variable width window, which corresponds to the scale time of observation (analysis). Wavelet analysis allows using long time windows when we need more precise low-frequency information, and shorter when we need high frequency information. Since the classic CWT transform requires considerable computing power and time, especially while applying it to the analysis of long signals, the authors used the CWT analysis based on the fast Fourier transform (FFT). The CWT was obtained using properties of the circular convolution to improve the speed of calculation. This method allows to obtain results for relatively long records of EGG in a fairly short time, much faster than using the classical methods based on running spectrum analysis (RSA). In this study authors indicate the possibility of a parametric analysis of EGG signals using continuous wavelet transform which is the completely new solution. The results obtained with the described method are shown in the example of an analysis of four-channel EGG recordings, performed for a non-caloric meal.


Introduction
Electrogastrography is a research method designed for noninvasive assessment of gastric slow wave propagation [1][2][3][4]. One or multichannel EGG signals are obtained from the disposable electrodes, appropriately arranged on the surface of the abdomen of the patient's stomach [5][6][7]. It is assumed that the frequency range of EGG signal is from 0.015 to 0.15 Hz and the amplitude of it is about 100-400 μV [6,8]. The typical EGG examination takes about 2 h and consists of three parts: the first one -preprandial, usually no longer than 30 min, it is a stage before a meal (person under investigation should be fasted). The second part takes about 5 to 15 min, including time when the person accepts a standardized meal, and the third part -postprandial, about 60-120 min, when the meal is digested. The standard of a meal depends on the examining center. Most frequently three types of meals are used: noncaloric meal e.g., 400 ml water, liquid meal e.g., 250 ml of yogurt and the caloric meal, e.g., pancake with jam prepared according to a well-defined recipe [9,10].
The initial analysis of EGG signals involves calculating dominant frequency and dominant power of slow waves [2,4,6,[11][12][13]. In the case of EGG examination the frequency is typically calculated in cycles per minute (cpm), as a medical standard [5]. According to the DF values, the EGG rhythm is classified to: bradygastria (0.5-2.0 cpm), normal rhythm (2.0-4.0 cpm) or tachygastria (4.0-9.0 cpm) [4,5]. Due to very high level of disturbances and interferences in EGG signals while receiving a meal, the DF values are calculated only for preprandial and postprandial parts. On the basis of the rhythm classification, the normogastria index is calculated [6]. This index is expressed as the amount of DF values in the range of normal rhythm to the total amount of the DF values [4,5].
The parameters DF and MP are usually calculated by means of the spectral analysis. The spectral analysis of EGG is done for short segments (1 to 5 min length) of the signals. The values of DF and MP are calculated for each segment. The length of the segments depends on the limitations of the used method and is a compromise between accuracy and resolution of calculated frequency and its time location in the analyzed signal. Segments of 3 to 5 min length are used to calculate spectrum of the EGG signal, using the short-time Fourier transform (STFT), and for the nonparametric methods (for example AR, ARMA modeling), the minimum length of the segment is about 60 s [4,6,11,12]. In the case of EGG signal analysis, the process of calculation the spectrum of consecutive or overlapped fragments is often referred as a running spectrum analysis (RSA) [8,14]. Figure 1 shows a 1-min segment of the signal before and after application of Tukey window (left), its power spectrum (middle) with marked both DF and MP values, and an example of RSA analysis of one channel EGG signal (right).
The EGG signals analysis based on CWT is widely presented in the literature [15][16][17][18][19]. In this study, the CWT algorithm based on FFT was applied to determine the dominant frequency of the slow wave in the EGG signal. In the literature, this algorithm is referred to as CWTFT [20][21][22]. An application of CWT allows to reduce limitations of classical methods of spectrum analysis (e.g., FFT, STFT) and facilitates to determine instantaneous frequencies and its location in the time domain [23][24][25]. The continuous wavelet transform is a powerful tool for analyzing nonstationary time series signals in the time-frequency domain and substantially differs from the STFT method that allows clear localization on the time axis of the frequency components, existing in the analyzed signals. Such an analysis is possible using of variable width window which corresponds to the scale   Fig. 4 Time-frequency analysis with CWTFT (non-analytic Morlet wavelet, ω 0 =6) for four-channels EGG signal of observation (analysis). Wavelet analysis allows using long time windows when we need more precise low frequency information, and shorter when we need high frequency information. It should be noted that the wavelet analysis does not include the area of time-frequency (as in the case of STFT), but the area: the time-scale. The time-scale area can be converted to the appropriate area of pseudo-frequency -time, where the pseudofrequency is the characteristic central frequency of the wavelet. Another important distinction from the STFT is that the CWT is not limited to sinusoidal analyzing function and do not requires, that the signal meets fairly strict criteria, which are required in the classical Fourier analysis [22].

Method
The CWT reflects the correlation between the analyzed continuous-time signal x(t) and a function referred to as wavelets and is defined by the following formula where: Cw(a, b) is the function of the parameters a and b. The a parameter is the dilation of wavelet (scale) and b defines a translation of the wavelet and indicates the time localization, ψ*(t) is the complex conjugate of the analyzing mother wavelet ψ(t) [22,26]. The coefficient 1 ffiffi a p is an energy normalized factor (the energy of the wavelet must be the same for different a value of the scale). Moreover, to be classified as a basic permissible wavelet, a wavelet function must satisfy the following mathematical criteria [27][28][29][30]: The wavelet must have finite energy The following condition must hold true is the Fourier transform of the ψ(t) function and ω=2πf is the circular frequency. This condition is defined as a condition of admissibility and can be interpreted as a requirement that |ψ(ω)| 2 decay endeavored (head) to zero faster than 1 ω . This condition means that the wavelet has no zero frequency component, that is Otherwise, the wavelet must have the zero mean value. In the literature the parameter C ψ is called the admissibility constant. The value of C ψ depends on the chosen wavelet [27][28][29].
In the case of complex wavelets, Fourier transform must have both a real component and a value of zero for negative frequencies [22].
As a result of CWT transform we obtain the twodimensional function E(a,b)=|Cw(a,b)| 2 called scalogram, which presents energy distribution of signals for used scales In practice, all functions that differ from |Cw(a,b)| 2 only by the constant multiplicative factor are also called scalograms [22]. The CWT can be considered as a transform that converts the signal from the time domain to the scale-time domain.
The scale as mentioned above can be converted to a frequency value (pseudo-frequency), the value of which depends on the center frequency of the applied wavelets and the scale value a where: f a is the frequency associated with the wavelet at the specific a scale, while f c is the characteristic frequency of mother wavelet at scale a=1, and time position b=0.
There is a very important distinction to be made here: BThe characteristic frequency f c of the wavelet used in the wavelet transform is representative of the whole frequency makeup of the wavelet. The wavelet does not contain a single frequency, and the signal is not decomposed according to numerous single (sinusoidal) frequencies; this is not Fourier analysis!^ [22]. It is known, if the wavelet transform coefficients are given, it is possible to reconstruct the original signal by the inverse wavelet transform described by the following equation [20] x where K ψ is a constant factor that depends on the applied wavelet function and the details function D(a,t) is given by the following equation In practical CWT applications usually discrete values of the a scale in the range of continuous values are used. As the result the wavelet coefficients are obtained (called wavelet series). The choice of appropriate wavelet function is crucial to obtain good results during signal analysis. The classic CWT transform is time consuming and it requires considerable computing power to apply it to the analysis of long signals.
In recent years, the new efficient algorithms have been developed for significant acceleration of CWT calculation. One of them uses well-known FFT algorithms to calculate the CWT [20,22,23].
If we define and the definition of CWT transform (1) can be rewritten in the following form which clearly indicates that the CWT can be treated as a convolution of the signal and wavelets. Consequently CWT can be expressed as an inverse Fourier transform where: denote the Fourier transform of the analyzed wavelet at scale a and location b and is the Fourier transform of the analyzed signal x(t).
In the case of discrete signals (which are typical for the signals processing problems), assuming that the input signal x(n) includes N samples, the discrete versions of the convolution can be represented as We can easily notice that in order to obtain the CWT we have to calculate the convolution of the signal and wavelets for each value of the location b and repeat the calculations for each value of the scale a. In the case of two periodic sequences (signals) we can use the property described by Eq. (15) and apply fast algorithms for determining the discrete Fourier transform (DFT) to calculate the circular convolution [31] where the discrete Fourier transform of x(n) signal is given by formulâ ψ a is the discrete Fourier transform of the wavelet ψ â ψ a k ð Þ ¼ where k is an index of frequency. Assuming that the signal is sampled at a frequency f=f s , the sampling period is Δt=1/f s and in order to obtain the unit energy for each scale a, the wavelet function is normalized by the following formula [23] ψ a aω k ð Þ ¼ where: The CWT can be expressed as the products of the inverse Fourier transform The above described method was used for the EGG signals analysis. The calculations were made for various wavelets e.g.,: Morlet, Derivative of Gausian and Paul. During initial tests, authors have examined all available in the applied version of the Matlab (R2013b) types of wavelets for CWTFT algorithm: m-th order derivative of a Gaussian wavelet, analytic Morlet wavelet, non-analytic Morlet wavelet, non-analytic Morlet wavelet with zero mean, Mexican hat wavelet. The non-analytic Morlet wavelet was chosen because the obtained scalograms provided similar information consistent with the commonly known properties of EGG signals as the occurrence of the characteristic frequencies (e.g., 3 cpm) and typical changes in parameters after administration of the meal [3].
In our work all the presented results were obtained for the non-analytic Morlet wavelet with zero mean, where ω 0 is the non-dimensional frequency parameter and its value was set to 6 and 15. If ω 0 =6 the admissibility condition is satisfied [23,32]. The dependence of the pseudo-frequency scale on the chosen wavelet is given by where λ is the Fourier wavelength (frequency Fourier factor) for the Morlet wavelet and it is given by the following formula [23] λ ¼ 4πa During calculations the range of the a 0 =ω 0 Δt scale (1.5 and 3.75) to 50 in steps of 0.15 were used, which correspond to the range of the pseudo-frequency values 0.6453-0.0040 Hz for ω 0 =6 and 0.638-0.0039 Hz for ω 0 =15 , respectively. The examples of the applied Morlet wavelet are shown in the Fig. 2.
The Fig. 3. depicts the deference between STFT and CWTFT transforms for an example of a chirp signal (from 0.005 to 0.025Hz, sampled at f s =4Hz).

Application to EGG
As the aim of this work is to show the application of new algorithms for EGG signal analysis, the paper presents the results of research carried out for only four subjects (women), volunteered to participate in the study. Their average age was 25.75 years (range: 24-31) and average BMI 19.83 (range: 18.6-21.1). Every volunteer gave a written consent to participate in the study. The research project was approved by the Bioethics Committee of the Silesian Medical University. The duration of EGG study was in the range of 120 to 170 min and it consisted of three parts: preprandial (30-40 min), meal (5-10 min) and postprandial (90-120 min). Before the test, all participants were in a fasting state.
The calculations of the CWT coefficients (absolute values of elements W ab further denoted |W ab | ) were performed for four-channels EGG signals, sampled at the frequency 4 Hz and the resolution of 12 bits, using the 4-channel prototype biomedical amplifier with the input range ±1 mV and gain 5000.
In order to assess the accuracy of the obtained results, the values of normogastria index (NI) were calculated for each EGG channel using the following procedure. The signal was divided into 60 s length segments (with overlap 50 %) and the |W ab | matrices were calculated. The |W ab | matrices were reshaped in order to remove the components which corresponded to the pseudo-frequency greater than 9 cpm (0.15Hz), because the analysis of EGG signals above this frequency is not carried out [2,4,5]. Then, for each segment of the modified |W ab | matrices the maximum value which corresponds to the pseudo-maximum power pMP(l) was found and its corresponding value of the dominant pseudo-frequency pDF(l), where l is the number of 1min segment of the EGG signal. Finally NI index as the ratio of the number of pDF values in the range of 2-4 cpm to all values was calculated, for all channels of  Fig. 13 Time-frequency analysis with the CWTFT (non-analytic Morlet wavelet, ω 0 =6) for four-channels EGG signal recorded EGG signal [2,5,6,10]. Then, evaluated normogastria indexes were compared with those calculated by means of the classical method [4,6].

Results
The described method was applied to the analysis of over 2 h, four-channel EGG recordings, using a light non caloric liquid meal (400 ml cold water). Figure 4 shows the result of the CWT analysis using the non-analytic Morlet wavelet for ω 0 =6. The scale values were converted to the corresponding pseudo-frequency values. This figure clearly shows that the maximum value of the energy in the signal occurs about 3 cpm -the typical frequency of the slow wave in the EGG signal [4,8]. Especially in the first part of the examination (preprandial) we can see clearly that the frequency is almost constant or oscillates near the 3 cpm. Figure 5 shows the frequency values corresponding to the maximum energy of scalogram. This process (curve) can be treated as a continuous frequency of the slow waves in the EGG signal. Figures 6 and 7 illustrate respectively the pDF and pMP for the sequent of 60 s segments of EGG signal. These values were also obtained based on the analysis of the CWTFT coefficients. Figures 6  and 7 were presented to compare the obtained results against the results of the classical EGG signals analysis (Fig. 12). The Figs. 8, 9, 10, and 11 show results of analysis using the Morlet wavelet with ω 0 =15. The Fig. 12 shows the values of the DF and the MP for the same signal derived from the classical EGG analysis for the same EGG signals.
Normogastria indexes Norm I and Norm 60 (corresponding to NI index) were calculated by the proposed method while Norm c was obtained by the means of classical method. These values of normogastria indexes for four EGG recordings are presented in Table 1 The normogastria indexes obtained on the basis of CWTFT were calculated by two methods: Norm I was calculated on the basis of all the instantaneous frequency (corresponding to the maximum energy) and Norm 60 was based on the average value for the 60 s segments. Figures 13, 14, and 15 show the results of the analysis for another EGG signal, which can clearly depict an immediate increase of power in the signal EGG after the meal and its gradual reduction during the postprandial phase. This is the typical phenomenon which can be often observed during the EGG examination [13].

Conclusion
In this paper, the method of multi-channels EGG signals analysis by means of the CWTFT was described. Thanks to FFT applying in the CWT algorithm computation, the results for relatively long records of EGG can be obtained in a fairly short time (much faster than using the classical methods based on RSA analysis, e.g., using AR or ARMA models).
In this study, for the first time, the authors show the possibility of a parametric analysis of multi-channel EGG signals, using continuous wavelet transform. The normogastria indexes obtained by means of the proposed method, have similar values to the coefficients calculated by means of the classical analysis. However, it was noticed that the largest differences occurred in the signals for which the value of normogastria index was below 0.6. This phenomenon requires further investigation and necessary medical verification.
We can notice that results obtained by the analysis of the CWT are dependent on the mother wavelet function, which significantly affects the quality of signal analysis and results [16]. According to our tests, the Morlet wavelet gives the best results of the EGG signal analysis moreover preliminary results show the robustness of the method and its large potential in the future analysis of the EGG signals. Additionally, the presented method allows to determine the instantaneous values of the dominant frequency and maximum energy which was not possible with the classical EGG signal analysis.
The possibility of continuous observation of the dominant frequency and the dominant power (and other coefficients calculated on this basis) gives opportunities for a wider application of the proposed method in the medical diagnosis of digestive systems. From medical point of view, the described method must be clinically verified, which requires a sufficiently long time, Open Access This article is distributed under the terms of the Creative Comm ons Attribution 4.0 International License (http:// creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.