Investigation of key factors of Blackman-Harris window and interpolation algorithm in TTU frequency estimation module

In order to provide a reference for the selection of related parameters when the Blackman-Harris window and interpolation algorithm is applied to the frequency estimation for voltage and current signals in transformer terminal unit (TTU), the principle of the algorithm is introduced, the implementation is preliminarily discussed, and the influence of signal parameters and measurement parameters on the frequency error is investigated based on the numerically generated voltage signals. The results reveal that the error is proportional to the frequency deviation of the signal. The frequency error decreases exponentially with signal-to-noise ratio (SNR) and sampling duration. Total harmonic distortion, sampling frequency and analog-to-digital converter (ADC) quantization bit have almost no impact on frequency error.

In order to solve this problem, the Blackman-Harris window and interpolation algorithm is implemented in programming language. A large number of voltage signals with different signal frequencies, SNRs, total harmonic distortions (THDs), sampling frequencies, sampling durations and analog-to-digital converter (ADC) quantization bits are numerically generated. Based the above generated voltage signals, the influence of above signal parameters and measurement parameters on frequency error is investigated.

Principle of algorithm
The signal frequency can be estimated from the discrete spectrum by discrete Fourier transformation (DFT) on the discrete signal. The accuracy of frequency estimation can be improved by analyzing the discrete spectrum of windowed signals. The principle of Blackman-Harris window and interpolation algorithm is described as follows: The Blackman-Harris window [11] can be expressed as follows: where N is the number of samples; a 0 =0.  (2) where D(θ) is the Dirichlet kernel; θ is the frequency.
Let the discrete signal be j2π ( ) e fn t xn where Δt is the time interval between two subsequent samples; x(n) is the nth discrete signal value; A is complex amplitude of signal; f is the signal frequency.
Assume that X(θ) is the DFT result of the discrete signal x(n). Then the DFT result for the Blackman-Harris windowed signal is where X w (θ) is the DFT result for the Blackman-Harris windowed signal.
The acquisition of voltage and current signals at the low voltage side of distribution transformer can be realized by ADC combined with microcontroller unit (MCU). A conventional CPU follows instructions in the software. However, a field programmable gate array (FPGA) sets up connections that actually reconfigure the hardware. Hardware is always significantly faster than software because it immediately processes the data without process of fetching and analyzing instructions. In order to improve the real-time performance of the subsequent harmonic analysis, FPGA can be taken as the main control chip. FPGA combines ADC (power measurement chip) and memory to realize signal acquisition and storage. Based on the FPGA, the above algorithm can be implemented in VHDL or Verilog HDL language to realize frequency estimation. Based on FPGA and LCD module, the acquired waveform and estimated frequency can be displayed. Based on RS485, FPGA can realize the communication function of TTU.

Investigation of influencing factors
Key signal parameters and measurement parameters may affect the accuracy of frequency estimation by the Blackman-Harris window and interpolation algorithm. In this section, the numerically generated signals are used to simulate the voltage signals acquired in TTU. The influence of signal frequency, SNR, THD, sampling frequency, sampling duration and ADC quantization bit on frequency error is investigated.

Signal frequency
On consideration of Reference [12], the signal frequency varies in the range of 49.8~50.2 Hz, and the signal shown in Equation (10) is used to simulate the voltage signal acquired in TTU.
where s is the voltage signal in V; t is time in s; f is the signal frequency in Hz and it varies from 49.8 to 50.2. B=311.13; φ 1 , φ 2 , φ 3 and φ 4 are uniformly distributed over the interval from 0 to 2π. The sampling duration is 0.08, 0.12 and 0.16 s, respectively. The sampling frequency is set to 2 kHz. 1000 groups of signals are generated under each signal frequency. The standard deviation and mean value of frequency error are shown in Figure 1. Considering the relationship between frequency error and signal frequency in Figure 1, we fit the error by Equation (11), and the fitted curve is also displayed in Figure 1. Figure 1 shows that the frequency error (standard deviation and mean value) is proportional to the difference between the signal frequency and the rated value.
E=a 1 |f-50| (11) where E is the mean value or standard deviation of the error; a 1 is the coefficient.

SNR
The voltage signal is generated according to Equation (12). s(t)=0.005B+Bsin(2πft+φ 1 )+0.015Bsin(6πft+φ 2 )+0.01Bsin(10πft+φ 3 )+0.005Bsin(14πft+φ 4 )+x (12) where, x is a Gaussian random variable with zero mean. SNR varies in the range of 10~40 dB and the step size is 3 dB. f=50.2. The other parameters are consistent with those in Section 3.1. For each SNR, 1000 groups of signals are generated. The standard deviation and mean value of frequency error calculated by the Blackman-Harris window and interpolation algorithm are displayed in Figure 2. Considering the relationship between frequency error and SNR in Figure 2, we fit the error by Equation (13), and the curves obtained by fitting are illustrated in Figure 2. As can be seen from Figure 2, frequency error (standard deviation or mean value) decreases exponentially with SNR. This is due to the fact that the influence caused by the noise decreases with SNR.
E=b 1 exp(c 1 r) (13) where r is the value of SNR, in dB; b 1 and c 1 are coefficients.

Sampling duration
The voltage signal is generated according to Equation (10 Figure 3. Considering the relationship between frequency error and sampling duration in Figure 3, we fit the error by Equation (14), and the curve obtained by fitting is also drawn in Figure 3. As can be seen from Figure 3, frequency error (standard deviation or mean value) decreases exponentially with sampling duration. This is due to the fact that the error in λ decreases with sampling duration. E=d 1 exp(e 1 T) (14) where d 1 and e 1 are coefficients.

THD
The voltage signal is generated according to Equation (15). s(t)=0.01Ba+Bsin(2πft+φ 1 )+0.015Basin(6πft+φ 2 )+0.01Basin(10πft+φ 3 )+0.005Basin(14πft+φ 4 ) (15) where f=50.2. a varies in the range of 0~5.35, that is, THD varies in the range of 0~10%, and the step size is 1%. The Other parameters are consistent with those in Section 3.1. The standard deviation and mean value of frequency error calculated by the Blackman-Harris window and interpolation algorithm are presented in Table 1. It can be seen from Table 1 that the frequency error (standard deviation or error value) is almost independent of THD. Note that E m and E std are the mean value and standard deviation of the frequency error, respectively.

Sampling frequency
The voltage signal is generated according to Equation (10). f=50.2. The sampling frequency varies in the range of 1~20 kHz. The other parameters are consistent with those in Section 3.1. The standard deviation and mean value of frequency error calculated by the Blackman-Harris window and interpolation algorithm are included in Table 2. It can be seen from Table 2 that the frequency error (standard deviation or mean value) is almost irrelevant to the sampling frequency.

ADC quantization bit
The voltage signal is generated according to Equation (10). f=50.2. The other parameters are consistent with those in Section 3.1. ADC quantization bit varies from 4 to 18. The standard deviation and mean value of frequency error calculated by the Blackman-Harris window and interpolation algorithm are presented in Table 3. As can be seen from Table 3, frequency error (standard deviation or mean value) is almost irrelevant to ADC quantization bit. In Table 3, M is the quantization bit.

Conclusions
The influence of signal frequency, SNR, sampling duration, THD, sampling frequency and ADC quantization bit on the frequency error estimated by the Blackman-Harris window and interpolation algorithm is investigated based on the numerically generated voltage signals. The conclusions are as follows: 1) Frequency error is proportional to the difference between the signal frequency and the rated value; 2) Frequency error decreases exponentially with SNR and sampling duration; 3) THD, sampling frequency and ADC quantization bit have almost no impact on frequency error.