STUDY OF TIME FREQUENCY TRANSFORMS APPLIED TO POWER QUALITY SIGNALS

This work presents a scientific study on Short-Time Frequency Transforms (STFT) with different windows, also called Windowed Fourier Transforms, applied to power quality signals. Additionally, it deals with S transforms, with its frequency-dependent window. The disturbances related to energy quality have non-stationary nature, in which the spectral content varies over time. So, the Fourier Transform is not appropriate for such analysis, because it does not show time locations, only information about existing frequencies in the signal. Therefore, the spectral analysis by windowed transforms helps to identify and detect a series of defects associated to these power signals. The motivation behind this document is to verify which window will provide a more precise identification of the characteristics of the disturbances in time-frequency domain. For this work, synthetic signals were generated for some of these disturbances, and their spectra were compared considering Gaussian, Hann and Blackman windows, as well as the S transform. Based on the obtained results, it was verified that each transform presents different behaviors according to the input signal, except for the ones with Hann and Blackman windows, that showed similar spectra. For all of them, there is always a tradeoff between time and frequency resolutions. Therefore, the choice of the window must be done according to the desired outputs. The Dev-C ++ ® IDE was used for C ++ programming, and the Gnuplot ® program for graphics generation.


INTRODUCTION
The subject Electrical Power Quality (EPQ) includes several topics, such as: reliability, provided power quality and provision of information. A definition which relates the aplications of signal processing and also the system ability to operate loads without damaging them and the capacity of the loads to operate on the system without disturbing or decreasing the eficiency of the electrical system is: "Electrical Power Quality is an arrangement between voltage quality and energy quality. An ideal voltage is a sinusoidal voltage with constant amplitude and frequency, where both present nominal values" (BOLLEN, 2006).
The power quality is directly related to the defects contained in power signals, named disturbances. These disturbances may cause changes in the duration, frequency, and also the interruption of such signals. The most relevant disturbances in power quality are: transients, voltage sag, voltage swell, notching, inter-harmonics and harmonics.
There are several analytical methods developed in literature that use transforms to evaluate the signal in time-frequency domains. The timefrequency techniques are tools which assist the analysis of electrical power quality and the disturbances detection and classification. Among them, the Gabor transform, the signal-tuned Gabor transforms, Wigner and S transforms (FERREIRA, 2016;VICTER, 2012;XIAO, 2009;SMAJDA, 2010;YOONNAJMI, 1994;TORREAO, 2013).
The Fourier Transform (FT) identifies the different frequencies contained in the signals, but doesn´t recognize the temporal interval of such frequencies.
The Short Time Fourier Transform (STFT), also known as windowed Fourier transform, analyses the signal breaking it into smaller intervals and applies the FT for each one of them. Consequently, the disturbance signals, of non stationary-nature, can be analyzed through various time-frequency transforms, each one with a specific window, and a spectrum comprised of several parts is generated. The signal is analyzed within each part, which results in the spectrum of the whole signal.
To this work, synthetic signals were produced with some of these disturbances, and their spectra compared through windowed transforms, considering Gaussian, Hann and Blackman windows, with fixed width windows.
And also the S transform, with its variable window size according to the frequency. Section 2 presents the algorithms in frequency domain based on the FT. In section 3, the algorithms in time-frequency domain are introduced and also the definition of each mentioned window. Section 4 shows the analyzed disturbances and section 5 explore the obtained results followed by conclusion.

Fourier Transform
Jean Baptiste Joseph Fourier was a French mathematician and physicist responsible for great considerable advances in science; one of his main contributions was about convergent trigonometric series and problems related to heat transfer. His study was very important for the analysis and understanding of physics through the waves. The Fourier series is a trigonometric series able to decompose and represent any periodic signal. The Fourier Transform (FT) presents the frequencies that comprise the temporal functions showed by the series.
According to (OPPENHEIM, 2010a), "All signals can be represented by a sum of complex exponentials. The resulting coefficient spectrum in this representation is named Fourier Transform".
The general Fourier series is given by: (1) where are the coefficients of the series and indicate the amplitude of each wave in series, and L is the width of the signal.
The FT takes the representation of periodic and aperiodic signals as sinusoidal weighted integrals which are not all harmonically related. It is obtained through the Fourier series.
The FT of a signal is as follows: ( 2) where is the angular frequency, with as the linear frequency. For each frequency , the signal is integrated over all values within t coordinate.
The inverse Fourier Transform, used to recover the original signal, is defined as: (3)

