**2. Transforms and its use in biomedical signal analysis**

### **2.1 Transforms**

Jean-Baptiste Joseph Fourier a French mathematician had developed theoretical and mathematical framework for Fourier analysis and harmonic analysis, which was laid down foundation to other transforms and important applications. Forward and inverse transform of a continuous time Fourier transform (CTFT) for a time domain signal *x(t)* is defined as

$$X(j\omega) = \int\_{-\infty}^{\infty} x(t)e^{-j\pi t} \,\mathrm{d}t \tag{1}$$

$$\mathcal{L}\left(x(t) = \frac{1}{2\pi} \int\_{-\infty}^{\infty} X(j\omega)e^{j\alpha t} d\alpha\right) \tag{2}$$

Here, *e*�*jϖ<sup>t</sup>* is called as a basis function for CTFT.

For ease of processing the continuous time signal is converted into discrete time, then the corresponding forward and inverse transform of a discrete Fourier transform (DFT) for a discrete time signal *x(n)* is defined as

$$X(k) = \sum\_{n=0}^{N-1} x(n)e^{-j\frac{2nk}{N}}; for \, k=1,2,3...N \tag{3}$$

$$\mathbf{x}(n) = \frac{1}{N} \sum\_{k=0}^{N-1} \mathbf{X}(k) e^{j\frac{2\pi k}{N}}; for \; n = 1, 2, 3 \dots N \tag{4}$$

Here, *e*�*<sup>j</sup>* 2*π*nk *<sup>N</sup>* is called as a basis function for DFT. Similarly, the continuous wavelet transform (CWT) is defined as

$$F(a,b) = \frac{1}{\sqrt{a}} \int\_{-\infty}^{\infty} \varphi\left(\frac{t-a}{b}\right) f(t) \, dt \tag{5}$$

**2.2 Biomedical signals**

*Typical recorded ECG signal in the laboratory.*

segment [7].

**103**

**Figure 2.**

**Figure 1.**

*interest and gives C and L matrices.*

The Electrocardiogram (ECG) is an electrical manifestation of contractile activity of the heart, is a representation of instantaneous electrical activity of the heart during its contraction and relaxation over a period of time. A standard 12 leads ECG is recorded with the help of surface electrodes placed on the limbs and chest. In general, ECG is a widely accepted diagnosis tool in clinical validations of heart related diseases. **Figure 2** shows a typical ECG signal, marked with all the characteristic waves and durations such as P wave, QRS complex wave, T wave and ST

*A sample of 3-stage Wavelet decomposition tree, In Matlab® 'wavedec' command will decompose signal of*

*Use of Transforms in Biomedical Signal Processing and Analysis*

*DOI: http://dx.doi.org/10.5772/intechopen.98239*

Monitoring of blood oxygen saturation (SpO2) is one of the important parameter to know the health status of Covid-19 affected patient. Pulse oximeter uses sensor probes to record photoplethysmographic (PPG) signals so as to estimate the SpO2

values. Typical recorded PPG signal is shown in **Figure 3**.

where, *f(t)* is a time domain signal, *ψ*ð Þ*t* is a basis function also called as mother wavelet; F(a, b) is WT of a signal *f(t)*; '*a*' and '*b*' are shifting and scaling parameters respectively;

Discrete WT (DWT) uses a series of low pass filters (LPF) and high pass filters (HPF) to decompose the signal of interest into different scales as approximate (*Aj*) and detailed coefficients (*Dj*). The output coefficients of the LPF are called approximations while the output coefficients of the HPF are called details.

A 3-stage DWT decomposition tree is illustrated in **Figure 1**.

After first level of decomposition A1 and D1 will be the outputs, D1 will be stored in **C** matrix as shown in **Figure 1**. A1 will be further decomposed in 2nd level of decomposition as D2, A2. D2 will be stored in **C** matrix, and A2 will be decomposed in 3rd level of decomposition as D3, A3. Then A3 and D3 will be stored in **C** matrix, i.e. **C** matrix consists of concatenated A3, D3, D2, D1 coefficients. **L** matrix stores the length of each corresponding approximate and detailed coefficient as in **C** matrix.

