Next Article in Journal
Box-Type Solar Cookers: An Overview of Technological Advancement, Energy, Environmental, and Economic Benefits
Previous Article in Journal
Retracement Ground Pressure Appearance and Control of the Working Face under the Overlying Residual Pillar: A Case Study
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Determination of Non-Zero Initial Conditions for IIR Notch Filters Using the Vector Projection Method with Minimum Delay

by
Sławomir Kocoń
*,† and
Jacek Piskorowski
Faculty of Electrical Engineering, West Pomeranian University of Technology, 70-310 Szczecin, Poland
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Energies 2023, 16(4), 1702; https://doi.org/10.3390/en16041702
Submission received: 26 November 2022 / Revised: 19 January 2023 / Accepted: 2 February 2023 / Published: 8 February 2023
(This article belongs to the Section F: Electrical Engineering)

Abstract

:

Featured Application

Portable energy-efficient measuring devices requiring a distortion-free signal as soon as possible after activation or awakening from a sleep/power-saving state.

Abstract

In this paper, two approaches to determining the non-zero initial conditions for the difference equation of notch filters are proposed and analyzed. The vector of non-zero initial conditions is determined to reduce the transient of the considered IIR notch filters. Both presented approaches are based on the vector projection method. The first method is based on the iterative determination of the vectors of initial conditions using samples available at a given moment. The main goal of the second approach is to reduce the computational cost compared to the first method with a slight deterioration in the quality of filtration. In order to demonstrate the suitability of the proposed methods, they have been used in simulation studies of power line interference filtering from disturbed ECG signals. The use of the proposed methods allowed for a significant reduction of the transient in the filter response with a shorter delay than in the classical vector projection method.

1. Introduction

The presence of a transient in the filter response is a usual side effect that occurs in finite impulse response (FIR) filters as well as in infinite impulse response (IIR) filters. This effect, undesirable in many applications, is a result of discontinuities in the input signal and its derivatives. In particular, such discontinuities arise between the initial conditions of the filter, which mostly have values equal to zero, and the initial sample of the input signal. The occurrence of a transient disturbs the initial portion of the information carried by the processed signal. This is particularly important when the signal being processed consists of a small number of samples.
Notch filters are used to remove specific frequency components from the total frequency spectrum of input signals. These filters are characterized by a narrow stop band. As the selectivity increases, i.e., as the stop band narrows, the transient duration increases. When processing the signals with finite sample lengths, the transient can disrupt all the information carried by the signal. In the case of real-time signal processing, this effect can result in the inability to obtain a valid, interference-free useful signal. Achieving a distortion-free signal as fast as possible is one of the challenges in the field of digital signal processing in modern measurement systems. There are several methods of limiting the transient effect in the filter response. Dewald, et al. in [1] propose a signal-shifting algorithm that iteratively determines the internal state of the filter to minimize the transient response. Al-Ahmand and Ahmed in [2] demonstrate the method of loading the internal filter memory with steady-state values. Jeedella, et al. in [3] used equivalent FIR filters to minimize the mean squared error between the steady-state frequency response and the transient frequency response of the IIR filter. Amini and Tazehkand in [4] propose changing the gain of the filter to suppress its transients. Zettenberg and Zhang in [5] present continuous state vector changes in an adaptive filter for transient reduction. Chornoboy in [6] proposes to determine the state vector of the filter from a few recorded samples of the signal in order to remove the transient response. Pei and Tseng in [7] propose the calculation of non-zero initial conditions using the vector projection method. The proposed methods require the recording of several signal samples, accessibility to the quadrature and in-phase channels, or changing the frequency characteristics of the filter, which, in the case of notch filters, are mostly used to remove specific frequencies, is unacceptable.
In previous works, the authors proposed some methods for the reduction of the transient response of notch filters. First of all, we proposed a method based on the temporary variability of filter parameters [8], approaches based on the use of classical vector projection method for various filtering structures [9,10,11,12], and methods that integrate the temporary variability of filter parameters and non-zero initial conditions for the filter [13,14]. The aim of this paper was the proposal of an extension of the method for the determination of non-zero initial conditions for the differential equations of narrow-band notch filters. The presented method reduces the time needed to determine the values of the aforementioned non-zero initial conditions. This is achieved by iteratively determining the values of the initial conditions along with subsequent samples of the processed signal. The methods presented in this paper make it possible to obtain a distortion-free signal faster than the use of classical methods for the determination of the value of non-zero initial conditions.
This paper is organized as follows. Section 2 presents the classical vector projection method and proposed improvements, modifications, and extensions. The first modification minimizes the delay in the output signal of the filter. The second extension reduces the computational complexity of the first modification. Section 3 presents the results of simulation tests of removing power line interference from the ECG signal. The ECG signal was chosen as a test signal due to the possibility of visual assessment of the filtration quality. Moreover, quality indicators were determined to quantitatively assess the filtering quality of the test signal. Section 4 contains a discussion of the simulation results. Section 5 provides a summary of the proposed methods.

