Next Article in Journal
Modeling Bottom-Up Visual Attention Using Dihedral Group D4
Next Article in Special Issue
The Algorithm of Continuous Optimization Based on the Modified Cellular Automaton
Previous Article in Journal
The Role of Orthogonal Polynomials in Tailoring Spherical Distributions to Kurtosis Requirements
Previous Article in Special Issue
Adaptive Image Matching Using Discrimination of Deformable Objects
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Automatic Frequency Identification under Sample Loss in Sinusoidal Pulse Width Modulation Signals Using an Iterative Autocorrelation Algorithm

by
Alejandro Said
1,*,
Yasser A. Davizón
2,
Piero Espino-Román
3,
Roberto Rodríguez-Said
4 and
Carlos Hernández-Santos
5
1
Department of Computer Science, Tecnológico de Monterrey (Campus Monterrey), Eugenio Garza Sada 2501, Monterrey 64849, Mexico
2
Department of Mechatronics, Universidad Popular Autónoma del Estado de Puebla, 21 Sur 1103, Puebla 72410, Mexico
3
Department of Mechatronics, Universidad Politécnica de Sinaloa, Carretera Municipal Libre Mazatlán Higueras Km 3, Mazatlán 82199, Mexico
4
Department of Mechatronics, Tecnológico de Monterrey (Campus Saltillo), Prolongación Juan de la Barrera 1241, Saltillo 25270, Mexico
5
Department of Mechatronics, Instituto Tecnológico de Nuevo León, Eloy Cavazos 2001, Guadalupe 67170, Mexico
*
Author to whom correspondence should be addressed.
Symmetry 2016, 8(8), 78; https://doi.org/10.3390/sym8080078
Submission received: 31 March 2016 / Revised: 28 July 2016 / Accepted: 29 July 2016 / Published: 10 August 2016
(This article belongs to the Special Issue Symmetry in Systems Design and Analysis)

Abstract

:
In this work, we present a simple algorithm to calculate automatically the Fourier spectrum of a Sinusoidal Pulse Width Modulation Signal (SPWM). Modulated voltage signals of this kind are used in industry by speed drives to vary the speed of alternating current motors while maintaining a smooth torque. Nevertheless, the SPWM technique produces undesired harmonics, which yield stator heating and power losses. By monitoring these signals without human interaction, it is possible to identify the harmonic content of SPWM signals in a fast and continuous manner. The algorithm is based in the autocorrelation function, commonly used in radar and voice signal processing. Taking advantage of the symmetry properties of the autocorrelation, the algorithm is capable of estimating half of the period of the fundamental frequency; thus, allowing one to estimate the necessary number of samples to produce an accurate Fourier spectrum. To deal with the loss of samples, i.e., the scan backlog, the algorithm iteratively acquires and trims the discrete sequence of samples until the required number of samples reaches a stable value. The simulation shows that the algorithm is not affected by either the magnitude of the switching pulses or the acquisition noise.

Graphical Abstract

1. Introduction

In a normal Alternating Current (AC) power system, the voltage varies sinusoidally at a specific frequency; usually 50 Hz or 60 Hz [1]. However, in some industrial applications, AC motors are required to work with different supply frequencies; thus, adjustable speed drives are used to solve this problem by varying the frequency of the input voltage.
In general, an oscilloscope is used to observe the voltage and current waveforms. An oscilloscope is designed to capture a specific number of samples at a predefined sampling frequency; thus allowing the operator to examine a plot of the samples on a screen. The operator needs, however, to know the fundamental frequency of the input signal in order to display an exact integer number of cycles. By knowing the fundamental frequency, the number of samples and sampling frequency can be adjusted exactly; otherwise, they need to be adjusted by trial and error. Nevertheless, if these parameters are not adjusted correctly, the Fourier transform will not contain the actual spectrum of the original signal; resulting in discontinuities and spectral leakage; i.e., the spilling of energy centered at one frequency into the surrounding spectral regions [2,3]. Usually, to address this problem, the windowing technique is employed to reduce the amplitude of the discontinuities at the boundaries of each period, reducing spectral leakage [3]. This process, however, produces errors when estimating the amplitude of the spectrum harmonics, while the capacity for detecting weak frequency components near strong components is also lost [2].
The waveform analyzed in the present study is the Sinusoidal Pulse Width Modulation (SPWM) [1,4,5,6], which is used widely in AC drives because it pushes the harmonics into a high-frequency range [4]; thus decreasing the mechanical vibrations that affect the performance of AC motors. However, SPWM generates high-frequency harmonic components that lead to stress on the associated switching devices [1] and electrical power losses; such as rotor and stator winding heating, as well as eddy and hysteresis losses [7]. In order to implement preventive maintenance and a detailed diagnosis of AC machines and their drives, it is necessary to determine the magnitude and location of the harmonics in a fast and accurate manner.
In former studies, the zero-crossing method has been used as one of the simplest ways to estimate the power system frequency; however, the measured signals typically contain harmonic distortions, which may introduce significant errors when using this method [8]. In some practical applications, the autocorrelation function [9,10,11] is used to identify the periodicities in an observed physical signal, which may be corrupted by a random interference [9]. In some recent studies, the problem of estimating the signal parameters for a sinusoidal waveform immersed in random noise has been addressed by using the autocorrelation function [12,13,14]. There exists the non-parametric methods, which are based on the idea of estimating the autocorrelation sequence of a random process from a set of measured data and then taking the Fourier transform for estimating the power spectrum; and the parametric methods, which require some knowledge about how the data samples are generated [15,16]. In addition, the covariance matrices [17,18,19] can be used to estimate the power spectrum assuming that the vector samples are taken from a zero-mean multivariate random Gaussian process. Although these methods are suitable for voice, radar and communication applications, our method is a straightforward engineering solution to a power electronics problem.
In the present study, we propose a frequency detection algorithm to deal with the problem of capturing a single SPWM signal cycle in a fast, automated and reliable manner. The pattern of pulses [6] produced by SPWM gating signals is not random or small, but we use a simulation to show that the autocorrelation function can be employed to identify the fundamental frequency of an SPWM signal despite the magnitude of the pattern of pulses under conditions with scan backlog [20,21] and acquisition noise [22].
First, the original signal is autocorrelated to estimate its period, then the number of samples required to process a single signal cycle is determined approximately. After those steps, the original signal sequence is trimmed iteratively until a single cycle can represent the Fourier spectrum accurately. A mathematical model is proposed for the scan backlog and used along with the acquisition noise effects in the steps of the algorithm.
The remainder of the article is organized as follows: In Section 2, we provide a summary of the background theory required to understand the proposed algorithm. Subsection 2.1 gives the definitions of the discrete Fourier transform, the root mean square (rms) and the Hanning window. An introduction to pure sinusoidal signal analysis is given to highlight the problem of capturing a non-integer number of cycles and to show why it is not convenient to use the windowing technique. Subsection 2.2 describes the relationship between time, the number of samples and the sampling frequency. Subsection 2.3 presents the analysis of the autocorrelation and the period estimation of unknown frequency signals. Subsection 2.4 gives the background theory for SPWM signals: the definitions for the reference signal, the carrier signal, the number of pulses per half cycle and the modulation index. In Section 3, we explain each step of the flowchart for the proposed algorithm. In Section 4, we show the results for the estimation of the input signal frequency, including the effects of the scan backlog and the signal noise. In Section 5, we give our conclusions regarding the main contributions of this study, as well as making suggestions for future research. In Appendix A, we include the parameter estimation of two signals, whose frequencies are non-integer. In Appendix B, the autocorrelation for periodic functions is defined.