C matrix gives the concatenated approximate and detail coefficients. **L** matrix gives length of each coefficient. **C** and **L** matrices along with suitable filters will be used to get back the original time domain signal *f(t)*.

*Use of Transforms in Biomedical Signal Processing and Analysis DOI: http://dx.doi.org/10.5772/intechopen.98239*

### **Figure 1.**

**2. Transforms and its use in biomedical signal analysis**

*Real Perspective of Fourier Transforms and Current Developments in Superconductivity*

*X j* ð Þ¼ *ω*

*x t*ðÞ¼ <sup>1</sup> 2*π*

Here, *e*�*jϖ<sup>t</sup>* is called as a basis function for CTFT.

*X k*ð Þ¼

*x n*ð Þ¼ <sup>1</sup> *N* X *N*�1

transform (DFT) for a discrete time signal *x(n)* is defined as

*k*¼0

*<sup>N</sup>* is called as a basis function for DFT.

*F a*ð Þ¼ , *<sup>b</sup>* <sup>1</sup>

imations while the output coefficients of the HPF are called details. A 3-stage DWT decomposition tree is illustrated in **Figure 1**.

used to get back the original time domain signal *f(t)*.

*N* X�1 *n*¼0

Jean-Baptiste Joseph Fourier a French mathematician had developed theoretical and mathematical framework for Fourier analysis and harmonic analysis, which was laid down foundation to other transforms and important applications. Forward and inverse transform of a continuous time Fourier transform (CTFT) for a time

∞ð

*x t*ð Þ*e* �*jϖt*

*X j* ð Þ *<sup>ω</sup> <sup>e</sup> <sup>j</sup>ω<sup>t</sup>*

dt (1)

*dω* (2)

*<sup>N</sup>* ; *for k* ¼ 1, 2, 3 …… *N* (3)

*<sup>N</sup>* ; *for n* ¼ 1, 2, 3 …… *N* (4)

*f t*ð Þ*dt* (5)

�∞

∞ð

�∞

then the corresponding forward and inverse transform of a discrete Fourier

*x n*ð Þ*e* �*j* 2*πnk*

*X k*ð Þ*<sup>e</sup> <sup>j</sup>*

Similarly, the continuous wavelet transform (CWT) is defined as

ffiffiffi *a* p ∞ð

*ψ*

where, *f(t)* is a time domain signal, *ψ*ð Þ*t* is a basis function also called as mother wavelet; F(a, b) is WT of a signal *f(t)*; '*a*' and '*b*' are shifting and scaling parameters

Discrete WT (DWT) uses a series of low pass filters (LPF) and high pass filters (HPF) to decompose the signal of interest into different scales as approximate (*Aj*) and detailed coefficients (*Dj*). The output coefficients of the LPF are called approx-

After first level of decomposition A1 and D1 will be the outputs, D1 will be stored in **C** matrix as shown in **Figure 1**. A1 will be further decomposed in 2nd level of decomposition as D2, A2. D2 will be stored in **C** matrix, and A2 will be decomposed in 3rd level of decomposition as D3, A3. Then A3 and D3 will be stored in **C** matrix, i.e. **C** matrix consists of concatenated A3, D3, D2, D1 coefficients. **L** matrix stores the length of each corresponding approximate and detailed coefficient as in **C** matrix. C matrix gives the concatenated approximate and detail coefficients. **L** matrix gives length of each coefficient. **C** and **L** matrices along with suitable filters will be

*t* � *a b* � �

�∞

2*πnk*

For ease of processing the continuous time signal is converted into discrete time,

**2.1 Transforms**

Here, *e*�*<sup>j</sup>*

respectively;

**102**

2*π*nk

domain signal *x(t)* is defined as

*A sample of 3-stage Wavelet decomposition tree, In Matlab® 'wavedec' command will decompose signal of interest and gives C and L matrices.*

**Figure 2.**

*Typical recorded ECG signal in the laboratory.*

### **2.2 Biomedical signals**

