# Digital Signal Processing of the Inharmonic Complex Tone
## 2 DSP Algorithms Used for the Analysis of String Instruments' Recordings
### Inharmonicity Coefficient Estimation from the Recorded Signal  
The presented application is primarily designed for analyzing musical tones produced by string musical instruments. For the plucked or struck string instruments, the inharmonicity is not negligible. Although the inharmonicity analysis is not the primary goal of the presented application, it must be estimated because the design of the filter bank relies on the values of the partial frequencies. Even if it seems that the variations in position raised by the inharmonicity are small, for the signals with a long array of prominent partials, the misadjustment between harmonic and inharmonic array can be significant for the larger index partials. For this reason, it is necessary to estimate the value of the inharmonicity coefficient \(B\) before designing the filter bank. In this application, it is achieved through simple visual matching between spectral coefficients and an array of frequencies obtained with the assumed inharmonicity coefficient value. By manually changing the value of \(B\), a result that is good enough for the filter bank design can be obtained. In the second step, the result is verified once again. After the filtering of the output signal, the spectral maximums of each subchannel are estimated. Based on those values, the inharmonicity coefficient is recomputed using the algorithm proposed in [38]. A mismatch of the values can be used as the cause for further analysis of the recorded signal. The algorithm [38] is simple and suitable for automatic processing. It begins with an initially presumed value of inharmonicity coefficient and an array of frequencies corresponding to partials of the signal extracted from the recording before the core algorithm starts. The length of the partial frequency array depends on the instrument and can range from just a few to more than 50 components. The algorithm is an iterative procedure that calculates the new inharmonicity coefficient value in each iteration, thereby minimizing the difference between the actual partial frequencies estimated from the recorded signal and the array of frequencies calculated using (1) in each iteration. In the presented application, it is implemented as an additional module that can be activated after the filter bank is designed. To evaluate the performance of the MuPI implementation of the algorithm [38] for estimating the inharmonicity coefficient, a comparative test was conducted using reference data published in the original paper [38]. Principally, the algorithm consists of two steps: estimation of the partials frequency array and iterative evaluation of the inharmonicity coefficient \(B\). The second step introduced a partial frequencies deviation (PFD) algorithm and validated it using synthetic piano tones with known inharmonicity profiles for key numbers 1-35 (\(f_{0}\in\) [27.5 195.99]). The same synthetic dataset was analyzed using the MuPI implementation of the inharmonicity estimation method on the array of frequencies estimated as maximal values for each subchannel. The results obtained from MuPI were compared against the original synthetic reference curve published in the paper. Figure 2 illustrates the comparison: the solid black line represents the reference value of the inharmonicity coefficient \(B\) used for the synthetic piano model, while red dots denote the values estimated by the MuPI implementation. The visual overlap of the two curves confirms that the MuPI implementation of the algorithm [38] achieves full agreement with the target values. Quantitatively, all estimated inharmonicity coefficients are within \(\pm 2\%\) deviation from the reference values, indicating high numerical accuracy. In particular, the shape of the inharmonicity profile--characterized by a decreasing trend in the bass range and an increase above key number 28--is faithfully reproduced. This comparison validates both the accuracy of the MuPI implementation of the estimation procedure.