2. Signal Analysis Background Theory

2.1. Analysis of the Spectrum Leakage at Sinusoidal Signals

In this subsection, we provide an analysis of the spectrum leakage of a sinusoidal signal in order to highlight the need to acquire an integer number of cycles. In this analysis, we test a sinusoidal signal of 60 Hz and 200 volts-peak (Vp).
The discrete Fourier transform of a sequence of N samples is given by Equation (1), where x ( n ) is the discretized signal and X ( k ) are the spectrum harmonics [23].
X ( k ) = n = 0 N 1 x ( n ) e j 2 π k n N k = 0 , 1 , 2 , . . . , N 1
Equations (2) and (3) conform a modified version of the discrete Fourier transform, which is preferred in the present study. The factors 1 / N and 2 / N affect the height of each harmonic in order to represent its actual amplitude, where the coefficient 1 / N is a normalizing factor used for the reconstruction sum [24] and a multiplication by two is used in order to represent the one-sided Fourier spectrum [3]. The DC component, however, is not multiplied by two [3,7], as can be seen in Equation (2). The mathematical software tool used in this study is MATLAB [25]. It is important to indicate that in order to ensure compatibility with this software, the lower and upper bounds of the summation are modified to start from n = 1 and to end at n = N . Furthermore, only half of the harmonics are used in the one-sided spectrum where k must be an integer; therefore, the index related to the location of each harmonic ranges from k = 1 to the floor integer of half of the samples. Here, the MATLAB function fft(X) is used to calculate the discrete Fourier transform of a sequence. Later, the output of this MATLAB function is modified according to Equations (2) and (3).
X ( k 1 ) = 1 N n = 1 N x ( n ) e j 2 π k n N k = 1
X ( k 1 ) = 2 N n = 1 N x ( n ) e j 2 π k n N k = 2 , 3 , . . . , N / 2
Equations (4)–(6) are used to calculate the rms value of the input signal, where V r m s is the total rms value of the signal, V r m s D C is the rms value of the direct component and V r m s A C is the rms value of the alternate components of the signal. For example, V r m s 1 denotes the rms value of the first harmonic, V r m s 2 is the rms value of the second harmonic, and so on, up to V r m s k [4], where the subscript k represents the number of the spectrum harmonics used, as stated earlier.
V r m s D C = V D C
V r m s A C = V r m s 1 2 + V r m s 2 2 + · · · + V r m s k 2
V r m s = V r m s A C 2 + V r m s D C 2
By displaying only 13 harmonics, the spectrum of an integer number of cycles for a sinusoidal signal of 200 Vp and 60 Hz has a single impulse located at the first harmonic at 60 Hz with a magnitude equal to the amplitude of the signal (as shown by the Fourier spectrum in Figure 1) and a rms value of 141.4 V. Nevertheless, because the Fourier transform assumes periodicity, if one period and a half of the signal is acquired, then the result of the Fourier analysis would be the worst, as shown in Figure 2, where it can be seen that there is a nonexistent D C component at 0 Hz with an amplitude of 42.4 V and several harmonics around the fundamental frequency with wrong amplitudes.
To reduce the magnitude of the nonexistent harmonics caused by acquiring a non-integer number of cycles, a Hanning window [3] can be applied to the input signal. The Hanning window formula is given in Equation (7). A new windowed sequence of samples is obtained by multiplying each element of the discretized signal x ( n ) by each element of the Hanning window h w ( n ) . In this case, the indexes of the Hanning window are assigned from n = 1 to n = N to ensure software compatibility.
h w ( n ) = 0.5 0.5 c o s ( 2 π n / N ) ; n = 1 , 2 , 3 , . . . , N
The resulting Fourier transform for one period and a half of the sine signal multiplied by the Hanning window is shown in Figure 3, where the total rms value is 86.6 V; therefore, representing an error of 38.7% calculated as ( 141.4 86.6 ) · ( 100 / 141.4 ) .
The analysis above demonstrates in a simple, but reliable manner that the window technique is not an appropriate solution when an accurate Fourier spectrum and its related calculations are needed, especially in power systems, where harmonics could be approximately hundreds of volts and should not be neglected.