The Electrocardiogram (ECG) is an electrical manifestation of contractile activity of the heart, is a representation of instantaneous electrical activity of the heart during its contraction and relaxation over a period of time. A standard 12 leads ECG is recorded with the help of surface electrodes placed on the limbs and chest. In general, ECG is a widely accepted diagnosis tool in clinical validations of heart related diseases. **Figure 2** shows a typical ECG signal, marked with all the characteristic waves and durations such as P wave, QRS complex wave, T wave and ST segment [7].

Monitoring of blood oxygen saturation (SpO2) is one of the important parameter to know the health status of Covid-19 affected patient. Pulse oximeter uses sensor probes to record photoplethysmographic (PPG) signals so as to estimate the SpO2 values. Typical recorded PPG signal is shown in **Figure 3**.

**Figure 3.** *Typical recorded PPG signal in the laboratory.*

### **2.3 Biomedical signal processing using transforms**

Fourier transform (FT) is used to analyze the behavior of biomedical signals in frequency domain. In Matlab FFT command can be used to get the frequency domain signal.

Following is the sample code to plot time and frequency domain signals.

```
load ecg_signal.txt;
ecg_signal_fft=fft(ecg_signal);
figure(1)
subplot(211)
plot(ecg_signal)
subplot(212)
plot(ecg_signal_fft)
```
Some additional modifications will be done in the program to get the following plots.

In the bottom trace of **Figure 4**, it can be seen that the frequency domain components of ECG signal are extending from 0 to 100 Hz, the main source of noise 60 Hz power line interference (PLI) the spike at 60 Hz can be observed. So, the complete frequency domain behavior of signal can be computed using fft command.

Similarly, the frequency domain components of PPG signal is shown in **Figure 5**. It can be seen from the bottom trace that frequency components present in PPG signal are pulse rate or heart rate component and MA noise component. Likewise it can be continued for many biomedical signals to see the frequency domain behavior of the signal.

So, use of Fourier transform in de-noising of signal can be described as shown in **Figure 6**.

In general adaptive filter provide a viable solution when signal and noise are in same frequency range. Adaptive filter requires a two input signals [8].

in the following way. The frequency spectrum of MA corrupted PPG signal consists of various frequency components, the pulsatile (0.5–4 Hz), respiratory activity (0.2–0.35 Hz) and MA noise component (0.1 Hz or more) information. By setting the co-efficients of cardiac and respiratory activity frequency components in the spectrum of MA corrupted PPG to zero, a modified spectrum corresponding to noise is obtained. By applying inverse Fourier transform to this modified spectrum, a synthetic noise reference signal is generated. The corresponding adaptive filter is

*Recorded PPG signal in top trace and its corresponding spectrum after application of FFT in bottom trace.*

*Recorded ECG signal in top trace and its corresponding spectrum after application of FFT in bottom trace.*

*Use of Transforms in Biomedical Signal Processing and Analysis*

*DOI: http://dx.doi.org/10.5772/intechopen.98239*

shown in **Figure 8**.

**105**

**Figure 5.**

**Figure 4.**

For example, in a power line interference cancelation from ECG signal, one is recorded noisy ECG signal and other is power line noise. So, here a synthetic noise reference signal will be generated using Fourier transform which will be used as another input to the adaptive filter will potentially eliminate additional sensor for acquisition shown in **Figure 7**.

A synthetic noise reference signal is generated for use in adaptive filtering without using any extra hardware. It is generated from the motion corrupted signal *Use of Transforms in Biomedical Signal Processing and Analysis DOI: http://dx.doi.org/10.5772/intechopen.98239*

**Figure 4.** *Recorded ECG signal in top trace and its corresponding spectrum after application of FFT in bottom trace.*

**Figure 5.** *Recorded PPG signal in top trace and its corresponding spectrum after application of FFT in bottom trace.*

in the following way. The frequency spectrum of MA corrupted PPG signal consists of various frequency components, the pulsatile (0.5–4 Hz), respiratory activity (0.2–0.35 Hz) and MA noise component (0.1 Hz or more) information. By setting the co-efficients of cardiac and respiratory activity frequency components in the spectrum of MA corrupted PPG to zero, a modified spectrum corresponding to noise is obtained. By applying inverse Fourier transform to this modified spectrum, a synthetic noise reference signal is generated. The corresponding adaptive filter is shown in **Figure 8**.

