# An Improved CZT Algorithm for High-Precision Frequency Estimation
## 2 Signal Model and Related Works  
Suppose that there are \(P\) frequency components in the signal. It takes the following form:  
\[x(t)=\sum_{i=1}^{P}a_{i}\exp(j2\pi f_{ci}t+\varphi_{i}) \tag{1}\]  
where \(a_{i}(i=1,\ldots,P)\) represents the amplitude, \(f_{ci}(i=1,\ldots,P)\) represents the frequency, and \(\varphi_{i}(i=1,\ldots,P)\) represents the phase.  
In order to facilitate the derivation of the proposed method, a single-tone signal model with \(P=1\) in (1) is considered. It should be noted that the same derivation can be applied to the signal model of multiple frequency components. When \(P=1\), the single-tone signal model takes the following form:  
\[x(t)=a_{0}\exp(j2\pi f_{c}t+\varphi_{0}) \tag{2}\]where \(a_{0}\) is the signal amplitude, \(\varphi_{0}\) is the initial phase, and \(f_{c}\) represents the frequency to be estimated. Then, the sampled signal \(x(n)\) is  
\[x(n)=a_{0}\exp\left(j2\pi f_{c}\frac{n}{f_{s}}+\varphi_{0}\right),n=0,\,1,\, \cdots,\,\,N-1 \tag{3}\]  
where \(f_{s}\) is the sampling rate, and \(N\) is the number of samples. The FFT algorithm is applied to \(x(n)\) to obtain the spectrum \(X(k)(k=0,\,1,\,\cdots,\,\,N-1)\), which then obtains the estimate \(\hat{f}_{p}\), corresponding to the frequency index \(k_{p}\) of the maximum of the FFT spectrum amplitude. The conventional CZT algorithm [11] is centered on the frequency estimate \(\hat{f}_{p}\), and the refined frequency range is chosen as \((f_{1},f_{2})\),  
\[f=f_{1}+B_{\text{CZT}}\frac{k}{M},k=0,\,\cdots,\,M-1 \tag{4}\]  
where \(B_{\text{CZT}}\) is the bandwidth of \((f_{1},f_{2})\), and \(M\) represents the length of CZT. The CZT algorithm [11] is performed on \(x(n)\) to obtain  
\[X_{\text{CZT}}(z_{k})=\sum\limits_{n=0}^{N-1}x(n)z_{k}^{-n},k=0,\cdots,M-1 \tag{5}\]  
where \(z_{k}=AW^{-k}\), \(A=A_{0}e^{i\theta_{0}}\), \(W=W_{0}e^{-j\phi_{0}}\), \(\theta_{0}\) is the starting sampling angle, and \(\phi_{0}\) is the angle between two adjacent sampling points. The frequency range \((f_{1},f_{2})\) of the CZT is determined based on the frequency index \(k_{p}\) and the parameter \(q\) and is given by  
\[f_{1}=\frac{f_{s}}{N}(k_{p}-q) \tag{6}\]  
\[f_{2}=\frac{f_{s}}{N}(k_{p}+q) \tag{7}\]  
Let \(A_{0}=1\) and \(W_{0}=1\).Then, the CZT of \(x(n)\) is given by  
\[X_{\text{CZT}}(k)=\sum\limits_{n=0}^{N-1}x(n)z_{k}^{-n}=\sum \limits_{n=0}^{N-1}x(n)\exp(-j\theta_{0})\exp(-j\phi_{0}nk) \tag{8}\] \[=a_{0}\exp(j2\pi\varphi_{0})\times\exp\left(j\pi(N-1)\left(\frac{ f_{c}}{f_{s}}-\frac{\theta_{0}}{2\pi}-\frac{\phi_{0}k}{2\pi}\right)\right) \times\frac{\sin\left(\pi\left(\frac{f_{c}}{f_{s}}-\frac{\theta_{0}}{2\pi} \right)-\frac{\phi_{0}k}{2\pi}\right)}{\sin\left(\pi\left(\frac{f_{c}}{f_{s}} -\frac{\theta_{0}}{2\pi}-\frac{\phi_{0}k}{2\pi}\right)\right)},\] \[k=0,\cdots,M-1\]  
where \(\theta_{0}=2\pi(k_{p}-q)/N\), and \(\phi_{0}=2\pi(2q)/(MN)\). In this case, the frequency resolution of the CZT is \(2 qf_{s}/(NM)\). By substituting \(\theta_{0}\) and \(\phi_{0}\) into (7), the CZT spectrum of \(x(n)\) can be expressed as:  
\[X_{\text{CZT}}(k)=a_{0}\exp(j2\pi\varphi_{0})\times \tag{9}\] \[\exp\left(j\pi(N-1)\left(\frac{f_{c}}{f_{s}}-\frac{k_{p}-q}{N}- \frac{2 qk}{MN}\right)\right)\times\frac{\sin\left(\pi\left(\frac{f_{c}N}{f_{s} }-\left(k_{p}-q\right)-\frac{2 qk}{MN}\right)\right)}{\sin\left(\pi\left(\frac{ f_{c}}{f_{s}}-\frac{(k_{p}-q)}{N}-\frac{2 qk}{NM}\right)\right)}\]  
Assuming that the frequency index at the maximum amplitude of the CZT spectrum is \(k_{m}\), the frequency estimate is expressed as:  
\[\hat{f}_{m}=\left(k_{p}-q\right)\frac{f_{s}}{N}+k_{m}\frac{2 qf_{s}}{NM} \tag{10}\]  
Because of the fence effect of the discrete signal, the maximum value \(\hat{f}_{m}\) of the CZT spectral in (9) is difficult to coincide with the true value \(f_{c}\), and thus, there exists a frequency bias between them. In order to solve this problem, an improved CZT algorithm will be proposed in the next section for estimating this frequency bias to obtain a more accurate frequency estimate.