2. Materials and Methods

One of the important effects that occurs in all dynamic systems is the presence of a transient in the input signal. In digital systems, the transient is a result of the zero initial conditions of the system. This means the system has no information about its past state. Thus, the system response in its first samples does not contain all the necessary components that are needed for the calculation of the filter output. This paper presents two methods for determining the vector of non-zero initial conditions for IIR notch filters. Both presented methods reduce the delay required to determine the vector of non-zero initial conditions in the filtering process. The proposed approaches are based on the vector projection method proposed in [7,15]. One of the most serious drawbacks of the vector projection method used to determine the vector of non-zero initial conditions is the need to register several samples of the processed signal. The improved methods presented in the paper allow the vector of non-zero initial conditions to be determined using a reduced number of samples. This is possible by updating the vector of non-zero initial conditions for each sample (in a specified period), according to the algorithms outlined below.

2.1. Classical Vector Projection Method

The vector projection method used to determine the values of non-zero initial conditions for IIR filters was presented in [7,15]. In order to determine the values of non-zero initial conditions for the filter, several signal samples must be multiplied by the determined projection matrix, presented as follows. In the paper, we assume that the input signal x ( n ) is the sum of the useful signal s ( n ) and the sinusoidal distortion d ( n ) with frequency ω 0 , as in the following equation:
x ( n ) = s ( n ) + d ( n ) .
The term d ( n ) can be written as:
d ( n ) = A 0 sin ( ω 0 n + ϕ ) ,
where A 0 is the amplitude of the distorting signal, ω 0 is its frequency, and ϕ is the phase shift. In order to determine the values of non-zero initial conditions using the vector projection method, L samples of the signal x ( n ) must be stored in the vector form:
X = x ( 0 ) x ( 1 ) x ( 2 ) x ( L 1 ) . .
Using Equation (1), vector X can be rewritten as:
X = S + D ,
where vectors S and D have the following forms:
S = s ( 0 ) s ( 1 ) s ( 2 ) s ( L 1 ) ,
D = A 0 sin ( ϕ ) A 0 sin ( ω 0 + ϕ ) A 0 sin ( 2 ω 0 + ϕ ) A 0 sin [ ( L 1 ) ω 0 + ϕ ] . .
Using some trigonometric identities, Equation (2) can be written as follows:
d ( n ) = A 0 [ cos ( ϕ ) sin ( ω 0 n ) + sin ( ϕ ) cos ( ω 0 n ) ] .
Using the properties of linear algebra, one can create a matrix A in which the vector D is in the column space of matrix A for any phase ϕ .
A = 0 1 sin ( ω 0 ) cos ( ω 0 ) sin ( 2 ω 0 ) 2 cos ( ω 0 ) sin [ ( L 1 ) ω 0 ] cos [ ( L 1 ) ω 0 ] . .
Therefore, a decomposition of the vector X into a vector S containing samples of the useful signal as well as a vector D containing samples of the sinusoidal disturbance can be calculated using the projection operator P . The projection operator is defined as:
P = A ( A T A ) 1 A T ,
where the superscript T stands for the transposition of a matrix. The approximation of the useful signal vector S ^ can be made in the following form:
S ^ = ( I P ) X ,
where I is the identity matrix. The calculated vector S ^ can be used in the filtering process as a vector of non-zero initial conditions of the difference equation of the considered filter. The methodologies used in works [9,10,11,12,13,14] do not eliminate the problem of the delay which is the result of recording L samples of the signal x ( n ) . Figure 1 presents an example of the filter response determined with the use of the non-zero initial conditions calculated using the classical vector projection method. In the example, the filter removes interference from the ECG signal originating from the power line. In order to compare the filtering quality, calculations of the filtering quality indicators were carried out. The following indices were used:
  • Mean Squared Error (MSE) between the filter output y ( n ) and clean signal s ( n ) :
    MSE = 1 N i = 1 N y ( n ) s ( n ) 2 ;
  • Cross-correlation coefficient ρ , between the original undistorted signal and the filter response:
    ρ = i = n 0 + 1 n 0 + K ( y ( i ) · s ( i ) ) i = n 0 + 1 n 0 + N y ( i ) 2 · i = n 0 + 1 n 0 + N s ( i ) 2 .
Figure 2 presents the influence of increasing the length L of vector X on the quality of the filtering, taking into account the delay that results from the collection of L samples of the processed signal.

2.2. Improvements and Modifications of the Vector Projection Method