2.2. Acquisition of a Signal Time-Lapse

Oscilloscopes and data acquisition boards are limited in terms of the number of samples they can store because they have a finite memory. They also capture the data using a specific sampling frequency, which is selectable in many cases. The length of the measured time [3], i.e., the time window t w to be displayed, is given by Equation (8), where N is the number of samples and T s is the sampling period. The sampling period can be related with the sampling frequency f s [3] using Equation (9). Then, Equation (8) can be rewritten as Equation (10). The period of the input signal T can be related to its frequency f using Equation (11).
t w = N · T s
T s = 1 f s
t w = N f s
T = 1 f
For example, if a signal of 60 Hz is acquired, then the number of samples needed to display a single cycle on the screen is N = f s T = ( 100 , 000 ) ( 1 / 60 ) = 1666.6 samples at a sampling frequency of 100 K samples per second, using t w = T . Nevertheless, as shown in Formula (10), the time window can be adjusted by varying the number of samples, as well as the sampling frequency. The maximum sampling frequency, however, should be used in order to get the best resolution. For this simulation, we set the sampling frequency at a value of 100 K s/s, while the number of samples remains variable.
When setting a constant sampling frequency, a lower limit for the input signal frequency is required because more samples are needed to display a signal on the screen as the signal frequency approaches zero Hertz. For simulation purposes, the memory buffer is set to store a maximum of 20,000 samples, which is the number of samples needed to display a signal of 5 Hz at 100 K s/s correctly; therefore, this simulation could not guarantee that the lower input frequencies would be analyzed correctly.

2.3. The Autocorrelation Function

If x ( n ) is a discrete causal sequence, i.e., [ x ( n ) = 0 for n < 0 and n N ], then Equation (12) describes the autocorrelation sequence [9], where i = l , k = 0 for l 0 and i = 0 , k = l for l < 0 . To save programming time, we used the MATLAB function xcorr(X) for calculating the autocorrelation, where X is a discrete sequence.
r x x ( l ) = n = i N k 1 x ( n ) · x ( n l )
The autocorrelation function can be used to extract the fundamental frequency of a signal producing a new sequence of samples of length 2 N 1 . If a discrete time signal x ( n ) is periodic, then its autocorrelation is also periodic with the same period [9,10]; i.e., its autocorrelation has large peaks every period; however, because the sequence has a finite number of samples, the magnitude of peaks decreases (see Appendix B for a detailed explanation about the autocorrelation of periodic discrete sequences). Therefore, the period of the original signal can be obtained using the two autocorrelation indices that belong to the consecutive maximums or the minimums.
At first, rather than estimating one signal period, the amount of time corresponding to half of the period is computed using the lag indexes of the global maximum and global minimum, r m a x and r m i n , respectively. In general, this method is faster because most of the software packages have functions to find the maximum and minimum values within a sequence (MATLAB functions [ M , I ] = m a x ( A ) and [ M , I ] = m i n ( A ) were used). After numbering the autocorrelation lag indices from one to 2 N 1 , the index of the global maximum value of the autocorrelation is l m a x , and the index of the global minimum value is l m i n . Since the autocorrelation samples are separated by a distance T s , half of the period can be estimated using T / 2 = T s ( l m a x l m i n ) ; however, small acquisition errors may occur, so the location of the global minimum cannot be determined accurately; i.e., the global minimum could be located to the right of the global maximum or to the left; therefore, an absolute value operation is needed; i.e., T / 2 = T s ( l m a x l m i n ) ; thus, the period estimation, can be obtained by doubling half of the signal period, as can be seen in Equation (13).
Figure 4 illustrates the case where one and a half period of a sine wave of 200 Vp and 60 Hz has been autocorrelated. For the example shown in Figure 4, the maximum and minimum indices are l m a x = 2500 and l m i n = 1667 , respectively.
T = 2 T s | ( l m a x l m i n ) |
For one period and a half of a sine wave of 200 Vp and 60 Hz, the calculation of the signal frequency based on the determination of the period using the autocorrelation function yields 60.024 Hz; thus, there is a frequency estimation error of 0.04%.

2.4. The Sinusoidal Pulse Width Modulation

