Accurate Sine-Wave Frequency Estimation by Means of an Interpolated DTFT Algorithm
Total Page:16
File Type:pdf, Size:1020Kb
21st IMEKO TC4 International Symposium and 19th International Workshop on ADC Modelling and Testing Understanding the World through Electrical and Electronic Measurement Budapest, Hungary, September 7-9, 2016 Accurate sine-wave frequency estimation by means of an interpolated DTFT algorithm Daniel Belega1, Dario Petri2, Dominique Dallet3 1Department of Measurements and Optical Electronics, University Politehnica Timisoara, Bv. V. Parvan, Nr. 2, 300223, Timisoara, Romania, email: [email protected] 2Department of Industrial Engineering, University of Trento, Via Sommarive, 9, 38123, Trento, Italy, email: [email protected] 3IMS Laboratory, Bordeaux IPB, University of Bordeaux, CNRS UMR5218,351 Cours de la Libération, Bâtiment A31, 33405, Talence Cedex, France, email: [email protected] Abstract – An Interpolated Discrete Time Fourier IpDFT methods have been proposed to reduce this detrimental Transform (IpDTFT) algorithm for sine-wave effect [10]-[13]. However, when the number of acquired frequency estimation is proposed in this paper. It sine-wave cycles is very small the achieved estimation generalizes the classical interpolated Discrete Fourier accuracy is quite low. Transform (IpDFT) algorithm by interpolating two In this paper a new Interpolated Discrete Time Fourier DTFT spectrum samples located one frequency bin Transform (IpDTFT) algorithm is proposed. It generalizes apart. The influence on the estimated frequency of the the classical IpDFT approach by interpolating two suitably spectral image component is investigated in the case selected DTFT spectrum samples located one bin apart. The when the acquired sine-wave samples are weighted by degree of freedom in the selection of the spectrum samples a Maximum Sidelobe Decay (MSD) window. An allows to minimize the contribution of the spectral image analytical expression for the estimation error due to component on the estimated frequency. An expression for that the spectral image component is derived. Leveraging contribution is derived and - leveraging on that expression - an on that expression an iterative procedure for the iterative IpDTFT procedure with maximum Image component reduction of the effect of spectral image component on interference Rejection capability (called IpDTFT-IR the estimated frequency is proposed. The accuracies of procedure) is proposed. The accuracies of the proposed the proposed procedure and other state-of-the-art procedure and other state-of-the-art multipoint IpDFT interpolated DFT algorithms are compared by means algorithms are compared through both computer simulations of both computer simulations and experimental and experimental results. results. It is shown that the proposed procedure can be advantageously adopted when the number of II. THE PROPOSED IPDTFT ALGORITHM acquired sine-wave cycles is small. Let us consider the following discrete-time sine-wave: Keywords – Discrete Time Fourier Transform (DTFT), Error analysis, Frequency estimation, Windowing ν () = Amx 2sin π +ϕ mm = K M −1,,2,1,0, (1) M I. INTRODUCTION where A, ν, and ϕ are the amplitude, the number of acquired The Interpolated Discrete Fourier Transform (IpDFT) algorithm sine-wave cycles (or normalized frequency expressed in bins), is often used for sine-wave frequency estimation since it returns and the initial phase, while M is the number of analyzed accurate results in real-time [1]-[8]. To reduce the detrimental contribution on the estimated frequency of the spectral leakage samples. The normalized frequency can be expressed as ν = l + from narrow band disturbances like harmonics or spurious δ, where l represents the closest integer to ν and -0.5 ≤ δ < 0.5. tones, the analyzed signal is weighted by a suitable window When coherent sampling occurs δ is null, but usually non- function. Cosine class windows [9] are often employed. In coherent sampling (i.e. δ ≠ 0) is encountered in practice. particular, Maximum Sidelobe Decay (MSD) windows allow to To reduce spectral leakage, the samples (1) are weighted by a obtain very simple IpDFT frequency estimators and exhibit suitable window function w(⋅) leading to the windowed signal very good spectral leakage suppression capabilities [1]-[8]. xw(m) = x(m)⋅w(m), m = 0, 1,…, M – 1. The related DTFT can Unfortunately, when only few sine-wave cycles are analyzed, be expressed as [4]: IpDFT frequency estimates are heavily affected by the interference from the spectral image component. Multipoint 122 A jϕ − jϕ M sin(πλ) (2H − 2) ! − jπλ X w ()λ =[W()()λ − ν e − Wλ + ν e ], (2) W ()λ = e . (7) 2 j 22H − 2 πλ H −1 ∏ ()h2− λ 2 where W(⋅) is the DTFT of the adopted window w(⋅). It is worth h=1 noticing that the second term in (2) is due to the signal image component. Substituting (7) into (6), after some simple algebra, we obtain: Cosine class windows are often used in spectral analysis. They are defined as: H− i −( − 1)i r +δ α r ≅ , (8) H−1 + i + ( − 1)i r −δ H −1 h m K w()() m =∑ −1ah cos2 π h ,m = 0,1,,M − 1 (3) M and the related fractional frequency estimator results: h=0 α (H+ ( − 1)i r + i − 1) − H + i + ( − 1)i r where H ≥ 2 is the number of window terms, ah, h = 0, 1,…, H ˆ r δ r = . (9) – 1 are the window coefficients. α r + 1 For |λ| << M the DTFT of (3) can be expressed as: III. THE PROPOSED PROCEDURE H −1 M sin(πλ) − jπλ h λ W ()λ ≅ e ∑ ()−1 ah . (4) The frequency estimation error due to the spectral interference π λ2− h 2 h=0 from the fundamental image component is given by (see Appendix): The proposed IpDTFT frequency estimator, as the classical IpDFT algorithm, is based on a two steps procedure [1]: ∆δ ≅ ∆ δ (1) − H sgn(r + (1) − iδ )cos(2 πδ+ 2 ϕ ), (10) i) The integer part l of the number of acquired sine-wave r r max cycles is determined through a simple maximum search procedure applied to the DFT samples |Xw(k)|, k = 1, 2,…, M/2 – where: 1. If the frequency Signal-to-Noise Ratio (SNR) is higher than a known threshold [14], then it is known that l can be exactly i determined with very high probability. 2(l+δ )( H − r + ( − 1)i δ ) W(2 l +δ + ( − 1)r ) ∆δ ≅ . ii) The fractional part δ of the number of acquired sine-wave r max i i i cycles is then estimated by firstly determining the ratio: 2l +δ − ( − 1)H + ( − 1) r W( r − ( − 1)δ ) (11) i Xw ( l+ i + ( − 1) r ) Expression (10) shows that ∆δr exhibits an almost sinusoidal α r = , (5) X( l− 1 + i + ( − 1)i r ) behaviour with respect to the sine-wave phase ϕ. The minimum w of its amplitude (11) is zero and it is reached when the fractional deviation r = |δ|. Since δ is unknow, that optimal value of r where i = 0 if |Xw(l – 1 + r)| ≥ |Xw(l + 1 – r)|, i = 1 if |Xw(l – 1 + r)| needs to be estimated, for instance, by applying a classical < |Xw(l + 1 – r)| and r ∈ [0, 0.5] is the fractional frequency IpDFT algorithm [1]-[8]. Hence, an iterative IpDTFT procedure deviation from DFT bins. It is worth noticing that the particular that maximizes the Image component interference Rejection case r = 0 corresponds to the classical IpDFT algorithm. Also, (IpDTFT-IR procedure) can be implemented. The 10 steps when r = 0.5 the expression for the ratio αr does not depend on procedure denoted with the acronym IpDTFT-IR(K) - since it is i. based on K iterations - is described in the following using a Using (2) and assuming that the image component provides a pseudo-code: negligible contribution to the considered DTFT samples, (5) 1. Evaluate the DFT of the windowed signal. becomes: 2. Determine the integer part l of the sine-wave frequency by applying a maximum search procedure to the discrete spectrum. i W(−δ + i + ( − 1) r ) 3. Evaluate α0 by applying (5) on the two largest samples of α ≅ . (6) r i the discrete spectrum; then determine an initial estimate δˆ for W (−δ − 1 +i + ( − 1) r ) 0 the fractional sine-wave frequency by applying (9) with αr = α0. ˆ ˆ The IpDTFT fractional frequency estimator δ r is then obtained 4. k := 0 and r = δ 0 by inverting (6) and using the value of αr returned by (5). 5. k := k +1 In particular, if the H-term MSD window (H ≥ 2) is used, (4) 6. Evaluate the two DTFT samples used in (5) and determine becomes [5]: 123 αr,k by applying (5): From Fig. 1 it follows that the proposed estimator outperforms the two-point estimator, the five-point IpDFT estimator, and (in X( l+ i + ( − 1)i r ) w most cases) the IpDFT-i estimator. The poorest performance is α r, k = X( l− 1 + i + ( − 1)i r ) achieved by the IpDFT estimator since it is not able to reduce w the contribution of the spectral image component. 7. Determine the fractional frequency estimate δˆ by r, k B. Simulated noisy sine-waves applying (9): Fig. 2 shows the MSEs of the considered estimators as a i i α r, k (H+ ( − 1) r + i− 1) − H + i + ( − 1) r function of ν when analyzing noisy sine-waves with SNR = 40 δˆ = r, k dB. The related Cramér-Rao Lower Bound (CRLB) for α r, k +1 unbiased estimators is also shown for comparison purposes. ˆ 8. Compute r = δ r, k 9. Repeat steps 5- 8 K-times (K ≥ 1) 10. Return the fractional frequency estimate obtained at the K- ˆ th iteration, δ r, K . IV. SIMULATION AND EXPERIMENTAL RESULTS In this Section the accuracies of the proposed IpDTFT-IR procedure, the classical two-point IpDFT algorithm [2], the improved three-point IpDFT algorithm [13] (called in the following the IpDFT-i algorithm), and the five-point IpDFT algorithm [10] are compared through both computer simulations and experimental results.