# Estimation of the Measurement Accuracy of Wireless Passive Resonance Sensors
## 4 Calculating the Natural Frequency of a Decaying Oscillator
### Fine Search for the Carrier Frequency  
Without zero padding, the width of the main lobe in the frequency domain is about two step sizes, and the points to the left and right of the maximum are approximately at the height of the 3 dB points. As a result, the Lorentz curve around the resonance frequency is quite poorly resolved for an exact determination of the maximum. In addition, the Lorentz curve can not be approximated with a parabolic approximation using the three points around the maximum, which is to be expected from Figure 10 on the left, but it can be seen clearly in Figure 11.  
To achieve a resolution close to [PERSON]'s lower bound, we need to fit the sample values in the frequency domain around the maximum with a Lorentz curve. In [39; 40], [PERSON] presents an iterative algorithm for the extremely efficient and highly accurate calculation of the maximum of an approximated Lorentz curve. The algorithm uses two DFT values that must have a mutual frequency separation of 1 FFT step size and that must be above and below the maximum. In Appendix E, we deduce the algorithm. Figure 10: **Left**: Detail enlargement of the peak in the frequency domain that was calculated via Fourier transformation of the signal of a decaying resonator over \(\
icefrac{{\mathcal{O}}}{{f}}\) oscillations. The initial signal-to-noise ratio is 40 dB. The blue circles represent the sample values for a calculation without zero padding. The red line was calculated with a zero padding of 10. The center frequency is marked with a small cross. The slight ripple results from the truncation of the exponential function. **Right**: Measurement signal in magnitude and phase that was demodulated with the frequency of the coarse resolved maximum in the left spectrum without zero padding. Since the actual frequency is about a quarter step size apart from the maximum, a phase error of \(90^{\circ}\) remains. The discrete Fourier coefficients \(S_{k}\) in the frequency domain are calculated from the sample values \(s_{n}\) with  
\[S_{k}=\sum_{n=0}^{N-1}s_{n}e^{-j2\pi\frac{n}{N}} \tag{48}\]  
Let \(m\) be the index of the maximum of the Fourier coefficients, corresponding to a frequency \(f_{old}\), with  
\[f_{old}=\frac{m}{NT}. \tag{49}\]  
Then, we need the DTF components for \(k=m\pm\frac{1}{2}\). Half-step sizes in the frequency domain can be achieved either by zero padding N points before calculating a FFT or by evaluating the DFT, Equation (48), for \(k=m\pm\frac{1}{2}\). We obtain \(S_{m-\frac{1}{2}}\) and \(S_{m+\frac{1}{2}}\), and we define  
\[h=\frac{1}{2}\frac{S_{m+\frac{1}{2}}+S_{m-\frac{1}{2}}}{S_{m+\frac{1}{2}}-S_{m -\frac{1}{2}}} \tag{50}\]  
An improved estimate of the resonance frequency \(f_{updated}\), as well as an estimate of the damping constant \(\alpha\), is then given by  
\[f_{updated} = f_{old}+\frac{\Re{\{h\}}}{NT} \tag{51}\] \[\alpha = \frac{2\pi}{NT}\Im{\{h\}}, \tag{52}\]  
with \(\Re{\{h\}}\) and \(\Im{\{h\}}\) being the real and imaginary part of \(h\). Based on this improved estimate for the resonance frequency, we can now use the discrete Fourier transformation (DTF) in Equation (48) to calculate the two Fourier coefficients half a step size from the improved estimate to the left and right  
\[S_{m+\Re{\{h\}}\pm\frac{1}{2}}=\sum_{n=0}^{N-1}s_{n}e^{-j2\pi\frac{n\left(m+ \Re{\{h\}}\right)}{N}} \tag{53}\]  
and thus run the optimization again. Figure 11: Detailed enlargement of the peak in the frequency domain, which was calculated by Fourier transforming the signal of a decaying resonator for \(\
icefrac{{0}}{{\!/}}\)/\(\!\!\) oscillations. The initial signal-to-noise ratio is 40 dB. The blue line connects the samples which were calculated without zero padding. The circles mark the maximum and its left and right sampling points. The dashed black line is a parabola approximation through these 3 points. The red line was calculated with a zero padding of 20 times the number of points. The actual resonance frequency and the maximum of the parabola are marked with small crosses.