Stability and Phase Response Analysis of Optimum Reduced-Order IIR Filter Designs for ECG R-Peak Detection

Cardiovascular health and training success can be assessed using electrocardiogram (ECG) data. For over a quarter of a century, an individual's resting heart rate is varying more. As a result, it has become the subject of inquiry and reveals the intricate relationship between the human body and its environment. The autonomic nervous system has impact on blood flow system based on the rate of heartbeats. However, heart rate variation (HRV) characteristics analysis throughout the time period has lack of physical activity information. In the presence of patient movement, ECG signal is suffering from hard artefacts. Time-varying HRV parameters can be derived from low-frequency (LF) and high-frequency (HF) domains of the correct frequency. However, sometimes it is critical to ensuring accurate detection of the R-peak position. The proposed ROIIR (reduced-order IIR) offers 8.8% improvement in peak-to-peak swing than earlier IIR filter. We present an advanced filtering algorithm that is used for R-peak detection.


Introduction
An individual's heart is a muscular structure that pumps blood through the circulatory system, allowing them to live. If the heart fails, a person will die. Heart illness is the foremost basis of death amongst humans today. Many people die as a result of heart illness. An electrocardiogram (ECG) is a recording of the physical explanation of electrical performance during the heart sequence. In order to discover heartbeat problems, ECG is utilized to assess heartbeat's rate and rhythm. Heart issues can be diagnosed early if they can be monitored by an ECG. Electrocardiogram (ECG) signal is a graphical depiction of cardiac commotion that can be used to identify heart illness.
Various waves, segments, and limited interludes make up the ECG signal. P, Q, R, S, and T are the five basic ECG waves. Information about cardiac disease can be gleaned from P-QRS-T wave patterns and the time interludes amongst crests. e QRS complex, the P and T waves, the QRS-Q wave, the R wave, and the S wave are all critical components in the ECG signal analysis [1]. Humanoid stress, crusade, ECG machine cable dislodgment, machine issue, and lead misplacement can all modify the electrode skin impedance, resulting in a noisy signal that can be hard for computer processing and difficult for a cardiologist to understand. e ECG data must therefore be filtered in order to detect and further process the heartbeat peak. Baseline drifts, power line interference, and ECG noise all contribute to ECG signal noise. Power line interference occurs at medium frequencies, and electromyography occurs at high frequencies; hence, baseline wander is a low-frequency filtering phenomenon. Filters are applied to eradicate these noises. When the noise in the ECG input signal is reduced using filters, the desired information can be extracted [2]. High-pass, low-pass, band-pass, band-stop, and all-pass filters are all used in ECG filtering. Filtering is based on the cut-off frequency; if we lower the cut-off frequency, then lowering the frequency will be allowed to pass through. e low and high frequencies are reduced by a band-stop filter, whereas the high and low frequencies are not affected by an all-pass filter. Filters are divided into two types: analogue and digital. Finite impulse response (FIR) filters and infinite impulse response (IIR) filters are once again two types of digital filters. FIR filters are outperformed by IIR filters in terms of speed and memory requirements. e IIR filter is a recursive filter centred on a sole linear filter, with the current output linked to the preceding input and output. ere are less design parameters, less memory needs, and less computational complication in IIR digital filters compared with FIR digital filters [3]. Designing and implementing IIR filters are more versatile since there are fewer limitations. When compared with FIR filters, IIR filters have a smaller number of parameters but are more vulnerable to noise and have a shorter response time. From the analogue filter, a bilinear transformation is used to create the digital IIR filter. Digital filters with a limitless impulse retort are known as IIR filters.
Heart rate variability (HRV), or the temporal deviation between heartbeats, has been increasingly noteworthy in recent years. e precise identification of R-peaks and RRintervals for physiological interpretation has become increasingly important [1]. Following the transfer of RR interludes into frequency domain moreover in certain frequency bands is known to be associated with activation of the sympathetic and parasympathetic nervous system and central nervous system [1]. Many motion artefacts, such as random or stochastic noise, cause the ECG to deform and the signal-to-noise ratio (SNR) to plummet, especially during physical activity [4][5][6]. ECG algorithms used in clinical practice are not intended for this determination and so demonstrate high false alarm degrees, resulting in inaccurate HRV measurements. In order to deal with motion artefacts, a number of filter approaches have been proposed. Finite impulse response (FIR) filters are commonly used in many algorithms. It is possible to obtain an undistorted ECG signal from this method because the FIR filter is combined with a delay that is equal to the essential numeral of the filter. A large number of filter coefficients are required by FIR filters to achieve the desired signal characteristics, resulting in a significant rise in the computational burden. Mobile applications, especially those that demand low battery consumption, limit the computer resources available; therefore, computational costs become increasingly significant. Because the FIR filter is bidirectional, we recommend employing a bidirectional infinite impulse response (IIR) filter. It is possible to achieve a great quality output with less filter constants and less computation time using the recursive IIR filter. e problem of familiarizing a phase shift can be avoided by smearing the filter bidirectional [7,8]. Following the filtering step, we add an R-peak detector founded on an improved methodology to perceive R-peaks to overcome motion artefacts [9]. Extra plausibility checks are needed to evaluate whether the observed event is part of a genuine R-peak or an artefact. In the particular instance of mobile data, R-peak detection rates can be enhanced using these innovations.

