The recognized waveform will generally be the one with the nearest distance, but by analysing the nearest second distance we introduce confidence.
If the two smaller distances are similar, we may incur errors of recognition because the probability of classifying one or the other is similar.
First picture: with feature algorithm accuracy is between 40% and 80%
Second picture: with Artificial Neural Network accuracy is between 80% and 100%
Third picture: with Convolution Neural Network accuracy is between 97% and 100% (please note the different scales!)