The classical vector projection method used to determine non-zero initial conditions for a filter requires L samples of the input signal x ( n ) . As a result, a delay is generated in the initial phase of filtration, as presented in Figure 1. In order to reduce the delay introduced by storing L samples in memory, two modifications are proposed. The first modification is related to the iterative determination of a new vector of non-zero initial conditions of the filter as a new sample of the processed signal appears. The second proposed modification is related to determining the values of the initial conditions vector within a specified sliding time window. The proposed approaches allow for reducing the delay in filter response while ensuring the quality of filtration.

2.2.1. Iterative Determination of Non-Zero Initial Conditions

In order to determine the values of non-zero initial conditions for the filter, it is necessary to create a matrix A of dimensions Lx2. The sub-matrices A i of matrix A have the following forms:
A 1 = 0 1 sin ( ω 0 ) cos ( ω 0 ) , A 2 = 0 1 sin ( ω 0 ) cos ( ω 0 ) sin ( 2 ω 0 ) cos ( 2 ω 0 ) , , A L 1 = 0 1 sin ( ω 0 ) cos ( ω 0 ) sin ( 2 ω 0 ) 2 cos ( ω 0 ) sin [ ( L 2 ) ω 0 ] cos [ ( L 2 ) ω 0 ] . .
The projection operators have to be determined as follows:
P 1 = A 1 ( A 1 T A 1 ) 1 A 1 T ,
P 2 = A 2 ( A 2 T A 2 ) 1 A 2 T ,
P L 1 = A L 1 ( A L 1 T A L 1 ) 1 A L 1 T ,
P L = A ( A T A ) 1 A T .
The vectors containing the non-zero initial conditions for each time step of the filtering process are then determined using the following equations:
S ^ 1 = ( I P 1 ) [ x ( 0 ) , x ( 1 ) ] T = [ s ^ 1 ( 0 ) , s ^ 1 ( 1 ) ] ,
S ^ 2 = ( I P 2 ) [ x ( 0 ) , x ( 1 ) , x ( 2 ) ] T = [ s ^ 2 ( 0 ) , s ^ 2 ( 1 ) , s ^ 2 ( 2 ) ] ,
S ^ L 1 = ( I P L 1 ) [ x ( 0 ) , x ( 1 ) , x ( 2 ) , , x ( L 2 ) ] T = [ s ^ L 1 ( 0 ) , s ^ L 1 ( 1 ) , s ^ L 1 ( 2 ) , , s ^ L 1 ( L 2 ) ] ,
S ^ L = ( I P L ) [ x ( 0 ) , x ( 1 ) , x ( 2 ) , , x ( L 1 ) ] T = [ s ^ L ( 0 ) , s ^ L ( 1 ) , s ^ L ( 2 ) , , s ^ L ( L 1 ) ] .
The determined vectors S 1 , S 2 , , S L of non-zero initial conditions can be used in the filtering process as initial conditions for the difference equation of the filter. The knowledge of only two samples of the processed signal is sufficient to determine the first vector of non-zero initial conditions S ^ 1 . Thus, compared to the classical method presented in [9,10,11,12,13,14], the delay between the processed signal and the filter response is only two samples. This allows the filtering process to start as quickly as possible. Therefore, the modified vector projection method is suitable for real-time processing, where the delay between the excitation and the object response should be as short as possible. Based on the above description, the proposed algorithm for obtaining the values of non-zero initial conditions is as follows:
Step 1
select the value of L - how many initial samples of the filter response will be determined using non-zero initial conditions, select ω 0 frequency which should be removed from the processed signal;
Step 2
on the basis of ω 0 and L determine the matrix A of dimension Lx2 using Equation (8);
Step 3
determine the set of the vector projection operators P 1 , , P L using Equations (13) and (14);
Step 4
store the first two samples of the input signal x ( n ) in vector X = [ x ( 0 ) , x ( 1 ) ] ;
Step 5
determine the first non-zero initial condition vector S ^ 1 using Equation (15);
Step 6
determine the first sample of the filter response y ( 0 ) using the vector of non-zero initial conditions S ^ 1 for the calculation;
Step 7
add the latest sample x ( 2 ) to the vector, X = [ x ( 0 ) , x ( 1 ) , x ( 2 ) ]
Step 8
determine a new vector of non-zero initial conditions S ^ i using the projection operator P i , and then calculate the next sample of the filter response y ( i ) ;
Step 9
store the next sample of the processed signal x ( n ) in the vector X
Step 10
repeat steps 8 and 9 until i = L is reached;
Step 11
subsequent values of y ( i ) are calculated as in the filter with zero initial conditions.

2.2.2. Determination of the Initial Conditions within a Time Window

