A Novel Adaptive Algorithm for Sinusoidal Interference Cancellation H. C. So Department of Electronic Engineering, City University of Hong Kong Tat Chee Avenue, Kowloon, Hong Kong August 11, 2005 Indexing terms : adaptive algorithms, power line interference Abstract : A new method is presented for adaptive canceling a sine wave signal with known frequency in a time series. The system is characterized by the phase and amplitude parameters which are updated directly according to an LMS-style algorithm. Convergence behaviors and variances of these parameters are analyzed. It is demonstrated that the proposed method can effectively remove the 50 Hz power line interference in the recording of electrocardiograms (ECG). 1
Introduction : Elimination of sinusoidal interference from an observed signal is of interest in many areas such as communication, control, biomedical engineering and others [1]-[2]. A well known application is to remove power line interference in the processing of the ECG [2]. One of the conventional methods for the interference cancellation is to pass the signal through a digital notch filter characterized by a unit gain at all frequencies except at the sine wave frequency where its gain is zero. When an auxiliary reference input is available containing the interference alone, Widrow et al [3] have proposed an alternative solution which consists of an 90 o phase shifter and a two-weight adaptive filter. By properly adjusting the weights, the reference waveform can be changed in magnitude and phase in any way to model the interfering sinusoid. The filtered output is then subtracted from the corrupted waveform leaving the source signal alone. With the use of this concept of adaptive noise canceling, a new adaptive system which are a function of two variables, viz amplitude and phase, assuming the frequency of the sinusoidal interference is known exactly, is developed. The proposed algorithm, which is computationally efficient, provides explicit amplitude and phase measurements for generating a single pure sinusoid to eliminate the interfering signal. Adaptive Sinusoidal Interference Canceller (ASIC) Algorithm : The problem of sinusoidal interference cancellation is formulated as follows. Given the received signal, r(kt s ), r(kt s ) = s(kt s ) + α cos(ω o kt s + φ) (1) where s(kt s ) is the desired signal, T s is the sampling period, ω o is the known frequency while α and φ represent the unknown amplitude and phase, respectively, of the sinusoidal interference. Without loss of generality, α is assumed to be greater than zero. The aim is to extract s(kt s ) from the corrupted signal r(kt s ) undistortedly. 2
When α and φ are accurately obtained, s(kt s ) can be recovered by subtracting a synthetic sinusoid, which is characterized by the amplitude and phase estimates, from r(kt s ). Using this time-domain cancellation idea, we define an error function, e(kt s ), which is of the form e(kt s ) = r(kt s ) ˆα cos(ω o kt s + ˆφ) (2) where ˆα and ˆφ denote the estimates of α and φ respectively. It is expected that when the mean square value of e(kt s ) is minimized with respect to these two variables, ˆα α and ˆφ φ while e(kt s ) will become identical to s(kt s ). In our proposed ASIC algorithm, the amplitude and phase parameters are adjusted iteratively to minimize the instantaneous square value of e(kt s ). Similar to Widrow s LMS algorithm [4], the ASIC uses stochastic gradient estimates which are obtained by differentiating e 2 (kt s ) with respect to ˆα(kT s ) and ˆφ(kT s ). The parameters are adapted directly and independently according to the following equations ˆα((k + 1)T s ) = ˆα(kT s ) µ α 2 e 2 (kt s ) ˆα(kT s ) = ˆα(kT s ) + µ α e(kt s ) cos(ω o kt s + ˆφ(kT s )) (3) ˆφ((k + 1)T s ) = ˆφ(kT s ) µ φ 2 e 2 (kt s ) ˆφ(kT s ) = ˆφ(kT s ) + µ φ e(kt s ) sin(ω o kt s + ˆφ(kT s )) (4) where µ α and µ φ are positive scalars that control convergence rate and ensure system stability of the algorithm. In order to avoid the sine and cosine operations, a cosine look-up table is constructed. It is a vector M of length L and has the following elements M = [ ( π 1 cos L) ( 2π ) cos L ( (L 1)π ) ] cos (5) L 3
The algorithm is computationally efficient because only five multiplications, three additions and two look-up operations are required for each sampling interval. Taking the expected value of (4), we have E{ ˆφ((k + 1)T s )} = E{ ˆφ(kT s )} µ φ E{(s(kT s ) + α cos(ω o kt s + φ) ˆα(kT s ) cos(ω o kt s + ˆφ(kT s ))) sin(ω o kt s + ˆφ(kT s )))} E{ ˆφ(kT s )} µ φ α( ˆφ(kT s ) φ) = φ + ( ˆφ(0) φ)(1 µ φ α/2) k+1 (6) provided that 4/α > µ φ > 0. It is seen that the phase parameter will converge to φ with a time constant of 2/(µ φ α). Using (3) and assuming that ˆφ(kT s ) has reached φ, the learning behavior of ˆα(kT s ) can be shown to be E{ˆα((k + 1)T s )} = α + (ˆα(0) α)(1 µ α /2) k+1 (7) provided that 4/α > µ φ > 0. As k, ˆα(kT s ) α. Therefore, the convergence of the ASIC algorithm is proved. Assuming that s(kt s ) is a stationary process, the variances of ˆα(kT s ) and ˆφ(kT s ), var(α) and var(φ) respectively, are calculated as and var(α) µ αr ss (0) 2 var(φ) µ φr ss (0) 2α (8) (9) where R ss (τ) denotes the autocorrelation function of s(kt s ) at time τ. Results & Discussions : Simulation tests were carried out to verify the performance of the ASIC algorithm for eliminating sinusoidal interference. The sampling interval T s was 1.25 10 3 second and ω o was fixed to 100π radian/second. The initial values of the amplitude and phase estimates were arbitrarily set to unity and zero respectively while 4
α = 35.0 and φ = 1.0. The length of the cosine vector was 1000 and this had provided a phase resolution of 0.001π. Figure 1 shows the learning characteristics of the amplitude and phase estimates when the source signal s(kt s ) was a white Gaussian noise with a variance of 10. The results were averages of 200 independent runs while µ α = 0.015 and µ φ = 0.0005. It can be seen that ˆα(kT s ) and ˆφ(kT s ) converged to the desired values at approximately the 500th iteration and they agreed with the theoretical derivation. At the beginning of the adaptation, the learning trajectory of ˆα(kT s ) converged at a slower rate than the predicted curve because of inaccurate estimate of φ during transients. Moreover, the measured variances of ˆα(kT s ) and ˆφ(kT s ) were found to be and 5.0 10 5 and 4.5 10 2 respectively, which conformed to those derived from (8) and (9). Elimination of the 50 Hz sine wave in an ECG signal using the ASIC is illustrated in Figure 2. In order to provide fast initial convergence rate and small steady state fluctuation, µ α and µ φ were set according to the previous test but were reduced 10 times after the first 500 iterations. It can be observed that the restored ECG signal was almost the same as the ideal one after the transient state. To conclude, a simple adaptive system for sinusoidal interference cancellation using a synthetic tone characterized by the amplitude and phase parameters has been developed. Theoretical analysis of the algorithm is derived and confirmed by simulations. Modification of the ASIC algorithm is under investigation to tackle the problem when the number of interfering sinusoids is greater than one and/or the interference frequencies are not exactly known. 5
References [1] NEHORAI, A. : A minimal parameter adaptive notch filter with constrained poles and zeros, IEEE Trans. Acoust., Speech, Signal Processing, 1985, 33, (4), pp.983-996 [2] PEI, S.C. and TSENG, C.C. : IIR multiple notch filter design based on allpass filter, IEEE Trans. Circuits Syst., II: Analog and Digital Signal Processing, 1997, 44, (2), pp.133-136 [3] WIDROW, B. et al. : Adaptive noise canceling: principles and applications, Proc. IEEE 1975, 63, (12), pp.1692-1716 [4] WIDROW, B. et al. : Stationary and nonstationary learning characteristics of the LMS adaptive filter, Proc. IEEE 1976, 64, (8), pp.1151-1162 6
(a) Fig. 1 Estimates of (a) amplitude and (b) phase. (b) 7
Fig. 2 Power line interference cancellation in ECG signal. (a) ECG waveform with artificial 50 Hz interference. (b) Restored signal. (c) Original ECG waveform without interference. 8