Discrete-Time Fourier Transform and Discrete Fourier Transform
The Discrete-Time Fourier Transform (DTFT) is a form of Fourier analysis that is applied to functions that operate on discrete data. The DTFT of is given by: The DFT converts one sequence of complex numbers x[n] into another one composed by complex numbers X[k].

Fast Fourier Transform
The Fast Fourier Transform (FFT) is an optimized algorithm based on the FT, usually more suitable for digital implementation. It reduces in some orders of magnitude the time needed to calculate the transforms, compared to DFT.
FFT algorithms can be classified into two groups. The first one, called time decimation, uses small transforms and the sequence evaluated in time is decomposed into small subsequences; the second one, called frequency decimation, has also a sequence decomposed into smaller ones, but evaluates the frequency instead.
The FFT shows the frequencies contained into the signal, but is unable to show the temporal localization of such frequencies (OPPENHEIM, 2010b).  The Short-Time Fourier transform (STFT) is a classic method of timefrequency analysis. Its mathematic formula is given by: (6) where is the input signal, is a randomly chosen analysis window, and is the frequency in Hertz. The term " " assures that the window will The implementation of the STFT algorithm is done in a discrete way. An algorithm is used to calculate the frequency at every instant. The STFT in discrete time is given by:

Short-Time Fourier Transforms
where represents the discrete time and the centered window in each instant .
The selected window main goal is to provide temporal localization, sliding through time axis to produce local spectrum for all signals. The STFT not always achieves the expected result because its analysis window is fixed; it means that it keeps the same time-frequency resolution for every spectra components. Therefore, several kinds of windows provide distinct information for the same signal. The studied windows considered here are: Gaussian, Hann and Blackman. Next, there is a description of each one of them.

Gaussian Window
The STFT with Gaussian window is also named Gabor Transform. In this kind of window, the signal is analyzed internally by a Gaussian function, that tends to infinite on the ordinates axis. So, the function needs to be truncated to allow a consistent analysis.
The Gaussian window has an advantage compared to the others, because the time-frequency sample is done in a compact way, what reduces the sample inaccuracy in these domains. (Oppenheim, 2010b). It is described by:

Hann Window
The Hann window is a linear combination of rectangular windowed functions. Its main advantage is the decrease of the aliasing that appears in graphics. Its mathematical formula is as follows:

Blackman Window
The Blackman window, as well as the Hann window, derive from a sum of rectangular windows functions. Its formulation is given by: (10) Figure 1 shows the behavior of each window mentioned above.

Transients
The transient disturbances are characterized as short duration events, and they occur due to diverse conditions in the electric systems. They show up as fast fluctuations related to sinusoidal signal, in a very short time. They can be divided into two types: impulsive and oscillatory.
The impulsive transients are caused by atmospheric discharges and are often characterized by the ascent and descent impulse time. Consequently, those disturbances provide sudden impulses in a voltage permanent regime, generally lasting less than 1ms.
The oscillatory transients consist in a fast variation on the values and the polarity of the voltage and current. Namely, in a short time interval, typically ranging from 5 μs to 50 ms, the signal quickly achieves maximum and minimum voltage values altering the amplitudes of the original signal.

Voltage Sag, Voltage Swell and Interruption
These disturbances are characterized by amplitude changes in the original signal, in a certain time interval, generally caused by the input or output of a temporary load in an electrical system.
The Voltage Sag and Voltage Swell disturbances represent, respectively, the reduction and increase of the electrical signal amplitude lasting from 0.5 cycle to one minute.
The interruption disturbance occurs when the signal stop oscillating and it can be observed graphically as a constant with null value on the abscissas axis.
The duration lasts less than a minute.

