# Digital Signal Processing of the Inharmonic Complex Tone
## 2 DSP Algorithms Used for the Analysis of String Instruments' Recordings
### Digital Filter Bank
Overall array of signals \(x_{0n}[k]\), \(n=0\),..\(N+1\) is obtained by the doubly complementary filter bank, whereas the signals \(x_{0n}[k]\), \(n=0\),..\(N+1\) are additionally phase corrected. attenuation \(A_{s}\) and the required pass-band edge frequency \(\omega_{p0}\). As can be concluded from (6), the zeros of all-pass transfer functions are reciprocal to the poles. The advantage of Butterworth and EMQF filters is that this half-band filter pair (a simple two-channel filter bank) can be easily transformed into a filter bank with an arbitrary crossover frequency [24; 27; 30]. The only additional parameter needed for the spectral transformation is the exact value of the crossover frequency \(\omega_{c}\). By the transformation, each second-order section (6) is transformed into a section with changed poles and zeros:  
\[\frac{\beta_{m}^{HB}+z^{-2}}{1+\beta_{m}^{HB}z^{-2}}\rightarrow\frac{\beta_{m }+\alpha(1+\beta_{m})z^{-1}+z^{-2}}{1+\alpha(1+\beta_{m})z^{-1}+\beta_{m}z^{-2 }}, \tag{7}\]  
where \(\alpha=-\cos(\omega_{c})\), \(\beta_{1}=\frac{\beta_{1}^{HB}+a_{1}^{2}}{\beta_{1}^{HB}a_{1}^{2}+1}\), and \(a_{1}=\frac{1-\sqrt{1-a^{2}}}{\alpha}=-\tan\Bigl{(}\frac{\frac{\pi}{2}-\omega _{c}}{2}\Bigr{)}\). The trivial first-order section is transformed into a non-trivial all-pass section:  
\[z^{-1}\rightarrow\frac{\alpha_{1}+z^{-1}}{1+\alpha_{1}z^{-1}}. \tag{8}\]  
The transformation procedures (7) and (8) rely on spectral transformation of the digital filters [32] that can be applied to different classes of filters. In the proposed application, the starting half-band filter is limited to either Butterworth or EMQF types because for these filter types, the coefficient \(\alpha\) is the same in all second-order sections (7), allowing for rapid calculation of the resulting filter pair. By transformation, the pass-band edge frequency of the resulting low-pass filter \(\omega_{p}\) is set to a value determined by the following [24]:  
\[\tan\Bigl{(}\frac{\omega_{p}}{2}\Bigr{)}=\frac{1}{\sqrt{\xi}}\tan\Bigl{(}\frac {\omega_{c}}{2}\Bigr{)}, \tag{9}\]  
where \(\omega_{c}\) is the crossover frequency of the transformed filter pair, and \(\xi\) is the selectivity parameter determined by the pass-band edge frequency \(\omega_{p0}\) of the prototype low-pass half-band filter  
\[\xi=\frac{1}{\tan^{2}\Bigl{(}\frac{\omega_{p0}}{2}\Bigr{)}}. \tag{10}\]  
The stop-band edge frequency of the resulting low-pass filter \(\omega_{s}\) is determined by the following:  
\[\tan\Bigl{(}\frac{\omega_{s}}{2}\Bigr{)}=\sqrt{\xi}\tan\Bigl{(}\frac{\omega_{ c}}{2}\Bigr{)}. \tag{11}\]  
It can be seen (9) and (10) that the transition band of the resulting filter pair depends on its crossover frequency and pass-band edge frequency of the prototype low-pass half-band filter. In the application presented in this paper, the array of crossover frequencies (\(\omega_{c}\)) is calculated based on the estimated positions of the partials for determined values of fundamental frequency \(f_{0}\) and inharmonicity coefficient \(B\) as a normalized geometric mean of two successive partials:  
\[\omega_{c,n+1}=\frac{2\pi}{f_{s}}\sqrt{f_{n}f_{n+1}},\ n=1,2,\ldots N \tag{12}\] \[\omega_{c,1}=\frac{2\pi}{f_{s}}\sqrt{f_{1}}\]  
where \(f_{n}\), \(n=1\), \(2\), \(\ldots\), \(N+1\) are frequencies (in Hz) calculated as in (1), and \(f_{s}\) is the sampling frequency of the recorded signal. It should be noted that in the recorded signal, some partials can be totally suppressed (i.e., missing). The 3 dB bandwidth of channel \(n\) is defined by crossover frequencies \(\omega_{c,n}\) and \(\omega_{c,n+1}\). In the proposed application, the total number of channels is the number of partials \(N\) enlarged by 2. The first channel (with index zero) contains components of the signal that are below the first partial, i.e., the pitch frequency, and the last channel contains higher frequency components of the signal, usually with no prominent partials.