## 3 Proposed Method
### \(df_{m}\) Estimator Block  
The \(df_{m}\) Estimator block makes an initial estimation of the distance between frequencies in the current spectrum that are related to the motor speed, \(df_{m}\). This estimation is later used by subsequent blocks to initialize the first estimation of the position of one frequency component in the current spectrum. This block (Figure 3) has two inputs and one output. The inputs are \(i\), the vector with the current samples stored in the buffer, and \(ex\_dfm\), the Boolean value that indicates whether or not the block is to be executed. When \(ex\_dfm\) has a _Ture_ value, the block is executed, and when it has a \(False\) value, the block is not executed. When the block is executed, it makes the initial estimation of \(df_{m}\). The block diagram of the \(df_{m}\) Estimator block when it is executed, in other words, when the value of \(ex\_dfm\) is _True_, is shown in Figure 4. As shown, there are several steps in the \(df_{m}\) Estimator block required to obtain an accurate value for the distance between frequencies in the current spectrum. The distance between frequencies is related to the motor speed. The \(df_{m}\) Estimator block (Figure 3) calculates the Fast Fourier Transform (FFT) over the vector of the sampled current to obtain its spectrum. However, not all components of the current spectrum are used in the algorithm. Instead, the next block selects the frequencies between \(f_{\min}\) and \(f_{\max}\), and only the frequencies between \(f_{\min}\) and \(f_{\max}\) are used. The region outside this window contains significant noise, and will not be helpful in the estimation. Another reason for not using values outside this region is the additional computational cost of the algorithm if those frequencies were included. To decrease the effect of noise on the estimate of the distance between frequencies, autocorrelation is performed on the spectrum band window between \(f_{\min}\) and \(f_{\max}\):  
\[A[m]=\sum_{k=0}^{K_{\max}}\big{(}I[m]-\overline{I}\big{)}\big{(}I[m-k]- \overline{I}\big{)} \tag{10}\]  
where \(A[m]\) is the autocorrelation, \(I[m]\) is the current spectrum between \(f_{\min}\) and \(f_{\max}\), \(\overline{I}\) is the mean value of the current spectrum between \(f_{\min}\) and \(f_{\max}\), \(K_{\max}\) is the length or number of samples of the spectrum between \(f_{\min}\) and \(f_{\max}\), and \(m\) is the discrete index. This autocorrelation formula is unusual because the mean value is previously subtracted from the input. This action eliminates the effect of the mean value in the autocorrelation and it ensures that the autocorrelation ground level will not decrease as the index \(m\) is increased. This facilitates the detection of peaks in the autocorrelation signal. The autocorrelation signal has different peaks that are related to the distance between frequencies present in the current spectrum. For example, the first peak in the autocorrelation indicates the distance between peaks in the spectrum signal, the second is two times this distance, and the third is three times this distance. So the distance between two consecutive peaks is the distance between frequencies in the spectrum. The advantage of using the autocorrelation signal instead of the spectrum is the  
Figure 4: Block diagram of the \(df_{m}\) Estimator block when \(ex\_dfm\) is _Ture_. FFT: Fast Fourier Transform. reduction of noise, and, thus, the improvement of the estimation. This can be seen in Figure 5, which shows the amplitude of the signal autocorrelation obtained according to the proposed method from the current spectrum of Figure 2. The motor speed in this situation is 2400 rpm, and the distance between frequencies in the spectrum is 40 Hz according to Equation (9). In the proposed method, instead of using only the first peak to estimate the distance between frequencies, every peak of the autocorrelation signal is used. This increases the precision of the estimation.