There are several SPWM techniques, such as bipolar SPWM [1] and unipolar SPWM [5,26,27]. In the present study, we consider the unipolar SPWM technique. The gating signals for unipolar SPWM can be created by comparing a normalized sinusoid (the reference signal) and a triangular waveform (the carrier signal) [4,5]. The amplitude of the reference signal is A r , and the amplitude of the carrier signal is A c . The modulation index M is the ratio of these signals (see Equation (14)), which affects the width of the pulses.
M = A r A c
The period of the reference signal T r is the same as the period of the SPWM signal T; thus, the switching period of the carrier signal T c [4] can be related to the number of pulses per half cycle p using Equation (15). It is important to note that the carrier period T c depends on the SPWM period T; therefore, given the integer constant of 2 ( p + 1 ) , the carrier frequency is always constrained to be a multiple of the SPWM frequency.
T c = T 2 ( p + 1 )
By rewriting Equation (15), the frequency of the carrier signal f c can be determined given the frequency of the reference signal f r and the desired number of pulses per half cycle p, as can be seen in Equation (16). Equation (16) is a simpler form of Equation (15) because it involves the frequency of the SPWM signal. Here, the frequency of the reference signal is equal to the frequency of the SPWM signal; i.e., f r = f .
f c = 2 f r ( p + 1 )
This type of modulation eliminates all of the Low Order Harmonics (LOH) less than or equal to 2 p 1 , as shown in Equation (17). For example, when p = 5 , the LOH is the ninth [4].
L O H 2 p 1
Figure 5 shows the resulting pattern of pulses for two periods of a reference signal of 60 Hz, with a modulation index of 0.5 and five pulses per half cycle. In this figure, the reference signal, the pattern of pulses and the carrier signal are displayed for the positive semi-cycle; but for clarity, only the reference signal and the pattern of pulses are shown for the negative semi-cycle. In this example, an unidirectional triangular wave is used as the carrier signal [4].
The voltage applied to the AC motor has the same shape as the pattern of pulses of Figure 5, but it is scaled to the available DC voltage of the speed driver. For example, if the available DC voltage at the speed driver is 200 V, then the amplitude of the SPWM is also 200 V; i.e., the peak voltage is 200 Vp.
Figure 6 shows a single period for the resulting SPWM signal produced by the pattern of pulses in Figure 5, where the peak value is 200 V. Figure 7 shows the Fourier spectrum of the waveform illustrated in Figure 6 using the first 29 harmonics. The V r m s A C value of 111.6 V equals the total Vrms value because there is no DC component. Figure 8 shows one period and a half of the same SPWM signal, and Figure 9 shows the corresponding Fourier spectrum. Figure 9 shows, however, that there is a nonexistent DC component with an amplitude of 20.8 V and that Equation (17) is misled because there are several low order harmonics below the ninth harmonic.

3. Automatic Fourier Spectrum Detection Using Autocorrelation

Figure 10 shows a flowchart of the proposed algorithm. Each step in the flowchart is indicated by a number enclosed in a gray circle and explained in the following list. Here, the boldface type is used to indicate a sequence of values; the index n refers to a particular sample; the lowercase index i denotes the latest calculated value; and the lowercase k is used to represent the location of each harmonic in the Fourier spectrum. The maximum and minimum autocorrelation indices are not in boldface type because it is only necessary to retain their last calculations.
(1)
In this step, a white noise signal w ( n ) is added to the original SPWM signal x ( n ) to simulate the effect of the acquisition noise.
(2)
Initially, because there is no information about the signal frequency, the algorithm retrieves the entire buffer to obtain a first approximation. In this step, the scan backlog is neglected because the sample loss is irrelevant.
(3)
After being forced to enter the cycle for the first iteration, the algorithm compares the last two values regarding the number of samples needed to represent a single period. If these values differ for more than one sample, then the algorithm continues with the calculation; else, the Fourier spectrum is computed and displayed as indicated by Step 11.
(4)
The signal autocorrelation is calculated. If this is the first iteration, the autocorrelation is calculated for the 20 Ksamples; else, a trimmed version of the signal is used.
(5)
The result of the autocorrelation is normalized in order to maintain a constant size in the vertical axis of the screen.
(6)
The lag indexes for maximum and minimum values in the autocorrelation are obtained. This is achieved by using the MATLAB functions [ M , I ] = m a x ( X ) and [ M , I ] = m i n ( X ) , where X is a discrete sequence, M is the maximum or minimum value (according to the function used) and I is the index where the value of interest is located.
(7)
The signal period, the signal frequency and the number of samples necessary to represent a single cycle are approximated by using Equations (10), (11) and (13), where the amount of time that needs to be displayed is the period of the signal; i.e., t w = T .
(8)
In this step, a simulation of the scan backlog effect is considered. The scan backlog indicates how much data remain in the buffer after each retrieval, providing a measure of how well the application is maintaining the throughput rate [20,23]; i.e., a Data Acquisition Card (DAQ) does not retrieve the data at the same rate as the sampling frequency f s . The retrieval speed refers to how fast the computer is taking samples from the buffer toward a specific application.
In this simulation, we assume a constant sampling frequency; hence, all of the samples are separated by a time interval of T s regardless of the retrieval speed.
Equation (18) shows our proposed model of the scan backlog. The scan backlog factor B is treated as a random variable that follows a uniform distribution; i.e., B~u(0,0.01). Therefore, the acquired number of N samples is reduced by 1% towards the actual number of samples processed N B in the worst case. For example, a number of samples less than or equal to 200 samples can be lost from a total of 20 K samples.
N B = N B · N
(9)
In this step, the original digital sequence is trimmed according to the computed number of samples necessary to represent a single cycle; however, this parameter is affected by the scan backlog effect; therefore, the algorithm needs at least two iterations to decide if the computed number of samples is correct.
(10)
In this step, a white-noise signal w ( n ) with a signal to noise ratio S N R = 30 dB is added to the acquired SPWM signal x ( n ) to model the acquisition noise. In every iteration, a different white noise signal is used because the computer must simulate the start of a new acquisition.

4. Algorithm Evaluation Methodology