Notches
Notches disturbances represent abrupt changes in the signal current or voltage. They visually correspond to "steps" that show up along the sinusoid and are caused by several factors, have short duration and act in permanent regime.

Changes in the waveform (Inter-harmonic and Harmonic)
These disturbances are characterized by interference of other signals with other frequencies in the original signal. So, for a certain time interval they completely change the original sinusoidal shape.
The inter-harmonics are interferences of a sinusoidal signal with noninteger multiple frequencies of the input signal. This kind of disturbance in nonperiodic, what means that it doesn´t repeat itself along the time.
The harmonics are interferences of a sinusoidal signal in which the frequencies are integral numbers of the input signal. Each harmonic is periodic, meaning that it repeats itself along the time.
Both disturbances act in permanent regime. Figure 2 shows a synthetic signal composed by some of such disturbances. Source: the authors.

DEVELOPMENT
The IDE Dev-C++ was used for C++ programming, and the Gnuplot program to plot the graphics. Here is analyzed the signals behavior of the mentioned disturbances. For each disturbance, it will be verified the spectra obtained by the FFT and the STFT with the windows described before and with the S transform. All signals have a length of 512 samples. Several windows sizes were tested, and it was verified that, for the Gaussian window, the best option was 256, and for the others STFT, 512.  where is possible to see only the signal frequency and its amplitude. However, through the STFT is possible to analyze the frequencies and amplitudes in the time intervals associated. For this case, the Gaussian window brings more accuracy, since it is possible to observe the amplitude variations more precisely, and it highlights better the frequency, as in Fig. 3c. The Hann transform generated a spectrum with the right frequency, but without clearly identifying the disturbances duration. Fig. 3e Fig. 4b, the FFT was applied in order to obtain signal frequency analysis and its amplitudes. In the spectrograms achieved with different windows, distinct outputs are presented, and the results obtained by Gaussian window in Fig. 4 showed a more precise output for the analysis of the frequency in time. In Fig.   4d, the time resolution obtained by Hann transform is the poorest one but with a better frequency identification. In Fig. 4e, S transform spectrum shows a long spread in higher frequencies, but a perfect time resolution.

CONCLUSIONS
This work showed the relevance of time-frequency windowed transforms applied to power quality signals. Fourier series, variations of Fourier transforms and some windows were introduced, and also the concepts about the disturbances contained in sinusoidal power signals. The analysis was made based on synthetic signals with some of the most known defects, being studied through algorithms developed for FFT, STFT with distinct windows and for the S transform.
With the use of the FFT, it was possible to detect all frequencies that form the signal, but without a localization along the samples; in contrast, the STFT through Gaussian window was able to identify the signal amplitudes and frequencies correctly; Through the use of Hann and Blackman windows, which showed extremely similar results, it was possible to localize the frequencies precisely where the defects occur, but they weren´t able to localize the instants associated accurately. For all STFT, it is necessary to adjust the window width according to what is expected to get. The S transform presented a great time resolution, but a poor frequency resolution for higher frequencies.
So, based on the actual results, it can be concluded that each transform has its advantages and disadvantages depending on the input signal and the selected window width, and also that a better resolution in frequency requires a poorer resolution in time, and vice versa, what characterizes them. Greater windows provide better frequency results, while smaller ones improve time resolution. Therefore, different windows sizes reflect in the final output, and the choice of this parameter is made according to the application.
As future works, Signal-tuned Gabor transforms will be considered in this study (Torreao, 2013); these techniques represent a hybrid method which combine the benefits of the windowed transforms with the efficiency of the S Transform, concerning its time domain resolution. It will also be investigated computational intelligent methods to classify and detect the windows used for the disturbance or in its characterization. Another approach is to use real data for a more realistic scenario.