ECG Dataset Details
A total of 18 ECG data were used to contrivance this investigation in the MATLAB surroundings. Each recording lasts for 30 minutes and 5556 seconds, but the time displayed below has been adjusted down to the next second to account for rounding errors. e heart rate is recorded in beats per minute across three R-R intervals [10].
Moreover, same database was applied in one of another research [11].

Existing Methodology
In research work [12], high-power noise in the ECG was reduced using an IIR Butterworth filter. is claim is backed up by the results of an IIR Butterworth low-pass filter, which demonstrate that the power of the filter signal is lower than that for the noise signal. Li et al. [6] developed an upgraded numeral coefficient IIR filter and associated with straight approaches of numeral coefficient. Low-and high-pass filters created by IIR can reduce both power frequency interference and baseline drift [13].
e Butterworth low-pass filter has a cut-off frequency of 100 Hz, which is used by Gaikwad and Chavan [14] to reduce noise from the ECG data. e result shows a reduction in noise of −18 dB. To eradicate power line noise from ECG signals, the discrete Fourier transform founded algorithm, IIR, FIR, Kalman wavelet, and in addition, advanced-order statistical filtering techniques were applied by Amiri et al. [15]. It has been determined that FIR filtering and IIR filtering improve SNR the most. Elliptic filtering and Butterworth Chebyshev type I, type II, and elliptic filtering were applied by Bhogeshwar and colleagues [16] to reduce noise from ECG signals. Once these algorithms applied to the MIT-BIH ECG database signals, the IIR elliptic filter is said to have increased SNR performance [17].
High-frequency disturbances whose order was experimentally selected were removed by Dhar et al. [17] using a Butterworth low-pass filter. To make the ECG file smaller, we compress the filtered signal using a stringent lossless approach. Das and Chakraborty [7] attempted to sifter ECG indications using FIR and IIR filters. Elliptic filter and Chebyshev type I IIR filters had the highest SNR values in 2 to 4 filter ranges, according to the results. If the filter order is amongst 12 and 14, then the SNR for Chebyshev type II is great [8,18]. SNR fluctuations in the filter order have been discovered to lead to the selection of the correct filter for ECG filtering. Wavelet transforms can be combined with evolutionary algorithms for enhanced noise removal, according to Ref. [19,20]. ere are 10 ECG signals that were taken from the MIT-BIH arrhythmia record. A low-pass filter was designed by Saini et al. using IIR filters, for example, Butterworth, elliptic, and Chebyshev filters to reduce the electromyography noise [21]. In addition, FIR digital sifters are applied. Elliptic IIR strainer with Blackman of FIR filter demonstrated superior consequences in SNR besides power spectral density presentation metrics than the conventional FIR filter [22]. Consequently, to remove various sounds from ECG data, we developed a cascaded FIR/IIR filter [23,24]. [25] have designed the two-stage IIR filter using band-pass and band-stop filters. e performance of several techniques based on FIR and IIR filter designs has been examined by them. e collected speech signal is typically coarser and requires front-end filtering. e FIR/IIR filter is widely used. It was the goal of this publication to validate the previously published Kumari and Singh [25] IIR filter design for improving speech signals. e IIR filter is designed in two stages as combination of the band-pass and band-stop filters. e transfer function of the two-stage IIR filter design is given as follows: 16

IIR Filter Design. Kumari and Singh
It is clear from Figure 1 that IIR filter can remove the noise at the front end for speech signal but need to carefully define the cut-off frequencies and also need improvement [10, 26].

