If no output argment is specified, YIN plots F0 as a function of time (in octaves re: 440 Hz), aperiodicity, and power.
In the F0 plot, samples in blue are reckoned reliable (aperiodicity
Type 'help yin' for a description of the parameters. Read the reference below and
the code to understand their meaning. In brief:
For speech or musical instruments a value of 0.1 is usually adequate. Singing voice
may require a smaller value (as low as 0.001) if a harmonic is reinforced by a
sharp formant.
Some signals are inherently ambiguous. For example
the response of a high-Q resonator excited by a pulse train may be seen either as a complex
tone with an F0 equal to that of the pulse train, or as an
amplitude modulated pure tone with an F0 equal to the resonant frequency.
Neither is more "correct" than the other. To obtain the result
that you expect, you must set the threshold to an appropriate value: small for the
fundamental periodicity, large for the resonance periodicity.
YIN is described in:
Parameter 'thresh' sets the proportion of aperiodic power that is
tolerated within a "periodic" signal. This may vary according to the application.
de Cheveigné, A., and Kawahara, H. (2002). "YIN, a fundamental frequency estimator
for speech and music," J. Acoust. Soc. Am., 111, 1917-1930. (pdf)
[Code is here]
[Alain de Cheveigné]