The second proposed modification is based on the determination of the non-zero initial conditions vector using the matrix A with the smallest possible dimensions. In order to determine the projection operator P , the matrix A must be inverted and multiplied by its transpose according to the Equation (9). The computational complexity of determining the projection operator is O ( m 2 ) [16]. The computational complexity of the matrix multiplication is equal to O ( m 3 ) (m is the number of elements of the non-zero initial conditions vector S ^ = [ s ^ ( 0 ) , , s ^ ( m 1 ) ] ). It should be emphasized that, in the proposed method, it is sufficient to define the projection operator P k once. In the same manner, we define the matrix A k once. The dimensions of the projection operator P k and the matrix A k are smaller if compared to the previously presented methods for determining non-zero initial conditions because the assumed value of k is smaller than the value of L. Thus, the use of the second proposed approach results in a smaller delay at the start of the filtering process.
In the second proposed method, a new vector of non-zero initial conditions is calculated for each sample n from 0 to L. In order to calculate the vector S ^ according to Equation (5), we can use the sliding window X m = [ x ( n ) , x ( n + 1 ) , , x ( n + k 1 ) ] instead of the vector X .
A k = 0 1 sin ( ω 0 ) cos ( ω 0 ) sin ( 2 ω 0 ) 2 cos ( ω 0 ) sin [ ( k 1 ) ω 0 ] cos [ ( k 1 ) ω 0 ] ,
P k = A k ( A k T A k ) 1 A k T .
The determined values of the non-zero initial conditions for each value of n can be written in the following form:
S ^ n = ( I P k ) [ x ( n ) , x ( n + 1 ) , , x ( n + k 1 ) ] T = [ s ^ n ( 0 ) , s ^ n ( 1 ) , , s ^ n ( k 1 ) ] .
Based on the above description, the proposed algorithm for obtaining the values of non-zero initial conditions is as follows:
Step 1
select the value of L (how many initial samples of the filter response will be determined using non-zero initial conditions), the value of k (the length of the time window), and the frequency ω 0 (which will be removed from the processed signal);
Step 2
on the basis of ω 0 and the value of k, build the matrix A k of dimension k x 2 using Equation (16);
Step 3
determine the vector projection operator P k of dimension k x k using Equation (17);
Step 4
store the first k samples of the input signal x ( n ) in vector x w = [ x ( 0 ) , x ( 1 ) , , x ( k 1 ) ] ;
Step 5
determine the non-zero initial condition vector S ^ 0 using Equation (18);
Step 6
determine the first sample of the filter response y ( 0 ) using the vector of non-zero initial conditions S ^ 0 for the calculation;
Step 7
remove the oldest sample x ( 0 ) from the vector x w and store the newest sample x ( k ) in this vector, x w = [ x ( 1 ) , x ( 2 ) , , x ( k ) ]
Step 8
determine a new vector of non-zero initial conditions S ^ i and, based on this, calculate the next sample of the filter response y ( i ) ;
Step 9
remove the oldest sample of signal x ( n ) from the vector x w and store the latest one;
Step 10
repeat steps 8 and 9 until i = L is reached;
Step 11
subsequent values of y ( i ) are calculated as in the filter with zero initial conditions.

2.3. Selection of the Values of L and k

In order to select the parameter L for the first presented approach, a trade-off between the values of the filter quality indices and the number of calculations required to determine this vector must be considered. As the value of L increases, the size of the matrix A also increases. Therefore, the number of calculations to compute the projection operator P is greater with an increase in k. The number of multiplications and inversions of the matrix A necessary to determine the vector of non-zero initial conditions depends on the value of L, and can be presented by the following equation:
N = 1 2 ( L 2 L ) ,
where N is the number of calls of Equation (9) in the manner given in Equations (14). The MSE between the filter response signal and the interference-free ECG signal is shown in Figure 3.
In the first proposed method, the benefit of delaying the filter response by only two samples comes at a cost of a significant increase in the number of required calculations. In order to reduce the complexity of these calculations, a second approach is proposed. In this approach, the matrix A has a constant dimension of k x 2 and the projection operator P has a dimension of k x k , as presented in Equations (16) and (17). To select the value of the factor k that determines the size of the matrix A , and also the delay in the start of the filtering process, the following method is proposed. The MSE between the filter response and the noise-free signal is determined using a simulation process including the delay at the start of the filtering process. In addition, the cross-correlation coefficient ρ is determined according to Equation (12). When calculating the ρ coefficient, the delay arising from the need to record k samples of the signal before filtering is not taken into account. The ρ coefficient describes how similar the filter response is to the signal without interference. In order to select a value for k, one should choose one that provides a filter response shape that is most similar to the signal without interference, while ensuring the least delay to the start of the filtering process. Figure 4 presents the MSE and ρ indices when L = 100 and k varies from 2 to 50.
By applying the methods presented in the paper, it is possible to determine a vector of non-zero initial conditions for the difference equation of the filter while ensuring the least possible delay at the start of the filtration process. The first method presented in this paper requires an increase in computational effort, while the second proposed method slightly deteriorates the values of the filtration quality indicators.

