PitchRecognize

PitchRecognize[audio]

recognizes the main pitch in audio, returning it as a TimeSeries object.

PitchRecognize[audio,spec]

returns the main pitch processed according to the specified spec.

Details and Options

  • PitchRecognize is also known as pitch detection or pitch tracking.
  • PitchRecognize assumes that the signal contains a single pitch at any given time.
  • If a pitch is not detected at a specific time, a Missing[] value is returned for that time.
  • The pitch specification spec can be any of the following:
  • "Frequency"a frequency in hertz (default)
    "FrequencyMagnitude"magnitude of a frequency in hertz
    "QuantizedFrequency"a quantized frequency in hertz
    {"QuantizedFrequency",list}a frequency in hertz quantized to the values of list
    "MIDI", where freq is the frequency in hertz
    "QuantizedMIDI"rounded MIDI values
    "SoundNotePitch"pitch specification with 0 corresponding to the middle C (as in SoundNote)
    farbitrary function f applied to recognized frequencies
  • The following options can be given:
  • AcceptanceThresholdAutomaticminimum probability to consider acceptable
    AlignmentCenteralignment of the time stamps with partitions
    AllowedFrequencyRangeAutomaticmin and max frequency
    MetaInformationNoneinclude additional metainformation
    MethodAutomaticmethod to be used
    MissingDataMethodNonemethod to use for missing values
    PartitionGranularityAutomaticaudio partitioning specification
    PerformanceGoal$PerformanceGoalwhat to optimize in the recognition
    ResamplingMethodAutomaticthe method to use for resampling paths
  • Possible settings for Method include:
  • Automaticautomatically chosen
    "CREPE"a neural network trained for pitch estimation
    "YIN"a YIN-based algorithm
  • Use Method->{"CREPE",TargetDevice->dev} to perform the neural net evaluation on device dev.
  • PitchRecognize uses machine learning, and its training set and methods may change in different versions of the Wolfram Language, yielding different results.
  • PitchRecognize may download resources that will be stored in your local object store at $LocalBase, and can be listed using LocalObjects[] and removed using ResourceRemove.

Examples

open all close all

Basic Examples  (1)

Recognize the pitch of an audio recording:

In[1]:=
Click for copyable input
Out[1]=

Scope  (4)

Options  (6)

Applications  (3)

Properties & Relations  (1)

Possible Issues  (1)

Neat Examples  (1)

Introduced in 2019
(12.0)