Skip to main content

pitchyin

pitchyin(
@framesize 2048
@interpolate 1
@maxfrequency 22050
@minfrequency 20
@samplerate 44100
@tolerance 0.15
@mode 0
) -> llll

Generates an audio descriptor to estimate the fundamental frequency of a monophonic buffer. It is an implementation of the Yin algorithm for computations in the time domain.

The resulting buffer will be updated with the following keys:

  • pitchyin
  • pitchyin_confidence
info

pitchyin is a mirror implementation of the same algorithm in the Essentia library. For more details on the algorithm, please check the Essentia Algorithms reference.


Arguments

  • @framesize [int]: Number of samples in the input frame. (default: 2048).
  • @interpolate [int]: Enable interpolation. (default: 1).
    • 0: Off
    • 1: On
  • @maxfrequency [int/float]: The maximum allowed frequency. (default: 22050).
  • @minfrequency [int/float]: The minimum allowed frequency. (default: 20).
  • @samplerate [int]: Sampling rate of the input audio. (default: 44100).
  • @tolerance [int/float]: Tolerance for peak detection. (default: 0.15).
  • @mode [int]: Analysis mode. (default: 0).
    • 0: Global
    • 1: Time series
    • 2: Time-tagged time series
    • 3: Buffer

Output

Pitchyin descriptor [llll]


Usage

pitchyin is meant to be used with the analyze function:

$buffer = importaudio('singing.wav'); ## input buffer
$descr = pitchyin(); ## generate pitchyin audio descriptor
$buffer.view('before analysis');
$buffer = $buffer.analyze($descr); ## apply analysis
$buffer.view('after analysis')