3. Results

In this section, simulation results of removing the 50 Hz power line interference from the ECG signal are presented. The transient response of the used notch filter will be reduced using the proposed methods of determining non-zero initial conditions. In order to present the filtering effects, the quality indices have been determined according to Equations (11) and (12). The presented methods were compared with the classical vector projection method. The comparison takes into account the delay required to register the first samples of the processed signal.

3.1. Filter Structure

In order to demonstrate the possibility of suppressing the transient response using non-zero initial conditions, the following notch filtering structure was used:
H ( z ) = 0.5 ( 1 + a 2 ) 2 a 1 z 1 + ( 1 + a 2 ) z 2 1 a 1 z 1 + a 2 z 2 ,
where a 1 and a 2 stands for:
a 1 = 2 cos ( ω 0 ) 1 + tan Ω 2 ,
a 2 = 1 tan Ω 2 1 + tan Ω 2 .
In the above equations, ω 0 is the frequency that the filter is supposed to remove from the frequency spectrum of the processed signal, and Ω is the width of the 3-dB stopband of the filter. The difference equation of the considered filter can be written in the following form:
y ( n ) = 0.5 [ ( 1 + a 2 ) x ( n ) 2 a 1 x ( n 1 ) + ( 1 + a 2 ) x ( n 2 ) + a 1 y ( n 1 ) a 2 y ( n 2 ) ] ,
where y ( n ) is the filter response and x ( n ) is the processed signal. As can be seen, the filter response y ( n ) depends not only on the current and previous samples of the processed signal x ( n ) , x ( n 1 ) , x ( n 2 ) but also on the previous samples of the filter response y ( n 1 ) , y ( n 2 ) . Assuming zero initial conditions for the difference equation of the filter, the first three samples of the filter response y ( n ) are determined according to the following equations:
y ( 0 ) = 0.5 [ ( 1 + a 2 ) x ( 0 ) ] ,
y ( 1 ) = 0.5 [ ( 1 + a 2 ) x ( 1 ) 2 a 1 x ( 0 ) + a 1 y ( 0 ) ] ,
y ( 2 ) = 0.5 [ ( 1 + a 2 ) x ( 2 ) 2 a 1 x ( 1 ) + ( 1 + a 2 ) x ( 0 ) + a 1 y ( 1 ) a 2 y ( 0 ) ] .
The first L samples of the filter response y ( n ) for the first proposed method can be written in the following form:
y ( 0 ) = 0.5 [ ( 1 + a 2 ) x ( 0 ) + a 1 s ^ 1 ( 1 ) a 2 s ^ 1 ( 0 ) ] ,
y ( 1 ) = 0.5 [ ( 1 + a 2 ) x ( 1 ) 2 a 1 x ( 0 ) + + a 1 s ^ 2 ( 1 ) a 2 s ^ 2 ( 0 ) ] ,
y ( 2 ) = 0.5 [ ( 1 + a 2 ) x ( 3 ) 2 a 1 x ( 2 ) + ( 1 + a 2 ) x ( 1 ) + a 1 s ^ 3 ( 2 ) a 2 s ^ 3 ( 1 ) ] ,
y ( L ) = 0.5 [ ( 1 + a 2 ) x ( L ) 2 a 1 x ( L 1 ) + ( 1 + a 2 ) x ( L 2 ) + a 1 s ^ L ( L 1 ) a 2 s ^ L ( L 2 ) ] ,
y ( L + 1 ) = 0.5 [ ( 1 + a 2 ) x ( L + 1 ) 2 a 1 x ( L ) + ( 1 + a 2 ) x ( L 1 ) + a 1 y ( L ) a 2 y ( L 1 ) .
The first L samples of the filter response y ( n ) for the second proposed method can be written as follows:
y ( n ) = 0.5 [ ( 1 + a 2 ) x ( n 1 ) 2 a 1 x ( n 2 ) + ( 1 + a 2 ) x ( n 3 ) + a 1 s ^ n ( k 1 ) a 2 s ^ n ( k 2 ) .
In the first method, to determine each sample y ( n ) of the filter response, a vector S ^ i must be calculated using all known samples x ( n ) . In the second method, only k samples of the signal x ( n ) are used when calculating the vector of non-zero initial conditions. As a result, many fewer calculations are performed.

3.2. Removal of the Power Line Interference from ECG Signals

The ECG signal was assumed to be perturbed by a 50 Hz sinusoidal waveform. This interference comes from the power line. The interference has to be removed in such a way that no other frequency components of the ECG frequency spectrum of the signal are removed. The frequency spectrum of the ECG signal ranges from 0.5 to 100 Hz. Therefore, the 50 Hz power line interference lies within the spectrum of this signal. In order to remove such interference, narrowband notch filters are usually used. The use of a narrow bandstop filter results in a significant transient in the filter response. The methods proposed in this paper have been used to reduce the impact of the transient response on the filter output. The proposed methods were compared with the classical vector projection method of determining non-zero initial conditions for the filter. The delay caused by the recording of the processed signal samples for the non-zero initial conditions vector projection was taken into account in the calculation of the quality indicators. The mean squared error, described by Equation (11), between the filter response and the signal without interference, and the correlation coefficient, described by Equation (12), between the filter response and the signal without interference, were used as indicators of the quality of the filtering. Table 1 contains the mentioned filtering quality indices for the simulation example, for which the following parameters were assumed: L = 100 , k = 5 , ω 0 = 2 π 50 250 , Ω = 2 π 1 250 .
Figure 5 presents the results of filtering the ECG signal using the notch filter with non-zero initial conditions determined with the aid of the methods proposed in the paper and the method from Ref. [15]. For a comparison, a distortion-free ECG signal is also depicted.

3.3. Simulation Results

This section presents the results of simulation studies. The values of the filtration quality indices for the case of the filter with zero initial conditions and the filter with non-zero initial conditions are presented. The values of non-zero initial conditions for the considered notch filter are determined in three manners—according to [15] and using two proposed methods that allow reducing the start delay of the filtering process. The simulations were carried out for two ECG signals which were perturbed by the 50 Hz sinusoidal signal originating from the power line. The simulations were carried out using Matlab software. The ECG signals were obtained from the MIT-BIH Arrhythmia Database [17]. The filtering structure used in the simulation experiments had the following parameters: ω 0 = 0.8727 , Ω = 0.0175 , L = 50 , k = 7 . The value of ω 0 results from the disturbance frequency f 0 = 50 Hz and the sampling frequency f s = 360 Hz. The value of Ω follows from the assumed bandwidth B W = 1 Hz. The values of L and k were determined using the method presented in Section 2.3.
Figure 6 and Figure 7 depict the 50 Hz disturbed ECG signals and the interference-free signals. Figure 8 and Figure 9 present the simulation results of removing the 50 Hz interference from the E C G 1 and E C G 2 signals. Table 2 presents the values of the filtering quality indicators. These results were obtained using the considered notch filter with zero initial conditions and non-zero initial conditions. The vectors of non-zero initial conditions were determined in three manners: using the method presented in [15], and using the two approaches proposed in this paper. The filtering quality indices were calculated for the test signals E C G 1 and E C G 2 perturbed by the 50 Hz sinusoidal waveform.
As one can observe, the two proposed approaches for determining non-zero initial conditions allow the obtaining of the filter response much faster than in the case of the classical vector projection method. The determined filtering quality indices for the first approach of determining the vector of non-zero initial conditions are much better than in the case of the classical method. Although the second proposed method has worse values of the filter quality indices, the output signal is obtained faster and the computational cost is lower.

4. Discussion

The methods presented in this paper allow the determination of the vector of non-zero initial conditions for the difference equation of the notch filter. The knowledge of the values of non-zero initial conditions enables the suppression of the filter transient response. These proposed methods are significant modifications of the classical vector projection method proposed in [7,15]. The methods proposed in this paper allow the vector of non-zero initial conditions to be determined with the minimum possible delay. In the first proposed method, only two samples need to be recorded to determine the first vector of non-zero initial conditions. It can be seen that the delay at the start of the filtering process is only two samples as opposed to the classical vector projection method, for which the filtering start delay is equal to the length of the vector of non-zero initial conditions denoted by L. The disadvantage of the first presented method is the increase in the number of calculations necessary to determine L sets of vectors of non-zero initial conditions, whose length increases from 2 to L. Therefore, this paper also proposes a second method to reduce computational complexity. In this method, the length of the vectors of non-zero initial conditions is fixed at k < L . In the second presented method, the cost of less computational effort is a deterioration in the filtration quality indicators. The choice of both methods for determining the vector of non-zero initial conditions and its parameters is a compromise between the delay of the filtering process, the computational complexity, and the quality of the filtering in terms of the quality indicators.

5. Conclusions

The methods presented in this paper for determining non-zero initial conditions vectors are characterized by a lower filtering onset delay than the classically used vector projection method. The proposed approaches were used to filter ECG signals disturbed by the power line interference. The first proposed method has the minimum possible delay of two samples. The second proposed method presented has a lower computational effort than the first method and a shorter delay at the start of the filtering process than the classical vector projection method. Simulation results show that both presented methods have a lower delay in the onset of filtering than the classical vector projection method. Furthermore, the simulation studies confirmed the possibility of reducing the transient from the notch filter response with the use of the proposed methods. This paper also presents parameter selection methods for both methods of determining non-zero initial conditions to ensure the best possible values for the filtration quality indices. This allows the filter response to be of high quality, in terms of quality indicators, with the shortest possible delay relative to the input signal.

Author Contributions

Conceptualisation, J.P. and S.K.; methodology, J.P. and S.K.; software, S.K.; validation, J.P. and S.K.; formal analysis, J.P.; investigation, S.K.; resources, S.K.; data curation, S.K.; writing—original draft preparation, S.K.; writing—review and editing, J.P.; visualisation, S.K.; supervision, J.P. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
ECGelectrocardiogram
IIRinfinite impulse response
FIRfinite impulse response
MSEmean square error

References

  1. Dewald, K.; Bersier, A.; Gardella, P.J.; Jacoby, D. IIR filter transient suppression by signal shifting. In Proceedings of the 2014 IEEE Biennial Congress of Argentina (ARGENCON), Bariloche, Argentina, 11–13 June 2014; pp. 153–158. [Google Scholar] [CrossRef]
  2. Al-Ahmad, H.; Ahmed, K. A novel technique for initializing digital IIR filters with a finite number of samples at a single frequency. IEEE Trans. Circuits Syst. II Analog. Digit. Signal Process. 1997, 44, 417–420. [Google Scholar] [CrossRef]
  3. Jeedella, J.; Al Ahamad, H.; Al-Mualla, M.; Noras, J.M. Design and analysis of transient IIR filters with multiple frequency initialization using equivalent FIR filters. In Proceedings of the 2007 9th International Symposium on Signal Processing and Its Applications, Sharjah, United Arab Emirates, 12–15 February 2007; pp. 1–4. [Google Scholar] [CrossRef]
  4. Amini, S.; Mozaffari Tazehkand, B. Design of feedback-structured IIR notch filter with transient suppression using gain variation. Biomed. Signal Process. Control. 2022, 71, 103075. [Google Scholar] [CrossRef]
  5. Zetterberg, L.H.; Zhang, Q. Elimination of transients in adaptive filters with application to speech coding. Signal Process. 1988, 15, 419–428. [Google Scholar] [CrossRef]
  6. Chornoboy, E. Initialization for improved IIR filter performance. IEEE Trans. Signal Process. 1992, 40, 543–550. [Google Scholar] [CrossRef]
  7. Pei, S.C.; Tseng, C.C. Elimination of AC interference in electrocardiogram using IIR notch filter with transient suppression. IEEE Trans. Biomed. Eng. 1995, 42, 1128–1132. [Google Scholar] [CrossRef] [PubMed]
  8. Kocoń, S.; Piskorowski, J. Time-Varying IIR Notch Filter with Reduced Transient Response Based on the Bézier Curve Pole Radius Variability. Appl. Sci. 2019, 9, 1309. [Google Scholar] [CrossRef]
  9. Piskorowski, J. Powerline interference removal from ECG signal using notch filter with non-zero initial conditions. In Proceedings of the 2012 IEEE International Symposium on Medical Measurements and Applications Proceedings, Budapest, Hungary, 18–19 May 2012; pp. 1–3. [Google Scholar] [CrossRef]
  10. Kocoń, S.; Piskorowski, J. Digital Finite Impulse Response Notch Filter with Non-Zero Initial Conditions, Based on an Infinite Impulse Response Prototype Filter. Metrol. Meas. Syst. 2012, 19, 767–776. [Google Scholar] [CrossRef] [Green Version]
  11. Kocoń, S.; Piskorowski, J. A concept of time-varying FIR notch filter with non-zero initial conditions based on linear Kalman notch filter prototype. In Proceedings of the 2013 18th International Conference on Methods & Models in Automation & Robotics (MMAR), Miedzyzdroje, Poland, 26–29 August 2013; pp. 34–39. [Google Scholar] [CrossRef]
  12. Kocoń, S.; Piskorowski, J. Implementation of non-zero initial conditions for multi-notch FIR filter using raspberry Pi. In Proceedings of the 2016 21st International Conference on Methods and Models in Automation and Robotics (MMAR), Miedzyzdroje, Poland, 29 August–1 September 2016; pp. 36–41. [Google Scholar] [CrossRef]
  13. Kocoń, S.; Piskorowski, J. Short Transient IIR Multinotch Filter With Time-Varying Parameters and Nonzero Initial Conditions. IEEE Trans. Instrum. Meas. 2021, 70, 6502509. [Google Scholar] [CrossRef]
  14. Kocoń, S.; Piskorowski, J. Power Line Interference Removal From Short-Latency Evoked Potentials Using Digital Time-Efficient Selective Elliptic Notch Filter. IEEE Trans. Instrum. Meas. 2022, 71, 6502009. [Google Scholar] [CrossRef]
  15. Paiss, O. Elimination of exponential interference form finite-length discrete signals. IEEE Trans. Acoust. Speech Signal Process. 1990, 38, 2189–2191. [Google Scholar] [CrossRef]
  16. Zhang, X.; Yu, F.X.; Guo, R.; Kumar, S.; Wang, S.; Chang, S.F. Fast Orthogonal Projection Based on Kronecker Product. In Proceedings of the 2015 IEEE International Conference on Computer Vision (ICCV), Santiago, Chile, 7–13 December 2015; IEEE: Santiago, Chile, 2015; pp. 2929–2937. [Google Scholar] [CrossRef]
  17. Moody, G.; Mark, R. The impact of the MIT-BIH Arrhythmia Database. IEEE Eng. Med. Biol. Mag. 2001, 20, 45–50. [Google Scholar] [CrossRef] [PubMed]
Figure 1. Comparison of the filter responses for different values of L in the classical vector projection method from the article [15].
Figure 1. Comparison of the filter responses for different values of L in the classical vector projection method from the article [15].
Energies 16 01702 g001
Figure 2. The MSE between the filter response and the undistorted signal as a function of the length L of the vector X .
Figure 2. The MSE between the filter response and the undistorted signal as a function of the length L of the vector X .
Energies 16 01702 g002
Figure 3. MSE for the first proposed method used to determine the non-zero initial conditions vector.
Figure 3. MSE for the first proposed method used to determine the non-zero initial conditions vector.
Energies 16 01702 g003
Figure 4. Values of the MSE and ρ when L = 100 and k varies from 2 to 50.
Figure 4. Values of the MSE and ρ when L = 100 and k varies from 2 to 50.
Energies 16 01702 g004
Figure 5. Filtering results of the ECG signal using different methods of determining non-zero initial conditions.
Figure 5. Filtering results of the ECG signal using different methods of determining non-zero initial conditions.
Energies 16 01702 g005
Figure 6. E C G 1 signal disturbed by the power line interference from the power line and the distortion-free signal.
Figure 6. E C G 1 signal disturbed by the power line interference from the power line and the distortion-free signal.
Energies 16 01702 g006
Figure 7. E C G 2 signal disturbed by the power line interference, and the distortion-free signal.
Figure 7. E C G 2 signal disturbed by the power line interference, and the distortion-free signal.
Energies 16 01702 g007
Figure 8. Results of simulation studies for E C G 1 signal. Responses of the notch filter with zero and non-zero initial conditions.
Figure 8. Results of simulation studies for E C G 1 signal. Responses of the notch filter with zero and non-zero initial conditions.
Energies 16 01702 g008
Figure 9. Results of simulation studies for E C G 2 signal. Responses of the notch filter with zero and non-zero initial conditions.
Figure 9. Results of simulation studies for E C G 2 signal. Responses of the notch filter with zero and non-zero initial conditions.
Energies 16 01702 g009
Table 1. Filtration quality indices for the case: L = 100 , k = 5 , Ω 0 = 50 250 , Ω = 2 1 250 .
Table 1. Filtration quality indices for the case: L = 100 , k = 5 , Ω 0 = 50 250 , Ω = 2 1 250 .
Method for Determining Non-Zero Initial ConditionsMSE ρ
First proposed0.02690.9649
Second proposed0.05520.9393
From article [15]0.21610.7011
Table 2. Values of filtration quality indicators acquired during simulation studies.
Table 2. Values of filtration quality indicators acquired during simulation studies.
Filter StructureMSE ρ
Test signal E C G 1
Zero initial conditions,0.00560.9709
Non-zero initial conditions, from article [15], L = 50,0.05110.7912
Non-zero initial conditions, first proposed method, L = 50,0.00340.9815
Non-zero initial conditions, second proposed method, L = 50, k = 7,0.05110.9040
Test signal E C G 2
Zero initial conditions,0.01470.9138
Non-zero initial conditions, from article [15], L = 50,0.13300.1080
Non-zero initial conditions, first proposed method, L = 50,0.00500.9663
Non-zero initial conditions, second proposed method, L = 50, k = 7,0.04100.7254
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Kocoń, S.; Piskorowski, J. Determination of Non-Zero Initial Conditions for IIR Notch Filters Using the Vector Projection Method with Minimum Delay. Energies 2023, 16, 1702. https://doi.org/10.3390/en16041702

AMA Style

Kocoń S, Piskorowski J. Determination of Non-Zero Initial Conditions for IIR Notch Filters Using the Vector Projection Method with Minimum Delay. Energies. 2023; 16(4):1702. https://doi.org/10.3390/en16041702

Chicago/Turabian Style

Kocoń, Sławomir, and Jacek Piskorowski. 2023. "Determination of Non-Zero Initial Conditions for IIR Notch Filters Using the Vector Projection Method with Minimum Delay" Energies 16, no. 4: 1702. https://doi.org/10.3390/en16041702

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop