## 2 Digital IIR Notch Filter Specification  
The magnitude response of ideal IIR filter can be written as:  
\[\left|H(e^{j\omega})\right|=\left\{\begin{array}{ll}0&\text{for }\omega= \omega_{0}\\ 1&\text{otherwise},\end{array}\right., \tag{1}\]  
where \(\omega=\frac{2\pi f}{f_{s}}\) is the normalized frequency, \(f_{s}\) is the sampling frequency, and \(\omega_{0}\) is the notch frequency. The notch effect of the IIR filter can be obtained by placing a pair of complex conjugate zeros at \(e^{\pm j\omega_{0}}\). The frequency response in the passband is close to unity by placing a pair of conjugate poles at \(re^{\pm j\omega_{0}}\). The value of \(r\) must be positive and less than unity. The transfer function of the second order IIR notch filter can be written as:  
\[H_{0}(z)=K_{0}\frac{(z-e^{j\omega_{0}})(z-e^{-j\omega_{0}})}{(z-re^{j\omega_{0 }})(z-re^{-j\omega_{0}})}, \tag{2}\]  
where \(K_{0}\) is the gain factor of the filter, \(\omega_{0}=\frac{2\pi f_{0}}{f_{s}}\), \(f_{0}\) is the frequency that has to be removed from a signal, and \(r\) is the radius of a pair of complex conjugate poles placed at the angle \(\omega_{0}\), the same angle as the zeros of the designed filter. In this design, the bandwidth \(\overline{BW}\) of the filter can be controlled through the value of \(r\), being narrower as the pole radius goes closer to the unit circle. The Equation (2) can be rewritten in the following form:  
\[H_{0}(z)=K_{0}\frac{1-2\cos\omega_{0}z^{-1}+z^{-2}}{1-2r\cos\omega_{0}z^{-1}+ r^{2}z^{-2}}. \tag{3}\]  
The bandwidth of the obtained notch filter can be calculated using following equation:  
\[\overline{BW}=\left(\frac{1-r}{\pi}\right)f_{s}. \tag{4}\]  
To improve the selectivity of the presented filter structure, the pole radius \(r\) needs to be as close to unity as possible. On the other hand, the settling time of the filter depends on the bandwidth as presented in [13]. The settling time considered in this paper should be interpreted as the time it takes for \(y(n)-y_{t}\) to fall below 2% of its peak value, where \(y(n)\) is the filter response at time \(n\) and \(y_{f}\) is the filter steady-state response. The dependence of the transient duration on the pole radius \(r\) is given by the following equation:  
\[y(n)=\text{A}\delta(n)+2\left|\text{B}\right|r^{n}\cos\left(n\omega_{0}+\phi \right)+\overline{s}(n), \tag{5}\]  
where \(n\) is the time index, A and B are constants, \(\delta(n)\) is the Kronecker delta, and \(\phi\) is the resultant phase. The first and the second term of Equation (5) correspond to the transient response [13]. Due to the Kronecker delta \(\delta(n)\), the first term only affects the first sample of the output signal. When the pole radius is closer to unity the component \(r^{n}\) in the second term of Equation (5) causes a longer settling time, and therefore a longer transient response. The last term of Equation (5) contains only the filtered useful signal. As one can see, the value of the pole radius \(r\) of the considered second order IIR notch filter controls the duration of the settling time and thus the duration of the transient state. In Table 1 settling times and rejection bandwidths of the second order IIR notch filter with \(f_{0}=50\) Hz and \(f_{s}=500\) Hz are presented. Both parameters are calculated for various values of the pole radius. As one can see, the closer the pole radius approaches the unit circle, the higher the selectivity of the filter, and the longer the settling time of the output signal.