**2.3 Biomedical signal processing using transforms**

domain signal.

**Figure 3.**

*figure(1) subplot(211) plot(ecg\_signal) subplot(212) plot(ecg\_signal\_fft)*

following plots.

of the signal.

in **Figure 6**.

**104**

acquisition shown in **Figure 7**.

*load ecg\_signal.txt;*

*ecg\_signal\_fft=fft(ecg\_signal);*

*Typical recorded PPG signal in the laboratory.*

Fourier transform (FT) is used to analyze the behavior of biomedical signals in

frequency domain. In Matlab FFT command can be used to get the frequency

*Real Perspective of Fourier Transforms and Current Developments in Superconductivity*

Following is the sample code to plot time and frequency domain signals.

Some additional modifications will be done in the program to get the

frequency domain behavior of signal can be computed using fft command.

same frequency range. Adaptive filter requires a two input signals [8].

In the bottom trace of **Figure 4**, it can be seen that the frequency domain components of ECG signal are extending from 0 to 100 Hz, the main source of noise 60 Hz power line interference (PLI) the spike at 60 Hz can be observed. So, the complete

Similarly, the frequency domain components of PPG signal is shown in **Figure 5**. It can be seen from the bottom trace that frequency components present in PPG signal are pulse rate or heart rate component and MA noise component. Likewise it can be continued for many biomedical signals to see the frequency domain behavior

So, use of Fourier transform in de-noising of signal can be described as shown

In general adaptive filter provide a viable solution when signal and noise are in

For example, in a power line interference cancelation from ECG signal, one is recorded noisy ECG signal and other is power line noise. So, here a synthetic noise reference signal will be generated using Fourier transform which will be used as another input to the adaptive filter will potentially eliminate additional sensor for

A synthetic noise reference signal is generated for use in adaptive filtering without using any extra hardware. It is generated from the motion corrupted signal *Real Perspective of Fourier Transforms and Current Developments in Superconductivity*

*N n* ^ ð Þ¼ <sup>X</sup>

and NR(n): the synthetic noise reference signal.

*(c1) and their corresponding spectra in (a2)-(c2) respectively.*

*Motion artifact reduction from PPG signals using Adaptive filter.*

*Use of Transforms in Biomedical Signal Processing and Analysis*

*DOI: http://dx.doi.org/10.5772/intechopen.98239*

to the same [9, 10].

**Figure 9.**

**107**

**Figure 8.**

eliminates the additional sensor for data acquisition.

*L*

*i*¼0

where i: 0,1,2, … , L, L: filter order, S(n) + N(n): MA corrupted PPG signal, ^

The result of above methodology is presented in **Figure 9**, below. **Figure 9(b1)**

The biomedical signals such as ECG and PPG signals are quasi periodic signals i.e. the period of the signal continuously changes with time, but it is a periodic signal. In general, the pure periodic signals are stationary in nature means its period will be constant irrespective of time. So, Fourier transform is not sufficient to analyze the quasi-periodic signals. Wavelet transform will provide a viable solution

*Recorded PPG signal in (a1), generated MA synthetic reference signal in (b1) and MA reduced PPG signal in*

=e(n): MA reduced PPG signal, *N*^ (n): estimated synthetic noise reference signal,

represents the generated synthetic noise reference signal which potentially

*wiNR*ð Þ *n* � *i* (7)

*S*(n)

*wi*ð Þ¼ *n* þ 1 *wi*ð Þþ *n* 2*μS n*ð Þ*NR*ð Þ *n* � *i* (8)

**Figure 6.** *Flowchart for de-noising of recorded signal using Fourier transform.*

### **Figure 7.**

*Flowchart for generation of synthetic noise reference signal using Fourier transform.*

With the help of LMS adaptive algorithm, MA noise is removed by estimating the synthetic noise reference signal and adapting the filter coefficients based on filter order. The necessary equations to implement the proposed method are given below:

$$
\hat{\mathcal{S}}\left(\boldsymbol{n}\right) = \mathcal{S}\left(\boldsymbol{n}\right) + \mathcal{N}\left(\boldsymbol{n}\right) - \hat{\mathcal{N}}\left(\boldsymbol{n}\right) \tag{6}
$$

