# Efficient Detection Approach for DTMF Signal Detection
## 3 Proposed Algorithm  
MFD is presented as a simplified but improved version of a typical DTMF detection algorithm. It is developed as a two-phase algorithm, the first of which is for offline detector design and the second is for tone detection. Phase 1 aims to design and then realize the optimal frequency response of a detector for a specified signal tone range of interest, and a lookup table is built accordingly. Subsequently, a tone detection is performed in Phase 2 using the optimal detector implemented previously. The presented MFD detection approach is illustrated with an example in Figure 3. The frequency response of a detector is synthesized as a superposition of \(W_{N}^{nk}\) corresponding to the \(k\) of interest, and the optimal frequency response thereof is found accordingly. Thus, this study presents a synthesized multi-frequency detector, formulated as a modified form of (1), that is,  
\[ \begin{array}{rl}\widetilde{X}[k^{\prime}]&=\sum\limits_{n=0}^{N-1}x[n] \widetilde{W}_{M,N,\theta}^{nk^{\prime}}\\ &=\sum\limits_{n=0}^{N-1}x[n]\sum\limits_{m=0}^{M-1}\Big{\{}\cos\Big{(}\frac{2 \pi n(k^{\prime}+m)}{N}+m\theta\Big{)}-j\sin\Big{(}\frac{2\pi n(k^{\prime}+m)} {N}+m\theta\Big{)}\Big{\}}\\ &=\sum\limits_{n=0}^{N-1}x[n]\{w_{r}(n)-jw_{i}(n)\}\end{array}  \tag{4}\]  
and  
\[ \begin{array}{rl}\widetilde{W}_{M,N,\theta}^{nk^{\prime}}&=\sum\limits_{m=0} ^{M-1}\widetilde{W}_{N,\theta}^{nk^{\prime}}\\ &=\sum\limits_{n=0}^{M-1}e^{-j(\frac{2\pi n(k^{\prime}+m)}{N}+m\theta)}\\ &=\sum\limits_{m=0}^{M-1}\Big{\{}\cos\Big{(}\frac{2\pi n(k^{\prime}+m)}{N}+m \theta\Big{)}-j\sin\Big{(}\frac{2\pi n(k^{\prime}+m)}{N}+m\theta\Big{)}\Big{\}} \\ &=w_{r}(n)-jw_{i}(n)\\ &\quad w_{r}(n)=\sum\limits_{m=0}^{M-1}\cos\Big{(}\frac{2\pi n(k^{\prime}+m) }{N}+m\theta\Big{)}\\ &\quad w_{i}(n)=\sum\limits_{m=0}^{M-1}\sin\Big{(}\frac{2\pi n(k^{\prime}+m) }{N}+m\theta\Big{)}\end{array}  \tag{5}\]  
where \(\widetilde{W}_{M,N,\theta}^{nk^{\prime}}\) denotes a proposed synthesized multi-frequency detector. The idea is that \(M\) number of \(W_{N}^{nk}\) components over the frequency band of interest is synthesized ahead of a DTMF detection, and then a distinct phase angle \(\theta\) is assigned. \(k^{\prime}\), representing the starting index over the detected frequency band, and \(M\) are respectively defined as:  
\[k^{\prime}=\text{INT}\Big{(}\frac{f*N*(1-T_{\text{off}})}{SR}+1\Big{)} \tag{8}\]\[M=\text{INT}\bigg{(}\frac{f*N*(1+T_{\text{off}})}{SR}\bigg{)}-k^{\prime}+1 \tag{9}\]  
where \(f\) denotes the tone of interest, \(SR\) the sampling rate, \(T_{\text{off}}\) the value of frequency tolerance, and INT(\(\cdot\)) the integer part of a number. As illustrated in Figure 2,\(f\) = 1477 Hz, \(k^{\prime}\) = 92 and \(M\) = 6 on a condition that \(T_{\text{off}}\) = 3.5%. As well, tabulated in Table 2 are the values of \(k\) and \(M\) versus the tone frequencies on a condition that \(N\) = 512 and \(T_{\text{off}}\) = 3.5%. Furthermore, presented in Figure 4 are the frequency response comparison among synthesized detectors with various combinations of \(M\) and \(\theta\). From Figure 4a, it is found that the MFD result shares the same frequency response with DFT in the case of \(M\) = 1, and the DTMF signal with frequency shift cannot be successfully detected. As demonstrated in Figure 4b-d, namely the cases of \(M\) = 2, \(\theta\) = 0, \(\pi\)/3, 102\(\pi\)/180, respectively, the frequency response of a detector shows a strong dependence on the phase angle. As a target of this paper, the phase angle \(\theta\) is then tuned so as to optimize the frequency response of a detector. As illustrated in Figure 4c, \(g_{\text{pr}}\) denotes the pass-band ripple of the frequency response, \(g_{\text{sr}}\) the maximal ripple of the stop-band, and \(g_{\text{PS}}\) = \(g_{\text{sr}}-g_{\text{pr}}\) the differential gain between the pass- and the stop-bands.