Comparison of the Transfer Functions.
e band-pass filters of the selected cut-off frequencies having transfer function, as an example, for ECG signal from 106 MIT-BIH data, are defined as follows: where h 2 is the band-stop filter's transfer function. A sample transfer function for ECG signal from 106 MIT-BIH data is as follows: In the further sections of the manuscript, the performance of the proposed filter is evaluated using the transfer functions [27].

Results of the Optimum Reduced-Order Filter Proposal.
is is observed via equations (2) and (3) above, the basic IIR filter entails a 16-order, advanced-order filter. To minimize the order of the transfer function, Min-Max optimization is projected in this study. e IIR filter's numerator and denominator coefficient vectors [b 1 , a 1 ] optimize Min-Max optimization. As seen in the sequential process for Min-Max optimization, transfer function coefficients are optimized consecutively. is IIR filter is termed as optimum reduced IIR (ORIIR). Table 1 represents the transfer functions aimed at several phases of the proposed lower mandate IIR filter strategy for ECG signals. As can be seen, our solution considerably reduces the filter order while also preserving the behaviour of the ECG signal, as beforehand mentioned. It is also seen that the IIR filter has a 16-order design, but after optimization, the reduced-order filter has a 2-order enterprise.

Design Parameters and Impacts.
e FIR filter outperforms the IIR filter in terms of frequency stability. Since the zeroes in the FIR filter transfer function are fixed, this is the case. As a result, addressing the issue of IIR filter stability is a challenging task. erefore, this manuscript is focused to analyse the stability performance. e channel simulator's input parameters are divided into two groups. e main benefit of this filter design is that it reduces compute delay and filter order. e stability of the best reduced-order filter for transfer functions is investigated. Filters are used to minimise the effects of ECG readings on the patient's movement. In addition to filter stability, the step, impulse, and pole-zero responses are also being studied.
In this study, the evaluation of filter performance is based on the examination of transfer function (TF) stability and pole-zero plots.
Many digital filters have been designed to reduce external and internal noises. Because the digital filters are programmable, their characteristics can be modified easily, while the hardware remains the same. Digital filters can be reprogrammed to change their characteristics without needing to change the hardware. Digital filters appear to be more consistent over time than analogue filters.