To test the effectiveness of the autocorrelation and the Equation (13) for estimating the period SPWM signals, the autocorrelation is applied to the signal of Figure 8, which consists of one period and a half and a frequency of 60 Hz (see Figure 11). After applying Equations (13) and (11), the estimation of the signal frequency is 60.024 Hz; therefore, this estimation has an error of 0.04% regarding the actual frequency.
After verifying the effectiveness of the autocorrelation and Equation (13) by themselves, we proceed to prove the algorithm. Initially, the algorithm retrieves the entire buffer. Figure 12 shows the initial screen, where 20 K of an SPWM signal of 200 Vp and 60 Hz were acquired.
After running the algorithm illustrated in Figure 10, the final version of the input sequence is presented in Figure 13, and its corresponding normalized autocorrelation is shown in Figure 14. In addition, the automated approximation of the Fourier spectrum produced by the algorithm is presented in Figure 15, which resembles the exact Fourier spectrum of the SPWM signal shown in Figure 7.
The final computation of the fundamental frequency of the SPWM signal, including the addition of the white noise and the effect of the scan backlog, is 60.024 Hz; therefore, there is an error of 0.04% regarding the actual input frequency of 60 Hz. After running the algorithm 30 times and including the white noise effect, the average calculation of the total rms value is 111.9 V, and the average estimation of the required number of samples is 1656.7 samples; representing an error of 0.2% in terms of the rms value and an error of 0.5% in terms of the number of samples (with one decimal place of significance). The average number of iterations required by the algorithm to converge to a stable number of samples under these conditions is 5.9 iterations.
To compare the latest results, the white noise is removed. Then, the average rms value is 111.8 V, and the estimated number of samples is 1658.4 samples; therefore, representing an average rms error of 0.2% and an error of 0.4% in terms of the required number of samples (with one decimal place of significance). The average number of iterations required by the algorithm to converge to a stable number of samples under these conditions is 6.9 iterations.

5. Conclusions and Future Work

Regarding the present study, we can conclude that:
  • It is important to represent a single SPWM signal period in the Fourier analysis; otherwise, the amplitude non-existing harmonics could lead to a poor electrical diagnosis. In industry, this could affect the preventive and corrective actions taken regarding the AC motors and their drives.
  • The autocorrelation function can be applied to calculate the period of SPMW signals regardless of the magnitude of the pattern of pulses.
  • The autocorrelation function can be used to estimate the period of SPWM signals under the loss of samples.
  • The acquisition noise had no substantial effect in the calculation of the required number of samples.
The main contributions of the present study are:
  • Taking advantage of the symmetry of the autocorrelation, we have searched for the maximum and minimum value indexes regardless of the global maximum and minimum locations. This allowed for a rapid estimation of the signal period.
  • We have provided a simple stochastic model for the scan backlog, to analyze the sample loss.
  • We have implemented an algorithm that uses the autocorrelation to iteratively calculate an SPWM signal period despite the loss of samples and acquisition noise. Thus, we have provided a simulation under realistic conditions for an acquisition process.
As future work, the following opportunity areas remain:
  • The scan backlog can also be modeled with variations in the sampling frequency around a set point.
  • In this study, the acquisition process commenced at the beginning of the positive semi-cycle; however, the variation of a specified trigger level can also be analyzed.
  • The analysis of other PWM techniques using this algorithm is encouraged.
  • The proposed algorithm can be programmed into a real acquisition device to analyze SPWM voltage and current signals.
Finally, it is important to say that if this algorithm is implemented in modern oscilloscopes and power analyzers, it could reduce the potential errors caused by the operator. The algorithm presented in this work could also be used in control applications where an in-line calculation of the fundamental frequency (or other harmonic) is needed for a fast and continuous analysis of SPWM signals.

Acknowledgments

This study was supported by Consejo Nacional de Ciencia y Tecnología (CONACYT), located at Insurgentes 1582, Zip Code 03940, CDMX, México. Furthermore, this study was supported by Tecnológico de Monterrey (ITESM), located at Eugenio Garza Sada 2501, Zip Code 64849, Monterrey, Nuevo León, México. The costs for open access publishing where funded by Universidad Politécnica de Sinaloa, located at Carretera Municipal Libre Mazatlán Higueras Km 3, Zip Code 82199, Mazatlán, Sinaloa, México.

Author Contributions

Alejandro Said and Roberto Rodríguez-Said conceived the idea and performed the simulations. Alejandro Said and Yasser A. Davizón wrote the paper. Piero Espino-Román and Carlos Hernández-Santos analyzed and reviewed the data. Piero Espino-Román and Yasser A. Davizón, looked for the suitable journal. All authors performed the literature review.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A