*Use of Transforms in Biomedical Signal Processing and Analysis DOI: http://dx.doi.org/10.5772/intechopen.98239*

### **Figure 8.**

*Motion artifact reduction from PPG signals using Adaptive filter.*

$$\hat{N}(n) = \sum\_{i=0}^{L} w\_i N\_R(n-i) \tag{7}$$

$$
\omega\_i(n+1) = \omega\_i(n) + 2\mu \mathcal{S}(n) N\_R(n-i) \tag{8}
$$

where i: 0,1,2, … , L, L: filter order, S(n) + N(n): MA corrupted PPG signal, ^ *S*(n) =e(n): MA reduced PPG signal, *N*^ (n): estimated synthetic noise reference signal, and NR(n): the synthetic noise reference signal.

The result of above methodology is presented in **Figure 9**, below. **Figure 9(b1)** represents the generated synthetic noise reference signal which potentially eliminates the additional sensor for data acquisition.

The biomedical signals such as ECG and PPG signals are quasi periodic signals i.e. the period of the signal continuously changes with time, but it is a periodic signal. In general, the pure periodic signals are stationary in nature means its period will be constant irrespective of time. So, Fourier transform is not sufficient to analyze the quasi-periodic signals. Wavelet transform will provide a viable solution to the same [9, 10].

### **Figure 9.**

*Recorded PPG signal in (a1), generated MA synthetic reference signal in (b1) and MA reduced PPG signal in (c1) and their corresponding spectra in (a2)-(c2) respectively.*

With the help of LMS adaptive algorithm, MA noise is removed by estimating the synthetic noise reference signal and adapting the filter coefficients based on filter order. The necessary equations to implement the proposed method are given

*S n*ð Þ¼ *S n*ð Þþ *N n*ð Þ� *N n* ^ ð Þ (6)

^

*Flowchart for generation of synthetic noise reference signal using Fourier transform.*

*Flowchart for de-noising of recorded signal using Fourier transform.*

*Real Perspective of Fourier Transforms and Current Developments in Superconductivity*

below:

**106**

**Figure 7.**

**Figure 6.**

### **Figure 10.**

*Wavelet Denoising methodology.*

The general de-noising procedure follows the steps described below and shown in **Figure 10**.

*Decomposition: Choose a wavelet and choose a convenient level N for decomposition. Compute the wavelet decomposition of the signal s at level N.*

*Thresholding detail coefficients: For each level from 1 to N, select a threshold and apply soft or hard thresholding to the detail coefficients.*

*Reconstruction: Perform the wavelet reconstruction using the original approximation coefficients of level N and the modified detail coefficients of levels from 1 to N.*

There are two important steps: how to choose the threshold, and how to perform the thresholding [10]. In hard thresholding process, the elements whose absolute values are lower than the threshold will be set to zero. Soft thresholding is an extension of hard thresholding, first setting to zero the elements whose absolute values are lower than the threshold, remaining coefficients are compressed.

**Figure 11.**

*(a) ECG signal corrupted with Electromyography signal (b) De-noised ECG signal using wavelet de-noising methodology.*

The same results were presented in **Figures 11**–**13**. Similar results were

*(a) PPG signal corrupted with MA noise (b) De-noised PPG signal using wavelet de-noising methodology.*

*(a) ECG signal corrupted with power line noise (b) De-noised ECG signal using wavelet de-noising*

*Use of Transforms in Biomedical Signal Processing and Analysis*

*DOI: http://dx.doi.org/10.5772/intechopen.98239*

Transforms like Fourier and wavelet transforms were used in biomedical signal analysis and processing. Fourier and wavelet transforms were utilized to reduce motion artifacts from PPG signals so as to produce correct blood oxygen saturation (SpO2) values. In an important contribution we utilized FT for generation of reference signal for adaptive filter based motion artifact reduction eliminating additional

presented for PPG signal as shown in **Figure 14**.

sensor for acquisition of reference signal.

**3. Conclusions**

**109**

**Figure 14.**

**Figure 13.**

*methodology.*

**Figure 12.** *(a) ECG signal corrupted with baseline noise (b) De-noised ECG signal using wavelet de-noising methodology.*