Stability and Response Analysis.
e outcomes of the filtered signal response are evaluated in this part using the IIR filter's recommended design. An IIR filter is composed of a band-pass filter and a band-stop filter, and the best reduced-order filter is examined for stability and transfer properties. To eliminate noise aberrations, ECG readings are filtered. For filter stability testing, the step, impulse, and pole-zero responses are evaluated for the three filter architectures including Pan-Tompkins 32-order FIR, 60order FIR filter, and the projected IIR filter with abridged order. Zero plots are used to measure the performance of filters based on the stability and poles of transfer functions. e amplitude besides frequency reactions of the recommended IIR filter strategy are compared first in this section. e presentation of the FIR filter used in the Pan--Tompkins method is compared to our proposed optimum reduced IIR filter design architecture, which employs a 16thorder IIR filter. e suggested filter has a substantially higher and steadier response, allowing it to efficiently minimize signal noise.
(1) 60-Order FIR Filter Step Responses. is study looks at the effectiveness of a 60-order filter for a design with a cut-off frequency of W n � 0.2 and band-pass ripples of 1.5 decibels (dB's). A 60-order filter is used to filter at 50 Hz. A band-pass filter is also applied to ECG signals. e 60-order filter produced in this study has a transfer function of h notch, which stands for eighth-order filter [29].
A mix between a band-pass and a band-stop filter, the IIR filter is a hybrid. e transfer functions for an ECG  Figure 2 compared the 32-order Pan-Tompkins filter, 60-order filter, and the two-stage IIR filter magnitude responses. It can be concluded from Figure 2 that the IIR filter with two stages the better magnitude responses [28]. e basic filter used by the standard Pan-Tompkins algorithm was of 32 orders. It has many ripples in magnitude response. It justifies the hardware complexity. e modified 60-order filter as used has the reduced magnitude [30]. e overall comparison justified the effectiveness of the proposed filter response. Nevertheless, it is also required to further minimise the filter order from 16. Figure 3 represents the comparison of three stages of our proposed optimum abridged IIR filter design for magnitude response. It is clear from Figure 3 that abridged-order filter has less magnitude response and thus may lead to amplification but has better filter response. e frequency bands that the filter will pass or reject can be used to describe the magnitude response of the filter.
is is clearly observed from Figure 3 magnitude responses that the proposed reduced-order IIR filter has the slope, which is same as magnitude response reduces to around −2 dB to −12 dB for the frequency range of 0 to 1 normalized range, while this is clear from Figure 3(b) that simple digital IIR filter although having flat response but over's the sharp cut-off in magnitude of around −40 dB at the 0.8 normalized range or (80%) frequency spectrum. erefore, over the entire optimum reduced-order filter relatively has flat response. ese data ranges are mentioned within the red colour rectangles in Figure 3.

Group Delay
Response. "Group delay" is nothing more than the lag between an input burst and its amplitude envelope in an output burst. e term "group delay" refers to the time it takes for a signal's envelope to travel through a filter. Figure 4 represents the comparison of the group delay responses. Figure 4(a) shows that the 60-order FIR filter has a nonlinear group delay and a varying response. It can be clearly served from Figure 4 that optimum IIR reduced-order filter has the flat group delay response as compared to the 60-order FIR filters. A flat group delay filter's main advantage is that binary digits related to distortions are reduced.
is is due to the fact that the transmitted pulses' harmonic components will all pass through the filter at the same time.
However, a magnitude response curve only conveys half the story. In addition, the phase response of filters must be considered. e phase response (the group delay response) impacts the transient response of filters [19]. Linear phase implies a flat group delay across a given bandwidth [8]. e flat group delay signifies that the filter follows the shape of the signal. In research work, Ref. [19] has presented the group delay lineation method. To justify the group delay response, the comparison of the group delay for band-pass, IIR filter, and optimum reduced-order IIR filters are evaluated. Figure 5 has presented the comparison of the group delay for IIR filter and the reduced-order IIR filter. It is clear that significant reduction is observed in the group delay by proposed optimum reduced-order IIR filter. ere is a nearlinear response. e genuine character of the ECG signal should be preserved better as a result of this. e improvement in the group delay of the filter transfer functions is clearly observed from Table 2. e quantitative performance for Mean delay, Max delay, and Min delay is presented in Table 2. e delay for band-pass filter (BPF), IIR filter, and reduced-order IIR (ROIIR) is presented in the Table 2.
To further graphically present the GD response, the peak-to-peak group delay is plotted in Figure 6. e improvement in the PP-GD values of the group delay responses is clear from Figure 6.

Step Response of Filters.
is section uses filter transfer functions to demonstrate the step response comparison for reduced-order filter design. In this study, this has proposed to optimise the IIR filter, the Min-Max optimization is applied across the coefficients of the IIR filters. e reducedorder IIR filter constructed as the transfer function of a second-order filter with step response is shown in Figure 7 H opt (s) � 3s + 14 41 .
e nonlinear impulse response comparisons of the filters are presented in Figure 8. e ECG signal is analysed using the fitter application in this publication. However, the filter can be applied to a variety of other indicators as well.
It is observed from impulse response comparison form Figure 8 that reduced-order filter has less peak amplitude than 60-order filter. Moreover, we have only two impulses and nonlinear responses.
(1) Significance of Impulse Response. ECG signals are usually of less amplitudes of around 1 or less. us, it has become essential to filter the noise at the front end of ECG signal processing since most of ECG processing is implemented using on board tiny hardware. us, it is good enough to design the reduced-order efficient ECG filters.
us, a reduced-order filter is favoured since it provides a lower number of impulses in the response. Reduced impulses and magnitudes are required for a step reaction. e tabular magnitude comparison of the step response and comparison with validation of the Jain and Rathore 2021 [20] is given in Table 3.
It is clear from Table 3 that our projected ROIIR filter is better suited for the real-time implementation of the filter with less step magnitude. Peak-to-peak magnitudes for step responses for IIR filters are shown in Figure 9.

Stability-Based Analysis.
In this section, the stability requirement for various designed transfer functions (TFs) was investigated. e poles and zeroes are plotted for evaluating the stability of the specified filter responses.

Stability Analysis.
e pole-zero analysis is used to assess the stability of the 60-order filter, IIR filter, and proposed optimum reduced-order IIR filter's designed transfer functions. Figure 10 depicts the filtered signal results and the corresponding pole zero graphs. e results of the noisy and artefact ECG channel CH-101 are compared. e ECG data help with the synthetic random noise, and the results in each row correlate with the IIR and reduced-order filters, respectively. e position of the transfer functions' poles and zeros in the z plane with respect to the unit circle determines the filter's stability. e poles must be on the left side of the z plane for the filter to be stable. Figure 10 shows the pole-zero charts for three alternative filter designs to investigate stability difficulties and consequences. e pole and zero locations are utilised to determine the stability. It is clear from the figure that all three filters have the poles within the unit circle or on the origin. Pan-Tompkins filter has widespread poles and zeros within the unit circle. us, it is a case of not stable filter design.    For the reduced-order IIR filter, all poles and zeros lie in the origin; thus, this is the most stable case of the all. However, the proposed filter has amplitude of two poles that is greater than 1, which could lead to instability if it is not carefully built.

Evaluation Noise Power Spectrum.
e comparison of the noise power spectrum for the 60-order filter and the proposed filter design is given in Figure 11. It can be observed from Figure 11 that our designed optimum reducedorder filter offers less noise spectrum performance. However, there may be scope of improvement further.

Phase Delay Performance.
e phase delay (PD) rather than the group delay (GD) is used to determine the delay performance of a wave of a given frequency w. e phase delay     (PD) and group delay (GD) in nonlinear phase IIR filters are typically not the same because of system's nonlinearity. It is required to design the filter with as close to linearity in order to maintain the shape of the ECG signals as shown in Figure 12.
Ps is the mathematical formula for phase shift, where Ps denotes the degree of phase shift, td denotes the time difference between signals and waves, and p is the wave period.
It is clear from the above figure that the suggested system achieves a nearly linear phase response. In addition, our lower order filter greatly reduces the amount of the phase delay.
e justification of the improvement in the phase delay is evidently pragmatic from the judgement of the PD response for the IIR filter and ROIIR filter. e proposed ROIIR filter provides the almost flat linear phase response and thus offers better true nature of ECG signals as shown in Figure 13. e comparison of the filtered signal for the IIR filter and the reduced-order IIR filter is presented in Figure 14. is graph supports the claim that the proposed filter preserves the true nature of the ECG signal more effectively than the current filter. Phase delay and group delay responses are almost linear with the suggested filter.

Component Utilization Cost Summary for Filters.
In this section, we have presented cost summary for the 60-order filter, the Pan-Tompkins filter, and the optimum reducedorder IIR filter as shown in Figure 15.

12
Journal of Healthcare Engineering e comparison of the adders, multiples, and number of states used in the filter design is presented in tabular form in this section, as shown in Table 4.
It has been demonstrated that using a reduced-order filter design can significantly reduce implementation costs, allowing it to be used in on-chip applications for low latency and real-time systems. e main reason of shifting from the Pan-Tompkins filter to reduced-order filter is to make it stable and low cost.
(1) Cost Justification. e cost of implementation does not mean to only financial aspects, but it incorporates a number of components as adders, multipliers, and delay elements required to design the filters. Yadav et al. [24] have presented the performance evaluations of the cost implementation of different filters. eir best performance is found with elliptical filter, and the performance comparison is shown in Table 5 for the proposed IIR filter.
It can be concluded from Table 5 that proposed ROIIR filter minimized the cost of the implementation significantly.

Conclusion
is manuscript has presented the strategy results of concentrated optimum-order filter design projected at the frontend processing of the ECG signals. e first validated the filter design by Kumari and Singh [25] who have designed the two-stage IIR filter for the speech signal demising for digital hearing ads. In the current research, the similar twostage modified IIR filter is used in context to ECG signal filtering.
en, the results of the 60-order FIR sieve are validated for the ECG peak recognition followed by the validation of the Pan-Tompkins filter for peak detection. e prime goal of the research is to design the filter with the simple and cost-effective manner; nevertheless, it must retain the true ECG nature. In order to justify the effectiveness of the designed filter, the transfer functions are evaluated for the step response and stability analysis. e pole-zero analysis is used to assess the stability of three different filters used for ECG peak detections. It is found that proposed reduced-order filter is stable and has less impulse response magnitudes. e phase responses of the group delay of the 60-order FIR filter, the Pan-Tompkins filter, and the proposed reduced-order IIR filter are compared. It is clear from results that peak-topeak delay and phase are minimized using the proposed IIR filter design.
Overall, it is concluded that the proposed reduced-order filter is capable of efficiently preprocess the ECG signal and used for the ECG artefact detection.

Data Availability
e data underlying this article are derived from online sources in the public domain as PhysioNet. e heart rates (ECG) are measured over 3 R-R intervals in beats per minute and available at https://physionet.org/physiobank/database/ html/mitdbdir/records.htm.

Conflicts of Interest
e authors declare no conflicts of interest.