Code covered by the BSD License  

Highlights from
Autocorrelation Pitch Detector

image thumbnail

Autocorrelation Pitch Detector

by

 

30 Jan 2014 (Updated )

Implements a pitch period detection algorithm using modified autocorrelation method

ac_pitch_GUI25
function ac_pitch_GUI25

%SENSE COMPUTER AND SET FILE DELIMITER
% Modifiable runGUI file
clc;
clear all;
switch(computer)				
    case 'MACI64',		char= '/';
    case 'GLNX86',  char='/';
    case 'PCWIN',	char= '\';
    case 'PCWIN64', char='\';
    case 'GLNXA64', char='/';
end


% USER - ENTER FILENAME
fileName = 'ac_pitch.mat';    
fileData=load(fileName);
temp=fileData(1).temp;

f = figure('Visible','on',...
'Units','normalized',...
'Position',[0,0,1,1],...
'MenuBar','none',...
'NumberTitle','off');

% find speech files directory by going up one level and down one level
% on the directory chain; as follows:
    dir_cur=pwd; % this is the current Matlab exercise directory path 
    s=regexp(dir_cur,char); % find the last '\' for the current directory
    s1=s(length(s)); % find last '\' character; this marks upper level directory
    dir_fin=strcat(dir_cur(1:s1),'speech_files'); % create new directory
    start_path=dir_fin; % save new directory for speech files location

% USER - ENTER PROPER CALLBACK FILE
Callbacks_ac_pitch_GUI25(f,temp,start_path);    
%panelAndButtonEdit(f, temp);       % Easy access to Edit Mode

% Note comment PanelandBUttonCallbacks(f,temp) if panelAndButtonEdit is to
% be uncommented and used
end

% GUI Lite 2.5 autocorrelation pitch detector
% 2 Panels
%   #1 - input parameters
%   #2 - graphics displays
% 4 Graphic Panels
%   #1 - original waveform
%   #2 - pitch period contour (unsmoothed)
%   #3 - pitch period contour (median smoothed)
%   #4 - confidence score contour
% 1 TitleBox
% 10 Buttons
%   #1 - pushbutton - Speech Directory
%   #2 - popupmenu - Speech Files
%   #3 - popupmenu - imf: male/female switch
%   #4 - editable button - fsd: signal processing sampling rate
%   #5 - editable button - Lm: analysis frame length in msec
%   #6 - editable button - Rm: analysis frame shift in msec
%   #7 - editable button - alpha: clipping level percentage
%   #8 - editable button - Lm: median smoother duration in samples
%   #9 - pushbutton - Run AC Pitch Detector
%   #10 - pushbutton - Close GUI

Contact us