*Use of Transforms in Biomedical Signal Processing and Analysis DOI: http://dx.doi.org/10.5772/intechopen.98239*

**Figure 13.**

The general de-noising procedure follows the steps described below and shown

*Real Perspective of Fourier Transforms and Current Developments in Superconductivity*

*Decomposition: Choose a wavelet and choose a convenient level N for decomposition.*

*Thresholding detail coefficients: For each level from 1 to N, select a threshold and*

*Reconstruction: Perform the wavelet reconstruction using the original approximation coefficients of level N and the modified detail coefficients of levels from 1 to N.*

There are two important steps: how to choose the threshold, and how to perform the thresholding [10]. In hard thresholding process, the elements whose absolute values are lower than the threshold will be set to zero. Soft thresholding is an extension of hard thresholding, first setting to zero the elements whose absolute values are lower than the threshold, remaining coefficients are compressed.

*(a) ECG signal corrupted with Electromyography signal (b) De-noised ECG signal using wavelet de-noising*

*(a) ECG signal corrupted with baseline noise (b) De-noised ECG signal using wavelet de-noising methodology.*

*Compute the wavelet decomposition of the signal s at level N.*

*apply soft or hard thresholding to the detail coefficients.*

in **Figure 10**.

*Wavelet Denoising methodology.*

**Figure 10.**

**Figure 11.**

*methodology.*

**Figure 12.**

**108**

*(a) ECG signal corrupted with power line noise (b) De-noised ECG signal using wavelet de-noising methodology.*

**Figure 14.** *(a) PPG signal corrupted with MA noise (b) De-noised PPG signal using wavelet de-noising methodology.*

The same results were presented in **Figures 11**–**13**. Similar results were presented for PPG signal as shown in **Figure 14**.

### **3. Conclusions**

Transforms like Fourier and wavelet transforms were used in biomedical signal analysis and processing. Fourier and wavelet transforms were utilized to reduce motion artifacts from PPG signals so as to produce correct blood oxygen saturation (SpO2) values. In an important contribution we utilized FT for generation of reference signal for adaptive filter based motion artifact reduction eliminating additional sensor for acquisition of reference signal.

**References**

2498500.

[1] Alejandro Domínguez, Alejandro Domínguez: Highlights in the history of the Fourier transform. IEEE Pulse. 2016: 7:1:53-61. DOI: 10.1109/MPUL.2015.

*DOI: http://dx.doi.org/10.5772/intechopen.98239*

*Use of Transforms in Biomedical Signal Processing and Analysis*

[2] Alan V Oppenhiem, Alan S. Willsky, S. Hamid Nawab. Signals and Systems.

transform, time-frequency localization and signal analysis. IEEE Trans. Inf. Theory, 1990: 130:5: 961-1005. DOI:

[4] P. M. Bentley and J. T. E. McDonnel: Wavelet transforms: an introduction, Electron. Commun. Eng. J., vol. 6, no. 4, pp. 175-186, Aug. 1994. DOI: 10.1049/

[5] Bochner, S.*;* Chandrasekharan, K. *(1949), Fourier Transforms,* Princeton

[6] Bracewell, R. N. (2000), The Fourier transform and its Applications (3rd ed.), Boston: McGraw-Hill, ISBN 978-0-

[7] P. S. Hamilton, "A comparison of adaptive and non-adaptive filters for the reduction of PLI in the ECG," IEEE Trans. Biomed. Eng., vol. 43(1),

[8] Lino Garcia Morales, Adaptive filtering, Intech open, DOI: 10.5772/675.

[10] D. L. Donoho, De-noising by softthresholding, IEEE Transaction on

Information Theory, Vol. 41, pp. 613–627, May 1995.

[9] J.S Sahambi, S.N. Tandon and R.K.P. Bhatt, "Using Wavelet Transform for ECG Characterization," IEEE Eng. in

Prentice Hall, Newjersy, 1983.

[3] I. Daubechies: The wavelet

10.1109/18.57199

ecej:19940401.

University Press.

07-116043-8*.*

pp. 105-109, 1996.

Med. and Bio., 1997.

**111**