In this section, the algorithm is tested with non-integer frequencies, to prove that the algorithm works correctly despite the round-off errors [23]. Two cases are provided: in the first case, the results are displayed for an SPWM signal of 33.7 Hz with p = 5 and M = 0.5 ; in the second case, the results are displayed for an SPWM signal of 99.3 Hz with p = 9 and M = 0.5 . The acquisition noise is considered for both frequencies.
For the SPWM signal of 33.7 Hz, Figure A1 shows the screen where 20 K samples are initially acquired. Figure A2 shows the final trimmed version of the SPWM signal, and Figure A3 shows its corresponding normalized autocorrelation used to calculate an approximated number of samples. Figure A4 shows the approximated Fourier spectrum obtained in an automated manner, where the L O H is the ninth. After running the algorithm 30 times, the average frequency calculation results in 33.715 Hz, representing an error of 0.012% regarding the exact frequency of 33.7 Hz. The average calculation of the total rms value is 111.9 V, representing an error of 0.3% regarding the exact rms value of 111.5 V (with one decimal place of significance). The average estimated number of samples results in 2950.9 samples, representing an error of 0.5% regarding the exact number of 2967.3 samples (with one decimal place of significance). The average number of iterations required by the algorithm to converge to a stable number of samples for this particular frequency is 16.8 iterations.
Figure A1. Initial screen for an SPWM signal of 200 Vp and 33.7 Hz, where p = 5 and M = 0.5.
Figure A1. Initial screen for an SPWM signal of 200 Vp and 33.7 Hz, where p = 5 and M = 0.5.
Symmetry 08 00078 g016
For the SPWM signal of 99.3 Hz, Figure A5 shows the screen where 20 K samples are initially acquired. Figure A6 shows the final trimmed version of the SPWM signal, and Figure A7 shows its corresponding normalized autocorrelation. Figure A8 shows the approximated Fourier spectrum, where the L O H is the seventeenth. After running the algorithm 30 times, the average frequency calculation results in 99.206 Hz, representing an error of 0.094 % regarding the exact frequency of 99.3 Hz. The average calculation of the total rms value is 113.0 V, representing an error of 0.2% regarding the exact rms value of 112.7 V (with one decimal place of significance). The average estimated number of samples results in 1003.2 samples, representing and error of 0.3% regarding the exact number of 1007.0 samples (with one decimal place of significance). The average number of iterations required by the algorithm to converge to a stable number of samples for this particular frequency is 7.0 iterations.
Figure A2. Final trimmed version for an SPWM signal of 200 Vp and 33.7 Hz, with p = 5 and M = 0.5.
Figure A2. Final trimmed version for an SPWM signal of 200 Vp and 33.7 Hz, with p = 5 and M = 0.5.
Symmetry 08 00078 g017
Figure A3. Final autocorrelation function of the trimmed version for an SPWM signal of 200 Vp and 33.7 Hz, with p = 5 and M = 0.5.
Figure A3. Final autocorrelation function of the trimmed version for an SPWM signal of 200 Vp and 33.7 Hz, with p = 5 and M = 0.5.
Symmetry 08 00078 g018
Figure A4. Final Fourier spectrum of a trimmed version for an SPWM signal of 200 Vp and 33.7 Hz, with p = 5 and M = 0.5.
Figure A4. Final Fourier spectrum of a trimmed version for an SPWM signal of 200 Vp and 33.7 Hz, with p = 5 and M = 0.5.
Symmetry 08 00078 g019
Figure A5. Initial screen for an SPWM signal of 200 Vp and 99.3 Hz, where p = 9 and M = 0.5.
Figure A5. Initial screen for an SPWM signal of 200 Vp and 99.3 Hz, where p = 9 and M = 0.5.
Symmetry 08 00078 g020
Figure A6. Final trimmed version for an SPWM signal of 200 Vp and 99.3 Hz, with p = 9 and M = 0.5.
Figure A6. Final trimmed version for an SPWM signal of 200 Vp and 99.3 Hz, with p = 9 and M = 0.5.
Symmetry 08 00078 g021
Figure A7. Final autocorrelation function of the trimmed version for a SPWM signal of 200 Vp and 99.3 Hz, with p = 9 and M = 0.5.
Figure A7. Final autocorrelation function of the trimmed version for a SPWM signal of 200 Vp and 99.3 Hz, with p = 9 and M = 0.5.
Symmetry 08 00078 g022
Figure A8. Final Fourier spectrum of a trimmed version for an SPWM signal of 200 Vp and 99.3 Hz, with p = 9 and M = 0.5.
Figure A8. Final Fourier spectrum of a trimmed version for an SPWM signal of 200 Vp and 99.3 Hz, with p = 9 and M = 0.5.
Symmetry 08 00078 g023

Appendix B

According to Proakis [9], the autocorrelation function of finite discrete sequences can be described by Equation (12); however, if the discrete sequence is periodic with a period consisting of N samples, then the autocorrelation can be described by Equation (B1).
r x x = 1 N n = 0 N 1 x ( n ) x ( n l )
Taking M samples of the signal in Equation (B2), where x ( n ) is a periodic sequence of unknown period and w ( n ) represents a random interference, the autocorrelation can be described by Equation (B3).
y ( n ) = x ( n ) + w ( n )
r y y = 1 M n = 0 M 1 y ( n ) y ( n l )
Substituting Equation (B2) in Equation (B3), Equation (B4) is obtained. Here, r x x ( l ) is the autocorrelation of x ( n ) , the cross-correlation between the signal x ( n ) ; the random interference w ( n ) is represented by r x w ( l ) and r w x ( l ) ; and the term r w w ( l ) is the autocorrelation of the random interference. Because x ( n ) is periodic, its autocorrelation has the same periodicity, presenting large peaks in l = 0 , N , 2 N and every N multiple; however, when the displacement l tends to M, the peaks decrease in amplitude, because there is a finite data storage consisting of M samples. In general, the cross-correlations r x w ( l ) and r w x ( l ) are small, because it is assumed that x ( n ) and w ( n ) are not related. Given the randomness of w ( n ) , its autocorrelation r w w ( l ) tends rapidly to zero.
r y y ( l ) = 1 M n = 0 M 1 [ x ( n ) + w ( n ) ] [ x ( n l ) + w ( n l ) ] = r x x ( l ) + r x w ( l ) + r w x ( l ) + r w w ( l )

