That's a great question, perhaps using a band pass filter or the amplitude of the note vs harmonics?How do you propose to tell the difference between two tones and a single tone with lots of harmonics.
For instance, a guitar note at 100Hz will have harmonics at 200Hz, 300Hz, 400Hz and 500Hz.
What would be the difference between a 100Hz tone with its harmonics and 100Hz and 300Hz tones played simultaneously?