%% Extract Pitch Using the LHS Method
% Read in an audio signal.

[audioIn,fs] = audioread("Counting-16-44p1-mono-15secs.wav");

%
% Create an audioFeatureExtractor object to extract pitch. Set the method of pitch extraction to "LHS".

aFE = audioFeatureExtractor("SampleRate",fs,"pitch",true);
setExtractorParams(aFE,"pitch","Method","LHS")

%
% Call extract and plot the results.

f0 = extract(aFE,audioIn);
plot(f0)

%
%
% Copyright 2019 The MathWorks, Inc.