AM-FM demodulation using zero crossings and local peaks K.V.S. Narayana and T.V. Sreenivas Department of Electrical Communication Engineering Indian Institute of Science, Bangalore, India 560012 Phone: +91 80 2360 2167, Fax: +91 80 2360 0683. Email: narayana.kvs@ece.iisc.ernet.in, tvsree@ece.iisc.ernet.in Abstract—We developed a new algorithm for estimating Instantaneous Amplitude(IA) and Instantaneous Frequency(IF) of a band limited AM-FM signal, using zero crossings(ZC) intervals and local peaks information(ZC-LP). In this method IA and IF are estimated independently. For estimating IF, zero crossing interval information is used in a K-Nearest Neighbor(K-NN) frame work and for estimating IA local peaks of the given band limited signal are used, also in a K-NN frame work[2]. Experimental results shows that the proposed algorithm gives better results than existing methods like Hilbert Transform[3], DESA1, DESA2[1]. I. I NTRODUCTION All naturally occurring signals such as speech, biomedical signals, music, etc., are non-stationary in nature. The nonstationarity of these signals are mainly due to their respective production phenomena. The temporal variability of these signals can be modeled in general as amplitude variability and frequency variability. In general, in communications AM is used for modeling amplitude variability and FM is used for modeling frequency variability of a signal. Hence to model a non-stationary signal with both amplitude and frequency variability, we can use AM and FM together. For a wideband signal such as speech or music, there can be multiple modes of frequency and amplitude variability, which can be represented by a linear combination of AM-FM signals[4]. Let an AM-FM modulated signal be represented by combination of AM-FM signals: S(t) = K X Ak (t)sin(Φk (t)) (2) k=1 where K is number of band pass filters in the filter bank. Given a bandpass AM-FM signal xk (t), there are many ways of estimating AM and FM components. The basic method for doing this is by using the Hilbert transform approach which determines the analytic signal of a given signal and then estimate AM and FM components separately. Other methods are DESA1 and DESA2 which use teager energy operator[1]. In this paper we are presenting a new method(ZC-LP) for separating AM and FM components of a given signal independent of each other. FM decomposition is done using zero crossing intervals and AM decomposition is done using local peaks information. From the experiments it is shown that AM estimation is not affected by the modulation index of the FM and FM estimation is not effected by the modulation index of the AM. The earlier approaches for AM-FM decomposition from our group has utilized ZC and level crossing(LC) information[2] [13] directly whereas this paper proposes ZC intervals. Other approaches in the literature use ZC interval statistics[12], but not ZC intervals, which has certain advantages. II. AM-FM D ECOMPOSITION USING ZC-LP Let the AM-FM signal be x(t) = A(t)sin(Φ(t)) (1) where Φ(t) is the phase component and A(t) is the amplitude variation. The frequency of the signal is given by 1 d f (t)= 2π dt Φ(t). To represent natural wideband signals such as speech, music, or biomedical signals, it is convenient to decompose them into narrow-band signals using a perfect reconstruction filter bank and then represent each filter output as an AM-FM signal. Let s(t) be a wideband which can be represented as the linear x(t) = A(t)sin(Φ(t)), where A(t) is the amplitude variation, generally given by A(t) = (1 + µ ma (t)). Here µ is the modulation index of AM and ma (t) modulating signal for AM. For all t, |µma (t)| < 1 i.e. A(t) > 0. Similarly IF of the signal is given 1 dΦ(t) by f (t) = 2π dt = fc + β mf (t) where β is the modulation index of FM and mf (t) is the FM modulation component. Again, let |βmf (t)| < fc . Also, let ma (t) be slowly varying compared to min [f (t)]. F = {f (t = τi ) = 1 2(ti+1 −ti ) , 0 ≤ i (ti +ti+1 ) }. 2 ≤ L − 1, where τi = In continuous domain we can say that there is a zero crossing when x(t) = 0, but in our case we are dealing with a discrete signal x[nTs ] where Ts is the sampling period. In order to find the ZC location we have used signal sign changes between successive samples i.e. X[nTs ]X[(n + 1)Ts ] < 0. After that th we interpolated the signal between nth and (n + 1) samples to a finer resolution using sinc interpolation for finding the ZC instant. Now we have a discrete set of frequencies at some nonuniform instants of time. In order to find the IF at any instant t we have to interpolate the non-uniform samples of f (t). To interpolate the data we can use the least squares approach. To retain the generality of different applications, we make a smooth local polynomial approximation of f (t) of aP fixed order P p .i.e., we can write f(t) at any instant t as f (t) = p=0 cp tp . By minimizing the cost function PL−1 2 S(c) = L1 i=0 kfi − CTi k where F is set of all L frequencies fi at discrete time instants. ′ C = [c0 , c1 ....cP ] and Ti = [1, ti , t2i ...tP i ] . Minimizing the cost function S(c) with respect to C will give us optimum ¯ ¯ Estimated IF Signal where L is the total number of ZC’s in a given interval 0 ≤ t ≤ T signal. Now from the above discussion of sampling of f (t), we can choose the IF between two consecutive zero crossings ti and ti+1 be approximated by fi := 2(ti+11 −ti ) [11]. This frequency can be assigned anywhere in the half cycle interval and we found it empirically that assigning it to the middle of the interval gave the best approximation for the time varying IF. When we assigned this frequency to the left ZC we got a delay in estimated IF with respect to the original IF and when we assigned it to the other end we found a delay in the other direction. By computing the frequency values between all the zero crossing intervals we have a set of non-uniform samples of IF function corresponding to each ZC interval. Let F be the set of IF samples: 0.22 0.2 0.18 0.05 0.04 0.03 0.02 0.01 0.16 0 100 200 300 400 0 0 500 100 Sample Index 200 300 400 500 400 500 Sample Index −4 −5 x 10 4 5 Error in IF estimation TZ = {ti , 0 ≤ i ≤ L, where x(ti ) = 0} 0.06 0.24 Estimated IF Signal For the simple case of a sine wave sin(2πf t), where f is the frequency of the sine wave, the time interval between two 1 consecutive zero crossings τ is given by τ = 2f . With A.M because the envelope A(t) is slowly varying and is positive, it does not affect the ZC’s. Thus, each successive ZC interval can be interpreted as due to only the IF f (t). The ZC’s provide a sampled information of f(t). For the given signal x(t) let TZ be the set of all successive zero crossing instants, i.e., values of C ∗ given by C ∗ = T + F (T + is pseudo inverse). and T is the matrix whose ith column is Ti . After obtaining the optimum solution for coefficients of the polynomial we can get the predicted value of fb(t) at any time instant t. Error in IF estimation A. FM Computation 0 −5 100 200 300 400 x 10 2 0 −2 −4 −6 −8 0 500 100 Sample Index 200 300 Sample Index Fig. 1. The plot of the estimated IF signal and Error signals.In 1st case the IF signal is a sin wave give by f (t) = 0.2 + 0.045sin(0.0565n + π4 ) and in 2nd case the IF signal is given by f (t) = and N=512 in this case. .7 2π ∗ (.25 + .25 ∗ (n−N/2+1)3 (N ) 2 3 ) We can use the least square solution for interpolating the IF only when we know the prior information about the smoothness of the modulating signal. If we do not know the prior information about the smoothness of the signal then in that case we cannot use the least squares solution. In that case we have to go for either K Nearest Neighbor(K-NN)[2] or splines as a solution for interpolation. In K-NN we will take K nearest points surrounding t, where we want to calculate IF and fit a polynomial locally in that region. In our experiments we have used K=11 and P=3. B. AM computation Given an amplitude modulated signal (AM), one way of getting back the modulating signal is to pass it through a low pass filter[8], which will output the envelope of the signal. Envelope of a signal can also be approximated by the curve passing through all the local peaks of the modulated carrier wave (i.e. AM signal). Similarly joining all negative peaks(valleys) of the signal will also give an envelope which is exactly negative of = 0|t=ti } 1.3 1.25 Estimated AM Signal Estimated AM Signal 1.6 1.4 1.2 1 0.8 0.6 1.2 1.15 1.1 1.05 1 0.4 0.2 0 100 200 300 400 500 0.95 0 100 Sample Index 200 300 400 500 Sample Index −3 −4 x 10 x 10 1.5 1 Error in IA estimation TP = {ti , 0 ≤ i ≤ Lp , where d dx x(t) (b) (a) Error in IA estimation the modulating signal. We can consider the negative of the local valleys as additional samples of the envelope function, enhancing the estimation accuracy and transient nature of the AM function. In the ZC-LP method, we calculate the local peaks of the given AM signal. For finding local peaks of the signal, we are finding the first difference of the signal and checking for the sign changes to determines ZC’s of the first derivative. If there is a sign change at ith sample that means there is th th a peak between (i − 1) and (i + 1) samples. After finding all intervals where there is a peak, we interpolate the difference signal to a finer resolution to determine the exact location of the peak and the value of the peak. 0.5 0 −0.5 −1 5 0 −5 −1.5 where TP is set of time instant, where there is a local peak and LP is the number of local peaks in the signal interval. −2 0 100 200 300 400 500 0 Sample Index 100 200 300 400 500 Sample Index XP = {x(ti ), 0 ≤ i ≤ Lp , ti ǫTP } We have a non-uniform sampled version of the envelope XP at TP . To find the IA at any instant t, we can use either KNN or splines. In our experimentation we have used the same method which we used in the computation of IF and computed b A(t). For the experimentation we have chosen K=11 and the order of polynomial p=3. We can see from the results that the estimation error in estimation of AM is quite low of the order of 10−4 . The usual method for envelope estimation is through coherent demodulation which utilizes the IF component of the signal x(t). But, here we are not using any information about the IF of the signal and computing the IA of the signal independently. Thus, are computing both IA and IF independently from the ZC’s of the signal and its derivative. In the next section we show that the performance of IA estimation is not effected much by the parameters of FM and estimation of IF is not effected by the parameters of the AM, when compared to other techniques in the literature. III. PERFORMANCE COMPARISON WITH DESA The performance of the new ZC-LP based AM-FM estimation is compared with the DESA1 which uses Teager Energy Operator (TEO) for computing AM and FM components. The AM-FM signal is given by R x(t) = (1 + µma (t))sin(fc t + β mf (t)dt) For comparison we have taken an AM-FM signal with both modulating signals ma and mf as sinusoidal signals. We studied the effect on performance by varying µ ,β , parameters of ma (frequency of the modulating signal) and carrier frequency fc . We estimated the signals A(t) and f (t) using both the methods DESA1 and the ZC-LP method. While calculating Fig. 2. The plot of estimated IA and error in estimation.In first case we have used a sine wave as modulation signal give as A(t) = 1 + sin(0.0471n) and in second case the envelope signal is given by A(t) = 1 + N=512 in this case. (n− N ) 2 N2 2 and AM and FM using DESA1 if there are any imaginary term we have replaced them using real value neglecting the imaginary part.We have taken mean square error(MSE) as a measure of performance. The MSE of AM estimation is calculated by : ξAM 1 = N − 2Q + 1 N −Q+1 X n=Q+1 2 b (A(n) − A(n)) (3) In our simulation we have used Q=24. As error in the edges will be high we have excluded those regions for computation of the ξAM . A similar measure is defined for computing MSE ξF M of FM also . First we have studied the performance of AM and FM estimation by varying the parameters of AM µ and fAM . From Fig, 3 we can see that the performance of ZC-LP is consistently better than the performance of DESA1 for all variations in µ and fAM . We can see that estimation of FM is not affected by the AM parameters, the error in estimation of FM ξF M is almost constant in the ZC-LP method, whereas in DESA1 estimation of FM is effected by the AM parameters. The estimation error in FM increased with increase in modulation index of AM (µ) and frequency fAM of the modulating wave. This is because for estimating FM in ZC-LP method we have used ZC’s, which are not effected by AM of the signal as discussed in the previous sections. The performance of the estimation of AM and FM is studied with variations in fc and β. As shown in the Fig 4 we can ZC−LP DESA−1 −55 −10 −40 −60 −20 −65 −30 −60 −75 −70 0.8 −80 −70 ω AM 0.06 0.4 (rad/s) µ −60 ξFM ξ FM −70 −80 −90 0.8 0.6 0.4 µ 0.2 0.02 0.04 ω AM 0.06 (rad/s) 0.08 0.2 0.02 0.04 ω AM 0.06 4 (rad/s) β −50 −50 −60 −60 −70 −90 −100 µ 0.2 0.02 0.04 ω AM 0.06 infer that ZC-LP is consistently performing better than DESA1 through out the range of fc and β. At the same time we can see that the performance of AM estimation is also doing consistently better than DESA1. We can see as fc is decreasing the performance of DESA1 in estimating FM is degrading fast, whereas the performance of the ZC-LP method is hardly affected. ω FM (rad/s) 0.15 2 0.1 β ω FM (rad/s) −50 −60 −70 −80 6 0.2 4 (rad/s) Fig. 3. The performance comparison of ZC-LP and DESA1 in case of estimation of IA and IF with respect to AM modulation index µ and Frequency of modulating sinusoidal wave.The AM modulating wave is given by ma = 1 + µsin(ωAM t) 2 0.1 6 0.08 0.2 4 −80 −90 0.8 0.4 6 0.15 −70 −80 0.6 −60 0.2 FM 0.2 0.04 −50 6 0.08 −40 ξ µ 0.02 0.6 FM 0.4 0.08 ξ 0.6 β 0.2 4 0.15 2 0.1 ω FM (rad/s) 0.15 2 0.1 β ω FM (rad/s) Fig. 4. The performance comparison of ZC-LP and DESA1 in case of estimation of IF and IA with respect to FM modulation index β and Carrie n frequency fc .The phase of the am-fm wave is given as ωf m +βsin(π 100 + π4 ) Bandpass Filtered speech signal and envelope 80 speech signal 60 Envelope 40 Signal value 0.8 −70 ξ AM ξ ξAM AM ξ −60 −50 AM −30 −40 −50 DESA−1 ZC−LP 20 0 −20 −40 −60 −80 0 50 100 150 200 250 300 350 400 450 500 Sample Index IV. APPLICATION OF NEW MODEL TO NATURAL SIGNALS V. C ONCLUSION We propose a new zero crossings based IF estimation and local peaks based IA estimation of a band limited signal.From the experimental results, we can see that for a clean signal the estimation error is of the order of -70 to -80 dB. This ZC−LP Hilbert Method 4000 IF value We tried applying the ZC-LP method for estimation of IA and IF of natural occurring signals like speech, and music. We took a bandpass filtered(BPF) signal multiplied by a trapezoidal window of length N=512. As we know when a speech wave is passed through a BPF the resulting signal will be of AM-FM structure[4], [2]. For this experimentations as we know that the frequency variations are high we used k=5 and p=3 (for K-NN). As we can see from the Fig 5, 6 small variations in frequency are captured by the ZC-LP in great detail because ZC’s will capture all variations in frequency very closely. Amplitude variations are also captured in good detail. Estimated IF Using ZC method and Hilbert 5000 3000 2000 1000 0 0 50 100 150 200 250 Sample Index 300 350 400 450 500 Fig. 5. New Algorithm when applied on a BPF speech signal,sampled at 16kHz. When passband is 0.25 to 0.45(normalized frequency). performance is much better than the existing methods like DESA1,DESA2. We have also seen that this method can be applied to natural signals like speech and music signal also. AM-FM decomposition can be used for analysis of and synthesis of speech signals[10]. Bandpass Filtered flute signal and envelope Flute signal 100 Envelope Signal value 50 0 −50 −100 0 50 100 150 200 250 Sample Index 300 350 400 450 500 Estimated IF Using ZC method and Hilbert 6000 ZC−LP Hilbert Method IF value 5000 4000 3000 2000 1000 0 50 100 150 200 250 Sample Index 300 350 400 450 500 Fig. 6. New Algorithm when applied on a BPF Music signal,sampled at 16kHz. When passband is 0.3 to 0.45 (normalized frequency). R EFERENCES [1] J.F. Kaiser P.Maragos and T.F. Quatieri, Energy separation in signal modulations with application to speech analysis, IEEE Trans. Signal Proc., vol. 41, pp. 30243051, Oct 1993. [2] S. Chandra Sekhar and T.V. Sreenivas, “Novel approch to amfm decomposition with application to speech and music analysis,“ Proc. IEEE ICASSP-04, vol. 2, pp. 7536, may 2004. [3] B. Boashash, “Estimating and interpreting the instantaneous frequency of a signal,” Proc. IEEE, vol. 80, pp. 519568, April 1992. [4] J.F. Kaiser, P. Maragos and T.F. Quatieri, “Speech nonlinearities,modulations, and energy operators,“ Proc. IEEE ICASSP,vol. 1, pp. 421424, May 1991. [5] Bishwarup Mondal and T.V. Sreenivas “Mixture gaussian envelope chirp model for speech and audio” in Proc. IEEE ICASSP-01,Vol. 1, pp. 857-860, May 2001. [6] Doh-Suk Kim Soo-Young Lee R.M.Kil “Auditory processing of speech signals for robust speech recognition in real-world noisy environments”IEEE Transaction on Speech and Audio Processing,vol. 7, no. 1, pp. 55-69, 1999. [7] T.E. Hanna, T.F. Quatieri and G.C. OLeary, “Am-fm separation using auditory-motivated filters,” IEEE Trans on Speech and Audio Proc., vol. 5, pp. 465480, Sep 1997. [8] George kennedy and R.W.Tinnell, , in Electronic communications systems. McG-Kog, 1991, vol. 3rd edition. [9] J.K Gupta, S. Chandra Sekhar and T.V. Sreenivas, “Performance analysis of am-fm estimators,” TENCON, vol. 3, pp.954958, Oct 2003. [10] A. Potamianos and P.Maragos, “speech analysis and synthesis using an am-fm modulation model,” Speech Comm., vol. 28, pp. 195209, July 1999. [11] Sharif, Z. Zainal, M.S. Sha’ameri, A.Z. Salleh, S.H.S. “Analysis and classification of heart sounds and murmurs based onthe instantaneous energy and frequency estimations” Proc. IEEE TENCON pp. 130-134 vol.2 2000. [12] T. V. Sreenivas and R. J. Niederjohn, “Formant contour estimation in noise: comparison of a zero-crossing based measure with other spectral estimates,” Proc. IEEE Int. Conf. Svst. Enara., Dayton, Ohio, pp. 399-402, August,1989. [13] S. Chandra Sekhar and T. V. Sreenivas, Polynomial instantaneous frequency estimation using level-crossing information, in Proc. IEEE-EURASIP Workshop on Nonlinear Signal and Image Processing, Grado, Italy, June 2003.