pitch detection: which is the most robust way to distinguish voiced from unvoiced audio I am trying to write a voice/whistle driven synth but I am struggling with pitch detection. As a premise I must say I am quite skilled and experienced at dsp coding plus I have pretty read almost everything I could find in literature about this very thorny topic and I understood that a single robust solution does not exist. I tried and invented every possible and fancy approach in frequency domain based on analysis of the harmonic series or HPS and variations thereof, but I am still plagued by octave errors,  plus the lack of a robust criterion to distinguish pitched from unpitched frames (i.e containing noise). At the end I decided to give up spectral approaches and use time domain autocorrelation (by FFT, squared magnitude plus IFFT) which turned out the most reliable approach of all even if still not 100% error prone. But again, I cannot find any reliable and robust rationale to decide when a frame is voiced/pitched and when it contains noise or transients and therefore the detected highest peak in autocorrelation has to be deemed invalid and discarded. 

I found the sourcecode of a plugin called Autotalent which I judged interesting,  the author there relies on a "confidence" value obtained by multiplying thr height of the highest peak in autocorrelation by the value at the corresponding position of the autocorrelation of the window used to window the processed frames but I really failed to understand the logics behind that. I tried for curiosity to use the same trick but what I get is a value which seems completely unrelated to the fact a frame is pitched or unpitched.

I kindly ask where should I start looking for a solution which is not,  possibly,  too complicated (everything is meant for realtime operation). Any hints ?  Do you know any robust method to distinguish pitched and unpitched frames (either in time or frequency domain ) ? Thanks
SWIPE is a pitch estimator that worked well for me in the past. You can find dissertation &amp; code in MATLAB here. It might give you some ideas.