References

  1. Reza, S.E. A Study on SPWM Boost Inverter and Its Reactive Power Control Strategy; Lap Lambert Academic Publishing: Saarbrücken, Germany, 2012; pp. 12–19. [Google Scholar]
  2. Rapuano, S.; Harris, F.J. An Introduction to FFT and Time Domain Windows. IEEE Trans. Instrum. Meas. 2007, 10, 32–44. [Google Scholar] [CrossRef]
  3. Chugani, M.L.; Samant, A.R.; Cerna, M. LabView Signal Processing; Prentice Hall PTR: Upper Saddle River, NJ, USA, 1998; pp. 76–104. [Google Scholar]
  4. Rashid, M.H. Power Electronics: Circuits, Devices and Applications; Pearson Prentice Hall: Upper Saddle River, NJ, USA, 2004; pp. 253–256. [Google Scholar]
  5. Mohan, N.; Undeland, T.M.; Robbins, W.P. Power Electronics: Converters, Applications and Design; John Wiley and Sons, Inc.: Hoboken, NJ, USA, 2003; pp. 212–216. [Google Scholar]
  6. Brown, M. Power Electronics in Motor Drives; Elektor International Media: London, UK, 2010; pp. 92–95. [Google Scholar]
  7. Llamas, A.; Acevedo, S.; Baez, J.A.; Reyes, J.A. Armónicas en Sistemas Eléctricos Industriales; Innovación Editorial Lagares: Monterrey, México, 2004; pp. 56–59. [Google Scholar]
  8. Nam, S.; Kang, S.; Kang, S. Real-Time Estimation of Power System Frequency Using A Three-Level Discrete Fourier Transform Method. Energies 2014, 8, 79–93. [Google Scholar] [CrossRef]
  9. Proakis, J.G.; Manolakis, D.G. Digital Signal Processing; Pearson Prentice Hall: Madrid, Spain, 2007; pp. 109–457. [Google Scholar]
  10. Rabiner, L.R. On the Use of Autocorrelation Analysis for Pitch Detection. IEEE Trans. Acoust. Speech Signal Process. 1977, 25, 24–33. [Google Scholar] [CrossRef]
  11. Shahnaz, C.; Zhu, W.; Ahmad, M.O. Pitch Estimation Based on a Harmonic Sinusoidal Autocorrelation Model and a Time-Domain Matching Scheme. IEEE Trans. Audio Speech Lang. Process. 2012, 20, 310–323. [Google Scholar] [CrossRef]
  12. Xiao, Y.; Wei, P.; Tai, H. Autocorrelation-Based algorithm for single-frequency estimation. Signal Process. 2007, 87, 1224–1233. [Google Scholar] [CrossRef]
  13. Elasmi-Ksibi, R.; Besbes, H.; López-Valcarce, R.; Cherif, S. Frequency estimation of real-valued single-tone in colored noise using multiple autocorrelation lags. Signal Process. 2010, 90, 2303–2307. [Google Scholar] [CrossRef]
  14. Cao, Y.; Wei, G.; Chen, F.A. A closed-form expanded autocorrelation method for frequency estimation of a sinusoid. Signal Process. 2012, 92, 885–892. [Google Scholar] [CrossRef]
  15. Stoica, P.; Randolph, L.M. Spectral Analysis of Signals; Pearson Prentice Hall: Upper Saddle River, NJ, USA, 2005. [Google Scholar]
  16. Hayes, M.H. Statistical Digital Signal Processing and Modeling; John Wiley and Sons: New York, NY, USA, 2009. [Google Scholar]
  17. Parker, B.J.; Luenberger, D.G.; Wenger, D.L. Estimation of structured covariance matrices. Proc. IEEE 1982, 70, 963–974. [Google Scholar]
  18. Zorzi, M.; Ferrante, A. On the estimation of structured covariance matrices. Automatica 2012, 48, 2145–2151. [Google Scholar] [CrossRef]
  19. Cai, T.T.; Ren, Z.; Zhou, H.H. Estimating structured high-dimensional covariance and precision matrices: Optimal rates and adaptive estimation. Electr. J. Stat. 2016, 10, 1–59. [Google Scholar] [CrossRef]
  20. Eltahir, W.E.; Lai, W.K.; Ismail, A.F.; Salami, M.J. Hardware Design, Development and Evaluation of a Pressure-based Typing Biometrics Authentication System. In Proceedings of the Eighth Australian and New Zealand Intelligent Information Systems Conference (ANZIIS), Sidney, Australia, 10–12 December 2003; pp. 49–54.
  21. Wei, C.; Zhuang, Z. A CAN Network for Temperature Monitoring of Car Engine and Train Bogie. In Proceedings of the International Conference on Internet Computing and Information Services, (ICICIS), Hong Kong, China, 17–18 September 2011; pp. 302–305.
  22. Skibinski, G.L.; Kerkman, R.J.; Schlegel, D. EMI emissions of modern PWM AC drives. IEEE Trans. Ind. Appl. 1999, 5, 47–81. [Google Scholar] [CrossRef]
  23. Rabiner, L.; Cooley, J.; Helms, H.; Jackson, L.; Kaiser, J. Terminology in digital signal processing. IEEE Trans. Audio Electroacoust. 1972, 20, 322–337. [Google Scholar] [CrossRef]
  24. Prandoni, P.; Vetterli, M. Signal Processing for Communications; CRC Press: Boca Raton, FL, USA, 2008; pp. 63–65. [Google Scholar]
  25. Matlab. The MathWorks, Inc. Available online: http://www.mathworks.com/ (accessed on 16 July 2016).
  26. Yue, X.; Ma, X.; Wang, H. A conceit of unipolar N-multiple frequency SPWM and the main circuit topology. In Proceedings of the IEEE 6th International Power Electronics and Motion Control Conference, Wuhan, China, 17–20 May 2009; pp. 1531–1534.
  27. Patel, M.A.; Patel, A.R.; Vyas, D.R.; Patel, K.M. Use of PWM techniques for power quality improvement. J. Recent Trends Eng. Technol. 2009, 1, 99–102. [Google Scholar]
