Iir Filter
Iir Filter
Iir Filter
Abstract— Bioelectric signals are often corrupted by noise. include some significant information, is entirely lost due to
The most common form of noise is power-line interference and transient state of the filter.
its harmonics. A convenient way for eliminating these unwanted In designing the notch filters, there is always a trade-off
components is to use a single or multiple notch filters. One of between transient response duration and the rejection band-
the problems about this approach is the effect of transient re- width of the filter. In other words, a great selectivity at notch
sponse of the filter at the beginning of its output in short time frequency, which requires a very narrow rejection bandwidth
measurements. In this work, three initialization methods, which (high quality factor Q), results in a long transient response.
can be used to reduce/overcome this problem are reviewed and One example where this problem should be addressed is
their performance and computational complexity are evaluated where intermittent measurements of ECG are used for ar-
using ECG as an example signal. These methods are projection rhythmia detection [4]. Another application is ambulatory
initialization, pole radius-varying filtering and vector projec- monitoring of event related potentials (ERP) of electroen-
tion. Additionally, some implementation variations and memory cephalogram (EEG) such as mismatch negativity [5]. In ERP
usage considerations are discussed. Our study shows that, pole monitoring, the relevant measurement time is known and the
radius-varying method is computationally cheap but introduces required recording duration is short, usually less than 1 sec-
longer transient than the others. On the other hand, vector pro- ond. These examples can be extended to a large application
jection provides a more accurate reconstruction of the signal in area in which the measurements are done intermittently, in or-
the transient part of the output but with a more expensive com- der to reduce the power consumption. In these applications,
putation. There are also two drawbacks about vector projection. due to the short length of the recorded signals, the transient
One is its computational complexity dependency to the sampling state of a filter with high quality factor corrupts a large part
frequency of the signal and the other is the fact that it cannot of the information.
provide the results in real-time. Earlier, various approaches for reduction the transient state
of the infinite impulse response (IIR) notch filters have been
Keywords— ECG, initialization, filter, IIR, transient. introduced. However, the error and computational cost of
these approaches have not been discussed and compared. In
this work, three methods for filter coefficient initialization are
I. I NTRODUCTION compared and the results about their performance and com-
putational complexity are presented. These methods are pro-
Electrocardiogram (ECG) signal is the electrical mani- jection initialization, pole radius-varying filtering and vec-
festation of the contractile activity of the heart and can be tor projection. There are some other techniques in literature
recorded easily with surface electrodes. ECG is a well-known which are not considered in this study because they do not
diagnostic tool for the detection of cardiovascular diseases suit notch filters due to following reasons. These methods
and abnormalities. Therefore the quality of the ECG signal is are step initialization [6] [7], single frequency initialization
an important factor which should be taken into consideration [8] and exponential initialization [9]. In step initialization,
in measurement and processing phases of this signal. [1] the memories of the IIR filter are initially loaded with their
Generally, bioelectrical signals can be easily corrupted by steady-state values for a step input and the transient effects
different noise sources due to their low amplitude and fre- due to the DC component in the clutter is eliminated. This is
quency range. The most common form of noise is power-line achieved only if the filter has a steady state zero at DC [8].
interference and its harmonics [2]. Using single or multi- The single frequency initialization method needs two chan-
ple notch filters are the simplest ways for removing this form nels [10], i.e. in-phase and quadrature in radar applications,
of noise from measured signals [3]. Although, when using which makes it inappropriate for conventional noise removal
conventional filtering, beginning of the signals, which might from biomedical signals. Initialization using two or more fre-
quencies discussed in [10] and [11] have the same problem. m1 (n) α0
In exponential initialization, the signal is modeled as a sin-
gle complex exponential with a specific amplitude, frequency m2 (n)
and phase. Using the formulas explained in [9], the frequency α1
and phase of the model are zero for a real signal and the esti- x(n) α2 y(n)
mated waveform would be a DC signal. z−1 z−1
The rest of the paper is organized as follows. In Section −β1
II, initialization techniques and the methods used for their
comparison are explained. The results of the comparisons are −β2
given in Section III. Finally, some concluding remarks are
given in Section IV.
Fig. 1: State-space variable representation of a second-order IIR filter
II. M ETHODS
By comparing Equations (4) and (2), it can be seen that α0 =
A. Traditional IIR Notch Filter α2 = 1, α1 = −2 cos Ω0 , β1 = −2r cos Ω0 and β2 = r2 . The
internal state of the filter is specified by
The input of the filter is considered as the following form
m [n]
x(n) = s(n) + A sin(nΩ0 + φ ), (1) M[n] = 1 , (5)
m2 [n]
where s(n) is a desired signal corrupted by a sinusoidal in- and the state-space description of the filtering equations is
terference signal with angular frequency Ω0 , phase shift φ expressed as
and amplitude A. The transfer function of a second-order IIR
notch filter with pole radius r and notch frequency Ω0 can be M[n] = BM[n − 1] +Cx[n] (6)
written as
and
1 − 2 cos(Ω0 )z−1 + z−2 .
H(z) = (2) y[n] = AT M[n − 1] + α0 x[n], (7)
1 − 2r cos(Ω0 )z−1 + r2 z−2
(see Fig. 1) where
The filter is stable for r < 1. By increasing the radii of the
poles inside the unit circle, the selectivity of the filter im- α1 − α0 β1 −β1 −β2 1
A , B , C (8)
proves but the transient duration also increases. The zeros, α2 − α0 β2 1 0 0
whose angles are equal to notch frequency, are constrained to
lie on the unit circle. Poles are placed at the same radial line With only a finite windowed version of data available, the
as zeros. Equation (2) can be expressed in time domain as state-transient equation can be written as