# Smart-Median: A New Real-Time Algorithm for Smoothing Singing Pitch Contours
## 7 Conclusions  
This paper has introduced a new pitch-contour-smoother targeted towards the singing voice in real-time environments. The proposed algorithm is based on the median filter and considers the features of fundamental frequencies in singing. The algorithm's accuracy was compared with 35 other smoother techniques, and four metrics evaluated their results: R-Squared, Root-Mean-Square Error, Mean Absolute Error, and F0 Frame Error. The proposed Smart-Median algorithm achieved better results across all the metrics, in comparison to the other smoother algorithms. According to this study, a buffer delay of 35 to 70 milliseconds is required for the algorithm to smooth the contour appropriately. Most of the general smoother algorithms did not show acceptable accuracy. A general observation is that in the ideal case, a smoother algorithm should be defined based on the essential features of the data in the contour and how that data is to be used after smoothing. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Input** & 100 & 102 & 2000 & 2000 & 100 \\
**Moving average(window size = 3)** & 734 & 1367,333 & 1366,667 & 1050 & 100 \\
**Median (window size = 3)** & 102 & 2000 & 2000 & 1050 & 100 \\
**Okada** & 100 & 102 & 2000 & 2000 & 100 \\
**Jlassi** & 100 & 102 & 2000 & 2000 & 100 \\
**Smart-Median** & 100 & 102 & 102 & 102 & 100 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: An example to illustrate the weakness of the moving average, Median, Okada, and Jlassi algorithms as compared to the Smart-Median. For future work, one short-term task is based on recognizing that the parameters of the Smart-Median can be set according to the specific properties of the sound input, such as those of particular musical instruments or their families, to improve accuracy in a targeted way. Another task considers that the Smart-Median finds the incorrect F0 based on its interval from the previous F0; this approach can be improved by considering a maximum noise duration. For example, if there is a considerable frequency interval between the previous F0 and the current one, or if several immediately subsequent F0s are near to the current F0, then we may not consider the large jump to be noise but rather a new musical articulation. This requires the introduction of an extra decision-making stage into the algorithm. In the longer term, further testing can be carried out on vocal material from a wide variety of genres and techniques. This would require the creation of new, specialist corpora, requiring considerable manual effort in both the gathering and labelling. This can be supported by machine learning. Such a dataset would also benefit the research field at large. Conceptualization, B.F.; methodology, B.F.; software, B.F.; validation, B.F.; formal analysis, B.F.; investigation, B.F.; resources, B.F.; data curation, B.F.; writing--original draft preparation, B.F.; writing--review and editing, B.F. and J.T. ; visualization, B.F.; supervision, J.T. ; project administration, B.F. All authors have read and agreed to the published version of the manuscript. This research received no external funding. Not applicable. All the files relevant to this study, including an implementation of the proposed algorithm and the dataset generated by all the algorithms mentioned in this paper, are available online at [[https://github.com/BehnamFaghihMusicTech/Onset-Detection](https://github.com/BehnamFaghihMusicTech/Onset-Detection)]([https://github.com/BehnamFaghihMusicTech/Onset-Detection](https://github.com/BehnamFaghihMusicTech/Onset-Detection)), accessed on 6 July 2022. Thanks to Maynooth University and the Higher Education Authority in the Department of Further and Higher Education, Research, Innovation and Science in Ireland for their supports. The authors declare no conflict of interest. In addition, the funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.