Figure 1. Exact Fourier transform for a sine wave of 200 volts-peak (Vp) and 60 Hz.
Figure 1. Exact Fourier transform for a sine wave of 200 volts-peak (Vp) and 60 Hz.
Symmetry 08 00078 g001
Figure 2. Distorted Fourier transform of one period and a half for a sine wave of 200 Vp and 60 Hz.
Figure 2. Distorted Fourier transform of one period and a half for a sine wave of 200 Vp and 60 Hz.
Symmetry 08 00078 g002
Figure 3. Distorted Fourier transform of one period and a half for a sine wave of 200 Vp and 60 Hz using a Hanning window.
Figure 3. Distorted Fourier transform of one period and a half for a sine wave of 200 Vp and 60 Hz using a Hanning window.
Symmetry 08 00078 g003
Figure 4. Autocorrelation of one cycle and a half for a sine wave of 200 Vp and 60 Hz.
Figure 4. Autocorrelation of one cycle and a half for a sine wave of 200 Vp and 60 Hz.
Symmetry 08 00078 g004
Figure 5. Carrier signal, reference signal and pattern of pulses for an SPWM where p = 5 and M = 0.5.
Figure 5. Carrier signal, reference signal and pattern of pulses for an SPWM where p = 5 and M = 0.5.
Symmetry 08 00078 g005
Figure 6. Single period for an SPWM signal of 200 Vp and 60 Hz, where p = 5 and M = 0.5.
Figure 6. Single period for an SPWM signal of 200 Vp and 60 Hz, where p = 5 and M = 0.5.
Symmetry 08 00078 g006
Figure 7. Fourier spectrum of a single period for an SPWM signal of 200 Vp and 60 Hz.
Figure 7. Fourier spectrum of a single period for an SPWM signal of 200 Vp and 60 Hz.
Symmetry 08 00078 g007
Figure 8. One period and a half for an SPWM signal of 200 Vp and 60 Hz, where p = 5 and M = 0.5.
Figure 8. One period and a half for an SPWM signal of 200 Vp and 60 Hz, where p = 5 and M = 0.5.
Symmetry 08 00078 g008
Figure 9. Spectrum of one period and a half for an SPWM signal of 200 Vp and 60 Hz.
Figure 9. Spectrum of one period and a half for an SPWM signal of 200 Vp and 60 Hz.
Symmetry 08 00078 g009
Figure 10. Flowchart of the algorithm based on the autocorrelation function.
Figure 10. Flowchart of the algorithm based on the autocorrelation function.
Symmetry 08 00078 g010
Figure 11. Autocorrelation function for one period and a half for an SPWM signal of 200 Vp and 60 Hz, with p = 5 and M = 0.5.
Figure 11. Autocorrelation function for one period and a half for an SPWM signal of 200 Vp and 60 Hz, with p = 5 and M = 0.5.
Symmetry 08 00078 g011
Figure 12. Initial screen for an SPWM signal of 200 Vp and 60 Hz, where M = 0.5 and p = 5.
Figure 12. Initial screen for an SPWM signal of 200 Vp and 60 Hz, where M = 0.5 and p = 5.
Symmetry 08 00078 g012
Figure 13. Final trimmed version for an SPWM signal of 200 Vp and 60 Hz, where M = 0.5 and p = 5.
Figure 13. Final trimmed version for an SPWM signal of 200 Vp and 60 Hz, where M = 0.5 and p = 5.
Symmetry 08 00078 g013
Figure 14. Final normalized autocorrelation function of the trimmed version for an SPWM input signal of 200 Vp and 60 Hz, where M = 0.5 and p = 5.
Figure 14. Final normalized autocorrelation function of the trimmed version for an SPWM input signal of 200 Vp and 60 Hz, where M = 0.5 and p = 5.
Symmetry 08 00078 g014
Figure 15. Final Fourier spectrum of a trimmed version for an SPWM input signal of 60 Hz and 200 Vp.
Figure 15. Final Fourier spectrum of a trimmed version for an SPWM input signal of 60 Hz and 200 Vp.
Symmetry 08 00078 g015

Share and Cite

MDPI and ACS Style

Said, A.; Davizón, Y.A.; Espino-Román, P.; Rodríguez-Said, R.; Hernández-Santos, C. Automatic Frequency Identification under Sample Loss in Sinusoidal Pulse Width Modulation Signals Using an Iterative Autocorrelation Algorithm. Symmetry 2016, 8, 78. https://doi.org/10.3390/sym8080078

AMA Style

Said A, Davizón YA, Espino-Román P, Rodríguez-Said R, Hernández-Santos C. Automatic Frequency Identification under Sample Loss in Sinusoidal Pulse Width Modulation Signals Using an Iterative Autocorrelation Algorithm. Symmetry. 2016; 8(8):78. https://doi.org/10.3390/sym8080078

Chicago/Turabian Style

Said, Alejandro, Yasser A. Davizón, Piero Espino-Román, Roberto Rodríguez-Said, and Carlos Hernández-Santos. 2016. "Automatic Frequency Identification under Sample Loss in Sinusoidal Pulse Width Modulation Signals Using an Iterative Autocorrelation Algorithm" Symmetry 8, no. 8: 78. https://doi.org/10.3390/sym8080078

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop